回答了之前的相关问题。谢谢!然而,这给我带来了一个新问题。为什么 nasm 将数据字节放在两个不同的内存位置?我在下面包含了程序信息和其他数据转储。
---------- code snippet compiled with nasm, ld -----------------
section .text
...
zero: jmp short two
one: pop ebx
xor eax, eax
mov [ebx+12], eax
mov [ebx+8], ebx
mov [ebx+7], al
lea ecx, [ebx+8]
lea edx, [ebx+12]
mov al, 11
int 0x80
two: call one
section .data align=1
msg: db '/bin/sh0argvenvp'
-------- readelf output to show load locations --------
readelf -Wl myshdb
Elf file type is EXEC (Executable file)
Entry point 0x8048080
There are 2 program …Run Code Online (Sandbox Code Playgroud)