Additon:If you get destination process,you may use ToolHelper,PsAPI ,PDH ,etc .You Do not use VC++'s advanced Code Copying,because after VC++ compile you function to machine code ,first two bytes is JMP instruction .if you want to use machine code compiled by advanced Code,you may use Delphi,thus ,you avoid write asm code
in your machine code or advanced code ,last statement must ExitThread function,otherwise ,you will get exception!,and your destination process will Terminate!!!
我有一个朋友在金山
他们汉化软件就是直接利用PE文件的格式读出资源,汉化后写回去
ICON m_hIcon;
m_hIcon = AfxGetApp()->LoadIcon(IDR_ICON);
找到icon 的位置和偏移量,解如就可以了,icon被编译后并无改变。我原来做过一个替换图片的
很成功。
我不须要改进程内存,只须改另一个文件的资源
in your machine code or advanced code ,last statement must ExitThread function,otherwise ,you will get exception!,and your destination process will Terminate!!!
你那个
[把"c:\\aaa.ico“的Ico文件的头去掉,把去掉头以后的数据写回EXE文件中图标资源的相应位置。]
的方法应该可行,具体怎么做啊?
可以看一看resview的源代码,程序大本营2000理有.是一读资源的例子.
代码我不能贴出,至少几百行.
知道了怎么读,写时去掉ico的头,写入原文件.不过如你不知pe格式,会失败的.
http://mfm.onchina.net/
看PEWelder的实现,那里有你要的答案。
里面有很详细的关于PE格式的资料。
MSDN的Technical Articles/Windows Platform/Base Services里有一篇《The Portable Executable File Format from Top to Bottom》
有了上面两个资料你基本上就能定位资源,了解资源目录树结构了。然后在MSDN里的Specifications/Platforms/Win32 Binary Resource Formats里能够找到各种资源的详细二进制结构说明。
有了这个资料你就能解析各种具体的资源了。PE文件的各种相关数据结构的定义都在Winnt.h里。然后就看你的编程功底了^o^