ALT-N change it to some other keys (How)

Second part of the best game ever made.
Thenasty
Sheikh
Sheikh
Posts: 34
Joined: February 27th, 2020, 10:19 pm

Re: ALT-N change it to some other keys (How)

Post by Thenasty »

Here is 55D2C0AAF
Attachments
5D2C0AAF.ZIP
(19.73 KiB) Downloaded 178 times
David
The Prince of Persia
The Prince of Persia
Posts: 2860
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: ALT-N change it to some other keys (How)

Post by David »

Thenasty wrote: August 21st, 2020, 4:24 pm Here is 55D2C0AAF
It's the EXE which you hacked according to my advice.
So that's why it has a different hash. :)
David
The Prince of Persia
The Prince of Persia
Posts: 2860
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: ALT-N change it to some other keys (How)

Post by David »

I'm trying to find a way to calculate CRC32 of files.

wxHexEditor can do that (Tools -> Checksum), but with a twist.
For example, for the EXE of the "most popular" version (c7a533cf.zip), wxHexEditor displays this:

Code: Select all

CRC32:  211c7d8b
CRC32B: cf33a5c7
wxHexEditor's CRC32B is the byte-swapped version of your CRC32, and wxHexEditor's CRC32 is something completely different!

Hexplorer is even worse, it displays the number in decimal:

Code: Select all

CRC32 = 945,474,608
In hex it's 0x385ACC30 which is different from the two numbers calculated by wxHexEditor.

Is there no single standard for CRC32?
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5760
Joined: April 9th, 2009, 10:58 pm

Re: ALT-N change it to some other keys (How)

Post by Norbert »

David wrote: August 21st, 2020, 10:31 pmIs there no single standard for CRC32?
Indeed, there's not. Quoting, "There are at least five different CRC32 polynomials in relatively common use, and if you add to that different schemes for padding and endianess, maybe 10-20 different ways to get a "crc32" on an identical block of data." (more info)

The IEEE does have this paper by Koopman (PDF) that "presents results from the first exhaustive search of the 32-bit CRC design space", and that - if I'm reading it right - suggests standardizing with (reversed reciprocal) polynomial class 0xBA0DC66B. Although according to Wikipedia, it performs poorly with long files.

Unless I'm mistaken, on this forum we've used MD5 sums instead.
At least, I have (example) and htamas did too.
Oh, I just noticed that SDLPoP also uses CRC-32, here.
Thenasty
Sheikh
Sheikh
Posts: 34
Joined: February 27th, 2020, 10:19 pm

Re: ALT-N change it to some other keys (How)

Post by Thenasty »

"It's the EXE which you hacked according to my advice.
So that's why it has a different hash. :)"


Sorry about that David.

I had copied the EXE file so many times while I was making changes, I lost track.
David
The Prince of Persia
The Prince of Persia
Posts: 2860
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: ALT-N change it to some other keys (How)

Post by David »

Thenasty wrote: August 25th, 2020, 12:40 am "It's the EXE which you hacked according to my advice.
So that's why it has a different hash. :)"


Sorry about that David.

I had copied the EXE file so many times while I was making changes, I lost track.
Okay, no problem!
David
The Prince of Persia
The Prince of Persia
Posts: 2860
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: ALT-N change it to some other keys (How)

Post by David »

David wrote: August 21st, 2020, 10:31 pm I'm trying to find a way to calculate CRC32 of files.
I recently found out that two programs I regularly use, Total Commander and 7-Zip, can calculate CRC32.
Both calculate C7A533CF from the KARATEKA.EXEs in c7a533cf.zip, which means I finally found a way to get the "correct" CRC32.

The "correct" versions are also available in PHP (hash_file("crc32b", ...), crc32()), and Python (binascii.crc32(), zlib.crc32()).
Post Reply