使用YASM编程 -07 模拟导入表
2017-09-18 18:18
253 查看
模拟导入表
导入表的调用方式
call xxx ; xxx 是导入函数的名称
xxx: jmp DWORD [fn] ; 是远程间接跳转
fn : DD 0x12345678 ; 跳到全局地址继续执行
这个0X12345678 是在运行的时候输入,然后就可以从这里继续执行
我们把OutputDebugStringA 的地址从kernel32 中获取,然后传过去
这样我们就能调用API了
远程注入的话我们可以这样进行处理。
将需要注入的代码编译成obj,然后用到的函数在变量区,我们在目标进程空间查找需要的API然后写入到变量区,然后再执行注入的代码,就能够很好的执行了
下面是代码,很简单,不解释了。
导入表的调用方式
call xxx ; xxx 是导入函数的名称
xxx: jmp DWORD [fn] ; 是远程间接跳转
fn : DD 0x12345678 ; 跳到全局地址继续执行
这个0X12345678 是在运行的时候输入,然后就可以从这里继续执行
我们把OutputDebugStringA 的地址从kernel32 中获取,然后传过去
这样我们就能调用API了
远程注入的话我们可以这样进行处理。
将需要注入的代码编译成obj,然后用到的函数在变量区,我们在目标进程空间查找需要的API然后写入到变量区,然后再执行注入的代码,就能够很好的执行了
下面是代码,很简单,不解释了。
bits 32 extern _scanf extern _exit extern _printf ; ;yasm -f win32 -o sim_imp.obj sim_imp.asm ;rem /entry:mainCRTStartup /verbose ;D:\masm32\bin\link.exe /entry:start /Release /PDB:sim_imp.pdb /subsystem:console /machine:x86 /out:sim_imp.exe /verbose:lib /version:5.1 /libpath:"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\LIB" kernel32.lib user32.lib sim_imp.obj msvcrt.lib ; ;extern _mainCRTStartup 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] ;db 0xff,0x25 ;DD outputDebugString
相关文章推荐
- 使用PHP Socket 编程模拟Http post和get请求
- 使用JavaScript链式编程实现模拟Jquery函数
- 使用YASM编程 - 03
- 关于uploadify插件的使用,导入excel03和07版本。
- 使用YASM编程 - 06
- 使用YASM编程 - 04
- MaxScript Object_Oriented_Struct 使用strut 模拟面向对像编程中的 Class
- 编程小白的第一本 python 入门书 学习笔记07 第八章 开始使用第三方类库
- C++ 网络编程之使用socket + epoll 模拟http 的请求与响应
- Java使用HTTP编程模拟多参数多文件表单信息的请求与处理
- 使用JavaScript链式编程实现模拟Jquery函数
- 并发编程复习(六):使用wait和notify模拟阻塞队列
- 使用YASM编程 - 02
- [导入]使用对Ant编程来实现简单文件的打包
- 使用PHP Socket 编程模拟Http post和get请求
- 编程作业160 页 第5题 使用(接口)设计一个动物声音"模拟器",希望模拟器可以模拟许多动物声音
- HTTP 笔记与总结(5)socket 编程:使用 HTTP 协议模拟登录并发帖
- 使用YASM编程 - 01
- 第七课-第二讲 07_02_bash脚本编程之六 使用脚本选项及组合条件测试
- C# winform 编程 向ACCESS数据库导入EXCEL表使用心得