|
[求助]动态加载的dll中如何调用外部函数
谢谢各位,我想我已找到解决办法。 假定有个xx.dll,其基址是65000000。 我们要对xx.dll打补丁,增加一些功能。 补丁中要调用一个zz函数(假定xx.dll的引入表中有这个函数,如果没有我们可以用LordPE等工具添加这个函数), 这个函数在xx.dll的引入表中地址为[65071020]。 调用方式如下 65032733 FF15 20100765 CALL DWORD PTR DS:[<&yy.zz>] ; yy.zz 65032738 . 90 NOP 静态加载xx.dll时,上面的做法没问题。 [65071020]指向zz函数的实际地址,这个地址是在系统加载时重定位的正确地址。 但动态加载xx.dll时,它的基地址会随机变化,这句话就会变成 xxxx2733 call dword ptr [65071020] 没有人知道[65071020]会指向哪里。程序执行到这里会raise exception。 错误在于我们不应该使用hard code方式确定函数在引入表中的位置, 因为上述代码是我们自己添加的,reloc段中没有这部分的索引, 系统加载dll时也就不可能替我们修正。 精华五中的一篇文章(对于DLL通过增加重定位项直接调用引入表函数 http://www.pediy.com/bbshtml/BBS5/pediy50339.htm)给出了一种修改reloc段来添加函数引用的方法, 可惜我对reloc段的结构不了解,没办法尝试。 好在我找到了一种替代的方法,据说是病毒常用的方法。 我们知道zz函数的正确地址确实存在于xx.dll中的import table中,偏移量为a(71020)。 我们的代码偏移量为b(32738)。因此从代码到引入表的绝对偏移是一个常数c。 动态加载时我们只要知道基地址,或者知道代码的实际地址,加上常数c就是指向zz函数的真实地址。 做法是在xx.dll的代码段中找一段空闲的位置,加入 6504E770 /$ 58 POP EAX ;调用语句的下一行代码地址 6504E771 |. 50 PUSH EAX ;恢复堆栈 6504E772 |. 05 E8E80300 ADD EAX,3E8E8 ;加上常数c …… 6504E779 |. FF10 CALL DWORD PTR DS:[EAX] ;[eax]指向zz的实际地址 6504E77B \. C3 RETN 再把开始的调用代码改为 65032733 . E8 38C00100 CALL impeg34.6504E770 这样就ok了。 |
|
[求助]动态加载的dll中如何调用外部函数
既然调用CreateFileA会失败,调用GetModuleHandle也同样会失败吧? import table里肯定有CreateFileA, 我希望手工修改重定位表,当系统加载dll时自动修正调用地址, 请问应如何实现? |
|
[求助]动态加载的dll中如何调用外部函数
这个dll自己也有调用CreateFileA的地方,动态加载时没问题。 我要做的是在它的code section添加一段代码,其中要调用CreateFileA, 并且要保证动态加载时能正确执行。 请问各位有什么办法? |
|
一个带狗的java软件的破解
“一阵摸索加实践”就是 1.用jcreater编一个最简单的java程序,但要有if(!……)。 2.用ultraEdit察看编译后的class文件,根据00-ff的java代码对照表判断哪个字节可能是if(!。 3.感觉9a(ifne)比较可疑,而且class文件里确实有一个字节是9a。 4.把9a改为99(ifeq),存盘。用jad反编译修改过的class文件,确实变成if(……)了。 5.用ultraEdit打开要破解的class文件,可能会有多个9a,逐个改为99,再反编译,看程序的流程是不是我们期待的那样。 6.如果不是,恢复。改下一个9a为99,直到成功为止。 以上是很笨的办法。严重需要高手做个专门工具出来。 |
|
一个带狗的java软件的破解
在百度搜一下java虚拟机规范,挺多的。 第十章是00-ff的java代码对照表。 我下的是无优书库的pdf,10M大小, 限制版,没法拷贝,所以没法贴上来,各位见谅。 哪位找到无限制版的pdf或word版,麻烦说一下。 |
|
一个带狗的java软件的破解
这是个行业软件,老外做的,要一万多欧元,可见软件的保护力度跟售价不一定成正比。 另外我的本意不是贬低狗,而是希望抛砖引玉,让大家对java软件破解多一些关注。因为现在老外做的很多软件是用java写的,而class文件修改起来很不方便。希望有精通虚拟机的高手做一个反编译加修改相结合的class文件编辑工具,或者讲一讲这方面的心得。 |
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值