2006-09-07 16:14:53 +02:00
|
|
|
format ELF
|
2007-08-24 21:49:07 +02:00
|
|
|
|
|
|
|
include "proc32.inc"
|
2006-09-07 16:14:53 +02:00
|
|
|
section '.text' executable
|
|
|
|
public malloc
|
|
|
|
public free
|
|
|
|
public realloc
|
|
|
|
|
2007-08-24 21:49:07 +02:00
|
|
|
align 4
|
|
|
|
proc malloc stdcall, size:dword
|
2006-09-07 16:14:53 +02:00
|
|
|
|
2007-08-24 21:49:07 +02:00
|
|
|
mov eax,68
|
|
|
|
mov ebx,12
|
|
|
|
mov ecx,[size]
|
|
|
|
int 0x40
|
2006-09-07 16:14:53 +02:00
|
|
|
|
2007-08-24 21:49:07 +02:00
|
|
|
ret
|
|
|
|
endp
|
2006-09-07 16:14:53 +02:00
|
|
|
|
2007-08-24 21:49:07 +02:00
|
|
|
align 4
|
|
|
|
proc free stdcall, pointer:dword
|
2006-09-07 16:14:53 +02:00
|
|
|
|
2007-08-24 21:49:07 +02:00
|
|
|
mov eax,68
|
|
|
|
mov ebx,13
|
|
|
|
mov ecx,[pointer]
|
|
|
|
int 0x40
|
2006-09-07 16:14:53 +02:00
|
|
|
|
2007-08-24 21:49:07 +02:00
|
|
|
ret
|
|
|
|
endp
|
2006-09-07 16:14:53 +02:00
|
|
|
|
2007-08-24 21:49:07 +02:00
|
|
|
align 4
|
|
|
|
proc realloc stdcall, pointer:dword, size:dword
|
2006-09-07 16:14:53 +02:00
|
|
|
|
2007-08-24 21:49:07 +02:00
|
|
|
mov ebx,20
|
|
|
|
mov eax,68
|
|
|
|
mov ecx,[size]
|
|
|
|
mov edx,[pointer]
|
|
|
|
int 0x40
|
2006-09-07 16:14:53 +02:00
|
|
|
|
2007-08-24 21:49:07 +02:00
|
|
|
ret
|
|
|
|
endp
|