{"type": "func", "start": 4295252984, "end": 4295253180, "name": "GameToolbox::gen_random", "pseudocode": "// \n// GameToolbox::gen_random from 0x100045bf8 to 0x100045cbc (196 bytes)\n// \n// 1 xrefs:\n// > GJMultiplayerManager::uploadComment @ 0x1001cf7d4\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\nvoid __usercall GameToolbox::gen_random(int a1@<W0>, _QWORD *a2@<X8>)\n{\n  int v4; // w0\n  std::string *v5; // x1\n  std::string v6; // [xsp+8h] [xbp-48h] BYREF\n\n  sub_100009900(&v6, \"\");\n  if ( a1 >= 1 )\n  {\n    do\n    {\n      v4 = rand();\n      std::string::push_back(&v6, a0123456789abcd[v4 % 0x3EuLL]);\n      --a1;\n    }\n    while ( a1 );\n  }\n  if ( (v6.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )\n    v5 = &v6;\n  else\n    v5 = (std::string *)v6.__r_.__value_.__r.__words[0];\n  sub_100009900(a2, (char *)v5);\n  if ( SHIBYTE(v6.__r_.__value_.__r.__words[2]) < 0 )\n    operator delete(v6.__r_.__value_.__l.__data_);\n}", "assembly": "; \n; GameToolbox::gen_random from 0x100045bf8 to 0x100045cbc (196 bytes)\n; \n; 1 xrefs:\n; > GJMultiplayerManager::uploadComment @ 0x1001cf7d4\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nSUB             SP, SP, #0x60                                          ; +0x0, 0x100045bf8\nSTP             X24, X23, [SP,#0x50+var_30]                            ; +0x4, 0x100045bfc\nSTP             X22, X21, [SP,#0x50+var_20]                            ; +0x8, 0x100045c00\nSTP             X20, X19, [SP,#0x50+var_10]                            ; +0xc, 0x100045c04\nSTP             X29, X30, [SP,#0x50+var_s0]                            ; +0x10, 0x100045c08\nADD             X29, SP, #0x50                                         ; +0x14, 0x100045c0c\nMOV             X20, X0                                                ; +0x18, 0x100045c10\nMOV             X19, X8                                                ; +0x1c, 0x100045c14\nADRL            X1, asc_100746688; \"\"                                  ; +0x20, 0x100045c18\nADD             X21, SP, #0x50+var_48                                  ; +0x28, 0x100045c20\nADD             X0, SP, #0x50+var_48; int                              ; +0x2c, 0x100045c24\nBL              sub_100009900                                          ; +0x30, 0x100045c28\nCMP             W20, #1                                                ; +0x34, 0x100045c2c\nB.LT            loc_100045C7C                                          ; +0x38, 0x100045c30\nMOV             X22, #0x8421084210842109                               ; +0x3c, 0x100045c34\nMOV             W23, #0x3E ; '>'                                       ; +0x4c, 0x100045c44\nADRL            X24, a0123456789abcd; \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabc\"... ; +0x50, 0x100045c48\nBL              _rand                                                  ; +0x58, 0x100045c50\nSXTW            X8, W0                                                 ; +0x5c, 0x100045c54\nLSR             X9, X8, #1                                             ; +0x60, 0x100045c58\nUMULH           X9, X9, X22                                            ; +0x64, 0x100045c5c\nLSR             X9, X9, #4                                             ; +0x68, 0x100045c60\nMSUB            X8, X9, X23, X8                                        ; +0x6c, 0x100045c64\nLDRSB           W1, [X24,X8]; __c                                      ; +0x70, 0x100045c68\nADD             X0, SP, #0x50+var_48; this                             ; +0x74, 0x100045c6c\nBL              __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc; std::string::push_back(char) ; +0x78, 0x100045c70\nSUBS            W20, W20, #1                                           ; +0x7c, 0x100045c74\nB.NE            loc_100045C50                                          ; +0x80, 0x100045c78\nLDRSB           W8, [SP,#0x50+var_48.__r_.__value_+0x17]               ; +0x84, 0x100045c7c\nLDR             X9, [SP,#0x50+var_48]                                  ; +0x88, 0x100045c80\nCMP             W8, #0                                                 ; +0x8c, 0x100045c84\nCSEL            X1, X9, X21, LT; __s                                   ; +0x90, 0x100045c88\nMOV             X0, X19; int                                           ; +0x94, 0x100045c8c\nBL              sub_100009900                                          ; +0x98, 0x100045c90\nLDRSB           W8, [SP,#0x50+var_48.__r_.__value_+0x17]               ; +0x9c, 0x100045c94\nTBZ             W8, #0x1F, loc_100045CA4                               ; +0xa0, 0x100045c98\nLDR             X0, [SP,#0x50+var_48]; __p                             ; +0xa4, 0x100045c9c\nBL              __ZdlPv; operator delete(void *)                       ; +0xa8, 0x100045ca0\nLDP             X29, X30, [SP,#0x50+var_s0]                            ; +0xac, 0x100045ca4\nLDP             X20, X19, [SP,#0x50+var_10]                            ; +0xb0, 0x100045ca8\nLDP             X22, X21, [SP,#0x50+var_20]                            ; +0xb4, 0x100045cac\nLDP             X24, X23, [SP,#0x50+var_30]                            ; +0xb8, 0x100045cb0\nADD             SP, SP, #0x60 ; '`'                                    ; +0xbc, 0x100045cb4\nRET                                                                    ; +0xc0, 0x100045cb8", "xrefs": ["GJMultiplayerManager::uploadComment @ 0x1001cf7d4"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}