Re: Calculating checksum of a PE format .exe?
- From: Tony Hedge <tonyatbenthicsciencesdotcodotuk>
- Date: Tue, 26 Aug 2008 15:59:48 +0100
Thanks Rob
Let me explain a little further. Re your first point - I'm trying (perhaps unwisely!) to reuse a technique I've used with DOS-format ..exe's. With a DOS-style .exe I read the "no of pages" etc stuff from the .exe so that I can determine how much of the .exe is the application (as opposed to debug symbols etc), and I can then determine a checksum (any type will do, as you point out).
Re your second - I can then build the checksum into the link that starts the program (as a command line option).
No it isn't foolproof, it just gives some reassurance/indication that the user hasn't installed a later/older version and that the .exe file hasn't been corrupted.
First thought was to replicate the technique for CE, but to use the ImageHlp dll to make (my) life easier. Easier than trying to understand the PE file format, that is!
I'm beginning to think that Authenticode signing of the .exe might be just as easy but I've not yet worked out what I need to do at the OS end to do the authentication - don't be surprised to see more posts on this as I struggle to understand it!
Thanks again.
Tony
Rob wrote:
Note that in theory you cannot rely on any data coming from the exe itself until you've validated the file. So an exe-built-in-checksum could have been messed with too..
Greetings,
Rob.
"Rob" wrote:
for your purpose, "any" checksum (CRC16 ?) will do, or not ?
You need to remember the correct nr somewhere, and recalculate it, regardless of the CS-type used, right ?
Greetings,
Rob.
"Tony Hedge" wrote:
I would like to be able to calculate the "PE-style" checksum of a .exe file, under CE5.0. I know there are support functions for doing this in ImageHlp.dll (in Win32) but I don't think it ever made it across to CE.
Anyone know of any similar functionality anywhere?
I'm really just tying to verify that the .exe that the user is trying to run is the one that I put on there. Any thoughts on a different way of approaching it?
Thanks
Tony
- References:
- Prev by Date: Re: Compactor::CompactDataBlock() - Warning, cached dirty sector count inconsistent for block 0x000003bc
- Next by Date: Re: FILE SYSTEM and PARTITION IN IN WIN CE 5.0
- Previous by thread: RE: Calculating checksum of a PE format .exe?
- Index(es):
Relevant Pages
|