Trespasser - CRC-32 hash tools

List your programs here (game-related or other software).

Moderators: scallenger, Rebel, madppiper, TresCom Support Team

User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: Trespasser - CRC-32 hash tools

Post by machf »

So, the trick is trying to guess as much of it as possible to keep the list short. For guns, for example, they start with "GUN - ", and we know some of them end with "01" (because there's another one that clearly ends in "02", being identical in everything else). And they are sorted alphabetically. By categories (handguns, rifles, shotguns). And any weapons that didn't exist prior to 1998 can be discarded. The first in the suspects list would those whose meshes are among the Mystery Models. That's a way to narrow the possibilities down.

EDIT: finished the non-recursive version (27). It's slower than the recursive one (26), which gets noticeable with longer strings (upwards from 6 characters). Wondering if I should work on the backwards ones in the afternoon...
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: Trespasser - CRC-32 hash tools

Post by machf »

Finished all 4 versions, here are quick links in DropBox while I update everything on the TresCom server:

https://www.dropbox.com/s/98ftn7lc58nm2 ... 6.zip?dl=0

https://www.dropbox.com/s/59g5nvuguhmlp ... 7.zip?dl=0

https://www.dropbox.com/s/vg33fybgsvk9e ... d.zip?dl=0

https://www.dropbox.com/s/6jwz36kd2ylbe ... d.zip?dl=0

v26 is the recursive one, v27 is the non-recursive one, v26bwd is the recursive backwards one and v27bwd is the non-recursive backwards one.

Whad did I add? A couple checkboxes and a selection spinner for one of them.

The checkbox labeled "strict", when checked, applies the same criteria for the random characters to the 4 automatically calculated characters, that is, if only if the 4 of them are listed in the "Charset" box, they will be included in the results list.

The checkbox labeled "Don't allow more than X repeats in a row" (where X is the selection spinner's value), when checked, will skip results with 2 or more identical characters in a row. The selection spinner next to it allows you to select between 1 and 2. If 1 is selected, only combinations where no characters are immediately repeated will be included in the results list. If 2 is selected, combinations with at most 2 identical characters in a row will be included in the results list, like "Anne", "lagoon", "tree" or "wood small". The "strict" option has no effect on this, which means that, in theory, you could for example get a result ending in (or starting with, if you use the backwards versions) "ooooo" (the first "o" belonging to the random characters and the other 4 in a row to the automatically calculated ones).
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
User avatar
Rebel
-=TresCom Developer=-
-=TresCom Developer=-
Posts: 6112
Joined: Sun Nov 10, 2002 10:26 pm
Location: That country nobody likes (you know the one)
Contact:

Re: Trespasser - CRC-32 hash tools

Post by Rebel »

Got 'em. If I ever do uncover an unknown sound I'll probably have to have a celebratory drink.
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: Trespasser - CRC-32 hash tools

Post by machf »

Uploaded them to the TresCom server and published them in the "Tools" section already... I'm leaving the older versions for some time before marking them as offline, as they may be marginally faster...
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Converting texture and sound names to 32bit IDs: CRC-32

Post by machf »

This is for Drac, who had been asking again:
machf wrote:OK, here's an explanation on how to use the program(s) I wrote some time ago on request of LtSten, I thought it might be a good idea to post it here too:
I think I wrote some instructions some time ago... anyway, the tool is basically divided in three sections, from top to bottom.

First, the CRC calculator, where you can type a text string and its hash value will be displayed below.

Second, the first half of the CRC reversing section. Here you input a known hash value in the box labeled "CRC", and the box labeled "string" further down will display a 4-character string that matches that hash value, if there is any (meaning, if the byte sequence isn't comprised of valid characters, it won't be displayed). The four smaller boxes above the string box display the 4 bytes in hexadecimal, so you can still see them. The other two boxes under the CRC box, labeled Leadin string and Trailing string, allow you to input known parts of the original string (or suspected parts), then the 4 characters that will be found go between those two strings. For example, if you have the hash value of BF11C5BF and type on the Leading string box the letter "b", you'll see that on the String box the letters "lood" appear, meaning that the full string is "blood". Or if you have 28DC6F86, type on the Trailing string " dirt" and on the Leading string "anne ", the "foot" will appear in the String box, meaning that the whole string is "anne foot dirt". Also, there are two boxes that display hex values next to the Leading and Trailing string boxes, those show you how the CRC parameters change for the calculation. Usually, the CRC-32 algorithm is calculated with a start (seed) value of 0xFFFFFFFF; if you add a Leading string, it's as if now you were starting the calculation with a new seed value. And when you add a Trailing string, it's as if instead of finding the matching sequence for the original CRC value, you now are looking for the sequence for a new value (meaning that you could remove the Trailing string and replace the CRC entry with the value shown, and it would be the same). Also, you may notice, for example, that if you have the CRC values 2E3736EB and B73E6751, the last of the "ASCII" boxes shows a hex value that varies in the two lesser bits for both; and if you input a trailing string of "1" for the former and "2" for the latter, the rest is identical. This means that both strings are the sme from the start, but one of them ends in "1" and the other in "2". Find one of them, and you've found both. Same thing is valid for strings where one ends in, for example, "dirt", another in "metal", and a third one in "cement", but the preceding part is identical for all of them.

Last, there's the bottom part of the CRC reversing section. If you click on the button labeled "Crack", the program will loop through possible strings and save them to a text file. Initially, the text file is set to "C:\crackcrc.txt", but you can change it with the "Select" button. You can also change the character set used by the program to test possible strings, either by manually editing the string in the box labeled "Charset" or using the buttons below it to select among three predefined sets. You can also change the number of characters to test, initially it's set to 1 (since 0 is the same as just looking at the results displayed on the "String" box), so if you tried for example the previous value of BF11C5BF and no leading or trailing string, and run the "Crack" operation with the default values, you'll se on the text file with the results the string "blood", 5 characters in total, because the first one is looped and the last 4 are calculated automatically like in the previous section. It's possible that aside from the "right" or "original" stings, others will be displayed too. The other ones listed will also give you the same hash value and can be used within Trespasser to access those sounds, even though they aren't the original names (and the original names may be easier to remember than some random string). The box labeled "Middle string" allows you to type a string of text that will be used in the calculations placing them between the N "random" characters tested by the program and the other 4 automatically calculated. The other selection list labeled "After middle" allows youto change that so that instead of having the N "random" characters placed before the Middle string, you have some of them before it, then the Middle string, then the other random characters after the middle, then the 4 calculated ones. The most complex results would use a Leading string, First set of random characters, Middle string, Other random characters after the middle, the 4 calculated characters, and the Trailing string. Neither the Leading string nor the Trailing string are saved to the text file. And the other two boxes labeled "Start" and "End" allow you to specify how the random charcaters should start and how they should end for the loop; for example, for 3 characters, you can have them loop from "aaa" to "zzz", or from "kkk" to "sss", or maybe you want to do one part at a time, and calculate first from "aaa" to "mzz" and then from "naa" to "zzz", it's your choice.
I'll probably write another program based on a similar analysis of the "encryption" used by one of those "nanny" programs... thy CRC they used was slightly different, so I'll need to generate a new set of tables, but the principle is the same, and boy, is the algorithm fast! Tons of results in virtually no time... for strings of up to 12 characters in total. That means the main problem will be searching through all those results afterwards.
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
User avatar
tatu
-=TresCom Website Manager=-
-=TresCom Website Manager=-
Posts: 5087
Joined: Fri Jun 24, 2005 9:40 pm
Antispam: No
Location: Sweden
Contact:

Re: Trespasser - CRC-32 hash tools

Post by tatu »

Cool, I will check this out and maybe spend some time trying to find something.

Is there a reason why RND Chars can't go above 10?
Active project: Trespasser: Isla Sorna
Status:
BE-PH1: Released
PH2-IT: Pre-released
PL-SUM: In production

"...there used to be more benches, but InGen's workers removed them during the evacuation in the name of framerate."
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: Trespasser - CRC-32 hash tools

Post by machf »

Yeah, space and time. It would take, I don't know, maybe a century to calculate... and take up not Terabytes but maybe Exabytes (1 Exabyte = a million Terabytes) or more. So, it's not worth to include.

Besides, the leading string+random chars+middle string+automatically calculated chars+trailing string is only allowed to add up to 28 characters (or was it 32? minus the 4 calculated ones) since no official Trespasser sound name has exceeded that length...
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
User avatar
tatu
-=TresCom Website Manager=-
-=TresCom Website Manager=-
Posts: 5087
Joined: Fri Jun 24, 2005 9:40 pm
Antispam: No
Location: Sweden
Contact:

Re: Trespasser - CRC-32 hash tools

Post by tatu »

I see. Guess that is not worth the time :P
Active project: Trespasser: Isla Sorna
Status:
BE-PH1: Released
PH2-IT: Pre-released
PL-SUM: In production

"...there used to be more benches, but InGen's workers removed them during the evacuation in the name of framerate."
User avatar
Draconisaurus
T-Rex Killer
T-Rex Killer
Posts: 14032
Joined: Mon Dec 06, 2004 5:21 pm
Antispam: No
Location: Isla Sorna
Contact:

Re: Trespasser - CRC-32 hash tools

Post by Draconisaurus »

Alright, am trying to learn this... Using the wxtrescrc26 one. I entered 3C24056F as the CRC, which is the hash for block 112 for b97 Efffects.tpa. In the spreadsheet it says afterward "(possibly “SPEC-”, EA5FB8BB +” RUN”)". So, I entered "SPEC-" as the leading string. No other specifics defined other than the destination of the output file. After hitting Crack, the resulting text file is blank. :?:
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: Trespasser - CRC-32 hash tools

Post by machf »

No wonder, since you left the "# RND Chars" spinner at its default value of 1; only very rarely will you get results with a single random character. Usually with 2 you may get a couple ones; with 3 it's sure you'll get at least one. Oh, and to save calculations, enter " RUN" as the trailing stream, since that part is also known; it will save you the need to figure out those last 4 characters.
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
User avatar
Draconisaurus
T-Rex Killer
T-Rex Killer
Posts: 14032
Joined: Mon Dec 06, 2004 5:21 pm
Antispam: No
Location: Isla Sorna
Contact:

Re: Trespasser - CRC-32 hash tools

Post by Draconisaurus »

Alright so I'm still confused, how do you choose what number of random characters to use? Since for example in this case we have no idea how many characters come in-between... If you select 3, doesn't that mean all your results would be SPEC-@@@RUN"? Should a high number like 9 be selected, allowing for a range of 0 to 9 in-between characters, for example?
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: Trespasser - CRC-32 hash tools

Post by machf »

Draconisaurus wrote:Alright so I'm still confused, how do you choose what number of random characters to use? Since for example in this case we have no idea how many characters come in-between... If you select 3, doesn't that mean all your results would be SPEC-@@@RUN"? Should a high number like 9 be selected, allowing for a range of 0 to 9 in-between characters, for example?
Actually, if you choose 3, it would be "SPEC-******* RUN" (you forgot the space at the beginning of " RUN"), as there are 4 characters which are automatically calculated aside form the 3 random ones tested...

The thing is: for each and every 32-bit (8 bits per byte, 4 bytes) CRC-32 value, there is exactly one 32-bit (4 bytes) "string" that matches it (that is, if you calculate the CRC-32 hash for that 4-byte "string", you'll get that exact unique value). Those 4 bytes are the ones displayed in the 4 text boxes next to the label "ASCII".

But we are interested only in those combinations which match the valid characters. What does that mean? Well, for starters, any byte values over 127 (128 to 255) aren't standard, printable ASCII characters, so we ignore them. Then, from the remaining group from 0 to 127, Trespasser ignores uppercase letters (because it first converts everything to lowercase) and some other characters, so the ranges 0-31 (non-printable printer control characters, mostly) and 64-95 (uppercase letters and some more, including the @ symbol, [, ], \, ^ and _) are discarded too. That leaves us with 64 valid characters of the possible 256 values for a single byte, and that's the reason why not always there's a text visible in the box labeled "String" below the 4 "ASCII" ones: only when those 4 values are in the valid range, the string will be displayed. And that's 64/256 = 1/4th chance of happening for a single character, or (1/4)^4 = 1/256th chance for 4 characters in a row. CRC-32 values like 2FE21360
(corresponding to the 4-character string "va16"), C9508DDA ("vh10"), 3546BF77 ("bone") or E4C41E16 ("amb1") will display results immediately, without needing to go testing through combinations of random characters.

Now let's say we add a single character in front of our 4-byte calculated string, testing for 64 different alternatives (actually, we are only using 41 possible characters by default, but let's assume it's 64 to simplify things), then our 1/256th chance becomes [(64/256)^4]*64, or 1/4th. With 2 additional characters to test, each one cycling through 64 possibilities, it becomes [(64/256)^4]*(64^2) = 16, which mean we will find exactly 16 valid matching strings. With 3, it becomes [(64/256)^4]*(64^3) = 1024, meaning we'll get a list of 1024 possible matching strings, each one 7 characters long. And so on.

The discrepancies in the results are due to the fact that we are testing not through 64 possible characters for each position, but a lower number (41 by default, as I mentioned, or less if we further limit the allowed characters in the "Charset" text box). With 1 character we get [(64/256)^4]*41 or ~0.16 = 16.016% chance; with 2 characters, [(64/256)^4]*(41^2) or ~6.566 = 6 strings plus 56.641% chance of a 7th; with 3 characters, [(64/256)^4]*(41^3) or ~269.22 (meaning we should get at least 269 results, with a 22.27% chance of a 270th), etc. With each character added, the possible valid results increase more or less tenfold.

There may be an error somewhere in my math, but that's more or less it...
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
User avatar
Draconisaurus
T-Rex Killer
T-Rex Killer
Posts: 14032
Joined: Mon Dec 06, 2004 5:21 pm
Antispam: No
Location: Isla Sorna
Contact:

Re: Trespasser - CRC-32 hash tools

Post by Draconisaurus »

Uhhhhhh. Alright, I entered "3C24056F" as the hash, "SPEC-" as the leading string, " RUN" as the trailing string, specified 4 random characters, and then Crack. Still an empty text file.
Attachments
CRC01.jpg
CRC01.jpg (118.49 KiB) Viewed 4389 times
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: Trespasser - CRC-32 hash tools

Post by machf »

Try selecting a different location than C:\, since these are the results that should be on the file:

First 10:

Code: Select all

  0 "/'*
  a22>z
  l z=)<
  po&<=<
  psi`<(
 #/jk72s
 #/v$k3g
 #39xj'g
 #b7j+?#
 #o9 x)q
Last 10:

Code: Select all

zycu7~mg
zyng2qz!
zyr4!,o5
zz #i(w<
zz--#{an
zz-1l'`z
zz1bzun
zzmb'h{x
zzq-{iox
zzq145nl
(I've omitted the rest since the message was almost twice the size of the maximum number of characters per post limit)
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
User avatar
Draconisaurus
T-Rex Killer
T-Rex Killer
Posts: 14032
Joined: Mon Dec 06, 2004 5:21 pm
Antispam: No
Location: Isla Sorna
Contact:

Re: Trespasser - CRC-32 hash tools

Post by Draconisaurus »

Huh. I forgot to change the output destination. They're all there, now, thanks...
Post Reply