Hi Stevens, I think you asked a wrong question in a wrong place. :-)
It would be better, if you question is about "how to issue a system call in assembly code". It seems you are in China, and I had written a Chinese blog about shell code under Solaris: http://blog.csdn.net/yayong/archive/2005/07/24/433359.aspx stevens wrote: > For example,I have created this code: > > /* shellcode.c */ > > int main(){ > char *name[2]; > > name[0] ="/bin/sh"; > > name[1] = 0x0; > > execve(name[0], name, 0x0); > > exit(0); > > } > > #gcc -o shellcode -g shellcode.c > > #gdb shellcode > (gdb)disassemble main > > (gdb)disassemble execve > > (gdb)disassemble exit > Now I must build shellcode from asm,but I can't get the exact asm code for > execve() and exit() without static compile.How to invoke a syscall in asm? > #gcc -o shellcode -g -static shellcode.c > gcc -o shellcode -g -static shellcode.c > ld: fatal: library -lc: not found > ld: fatal: File processing errors. No output written to shellcode > collect2: ld returned 1 exit status > > > This message posted from opensolaris.org > _______________________________________________ > opensolaris-code mailing list > [email protected] > http://mail.opensolaris.org/mailman/listinfo/opensolaris-code > -- Cheers, ------------------------------------------------------------ Oliver Yang | Work from home | http://blog.csdn.net/yayong _______________________________________________ opensolaris-code mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/opensolaris-code
