2007-10-15 11:42:17 +02:00
|
|
|
format ELF
|
|
|
|
|
|
|
|
;include "proc32.inc"
|
|
|
|
section '.text' executable
|
2018-11-01 18:24:22 +01:00
|
|
|
public sysmalloc
|
|
|
|
public sysfree
|
|
|
|
public sysrealloc
|
2007-10-15 11:42:17 +02:00
|
|
|
|
|
|
|
align 4
|
2018-11-01 18:24:22 +01:00
|
|
|
sysmalloc:
|
2016-05-19 14:15:22 +02:00
|
|
|
push ebx
|
2007-10-15 11:42:17 +02:00
|
|
|
mov eax,68
|
|
|
|
mov ebx,12
|
2016-05-19 14:15:22 +02:00
|
|
|
mov ecx,[esp+8] ;size
|
2007-10-15 11:42:17 +02:00
|
|
|
int 0x40
|
2016-05-19 14:15:22 +02:00
|
|
|
pop ebx
|
2007-10-15 11:42:17 +02:00
|
|
|
ret 4
|
|
|
|
|
|
|
|
align 4
|
2018-11-01 18:24:22 +01:00
|
|
|
sysfree:
|
2016-05-19 14:15:22 +02:00
|
|
|
push ebx
|
2007-10-15 11:42:17 +02:00
|
|
|
mov eax,68
|
|
|
|
mov ebx,13
|
2016-05-19 14:15:22 +02:00
|
|
|
mov ecx,[esp+8]
|
2007-10-15 11:42:17 +02:00
|
|
|
int 0x40
|
2016-05-19 14:15:22 +02:00
|
|
|
pop ebx
|
2007-10-15 11:42:17 +02:00
|
|
|
ret 4
|
|
|
|
|
|
|
|
align 4
|
2018-11-01 18:24:22 +01:00
|
|
|
sysrealloc:
|
2016-05-19 14:15:22 +02:00
|
|
|
push ebx
|
2007-10-15 11:42:17 +02:00
|
|
|
mov ebx,20
|
|
|
|
mov eax,68
|
2016-05-19 14:15:22 +02:00
|
|
|
mov edx,[esp+8] ; pointer
|
|
|
|
mov ecx,[esp+12] ; size
|
2007-10-15 11:42:17 +02:00
|
|
|
int 0x40
|
2016-05-19 14:15:22 +02:00
|
|
|
pop ebx
|
2007-10-15 11:42:17 +02:00
|
|
|
ret 8
|