|
导入表想增加一个DLL,实现程序启动时加载自己的DLL
看到图了。 FirstThunk指向IMAGE_THUNK_DATA32的链表,少个结束NULL! 1) 最简单,这样改: [FONT=Courier]00000360: 68 03 00 00.00 00 00 00.00 00 6D 79.66 75 6E 00 ..........myfun.[/FONT]因为位置不够,函数名由"myfunc"缩短为"myfun",重新编译MyDll.dll。 2) 不重新编译。00000370的库名向下挪一行,调整相应指针。 |
|
导入表想增加一个DLL,实现程序启动时加载自己的DLL
能够发帖,图应该不需要审核,是你编辑帖子的问题。 报“0xC0000005: Access Violation”错,这是内存访问的问题,说明你有地方改得不对。 由于看不到图,只能从你的描述猜测。 1.找一片连续为0代码地址,将已有的导入表COPY过去。这样看来,可能是IMAGE_IMPORT_DESCRIPTOR的内容有问题! [FONT="Courier"]typedef struct _IMAGE_IMPORT_DESCRIPTOR { union { DWORD Characteristics; // 0 for terminating null import descriptor DWORD OriginalFirstThunk; // RVA to original unbound IAT (PIMAGE_THUNK_DATA) }; DWORD TimeDateStamp; // 0 if not bound, // -1 if bound, and real date\time stamp // in IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT (new BIND) // O.W. date/time stamp of DLL bound to (Old BIND) DWORD ForwarderChain; // -1 if no forwarders DWORD Name; DWORD FirstThunk; // RVA to IAT (if bound this IAT has actual addresses) } IMAGE_IMPORT_DESCRIPTOR; typedef IMAGE_IMPORT_DESCRIPTOR UNALIGNED *PIMAGE_IMPORT_DESCRIPTOR;[/FONT]其中,Name和FirstThunk两个字段必填。 Name:一个RVA指针,指向导入lib名。比如你的情况为指向"mydll.dl\0"。 FirstThunk:一个RVA指针,指向IMAGE_THUNK_DATA32/IMAGE_THUNK_DATA64链表。表以一个NULL结束。 [FONT="Courier"]typedef struct _IMAGE_THUNK_DATA32 { union { PBYTE ForwarderString; PDWORD Function; DWORD Ordinal; PIMAGE_IMPORT_BY_NAME AddressOfData; } u1; } IMAGE_THUNK_DATA32; typedef IMAGE_THUNK_DATA32 * PIMAGE_THUNK_DATA32;[/FONT]这里最常见的两种导入方式:by Ordinal或by Name。 如果是"by Ordinal",就填你导入函数的Ordinal。 如果是"by Name",又是一个RVA指针,指向IMAGE_IMPORT_BY_NAME。 [FONT="Courier"]typedef struct _IMAGE_IMPORT_BY_NAME { WORD Hint; BYTE Name[1]; } IMAGE_IMPORT_BY_NAME, *PIMAGE_IMPORT_BY_NAME;[/FONT]其中Name必填,指向你的导入函数名,比如"MyFunction1\0"。 PS:DLL不一定非得有导出函数,DllEntry总归是有的。有人会把DllEntry也当作一个导出函数。 也就是说,当这个DLL载入时,该做的事情在DllEntry里去完成。也许有函数在DLL里,你在DLL的Exports里没有列出来,这时需要硬编码:得到你DLL的载入基址后,加上你导出函数的RVA,再Call过去。 DLL在卸载时,DllEntry会被再调用一次,给你一个Cleanup的机会。 在作系统DLL Hook的时候,你得“继承”原DLL的所有导出项,选其中一个或几个导出函数作为Monitor,在时机成熟时再做Patching,比如一个加了壳的目标解压缩完成后。 |
|
[注意]刚发现今天是1月13号
感谢、支持! |
|
[下载]Exeinfo PE - ver 0.0.3.3 680 sign 测试版[多语言支持]
Exeinfo PE ver.0.0.3.7 with 818 + 4 signatures Ext_detector.dll v.2.4.0 www.exeinfo.xn.pl 2015.01.01 by A.S.L http://www.exeinfo.pe.hu/exeinfope.zip |
|
|
|
|
|
|
|
UPX源码的问题,还请各位大牛解惑!
2楼的建议值得参考! 仅“看”源码是很难“看”懂的,需要对C++语言非常深刻的理解。 我是没这个功力,所以在写“UPX完美脱壳脚本”时,调试与源码版本对应的upx.exe。这样就比较容易理解它各个类及成员函数的意义了。 困难在于UPX是面向多个操作系统平台、支持多种可执行文件格式的。源码中采用“框架”的结构,包括它设计得极其精巧的汇编部分。 要根据你的需求,识别出特定平台、格式的具体实现。 |
|
[下载]Exeinfo PE - ver 0.0.3.3 680 sign 测试版[多语言支持]
Exeinfo PE ver.0.0.3.6 Beta with 770 + 4 signatures http://www.asl-soft.hostoi.com/exeinfope.zip |
|
[讨论]海风月影是谁啊,听说很厉害
敢情这位HC是UpK的那位吗?头像看着似曾相识。 |
|
[原创]N卡全局设置之垂直同步覆盖的实现
学习学习。 |
|
[讨论]RC4算法暴力破解的尝试(附源码)
没仔细去研究,简单地想想,这也是极其困难的: 这时,state序列00~FF被Key“随机”地打乱了,字节交换的index是不确定的,逆回去的每一步至少有256x255个可能,直到还原初始序列。 |
|
[转帖]ILSpy 2.2
ILSpy 2.0 Final However, one thing changed for the binaries distribution: we do not include the debugger addin by default (it is part of the source download). The reason is that it is not stable enough - we´re improving the debugger in SharpDevelop and don´t have the resources to port those changes over to ILSpy just yet. 只有ILSpy_Master_2.0.0.1564_Beta_Binaries.zip里面含Debugger,否则需要自己编译。 |
|
[转帖]Red Gate .NET Reflector v8.0.2.313
最近的版本: .NET Reflector Desktop 8.3(8.3.3.115) - January 16, 2014 |
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值