|
|
|
[原创]PE加载器的简单实现
这个练习代码哪里有问题,查错都困难,吐血... |
|
[原创]PE加载器的简单实现
搜了下论坛里帖子,用这个帖子也能实现 {想把exe作为dll 一样载入,然后调用里面的代码。 用loadlibrary 显示载入的时候,目标exe的baseimage被占用了,所以被加载到了别的位置,所以代码段和数据段都需要手工重定位,在想有没办法能把目标exe 加载到目标exe的baseimage上,如0x400000,这样可以免去重定位。 还尝试把目标exe 加到主程序IAT上面,想法是在主程序启动的时候就先去加载目标exe,这样就能启动的时候先去占位置了,不过改了之后程序启动不了了,有没有人成功过?? } {其实不复杂,说两个要点: 1.要调用的exe没有重定位表没关系,比如默认基址都是0x400000,你自己的程序在编译的时候可以改到其它基址,比如0x20000000,这样load别的exe的时候就可以加载到它的默认基址了,不需要重定位 2.对一些api要做特殊处理,比如GetModuleHandle,当exe调用它的时候,你得返回它实际加载的位置,不然就变成你exe加载的位置了,一般是用hook处理,当然需要处理的还有其它一些函数 这样的话,大部分不是太复杂的程序应该没问题了} |
|
[原创]PE加载器的简单实现
抱歉,语气有点差,想了十几天没想出来是哪里有问题头疼...后来查资料找到编译出重定位表的exe程序,实现了你说的效果 |
|
[原创]PE加载器的简单实现
而大多数.exe都没有重定位表,怎么去实现这个加载器? |
|
[原创]PE加载器的简单实现
你这人怎么关键性的东西留一手?如果这个程序没有重定位表,这种方法根本就没法实现PE加载器,所有全局变量全是错的 |
|
[原创]PE加载器的简单实现
楼主有源码么,可以发一份不,最近在学这部分内容,照着你的思路自己写的,总是失败,排查bug也查了十几个小时也查不到在哪,和你发的源码一点点比对也找不出来,吐血了. |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值