-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.) Added a load of new hashes in src/util/translations/general.cr 2.) Tweaked some of the code to be little nicer overall 3.) Normalized a few of the file/directory names 4.) Updated the default localize.json file to be up to date with v1.31.3 (MWIII)
- Loading branch information
1 parent
5069502
commit 0e5ed55
Showing
10 changed files
with
4,760 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
bin/ | ||
src/util/c-src/fnv64.o | ||
src/util/bindings/fnv64.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,31 @@ | ||
# CoD Lua Dehasher | ||
This is a program that's able to take Call of Duty's decompiled Lua files, and dehash about 99% of their file names while also dehashing many strings and function names. | ||
This is a program that's able to take Call of Duty's decompiled lua files, and dehash about 99% of their file names while also dehashing many strings and function names. | ||
|
||
**BIG OVERHAUL UPDATE**:<br> | ||
I updated this project to use [Crystal](https://crystal-lang.org) instead of Ruby. If you look at the code between the old version (still in the `legacy` folder) and the new version, you'll notice that the code looks somewhat similar. That's because Crystal is, in simple terms, just a compiled Ruby. This makes the script run much faster along with the code being a lot safer now! I also changed how the localize JSON should be structed along with a few minor bug-fixes. | ||
|
||
# Requirements | ||
To be able to run the program you will not need to install anything. To compile the program, you need to install `Crystal` ([Windows Install](https://crystal-lang.org/install/on_windows/)) and `GCC` (Windows install can be found [here](https://github.com/niXman/mingw-builds-binaries/releases) with release win32-seh-msvcrt). | ||
To be able to run the program you will not need to install anything. To compile the program, you need to install `Crystal` ([Windows Install](https://crystal-lang.org/install/on_windows/)) and `GCC` (Windows installation instructions [here](https://www.msys2.org)). | ||
|
||
# Before Running | ||
You must decompile your Lua files using JariK's Lua decompiler found [here](https://github.com/JariKCoding/CoDLuaDecompiler). There is a slight flaw in the code where hashes are truncated to 60 bits when they shouldn't be truncated at all. | ||
You must decompile your lua files using JariK's lua decompiler found [here](https://github.com/JariKCoding/CoDLuaDecompiler). There is a slight flaw in the code where hashes are truncated to 60 bits when they shouldn't be truncated at all. | ||
|
||
I have recently made a fork with the required fixes found [here](https://github.com/Nico-Posada/CoDLuaDecompiler). | ||
|
||
# Usage | ||
In the command line, type the following: | ||
In the command line, type the following command: | ||
`./lua_dehasher.exe <path>` | ||
where `path` is the path to your directory holding all of your Lua files. | ||
where `path` is the path to your directory holding all of your lua files. | ||
<br>**OR**<br> | ||
Drag and drop your folder of Lua files onto the exe file and it'll begin execution. | ||
Drag and drop your folder of lua files onto the exe file and it'll begin execution. | ||
|
||
You'll also need a localize.json file (a default one can be found in the `localize` directory in this repository). When running the program, make sure to have this localize.json file in the same directory as the executable. Although the json isn't required to actually run the program, it still helps to make the final Lua file outputs much cleaner. | ||
You can optionally include a `localize.json` file (a default one can be found in the `localize` directory in this repository). When running the program, make sure to have this json file in the same directory as the executable. Although the json isn't required to actually run the program, it still helps to make the final lua file outputs much cleaner. | ||
|
||
# What to Expect | ||
When the dehasher finishes, you'll notice a new directory named `Parsed` appear in the original directory you passed to the program. This will contain 2 subdirectories named `Hashed` and `Dehashed`. As the name suggests, Hashed contains all the files with names that could not be dehashed, and Dehashed contains all the files with names that were successfully dehashed. Upon opening any of the Lua files, you'll notice many strings marked with a `--[[DH]]` which means that those were hashed strings that the program dehashed. | ||
When the dehasher finishes, you'll notice a new directory named `Parsed` appear in the original directory you passed to the program. This will contain 2 subdirectories named `Hashed` and `Dehashed`. As the name suggests, Hashed contains all the files with names that could not be dehashed, and Dehashed contains all the files with names that were successfully dehashed. Upon opening any of the lua files, you'll notice many strings marked with a `--[[DH]]` which means that those were hashed strings that the program dehashed. | ||
|
||
# Compiling | ||
I have provided a `build.bat` file. After installing the requirements, run `build.bat`, and go to the `bin` directory. The executable will be there. | ||
|
||
# Contributing | ||
If you would like to contribute in any way, even if it is just adding new hashes to the list of translations, I will gladly accept any help. Fork the repository, make your changes, and then make a pull request with those changes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@echo off | ||
mkdir bin 2> NUL | ||
gcc -m64 -Wall -O3 -march=native -c .\src\util\C-src\fnv64.c -o .\src\util\C-src\fnv64.o | ||
crystal build -o .\bin\lua_dehasher.exe .\src\lua_dehasher.cr --release --no-debug | ||
gcc -m64 -Wall -O3 -march=native -c .\src\util\bindings\fnv64.c -o .\src\util\bindings\fnv64.o | ||
crystal build -o .\bin\lua_dehasher.exe .\src\lua_dehasher.cr --release --no-debug --stats --progress --time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
src/util/cod-lua-functions.cr → src/util/translations/functions.cr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.