Log in

View Full Version : make in aix5 creating exe with different cksum.please help.


net_invade
December 25th, 2008, 01:54
i have make utlity in aix 5 creating the exe with different checksum for each build i create. the source comprises of .pc (which will generate .c ) and two header files.could not identify anything time dependent.every time i build using make , it create c file with same checksum and object and exe with different checksums. anyone could explain this ?

FrankRizzo
December 26th, 2008, 18:43
I would just about bet that there is "Build time" being included in there somewhere. If I were you, I would build the exe, rename it, rebuild it, and then compare the 2 to see where the changed bytes are.

Furthermore, I would do the same with the object file (.o?) as well.

net_invade
December 27th, 2008, 23:26
Thanks a lot ! I did diff for the two exe-s and found the build time incorporated in exe.eg :
Sat Dec 27 22:30:19 2008 ·C for AIX Compiler Version 6.0.0.0 ---

So how can i make sure that the two exe-s made at different time are identical ?(i mean the exe which is created from same source code but built at different time). if i remove the exe alone keeping the outfiles intact , "sum -i " gives me the same out put.is there any other way to exclude these time factors and give a cksum ?

Thanks again for your help !

FrankRizzo
December 29th, 2008, 14:25
Well, I know nothing about AIX really, so it sounds like you are in for some studying of the toolchain to see if there is a way to NOT include the build time.

As a secondary option, you could write a little app that you use as a "post built processor" that sets the time to some agreed upon value so that THAT part is always the same.

net_invade
December 29th, 2008, 22:37
thats a good idea.i guess i can use that as a reusable component as well.now my attention is towards how can i modify the binary information in the exe.coz two places in exe , the time is in text foramt.but at header its in binary format.if you have any idea of modifying binary information manually ,wud love to hear that.thanks again for ur time n help !

FrankRizzo
December 29th, 2008, 22:44
Quote:
[Originally Posted by net_invade;78422]thats a good idea.i guess i can use that as a reusable component as well.now my attention is towards how can i modify the binary information in the exe.coz two places in exe , the time is in text foramt.but at header its in binary format.if you have any idea of modifying binary information manually ,wud love to hear that.thanks again for ur time n help !


He he he.

fopen
fread
buffer[x] = 0x00;
...
fwrite
fclose


net_invade
December 29th, 2008, 23:00

FrankRizzo
December 29th, 2008, 23:03
Quote:
[Originally Posted by net_invade;78425]


I left out the fseek stage. Which is needed, because after the read, the read pointer will be PAST the bytes you just read, so you need to reposition it before the write.

Let me know if that doesn't make sense.

net_invade
December 29th, 2008, 23:20
I was trying to identify how can i locate the first byte of exe , created by xlc_r in aix 5.i cud get the header format from somewhere.

FrankRizzo
December 29th, 2008, 23:34
Quote:
[Originally Posted by net_invade;78427]I was trying to identify how can i locate the first byte of exe , created by xlc_r in aix 5.i cud get the header format from somewhere.


Hmm.. If the format is like that of MOST compilers, and systems, you could search for the bytes that surround the time. There may be some sorta format in there.

Compile up a couple of files, and compare them, see if the bytes surrounding the time are the same. If so, you could search for them.

net_invade
December 29th, 2008, 23:55
ok..will try that approach.