SIGSEGV在装配中

时间:2018-04-18 17:12:48

标签: assembly x86 shellcode

我正在阅读一本关于利用,编写shellcode和漏洞发现的书。我现在的章节是关于编写shellcode,我在汇编中编写了一个程序并组装它,但是我从第一个mov指令得到了一个Segmentation错误。程序需要系统调用execve函数。这是通过att中的objdump看到的组装后的代码:

execve2:     file format elf32-i386
Disassembly of section .text:
08048080 <_start>:
 8048080:       eb 1a                   jmp    804809c <GotoCall>

08048062 <shellcode>:
 8048062:       5e                      pop     %esi
 8048063:       31 c0                   xor     %eax, %eax
 8048065:       88 46 07                mov     %al,0x7(%esi)
 8048068:       8d 1e                   lea     (%esi),%ebx
 804806a:       89 5e 08                mov     %ebx,0x8(%esi)
 804806d:       89 46 0c                mov     %eax,0xc(%esi)
 8048070:       b0 0b                   mov     $0xb,%al
 8048072:       89 f3                   mov     %esi,%ebx
 8048074:       8d 4e 08                lea     0x8(%esi),%ecx
 8048077:       8d 56 0c                lea     0xc(%esi),%edx
 804807a:       cd 80                   int     $0x80

0804807c <GotoCall>:
 804807c:       e8 e1 ff ff ff          call     8048062 <shellcode>
 8048081:       2f                      das
 8048082:       62 69 6e                bound    %ebp,0x6e(%ecx)
 8048085:       2f                      das
 8048086:       73 68                   jae      80480f0 <GotoCall+0x74>
 8048088:       4a                      dec %edx
 8048089:       41                      inc %ecx
 804808a:       41                      inc %ecx
 804808b:       41                      inc %ecx
 804808c:       41                      inc %ecx
 804808d:       4b                      dec %ebx
 804808e:       4b                      dec %ebx
 804808f:       4b                      dec %ebx
 8048090:       4b                      dec %ebx

在8048065,我收到一个SIGSEGV错误,我不知道该改变什么以及出了什么问题?

0 个答案:

没有答案