Files
metasploit-gs/lib/metasm/samples/source.asm
T
HD Moore 4a204efaa1 Import the new METASM code
git-svn-id: file:///home/svn/framework3/trunk@5008 4d416f70-5f16-0410-b530-b9f4589650da
2007-06-30 21:53:26 +00:00

31 lines
444 B
NASM

sys_write equ 4
sys_exit equ 1
stdout equ 1
syscall macro nr
mov eax, nr // the syscall number goes in eax
int 80h
endm
nop nop
call foobar
toto_str db "toto\n"
toto_str_len equ $ - toto_str
foobar:
; setup write arguments
mov ebx, stdout ; fd
call got_eip
got_eip: pop ecx
add ecx, toto_str - got_eip // buf
mov edx, toto_str_len ; buf_len
syscall(sys_write)
/*
; hang forever
jmp $
*/
xor ebx, ebx
syscall(sys_exit)