print found GCI file seed on success
This commit is contained in:
@@ -210,7 +210,6 @@ void PSOEncryptionSeedFinder::parallel_all_seeds_t(
|
|||||||
usleep(1000000);
|
usleep(1000000);
|
||||||
}
|
}
|
||||||
|
|
||||||
log_info("Waiting for worker threads to terminate\n");
|
|
||||||
for (auto& t : threads) {
|
for (auto& t : threads) {
|
||||||
t.join();
|
t.join();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,12 +148,14 @@ string find_seed_and_decrypt_gci_data_section(
|
|||||||
const void* data_section, size_t size, size_t num_threads) {
|
const void* data_section, size_t size, size_t num_threads) {
|
||||||
mutex result_lock;
|
mutex result_lock;
|
||||||
string result;
|
string result;
|
||||||
|
uint32_t result_seed = 0xFFFFFFFF;
|
||||||
PSOEncryptionSeedFinder::parallel_all_seeds(num_threads, [&](
|
PSOEncryptionSeedFinder::parallel_all_seeds(num_threads, [&](
|
||||||
uint32_t seed, size_t) {
|
uint32_t seed, size_t) {
|
||||||
try {
|
try {
|
||||||
string ret = decrypt_gci_data_section(data_section, size, seed);
|
string ret = decrypt_gci_data_section(data_section, size, seed);
|
||||||
lock_guard<mutex> g(result_lock);
|
lock_guard<mutex> g(result_lock);
|
||||||
result = move(ret);
|
result = move(ret);
|
||||||
|
result_seed = seed;
|
||||||
return true;
|
return true;
|
||||||
} catch (const runtime_error&) {
|
} catch (const runtime_error&) {
|
||||||
return false;
|
return false;
|
||||||
@@ -161,6 +163,8 @@ string find_seed_and_decrypt_gci_data_section(
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!result.empty()) {
|
if (!result.empty()) {
|
||||||
|
static_game_data_log.info("Found seed %08" PRIX32 " to decrypt GCI file",
|
||||||
|
result_seed);
|
||||||
return result;
|
return result;
|
||||||
} else {
|
} else {
|
||||||
throw runtime_error("no seed found");
|
throw runtime_error("no seed found");
|
||||||
|
|||||||
Reference in New Issue
Block a user