首页
社区
课程
招聘
[ZT]Locating API function offsets in memory by Rheingold
发表于: 2007-3-12 01:54 4030

[ZT]Locating API function offsets in memory by Rheingold

2007-3-12 01:54
4030

In the last issue of the Programming Journal I wrote about this prog which adds a password dialog to EXE files and how to add functions and DLLs to the import table of PE files. This essay deals with a completely different way to use all API functions you need in your packer/cryptor/whatever with no need to change the import table in any way. I'll show you how to search through the memory in order to locate Kernel32.dll and then parse the export section to get the API functions you want to use.



When an EXE file is executed, it's not (very) much more than a sub-call of Kernel32.dll (mostly of CreateProcessA). This means that at the start [esp] must contain the return offset to somewhere inside the Kernel32.dll and that is our starting point. Considered that we know a valid offset inside Kernel32.dll there must be a way to locate the beginning of this DLL and then we can easily parse for the PE header, the Exports section and all APIs we desire to use. And obviously there is one. Since Kernel32.dll is mapped to a certain offset which is aligned to 1000h we can parse back and look at all offsets which are aligned to 1000h and check for a MZ header.



Download Source here:

[培训]《安卓高级研修班(网课)》月薪三万计划,掌握调试、分析还原ollvm、vmp的方法,定制art虚拟机自动化脱壳的方法

上传的附件:
收藏
免费 1
支持
分享
最新回复 (2)
雪    币: 214
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
支持...!
2007-3-12 17:50
0
雪    币: 208
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
第一眼没看懂~仔细再看看~
2007-3-12 18:00
0
游客
登录 | 注册 方可回帖
返回
//