Here's some details on how to encrypt the database.
First of all, a couple of disclaimers:
- The technique actually calls code in the product to do
the decryption and encryption, so it needs the
product to be installed to run.
- This is rather embarrassing, but recently I got in an
overzealous disk cleanup mode, and erased the C++
source code corresponding to this technique. All
I'm left with is the knowledge of how I did it, and the final
tool.
How To Do It:
The cricket program is written in C++/MFC. The program
reads and writes the database through a single C++
class, called CrEncryptedSerialize, that does the
encryption/decryption. This class is implemented in a DLL called
global.dll (found in the program directory). Because the main program
needs to use this class, the class is exposed as a
set of exports from this DLL.
This being C++, all the exported method names include information
about what parameters they take. So, by dynamically
loading this DLL, and calling the right exports, you
can access this same functionality.
The Program:
Below is
a downloadable ZIP containing a file called
convdb.exe, which uses this technique to decrypt and
encrypt the file. To use it, you'll need to drop it
into your cricket game directory. Then, run
convdb -d encrypted_db decrypted_db
where encrypted_db is one of the db files (e.g. datap.db),
and decrypted_db is some filename you choose. The
tool will create a decrypted version of the
database. When you're done, you can call
convdb -e decrypted_db encrypted_db
to re-encrypt the file into the format the program uses.
I also found that running this on one of the .db files in
the scenario directory makes it easier to figure out
the decrypted format, because there are fewer
players. But, as I said, I haven't got any patience for that sort
of thing!
Good luck!