Author Topic: Checksum Checker  (Read 3256 times)

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Checksum Checker
« on: October 18, 2008, 04:48:22 PM »
Here's a tool to help with checksum related problems. If you can't play with someone due to a checksum related error, then run this tool to see a dump of checksums for each file. Comparing checksums of files can help you determine which file caused the error, and possibly who is different among a group of people.

Of course for this to be useful, it helps to know which files have been modded from some original copy. To do this, it would need to know something about the original file. If FileChecksumList.txt is in the folder, then it will be read for a list of original checksums to compare with. For each file in the folder, it will get a single "*" if it is unknown (not found in FileChecksumList.txt), and it will get two "**" if the checksum differs from the original. If no difference is detected, no "*"'s will be printed.

Note: The FileChecksumList.txt packaged with this tool contains checksums for 1.3.5 Beta 2.

If you all have the same base version, then you only really need to check lines with *'s on them, and compare those checksums. Also, here's a reminder of what files are compared that can lead to this error. Remember that some of this data is stored in Sheets.vol or Maps.vol by default. The error is generated on the final checksum listed in section 4, which is just the checksum of the checksum values in the above sections. Basically, double check the files listed in Sections 1-3, including any .vol files they may be located in.

Quote
------- [Part 1: Sheet data]
BUILDING.TXT
MINES.TXT
MORALE.TXT
SPACE.TXT
VEHICLES.TXT
WEAPONS.TXT
edentek.txt
ply_tek.txt
multitek.txt
------- [Part 2: Exe data]
Shell [whatever the loaded shell DLL is called]
Outpost2 [whatever is returned by GetModuleFileName(0)]
------- [Part 3: Script data]
scriptChecksum [the level DLL]
map [referenced by the DLL]
------- [Part 4: Summary]
checksumOfChecksums [checksum of the above checksum table]
-------

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
Checksum Checker
« Reply #1 on: October 19, 2008, 06:43:48 AM »
Very nice :)

Offline Savant 231-A

  • Sr. Member
  • ****
  • Posts: 486
    • https://www.outpost2.net
Checksum Checker
« Reply #2 on: October 19, 2008, 07:11:15 AM »
Quote
checksumOfChecksums [checksum of the above checksum table]
 
I really like this line xD

Anyway, nice job :D
Gordon Freeman, and mr. Crowbar would own Master Chief in any part of the day.
"Come here citizen."

"From the ashes of the collapse we seek to build a better world for all."

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Checksum Checker
« Reply #3 on: October 21, 2008, 09:19:41 PM »
Quote
Quote
checksumOfChecksums [checksum of the above checksum table]
 
I really like this line xD
You realize OP2 actually does check that?  It's not some random thing Hooman added for no apparent reason.
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Checksum Checker
« Reply #4 on: October 22, 2008, 02:43:53 PM »
Yes, actually that final line is the only one that Outpost 2 checks. Which is perhaps part of the reason why it doesn't tell you which file caused the checksum error. It only tells you that there is a checksum error.
 

Offline TH300

  • Hero Member
  • *****
  • Posts: 1404
    • http://op3game.net
Checksum Checker
« Reply #5 on: December 28, 2010, 07:45:56 AM »
The program doesn't work correctly for me. I put the FileChecksumList.txt in my op2 directory and call the program from that directory. But it ignores most entries in the reference file. Here is part of the output:
Quote
-- Current  Original FileName
 * D1F4AC65          fl01.map
   641F5E75 641F5E75 Outpost2.exe
 * E93CF561          mu6_12.dll
 * 590651EE          cdp1.dll
 * 61CC8ED6          move.ani
 * 7CCB2401          e03.dll
 * 76379B3B          attack.ani
 * ADC05650          odasl.dll
 * EA1F73D5          atwmon.map
 * 724BC795          e02.dll
   FD99100B FD99100B p08.dll
 * 25725549          maps02.vol
 * 8BD702E5          p04.dll
(most of) these files are obviously listed in the reference file with those checksums.
When I execute the program several times, I always get the exact same result.

I should mention that I am using Wine on Linux to run it. Don't think that wine is that buggy, though.
« Last Edit: December 28, 2010, 07:48:24 AM by TH300 »

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Checksum Checker
« Reply #6 on: December 28, 2010, 03:54:08 PM »
I added the source to SVN if you want to take a look. I don't see anything obviously wrong with it. It uses the Win32 API functions FindFirstFile and FindNextFile to iterate over the files in the current working directory (I believe). I suppose those should be fine under Wine, especially since it lists those files, which clearly have been found.

Actually, the issue might be the .txt file. Perhaps it's a line ending issue? The file parsing is really simple stupid and would probably be confused if the line endings got converted. That would explain why the hash lookup wasn't finding the original checksums.


Also, you're not running the official downloaded version of the game. You seem to be running an updated SVN copy. The checksum of your Outpost2.exe file matches a patch I committed on the weekend.
 

Offline TH300

  • Hero Member
  • *****
  • Posts: 1404
    • http://op3game.net
Checksum Checker
« Reply #7 on: December 28, 2010, 05:46:44 PM »
The Outpost2.exe from svn gave me the checksum 645F5EB5. And that is different.

My first thought was that the linebreaks got converted, but I checked them in a hexeditor. They are still 13,10.

I will look at the source tomorrow. Thanks for it.