Re: [問題] shellcode會core dump
hi all
我把程式再改寫成這樣
===================
char shellcode[]="\x31\xdb\x89\xd8\x40\xcd\x80";
int main(int argc, char** argv){
__asm__
(
"call shellcode;"
)
printf("main\n");
return 0;
==================
這個就是直接測試shellcode能不能用
但我一跑還是core dump
用gdb看是死在shellcode裡
可是這個shellcode我是用下面這個組語產生的
================
"xorl %ebx, %ebx;"
"movl %ebx, %eax;"
"inc %eax;"
"int $0x80;"
================
這個exit的asm code我直接跑是ok的
但是把機器碼抓出來
寫到shellcode裡
用call shellcode的方法來呼叫
就會core dump
不知哪位大德可以給一點方向
卡很久實在是很嘔啊…
感謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.130.51.128
→
12/30 17:49, , 1F
12/30 17:49, 1F
討論串 (同標題文章)
完整討論串 (本文為第 2 之 2 篇):