jmp get_str_adress resume: popl %esi # move esp into esi movl %esi, 0x8(%esi) # store adress of "/bin/sh" movb $0x0, 0x7(%esi) # create null byte movl $0x0, 0xc(%esi) # create null word movl $0xb, %eax # zero eax movl %esi, %ebx # "/bin/sh" as first arg leal 0x8(%esi), %ecx # pointer to "/bin/sh" leal 0xc(%esi), %edx # pointer to null word int $0x80 get_str_adress: call resume # puts esp on stack (adress of string) .string "/bin/sh"
to me that looks pretty complete and it should work... but it doesnt :/
genjix@linux:~/programming/> ./sbashSegmentation fault
BTW i just wanted to say thanks for your help, i really appreciate it im really learning :D