#1
|
|||
|
|||
Help me with encrypted data.pak file
I wanted to repack the game Car Jacker Hotwired and Gone but the data.pak file is encrypted - so files like .ogg .wav .dds do not compress efficiently with msc, oggre...
I can extract the files with quickbms but this script cannot reconstruct them back. I wanted someone to help me make a tool that decrypts and encrypts (CLI) this file. Looking online I found a website (https://habr.com/ru/articles/689354/) where someone explains how to do this but I didn't understand anything ![]() interesting topic about this file: https://web.archive.org/web/20220309...p=69458#p69458 the AI claude told me that it is possible, using the quickbms script, to create a program in c++ (CLI) that has the function of decrypting and encrypting the data.pak file. but I don't understand anything about programming ![]() I will leave the file for analysis: Last edited by teusma; 23-04-2025 at 01:20. |
Sponsored Links |
#2
|
||||
|
||||
Use quickbms reimport
Code:
quickbms_4gb_files -w -r "en_gine_pak_CarJacker - Hotwired and Gone.bms" "data.pak" "data.pak_extract"
__________________
Haters gonna hate
Last edited by KaktoR; 23-04-2025 at 09:32. |
#3
|
|||
|
|||
this doesn't help, because I will have to keep the data.pak plus the extracted files.
|
#4
|
||||
|
||||
You keep data.pak, but it's empty except for something in the file footer which is required by the script to reimport the files properly so the data.pak file is crc perfect after second reimport.
__________________
Haters gonna hate
|
#5
|
|||
|
|||
Are you saying that the data.pak is empty after executing "01_unpack.bat" because if so... I'm running it and it's still not getting empty...
|
#6
|
||||
|
||||
Look at the data.pak before and after reimport zero'd files. Original ![]() Reimported zero'd files ![]() If you compress the modified data.pak with 7z or any other compressor, ratio is extrem low (compressed data.pak from 91MB to 25KB).
__________________
Haters gonna hate
Last edited by KaktoR; 24-04-2025 at 02:08. |
The Following User Says Thank You to KaktoR For This Useful Post: | ||
teusma (24-04-2025) |
#7
|
|||
|
|||
It took me a while but I understood haha, thanks. the only downside is that the quickbms executable is 19.3 MB and compressed 3.79 MB, this will overshadow almost all the gain I will have by decrypting the data.pak. But do what you know...that's life. If someone could create a C++ program from this BMS script, the executable would not exceed 100kb....
|
#8
|
||||
|
||||
Quote:
Even though I've only ever dabbled in python scripting, writing a C++ application proved to be quite simple, here's the source code: Code:
#include <fstream> #include <vector> #include <cstdint> #include <iostream> uint8_t reencrypt_byte(uint8_t d) { return (d < 128) ? (d * 2) : static_cast<uint8_t>(2 * d - 255); } int main(int argc, char* argv[]) { if (argc != 3) { std::cerr << "Usage: reenc <infile> <outfile>\n"; return 1; } // Read input file std::ifstream fin(argv[1], std::ios::binary); if (!fin) { perror("Error opening input"); return 1; } std::vector<uint8_t> buf((std::istreambuf_iterator<char>(fin)), std::istreambuf_iterator<char>()); // Transform in place for (auto &b : buf) { b = reencrypt_byte(b); } // Write output file std::ofstream fout(argv[2], std::ios::binary); if (!fout) { perror("Error opening output"); return 1; } fout.write(reinterpret_cast<char*>(buf.data()), buf.size()); return 0; } Last edited by L33THAK0R; 24-04-2025 at 08:34. |
#9
|
|||
|
|||
Couldn't you (if it's not too much to ask) simply produce a tool that looks like this pak_enc_dec that can be put in a chain like this: -mpak_enc_dec+oggre+srep+msc+lolz.
To be honest, your program I don't understand how it works. and it also has a dependency on dlls - which is not a big problem since when compressed it drops from 1.50mb to 343kb... Sorry if I'm being noob in any way. Last edited by teusma; 24-04-2025 at 19:44. |
#10
|
||||
|
||||
Quote:
|
#11
|
|||
|
|||
forget it, I managed to create myself (with the help of AI) a tool(with only 29kb) that can be used like this: -mpak+oggre+srep+msc+lolz reaching all types
of files inside the data.pak already decrypted. this ambition I had to make this repack was more for sport - because it doesn't save much space - due to the amount of .ogg and .wav being small, but even so it was a delight to compress after applying the decryption. I'll leave the tool here for anyone who wants to use it too: Last edited by teusma; 10-05-2025 at 18:14. |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Borderlands 2 GOTY | omdj | PC Games - CD/DVD Conversions | 11 | 22-01-2021 08:22 |
Tom Clancy's Splinter Cell Conviction | Faks | PC Games - Protection List | 3 | 03-06-2010 02:10 |
Having a nightmare with Iomega USB ZipCD - Help! | Tranced | CD/DVD-Writers | 2 | 03-04-2005 06:00 |
PMA Update failure....????????? | dannyk | DVD Backup Forum | 1 | 05-01-2005 14:19 |
HELP ME PLZ!!!! | Dalvin | DC Games | 0 | 02-01-2001 22:15 |