Discussion:
Generating CheckSum for AMD64 Executable
(too old to reply)
Paul McKneely
2019-05-01 12:39:22 UTC
Permalink
Hi,

I have written an assembler and library manager targeting AMD64
using OpenWatcom 1.8. I am currently writing a Linker. Source
code is in C (not C++).  Though the OW suite I am using is 32-bits,
I don't see any reason why it can't be used to write software that can
create 64-bit running target programs.

The Optional Header of the AMD64 Exe has a field called CheckSum
at offset 64. The PE specification I am using says the following to
describe
the field that must be filled in within an EXE file:

"The image file checksum. The algorithm for computing the checksum
is incorporated into IMAGHELP.DLL. The following are checked for
validation at load time: all drivers, any DLL loaded at boot time, and
any DLL that is loaded into a critical Windows process."

Has anyone done this? Certainly the OW linker gets this field
completed for the 32-bit executables that it generates. Perhaps
the algorithm is the same. Is it possible to get the OW tool suite
that I am using to perform this action?

Thanks.
Frank Beythien
2019-05-01 15:10:31 UTC
Permalink
Post by Paul McKneely
Hi,
I have written an assembler and library manager targeting AMD64
using OpenWatcom 1.8. I am currently writing a Linker. Source
code is in C (not C++).  Though the OW suite I am using is 32-bits,
I don't see any reason why it can't be used to write software that can
create 64-bit running target programs.
The Optional Header of the AMD64 Exe has a field called CheckSum
at offset 64. The PE specification I am using says the following to
describe
"The image file checksum. The algorithm for computing the checksum
is incorporated into IMAGHELP.DLL. The following are checked for
validation at load time: all drivers, any DLL loaded at boot time, and
any DLL that is loaded into a critical Windows process."
Has anyone done this? Certainly the OW linker gets this field
completed for the 32-bit executables that it generates. Perhaps
the algorithm is the same. Is it possible to get the OW tool suite
that I am using to perform this action?
Thanks.
Look at the OW Linker source at the website:

openwatcom.org

Direct jump to the source:

http://perforce.openwatcom.org:4000/@md=d&cd=//depot/openwatcom/bld/wl/c/&c=lzi@//depot/openwatcom/bld/wl/c/loadpe.c?ac=22

Frank

Loading...