我是StackOverflow的新手.最近,我开始研究汇编,对于汇编来说还是一个新手,对shellcode来说是全新的.我正在使用RadAsm使用MASM汇编程序进行编译,我尝试从这个网站shellcoding for Linux和Windows学习shellcode
我在Windows 64位上使用RadAsm.我使用的代码几乎相同,只是我使用函数的绝对名称而不是DLL中函数的地址.shellcode应该使用带参数的sleep函数5000.
这是我在MASM中使用的代码.
.386
.model flat, stdcall
option casemap:none
include kernel32.inc
includelib kernel32.lib
.code
_start:
xor eax, eax ; zero out eax
mov ebx, Sleep ; function sleep goes in ebx
mov ax, 5000 ; parameter goes in ax
push eax ; parameter on stack
call ebx ; call Sleep
end _start
end
Run Code Online (Sandbox Code Playgroud)
这在MASM中没有错误地组装.
生成的shellcode具有空值,与网站略有不同.它如下.
我objdump -d nameofexecutable.exe以前得到了反汇编.
Disassembly of section .text
00401000 <.text>:
401000: 33 c0 xor %eax,%eax
401002: bb …Run Code Online (Sandbox Code Playgroud)