2006-09-07 16:14:53 +02:00
|
|
|
format ELF
|
2006-09-23 16:00:36 +02:00
|
|
|
include "public_stdcall.inc"
|
2006-09-07 16:14:53 +02:00
|
|
|
section '.text' executable
|
2020-05-03 10:21:08 +02:00
|
|
|
extrn sysmalloc
|
2007-10-15 11:42:17 +02:00
|
|
|
public_stdcall _ksys_start_thread,12
|
2006-09-07 16:14:53 +02:00
|
|
|
;arg1 - proc
|
|
|
|
;arg2 - stacksize
|
|
|
|
;arg3 - pid
|
|
|
|
push dword [esp+8]
|
2020-05-03 10:21:08 +02:00
|
|
|
call sysmalloc
|
2006-09-07 16:14:53 +02:00
|
|
|
test eax,eax
|
|
|
|
jz .no_mem
|
|
|
|
push ebx
|
|
|
|
mov edx,eax
|
|
|
|
add edx,[esp+12]
|
|
|
|
mov [edx-4],dword 0
|
|
|
|
mov ecx,[esp+8]
|
|
|
|
mov ebx,1
|
|
|
|
mov eax,51
|
|
|
|
int 0x40
|
|
|
|
mov ebx,[esp+16]
|
|
|
|
test ebx,ebx
|
|
|
|
jz .no_val
|
|
|
|
mov [ebx],eax
|
|
|
|
.no_val:
|
|
|
|
mov eax,edx
|
|
|
|
sub eax,[esp+12]
|
|
|
|
pop ebx
|
|
|
|
ret 12
|
|
|
|
.no_mem:
|
|
|
|
mov ecx,[esp+12]
|
|
|
|
mov [ecx],eax
|
|
|
|
ret 12
|