{"type": "func", "start": 4300485920, "end": 4300486152, "name": "GameLevelManager::saveGauntlet", "pseudocode": "// \n// GameLevelManager::saveGauntlet from 0x100543520 to 0x100543608 (232 bytes)\n// \n// 1 xrefs:\n// > GameLevelManager::onGetGauntletsCompleted @ 0x100529c07\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::saveGauntlet(GameLevelManager *a1, GJMapPack *a2)\n{\n  double v2; // xmm0_8\n  cocos2d::CCDictionary *m_savedGauntlets; // r14\n  cocos2d::CCString *v4; // rax\n  const char *CString; // r12\n  size_t v6; // rax\n  size_t v7; // r15\n  char *v8; // r13\n  size_t v9; // r14\n  char v10; // [rsp+0h] [rbp-50h]\n  cocos2d::CCDictionary *v11; // [rsp+8h] [rbp-48h]\n  _QWORD __dst[2]; // [rsp+10h] [rbp-40h] BYREF\n  void *__p; // [rsp+20h] [rbp-30h]\n\n  m_savedGauntlets = a1->m_savedGauntlets;\n  v4 = (cocos2d::CCString *)sub_1007AB580(\"%i\", v10);\n  CString = cocos2d::CCString::getCString(v4);\n  v6 = strlen(CString);\n  if ( v6 >= 0xFFFFFFFFFFFFFFF8LL )\n    sub_100006BF0(v2);\n  v7 = v6;\n  if ( v6 >= 0x17 )\n  {\n    v11 = m_savedGauntlets;\n    v9 = 26;\n    if ( (v6 | 7) != 0x17 )\n      v9 = (v6 | 7) + 1;\n    v8 = (char *)operator new(v9);\n    __p = v8;\n    __dst[0] = v9 + 1;\n    m_savedGauntlets = v11;\n    __dst[1] = v7;\n    goto LABEL_8;\n  }\n  LOBYTE(__dst[0]) = 2 * v6;\n  v8 = (char *)__dst + 1;\n  if ( v6 )\nLABEL_8:\n    memmove(v8, CString, v7);\n  v8[v7] = 0;\n  cocos2d::CCDictionary::setObject_1((__int64)m_savedGauntlets, a2, (char *)__dst);\n  if ( (__dst[0] & 1) != 0 )\n    operator delete(__p);\n}", "assembly": "; \n; GameLevelManager::saveGauntlet from 0x100543520 to 0x100543608 (232 bytes)\n; \n; 1 xrefs:\n; > GameLevelManager::onGetGauntletsCompleted @ 0x100529c07\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, 0x100543520\nmov     rbp, rsp                                                       ; +0x1, 0x100543521\npush    r15                                                            ; +0x4, 0x100543524\npush    r14                                                            ; +0x6, 0x100543526\npush    r13                                                            ; +0x8, 0x100543528\npush    r12                                                            ; +0xa, 0x10054352a\npush    rbx                                                            ; +0xc, 0x10054352c\nsub     rsp, 28h                                                       ; +0xd, 0x10054352d\nmov     rbx, rsi                                                       ; +0x11, 0x100543531\nmov     r14, [rdi+250h]                                                ; +0x14, 0x100543534\nmov     esi, [rsi+148h]                                                ; +0x1b, 0x10054353b\nlea     rdi, aI; \"%i\"                                                  ; +0x21, 0x100543541\nxor     eax, eax                                                       ; +0x28, 0x100543548\ncall    sub_1007AB580                                                  ; +0x2a, 0x10054354a\nmov     rdi, rax                                                       ; +0x2f, 0x10054354f\ncall    cocos2d__CCString__getCString                                  ; +0x32, 0x100543552\nmov     r12, rax                                                       ; +0x37, 0x100543557\nmov     rdi, rax; __s                                                  ; +0x3a, 0x10054355a\ncall    _strlen                                                        ; +0x3d, 0x10054355d\ncmp     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x42, 0x100543562\njnb     loc_100543603                                                  ; +0x46, 0x100543566\nmov     r15, rax                                                       ; +0x4c, 0x10054356c\ncmp     rax, 17h                                                       ; +0x4f, 0x10054356f\njnb     short loc_100543587                                            ; +0x53, 0x100543573\nlea     eax, [r15+r15]                                                 ; +0x55, 0x100543575\nmov     byte ptr [rbp+__dst], al                                       ; +0x59, 0x100543579\nlea     r13, [rbp+__dst+1]                                             ; +0x5c, 0x10054357c\ntest    r15, r15                                                       ; +0x60, 0x100543580\njnz     short loc_1005435C2                                            ; +0x63, 0x100543583\njmp     short loc_1005435D0                                            ; +0x65, 0x100543585\nmov     rax, r15                                                       ; +0x67, 0x100543587\nor      rax, 7                                                         ; +0x6a, 0x10054358a\nlea     rcx, [rax+1]                                                   ; +0x6e, 0x10054358e\ncmp     rax, 17h                                                       ; +0x72, 0x100543592\nmov     [rbp+var_48], r14                                              ; +0x76, 0x100543596\nmov     r14d, 1Ah                                                      ; +0x7a, 0x10054359a\ncmovnz  r14, rcx                                                       ; +0x80, 0x1005435a0\nmov     rdi, r14; __sz                                                 ; +0x84, 0x1005435a4\ncall    __Znwm; operator new(ulong)                                    ; +0x87, 0x1005435a7\nmov     r13, rax                                                       ; +0x8c, 0x1005435ac\nmov     [rbp+__p], rax                                                 ; +0x8f, 0x1005435af\ninc     r14                                                            ; +0x93, 0x1005435b3\nmov     [rbp+__dst], r14                                               ; +0x96, 0x1005435b6\nmov     r14, [rbp+var_48]                                              ; +0x9a, 0x1005435ba\nmov     [rbp+var_38], r15                                              ; +0x9e, 0x1005435be\nmov     rdi, r13; __dst                                                ; +0xa2, 0x1005435c2\nmov     rsi, r12; __src                                                ; +0xa5, 0x1005435c5\nmov     rdx, r15; __len                                                ; +0xa8, 0x1005435c8\ncall    _memmove                                                       ; +0xab, 0x1005435cb\nmov     byte ptr [r13+r15+0], 0                                        ; +0xb0, 0x1005435d0\nlea     rdx, [rbp+__dst]                                               ; +0xb6, 0x1005435d6\nmov     rdi, r14                                                       ; +0xba, 0x1005435da\nmov     rsi, rbx                                                       ; +0xbd, 0x1005435dd\ncall    cocos2d__CCDictionary__setObject_1                             ; +0xc0, 0x1005435e0\ntest    byte ptr [rbp+__dst], 1                                        ; +0xc5, 0x1005435e5\njz      short loc_1005435F4                                            ; +0xc9, 0x1005435e9\nmov     rdi, [rbp+__p]; __p                                            ; +0xcb, 0x1005435eb\ncall    __ZdlPv; operator delete(void *)                               ; +0xcf, 0x1005435ef\nadd     rsp, 28h                                                       ; +0xd4, 0x1005435f4\npop     rbx                                                            ; +0xd8, 0x1005435f8\npop     r12                                                            ; +0xd9, 0x1005435f9\npop     r13                                                            ; +0xdb, 0x1005435fb\npop     r14                                                            ; +0xdd, 0x1005435fd\npop     r15                                                            ; +0xdf, 0x1005435ff\npop     rbp                                                            ; +0xe1, 0x100543601\nretn                                                                   ; +0xe2, 0x100543602\ncall    sub_100006BF0                                                  ; +0xe3, 0x100543603", "xrefs": ["GameLevelManager::onGetGauntletsCompleted @ 0x100529c07"], "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"}