Tools and a C/C++ library to manipulate BFCodec-encrypted content.
jbt encrypts a directory of game data then zips it up. The extension depends on the target game. You
must use the correct key to encrypt the data.
jbt -K 'the game key' game-data/ game-data.jbtLike unzip, unjbt extracts the zip file then decrypts each game file. Conversions will happen if
tools are in PATH:
| Input Format | Output Format | Tool Used |
|---|---|---|
| Binary Property List (plist) | XML Property List | libplist (if found at configure time), CoreFoundation (macOS) |
| CgBI PNG | PNG | pngcrush, pngdefry |
pngdefry can be downloaded from its official site (archived).
pngcrush is only available on macOS if you have Xcode installed.
unjbt -d game-data game-data.jbtIf the directory passed to -d/--extract-to does not exist it will be created.
// If using a DLL on Windows:
// #ifdef _WIN32
// #define BFCODEC_USE_DLL 1
// #endif
#include <bfcodec.h>
void func() {
C_BLOWFISH *blf = bfcodec_init();
const uint8_t my_key = {};
const uint8_t iv[8] = {};
bfcodec_expand_key(blf, &my_key, 16);
bfcodec_decrypt(blf, in_out_data, data_len, my_iv);
// or
bfcodec_encrypt(blf, in_out_data, data_len, my_iv);
}Link with -lbfcodec.
// If using a DLL on Windows:
// #ifdef _WIN32
// #define BFCODEC_USE_DLL 1
// #endif
#include <bfcodecpp.h>
void func() {
auto bfc = BFCodec::create();
bfc.expandKey({ /* key here */});
bfc.decrypt(inOutData, {/* IV here */});
// or
bfc.encrypt(inOutData, {/* IV here */})
}Link with -lbfcodec.
Requirements:
- CMake
- On Linux (for tools): OpenSSL
- Optional: libplist on non-macOS
Basic commands to build after cloning:
mkdir build
cd build
cmake ..
makejbt and unjbt will be in the tools directory.