News:

SMFNew Installed

+-+-

User+-

Welcome, Guest.
Please login or register.
 
 
 

Login with your social network

Forgot your password?

Site Stats+-

Members
Total Members: 728
Latest: Cho
New This Month: 0
New This Week: 0
New Today: 0
Stats
Total Posts: 10932
Total Topics: 795
Most Online Today: 157
Most Online Ever: 854
(September 18, 2024, 07:49:37 am)
Users Online
Members: 0
Guests: 130
Total: 130

Author Topic: Another Tag/Hash Tool  (Read 1688 times)

0 Members and 39 Guests are viewing this topic.

Another Tag/Hash Tool
« on: »
Saw a couple posts recently where this could be useful, thought I'd post it.

RGTools is my unfinished/abandoned set of mod tools for Rebel Galaxy. Most of it's irrelevant, but two tools related to tag hashing are also useful for TL2 because both games use the same hash function.

One tool is a brute force hash reverser. You can invoke it from the command line with:
Code: [Select]
rgtools.exe -m brutehash -h <hash> -w <guess>where <hash> is the hash you want to reverse (decimal notation)
and <guess> is a text string that's a guess at the original input string with the $ symbol in place of unknown characters.

For example,
Code: [Select]
rgtools.exe -m brutehash -h 250724719 -w M$$$$will try to find a 5-letter string starting with 'M' that hashes to 250724719.

A few things to note:

1. This program can take a very, very long time to run (days, weeks, months, years) if the guess is long or contains many unknown characters. Ctrl+C is the shortcut to abort a command line program.

2. Runic's hash is not a very good one, in that it suffers from very frequent collisions, cases where multiple inputs yield the same hash. For instance, the example above finds two strings that hash to 250724719: "MARIO" and "MB2IO." If the guess is long or contains many unknown characters, the number of strings found will grow very, very large. You may need to direct rgtools' output to a file to prevent it from scrolling off the screen and disappearing, like this:
Code: [Select]
rgtools.exe -m brutehash -h 250724719 -w M$$$$ > some_output_file.txt
3. If all you want is to fix files so that they repack, then ANY string with the correct hash will work. For instance, over in this thread, Zayn wants a string that hashes to 1897279165. I have no idea what string the original .dat file used, but "BWZSNKGX" will hash to the same value, and therefore repack into an identical .bindat file.  ;D

(I don't have any good solution to finding a semantically meaningful string buried in the pile of gibberish strings that share the same hash.)



The other tool is a command line version of the hasher. Invoke it like this:
Code: [Select]
rgtools.exe -m hash -w <input>where <input> is the string you want to hash.

This does the same thing as the hasher in TL2 Tag Fixer, just in command line form. It might be useful if you're faster with a keyboard than a mouse, especially if you've already got a command prompt open.

Share on Bluesky Share on Facebook


Re: Another Tag/Hash Tool
« Reply #1 on: »
@Chthon thank u So Much for sharing the tools And the tips for using them! Hope things are well with u senpai!


 

Recent Topics+-