开发者

Find out where PE file ends through PE header?

I 开发者_开发知识库want to append some binary data to the end of my executable. This is just to make my program into a single file. I tried using UpdateResource but I hit some bug inside it with my specific data, so I have to use another solution. So I need to know the original file size to determine if there is actually any data appended to it. Is it possible to obtain this information from the PE headers?

Thanks!


I found my solution here http://www.strchr.com/creating_self-extracting_executables


You might be able to, if you can get the size of each chunk. This may be of assistance:

http://msdn.microsoft.com/en-us/library/ms809762.aspx


You may find this PE file reader useful. You should be able to extract the appropriate value from the PE header using this software. Full source supplied.

http://www.objectmedia.ltd.uk/freeSoftware/peFileDLL.html

There is also a PE File Explorer (with source) on the same site. I can't post more than one URL at present because I don't have enough status points, so you'll have to work it out.

The PE File Explorer allows you to browse the contents of the PE file.

I wrote the software I am referring to (which in turn was inspired, many, many moons ago by a software tool by Matt Pietrek call LIPOsuction).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜