Project includes the library NoxCryptKeys that encompass encryption/decryption mechanism of the Nox game. Also it include additional executable NoxCryptUnpacket that utilises former library to decrypt or encrypt Nox files.
One public header - NoxCryptKeys/keys.h. It's only one class - NoxCrypt::Key. It have two only constructors:
explicit Key(int keyNumber); explicit Key(KeyType keyType);
Former get number of key explicitly, later from enumerate NoxCrypt::KeyType. In Nox there are only 31 different keys. They are numbered from 0 to 30. After initialization you can use two interface for your tasks:
encryptBlock/decryptBlockthat works with Nox block (64 bit breaked in two words).
encrypt/decryptthat work with sequence uint32_t. There is must be even sequence element!
Use it like any other linux command line tool. First not option argument - input file, second - output file. Option must be enumerated one by one, each with '-' character.
-i [filename]explicit input file path.
-o [filename]explicit output file path.
-k [keynumber]explicit key number.
-ddecrypt file, not encrypt.
-frewrite output file.
NoxCryptUnpacker not very dumb. In general it can work with only one argument - input file name. If it's possible programm find out what other argument must be. The guessing is based on file name and it's extension. And on logic too.
Uncrypted file have default extension
Example of usage:
# Will decrypt file NoxCryptUnpacker thing.bin
I used std::filesystem feature that now is not standard. Therefore you need a few changes in code to adapt it for particular compiler. If, when you read this, filesystem becomed standard, and code flawned in this moment - please report me.
I'm not very strive to perfect, or even good program style or software quality. I doubt in very big fan base :) It's mainly documentation to Nox encryption mechanisms!