- 模拟导入表
- 导入表的调用方式
-
-
- xxx: jmp DWORD [fn] ; 是远程间接跳转
-
- fn : DD 0x12345678 ; 跳到全局地址继续执行
-
- 这个0X12345678 是在运行的时候输入,然后就可以从这里继续执行
-
- 我们把OutputDebugStringA 的地址从kernel32 中获取,然后传过去
-
- 远程注入的话我们可以这样进行处理。
-
- 将需要注入的代码编译成obj,然后用到的函数在变量区,我们在目标进程空间查找需要的API然后写入到变量区,然后再执行注入的代码,就能够很好的执行了
- 下面是代码,很简单,不解释了。
bits 32
extern _scanf
extern _exit
extern _printf
section .data
hello db "hello imp",0ah,0
outputDebugString DD 0
format db "%d",0
section .text
global _start
_start:
call _mainCRTStartup
global _main
_main:
push input_promot
call _printf
add esp,4
push outputDebugString
push format
call _scanf
add esp,8
push hello
call xxx
push 0
call _exit
ret
section .data
xxx:
jmp DWORD [outputDebugString]