{"type": "func", "start": 4300578544, "end": 4300579136, "name": "GameLevelManager::restoreItems", "pseudocode": "// \n// GameLevelManager::restoreItems from 0x100559ef0 to 0x10055a140 (592 bytes)\n// \n// 0 xrefs:\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 __fastcall GameLevelManager::restoreItems(GameLevelManager *a1)\n{\n  double v1; // xmm0_8\n  GameManager *v2; // rax\n  std::string *p_m_playerUDID; // rax\n  cocos2d::CCString *v4; // rax\n  cocos2d::CCString *v5; // rax\n  const char *CString; // r14\n  size_t v7; // rax\n  size_t v8; // r15\n  char *v9; // r12\n  size_t v10; // r13\n  char v11; // [rsp+0h] [rbp-90h]\n  std::string v12; // [rsp+8h] [rbp-88h] BYREF\n  char v13; // [rsp+20h] [rbp-70h] BYREF\n  _BYTE v14[23]; // [rsp+21h] [rbp-6Fh] BYREF\n  _QWORD __dst[2]; // [rsp+38h] [rbp-58h] BYREF\n  void *v16; // [rsp+48h] [rbp-48h]\n  __int128 v17; // [rsp+50h] [rbp-40h] BYREF\n  void *__p; // [rsp+60h] [rbp-30h]\n\n  if ( GameLevelManager::isDLActive(a1, \"restoreKey\") )\n    return;\n  GameLevelManager::addDLToActive(a1, \"restoreKey\");\n  v2 = GameManager::sharedState();\n  if ( (v2->m_playerUDID.m_data.m_short.sizex2 & 1) != 0 )\n  {\n    sub_100006B70(&v17, v2->m_playerUDID.m_data.m_long.longStorage, v2->m_playerUDID.m_data.m_long.size, v1);\n  }\n  else\n  {\n    p_m_playerUDID = &v2->m_playerUDID;\n    __p = p_m_playerUDID->m_data.m_long.longStorage;\n    v17 = *(_OWORD *)&p_m_playerUDID->m_data.m_short.sizex2;\n  }\n  v4 = (cocos2d::CCString *)sub_1007AB580(\"%c%s%s%c%c%s\", (char)\"7\");\n  cocos2d::CCString::getCString(v4);\n  v5 = (cocos2d::CCString *)sub_1007AB580(\"udid=%s&secret=%s\", v11);\n  CString = cocos2d::CCString::getCString(v5);\n  v12.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x38u);\n  v12.__r_.__value_.__r.__words[0] = 57;\n  v12.__r_.__value_.__l.__size_ = 53;\n  strcpy(v12.__r_.__value_.__l.__data_, \"https://www.boomlings.com/database/restoreGJItems.php\");\n  v7 = strlen(CString);\n  if ( v7 >= 0xFFFFFFFFFFFFFFF8LL )\n    sub_100006BF0(2.057594829120962e-81);\n  v8 = v7;\n  if ( v7 >= 0x17 )\n  {\n    v10 = 26;\n    if ( (v7 | 7) != 0x17 )\n      v10 = (v7 | 7) + 1;\n    v9 = (char *)operator new(v10);\n    v16 = v9;\n    __dst[0] = v10 | 1;\n    __dst[1] = v8;\n    goto LABEL_12;\n  }\n  LOBYTE(__dst[0]) = 2 * v7;\n  v9 = (char *)__dst + 1;\n  if ( v7 )\nLABEL_12:\n    memmove(v9, CString, v8);\n  v9[v8] = 0;\n  v13 = 20;\n  strcpy(v14, \"restoreKey\");\n  GameLevelManager::ProcessHttpRequest(a1, &v12, (__int64)__dst, (__int64)&v13, 16);\n  if ( (v13 & 1) == 0 )\n  {\n    if ( (__dst[0] & 1) == 0 )\n      goto LABEL_15;\nLABEL_20:\n    operator delete(v16);\n    if ( (*(_BYTE *)&v12.__r_.__value_.__s.0 & 1) == 0 )\n    {\nLABEL_16:\n      if ( (v17 & 1) == 0 )\n        return;\n      goto LABEL_17;\n    }\n    goto LABEL_21;\n  }\n  operator delete(*(void **)&v14[15]);\n  if ( (__dst[0] & 1) != 0 )\n    goto LABEL_20;\nLABEL_15:\n  if ( (*(_BYTE *)&v12.__r_.__value_.__s.0 & 1) == 0 )\n    goto LABEL_16;\nLABEL_21:\n  operator delete(v12.__r_.__value_.__l.__data_);\n  if ( (v17 & 1) != 0 )\nLABEL_17:\n    operator delete(__p);\n}", "assembly": "; \n; GameLevelManager::restoreItems from 0x100559ef0 to 0x10055a140 (592 bytes)\n; \n; 0 xrefs:\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\npush    rbp                                                            ; +0x0, 0x100559ef0\nmov     rbp, rsp                                                       ; +0x1, 0x100559ef1\npush    r15                                                            ; +0x4, 0x100559ef4\npush    r14                                                            ; +0x6, 0x100559ef6\npush    r13                                                            ; +0x8, 0x100559ef8\npush    r12                                                            ; +0xa, 0x100559efa\npush    rbx                                                            ; +0xc, 0x100559efc\nsub     rsp, 68h                                                       ; +0xd, 0x100559efd\nmov     rbx, rdi                                                       ; +0x11, 0x100559f01\nlea     rsi, aRestorekey; \"restoreKey\"                                 ; +0x14, 0x100559f04\ncall    GameLevelManager__isDLActive                                   ; +0x1b, 0x100559f0b\ntest    al, al                                                         ; +0x20, 0x100559f10\njnz     loc_10055A0FA                                                  ; +0x22, 0x100559f12\nlea     rsi, aRestorekey; \"restoreKey\"                                 ; +0x28, 0x100559f18\nmov     rdi, rbx                                                       ; +0x2f, 0x100559f1f\ncall    GameLevelManager__addDLToActive                                ; +0x32, 0x100559f22\ncall    GameManager__sharedState                                       ; +0x37, 0x100559f27\ntest    byte ptr [rax+238h], 1                                         ; +0x3c, 0x100559f2c\njnz     short loc_100559F56                                            ; +0x43, 0x100559f33\nadd     rax, 238h                                                      ; +0x45, 0x100559f35\nmov     rcx, [rax+10h]                                                 ; +0x4b, 0x100559f3b\nmov     [rbp+__p], rcx                                                 ; +0x4f, 0x100559f3f\nmovups  xmm0, xmmword ptr [rax]                                        ; +0x53, 0x100559f43\nmovaps  [rbp+var_40], xmm0                                             ; +0x56, 0x100559f46\ntest    byte ptr [rbp+var_40], 1                                       ; +0x5a, 0x100559f4a\njnz     short loc_100559F73                                            ; +0x5e, 0x100559f4e\nlea     r14, [rbp+var_40+1]                                            ; +0x60, 0x100559f50\njmp     short loc_100559F77                                            ; +0x64, 0x100559f54\nmov     rdx, [rax+240h]                                                ; +0x66, 0x100559f56\nmov     rsi, [rax+248h]                                                ; +0x6d, 0x100559f5d\nlea     rdi, [rbp+var_40]                                              ; +0x74, 0x100559f64\ncall    sub_100006B70                                                  ; +0x78, 0x100559f68\ntest    byte ptr [rbp+var_40], 1                                       ; +0x7d, 0x100559f6d\njz      short loc_100559F50                                            ; +0x81, 0x100559f71\nmov     r14, [rbp+__p]                                                 ; +0x83, 0x100559f73\nlea     rax, a7; \"7\"                                                   ; +0x87, 0x100559f77\nmov     qword ptr [rsp+90h+var_90], rax; char                          ; +0x8e, 0x100559f7e\nlea     rdi, aCSSCCS; \"%c%s%s%c%c%s\"                                   ; +0x92, 0x100559f82\nlea     rdx, aMfd; \"mfd\"                                               ; +0x99, 0x100559f89\nlea     rcx, a2893; \"2893\"                                             ; +0xa0, 0x100559f90\nmov     esi, 57h ; 'W'                                                 ; +0xa7, 0x100559f97\nmov     r8d, 67h ; 'g'                                                 ; +0xac, 0x100559f9c\nmov     r9d, 62h ; 'b'                                                 ; +0xb2, 0x100559fa2\nxor     eax, eax                                                       ; +0xb8, 0x100559fa8\ncall    sub_1007AB580                                                  ; +0xba, 0x100559faa\nmov     rdi, rax                                                       ; +0xbf, 0x100559faf\ncall    cocos2d__CCString__getCString                                  ; +0xc2, 0x100559fb2\nlea     rdi, aUdidSSecretS; \"udid=%s&secret=%s\"                        ; +0xc7, 0x100559fb7\nmov     rsi, r14                                                       ; +0xce, 0x100559fbe\nmov     rdx, rax                                                       ; +0xd1, 0x100559fc1\nxor     eax, eax                                                       ; +0xd4, 0x100559fc4\ncall    sub_1007AB580                                                  ; +0xd6, 0x100559fc6\nmov     rdi, rax                                                       ; +0xdb, 0x100559fcb\ncall    cocos2d__CCString__getCString                                  ; +0xde, 0x100559fce\nmov     r14, rax                                                       ; +0xe3, 0x100559fd3\nmov     edi, 38h ; '8'; __sz                                           ; +0xe6, 0x100559fd6\ncall    __Znwm; operator new(ulong)                                    ; +0xeb, 0x100559fdb\nmov     [rbp+var_78], rax                                              ; +0xf0, 0x100559fe0\nmov     [rbp+var_88], 39h ; '9'                                        ; +0xf4, 0x100559fe4\nmov     [rbp+var_80], 35h ; '5'                                        ; +0xff, 0x100559fef\nmovups  xmm0, xmmword ptr cs:aHttpsWwwBoomli_65+20h; \"se/restoreGJItems.php\" ; +0x107, 0x100559ff7\nmovups  xmmword ptr [rax+20h], xmm0                                    ; +0x10e, 0x100559ffe\nmovups  xmm0, xmmword ptr cs:aHttpsWwwBoomli_65+10h; \"lings.com/database/restoreGJItems.php\" ; +0x112, 0x10055a002\nmovups  xmmword ptr [rax+10h], xmm0                                    ; +0x119, 0x10055a009\nmovups  xmm0, xmmword ptr cs:aHttpsWwwBoomli_65; \"https://www.boomlings.com/database/rest\"... ; +0x11d, 0x10055a00d\nmovups  xmmword ptr [rax], xmm0                                        ; +0x124, 0x10055a014\nmov     rcx, 7068702E736D6574h                                         ; +0x127, 0x10055a017\nmov     [rax+2Dh], rcx                                                 ; +0x131, 0x10055a021\nmov     byte ptr [rax+35h], 0                                          ; +0x135, 0x10055a025\nmov     rdi, r14; __s                                                  ; +0x139, 0x10055a029\ncall    _strlen                                                        ; +0x13c, 0x10055a02c\ncmp     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x141, 0x10055a031\njnb     loc_10055A13B                                                  ; +0x145, 0x10055a035\nmov     r15, rax                                                       ; +0x14b, 0x10055a03b\ncmp     rax, 17h                                                       ; +0x14e, 0x10055a03e\njnb     short loc_10055A056                                            ; +0x152, 0x10055a042\nlea     eax, [r15+r15]                                                 ; +0x154, 0x10055a044\nmov     byte ptr [rbp+__dst], al                                       ; +0x158, 0x10055a048\nlea     r12, [rbp+__dst+1]                                             ; +0x15b, 0x10055a04b\ntest    r15, r15                                                       ; +0x15f, 0x10055a04f\njnz     short loc_10055A08A                                            ; +0x162, 0x10055a052\njmp     short loc_10055A098                                            ; +0x164, 0x10055a054\nmov     rax, r15                                                       ; +0x166, 0x10055a056\nor      rax, 7                                                         ; +0x169, 0x10055a059\nlea     rcx, [rax+1]                                                   ; +0x16d, 0x10055a05d\ncmp     rax, 17h                                                       ; +0x171, 0x10055a061\nmov     r13d, 1Ah                                                      ; +0x175, 0x10055a065\ncmovnz  r13, rcx                                                       ; +0x17b, 0x10055a06b\nmov     rdi, r13; __sz                                                 ; +0x17f, 0x10055a06f\ncall    __Znwm; operator new(ulong)                                    ; +0x182, 0x10055a072\nmov     r12, rax                                                       ; +0x187, 0x10055a077\nmov     [rbp+var_48], rax                                              ; +0x18a, 0x10055a07a\nor      r13, 1                                                         ; +0x18e, 0x10055a07e\nmov     [rbp+__dst], r13                                               ; +0x192, 0x10055a082\nmov     [rbp+var_50], r15                                              ; +0x196, 0x10055a086\nmov     rdi, r12; __dst                                                ; +0x19a, 0x10055a08a\nmov     rsi, r14; __src                                                ; +0x19d, 0x10055a08d\nmov     rdx, r15; __len                                                ; +0x1a0, 0x10055a090\ncall    _memmove                                                       ; +0x1a3, 0x10055a093\nmov     byte ptr [r12+r15], 0                                          ; +0x1a8, 0x10055a098\nmov     [rbp+var_70], 14h                                              ; +0x1ad, 0x10055a09d\nmov     rax, 4B65726F74736572h                                         ; +0x1b1, 0x10055a0a1\nmov     [rbp+var_6F], rax                                              ; +0x1bb, 0x10055a0ab\nmov     word ptr [rbp-67h], 7965h                                      ; +0x1bf, 0x10055a0af\nmov     byte ptr [rbp-65h], 0                                          ; +0x1c5, 0x10055a0b5\nlea     rsi, [rbp+var_88]                                              ; +0x1c9, 0x10055a0b9\nlea     rdx, [rbp+__dst]                                               ; +0x1d0, 0x10055a0c0\nlea     rcx, [rbp+var_70]                                              ; +0x1d4, 0x10055a0c4\nmov     rdi, rbx                                                       ; +0x1d8, 0x10055a0c8\nmov     r8d, 10h                                                       ; +0x1db, 0x10055a0cb\ncall    GameLevelManager__ProcessHttpRequest                           ; +0x1e1, 0x10055a0d1\ntest    [rbp+var_70], 1                                                ; +0x1e6, 0x10055a0d6\njnz     short loc_10055A109                                            ; +0x1ea, 0x10055a0da\ntest    byte ptr [rbp+__dst], 1                                        ; +0x1ec, 0x10055a0dc\njnz     short loc_10055A118                                            ; +0x1f0, 0x10055a0e0\ntest    byte ptr [rbp+var_88], 1                                       ; +0x1f2, 0x10055a0e2\njnz     short loc_10055A12A                                            ; +0x1f9, 0x10055a0e9\ntest    byte ptr [rbp+var_40], 1                                       ; +0x1fb, 0x10055a0eb\njz      short loc_10055A0FA                                            ; +0x1ff, 0x10055a0ef\nmov     rdi, [rbp+__p]; __p                                            ; +0x201, 0x10055a0f1\ncall    __ZdlPv; operator delete(void *)                               ; +0x205, 0x10055a0f5\nadd     rsp, 68h                                                       ; +0x20a, 0x10055a0fa\npop     rbx                                                            ; +0x20e, 0x10055a0fe\npop     r12                                                            ; +0x20f, 0x10055a0ff\npop     r13                                                            ; +0x211, 0x10055a101\npop     r14                                                            ; +0x213, 0x10055a103\npop     r15                                                            ; +0x215, 0x10055a105\npop     rbp                                                            ; +0x217, 0x10055a107\nretn                                                                   ; +0x218, 0x10055a108\nmov     rdi, [rbp+var_60]; __p                                         ; +0x219, 0x10055a109\ncall    __ZdlPv; operator delete(void *)                               ; +0x21d, 0x10055a10d\ntest    byte ptr [rbp+__dst], 1                                        ; +0x222, 0x10055a112\njz      short loc_10055A0E2                                            ; +0x226, 0x10055a116\nmov     rdi, [rbp+var_48]; __p                                         ; +0x228, 0x10055a118\ncall    __ZdlPv; operator delete(void *)                               ; +0x22c, 0x10055a11c\ntest    byte ptr [rbp+var_88], 1                                       ; +0x231, 0x10055a121\njz      short loc_10055A0EB                                            ; +0x238, 0x10055a128\nmov     rdi, [rbp+var_78]; __p                                         ; +0x23a, 0x10055a12a\ncall    __ZdlPv; operator delete(void *)                               ; +0x23e, 0x10055a12e\ntest    byte ptr [rbp+var_40], 1                                       ; +0x243, 0x10055a133\njnz     short loc_10055A0F1                                            ; +0x247, 0x10055a137\njmp     short loc_10055A0FA                                            ; +0x249, 0x10055a139\ncall    sub_100006BF0                                                  ; +0x24b, 0x10055a13b", "xrefs": [], "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"}