// // GameToolbox::gen_random from 0x3d3e48 to 0x3d3f5c (276 bytes) // // 2 xrefs: // > GJGameLevel::generateAutoSaveUID @ 0x4ca818 // > GJMultiplayerManager::uploadComment @ 0x6423d4 // // This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False! // // Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings // Generated at Fri, 27 Nov 2026 11:46:42 +0000 // GameToolbox *__fastcall GameToolbox::gen_random(GameToolbox *this, int a2) { char v4; // r6 int v5; // r0 int v6; // r1 char *v7; // r3 unsigned int v8; // t1 int v9; // r2 int i; // r6 unsigned int v11; // r0 unsigned int v12; // r0 int v14[3]; // [sp+4h] [bp-38h] BYREF int v15[9]; // [sp+10h] [bp-2Ch] BYREF v4 = byte_D2A6D8; __dmb(0xFu); if ( (v4 & 1) == 0 && _cxa_guard_acquire((__guard *)&byte_D2A6D8) ) { memset(v14, 0, sizeof(v14)); std::string::__init(v14, "/dev/urandom", 0xCu); std::random_device::random_device(v15, v14); v5 = std::random_device::operator()(v15); v6 = 1; v7 = &byte_D2A6D8; dword_D2A6DC = v5; do { v8 = *((_DWORD *)v7 + 1); v7 += 4; v9 = v6 + 1812433253 * (v8 ^ (v8 >> 30)); ++v6; *((_DWORD *)v7 + 1) = v9; } while ( v6 != 624 ); dword_D2B09C = 0; _cxa_guard_release((__guard *)&byte_D2A6D8); std::random_device::~random_device((std::random_device *)v15); std::string::~string((int)v14); } *(_DWORD *)this = 0; *((_DWORD *)this + 1) = 0; *((_DWORD *)this + 2) = 0; std::string::reserve((int *)this, a2); for ( i = 0; i < a2; ++i ) { std::__independent_bits_engine,unsigned int>::__independent_bits_engine( v15, (int)&dword_D2A6DC, 6u); do { v11 = std::mersenne_twister_engine::operator()(v15[0]); v12 = v11 & v15[7]; } while ( v12 > 0x3D ); std::string::push_back((int *)this, *((_BYTE *)&word_BEADC0 + v12 + 12)); } return this; }
GD Web Decomp Icon

GD Web Decomp

Raw Source