【发布时间】:2014-01-12 22:33:02
【问题描述】:
我知道它的作用,但我真的很想解释为什么?
SECTION .data
global _start
_start:
jmp j ;jump to 'j' label
r:
pop ebx ;Pop the address of 'shell' into EBX. Parameter is Filename
xor eax, eax ; clear EAX register
mov BYTE[ebx+7], al ;push one NUL byte to end any string reading
mov DWORD[ebx+8], ebx ;mov address of EBX into the content EBX (offset of 8)
mov DWORD[ebx+12], eax ;mov 4 NUL bytes at EBX (offset of 12)
mov al, 11d ;execve system call
lea ecx, [ebx+8] ; HELP
lea edx, [ebx+12] ; HELP
int 80h ;Kernel call
j: call r ;call r... pushes 'shell' address onto the stack
shell: db "/bin/sh" ;file name
具体来说,我想知道:
1) execve 的 3 个参数是什么(我看过 man 2 execve 并没有帮助)
2) 在这种情况下,LEA 究竟做了什么?
【问题讨论】:
标签: assembly linux-kernel nasm shellcode