{"type": "func", "start": 5371276112, "end": 5371276530, "name": "GJLevelList::addLevelToList", "pseudocode": "// \n// GJLevelList::addLevelToList from 0x140272b50 to 0x140272cf2 (418 bytes)\n// \n// 3 xrefs:\n// > LevelInfoLayer::cellPerformedAction @ 0x14041e888\n// > LevelListLayer::cloneList @ 0x140430231\n// > <???> @ 0x14091cb50\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:28:54 +0000\n// \n\n// Hidden C++ exception states: #wind=2\nvoid __fastcall GJLevelList::addLevelToList(__int64 a1, __int64 a2)\n{\n  _DWORD *v4; // rax\n  _BYTE *v5; // rdx\n  int v6; // eax\n  unsigned int v7; // ebx\n  _BYTE *v8; // rax\n  size_t v9; // r8\n  __int64 v10; // rbx\n  __int64 ListSnapshot; // rax\n  void *v12; // rcx\n  int v13; // [rsp+30h] [rbp-268h] BYREF\n  void *Block[2]; // [rsp+38h] [rbp-260h] BYREF\n  __int128 v15; // [rsp+48h] [rbp-250h]\n  _BYTE v16[528]; // [rsp+60h] [rbp-238h] BYREF\n\n  v4 = *(_DWORD **)(a1 + 320);\n  v5 = *(_BYTE **)(a1 + 328);\n  if ( v4 == (_DWORD *)v5 )\n  {\nLABEL_4:\n    v6 = *(_DWORD *)(a2 + 328) - *(_DWORD *)(a2 + 332);\n    v13 = v6;\n    if ( v5 == *(_BYTE **)(a1 + 336) )\n    {\n      sub_140069B30((const void **)(a1 + 320), v5, &v13);\n    }\n    else\n    {\n      *(_DWORD *)v5 = v6;\n      *(_QWORD *)(a1 + 328) += 4LL;\n    }\n    GJLevelList::updateLevelsString(a1);\n    v7 = *(_DWORD *)(a2 + 328) - *(_DWORD *)(a2 + 332);\n    fmt::BasicWriter<char>::BasicWriter<char>(v16);\n    fmt::BasicWriter<char>::operator<<(v16, v7);\n    v8 = (_BYTE *)fmt::BasicWriter<char>::c_str(v16);\n    *(_OWORD *)Block = 0;\n    v15 = 0;\n    v9 = -1;\n    do\n      ++v9;\n    while ( v8[v9] );\n    sub_14003D230(Block, v8, v9);\n    fmt::BasicWriter<char>::~BasicWriter<char>(v16);\n    v10 = *(_QWORD *)(a1 + 576);\n    ListSnapshot = GJGameLevel::getListSnapshot(a2);\n    cocos2d::CCDictionary::setObject(v10, ListSnapshot, Block);\n    if ( *((_QWORD *)&v15 + 1) > 0xFu )\n    {\n      v12 = Block[0];\n      if ( (unsigned __int64)(*((_QWORD *)&v15 + 1) + 1LL) >= 0x1000 )\n      {\n        v12 = *((void **)Block[0] - 1);\n        if ( (unsigned __int64)((char *)Block[0] - (char *)v12 - 8) > 0x1F )\n          invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n      }\n      j_j_free(v12);\n    }\n    *(_BYTE *)(a1 + 399) = 1;\n  }\n  else\n  {\n    while ( *v4 != *(_DWORD *)(a2 + 328) - *(_DWORD *)(a2 + 332) )\n    {\n      if ( ++v4 == (_DWORD *)v5 )\n        goto LABEL_4;\n    }\n  }\n}", "assembly": "; \n; GJLevelList::addLevelToList from 0x140272b50 to 0x140272cf2 (418 bytes)\n; \n; 3 xrefs:\n; > LevelInfoLayer::cellPerformedAction @ 0x14041e888\n; > LevelListLayer::cloneList @ 0x140430231\n; > <???> @ 0x14091cb50\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:28:54 +0000\n; \nmov     [rsp+arg_10], rbx                                              ; +0x0, 0x140272b50\npush    rbp                                                            ; +0x5, 0x140272b55\npush    rsi                                                            ; +0x6, 0x140272b56\npush    rdi                                                            ; +0x7, 0x140272b57\nsub     rsp, 280h                                                      ; +0x8, 0x140272b58\nmov     rax, cs:__security_cookie                                      ; +0xf, 0x140272b5f\nxor     rax, rsp                                                       ; +0x16, 0x140272b66\nmov     [rsp+298h+var_28], rax                                         ; +0x19, 0x140272b69\nmov     rbp, rdx                                                       ; +0x21, 0x140272b71\nmov     rsi, rcx                                                       ; +0x24, 0x140272b74\nmov     rax, [rcx+140h]                                                ; +0x27, 0x140272b77\nmov     rdx, [rcx+148h]                                                ; +0x2e, 0x140272b7e\ncmp     rax, rdx                                                       ; +0x35, 0x140272b85\njz      short loc_140272BA7                                            ; +0x38, 0x140272b88\nmov     ecx, [rbp+148h]                                                ; +0x3a, 0x140272b8a\nsub     ecx, [rbp+14Ch]                                                ; +0x40, 0x140272b90\ncmp     [rax], ecx                                                     ; +0x46, 0x140272b96\njz      loc_140272CCF                                                  ; +0x48, 0x140272b98\nadd     rax, 4                                                         ; +0x4e, 0x140272b9e\ncmp     rax, rdx                                                       ; +0x52, 0x140272ba2\njnz     short loc_140272B96                                            ; +0x55, 0x140272ba5\nmov     eax, [rbp+148h]                                                ; +0x57, 0x140272ba7\nsub     eax, [rbp+14Ch]                                                ; +0x5d, 0x140272bad\nmov     [rsp+298h+var_268], eax                                        ; +0x63, 0x140272bb3\nlea     rcx, [rsi+140h]                                                ; +0x67, 0x140272bb7\ncmp     rdx, [rcx+10h]                                                 ; +0x6e, 0x140272bbe\njz      short loc_140272BCD                                            ; +0x72, 0x140272bc2\nmov     [rdx], eax                                                     ; +0x74, 0x140272bc4\nadd     qword ptr [rcx+8], 4                                           ; +0x76, 0x140272bc6\njmp     short loc_140272BD7                                            ; +0x7b, 0x140272bcb\nlea     r8, [rsp+298h+var_268]                                         ; +0x7d, 0x140272bcd\ncall    sub_140069B30                                                  ; +0x82, 0x140272bd2\nmov     rcx, rsi                                                       ; +0x87, 0x140272bd7\ncall    GJLevelList__updateLevelsString                                ; +0x8a, 0x140272bda\nmov     ebx, [rbp+148h]                                                ; +0x8f, 0x140272bdf\nsub     ebx, [rbp+14Ch]                                                ; +0x95, 0x140272be5\nlea     rcx, [rsp+298h+var_238]                                        ; +0x9b, 0x140272beb\ncall    cs:??0?$BasicWriter@D@fmt@@QEAA@XZ; fmt::BasicWriter<char>::BasicWriter<char>(void) ; +0xa0, 0x140272bf0\nnop                                                                    ; +0xa6, 0x140272bf6\nmov     edx, ebx                                                       ; +0xa7, 0x140272bf7\nlea     rcx, [rsp+298h+var_238]                                        ; +0xa9, 0x140272bf9\ncall    cs:??6?$BasicWriter@D@fmt@@QEAAAEAV01@H@Z; fmt::BasicWriter<char>::operator<<(int) ; +0xae, 0x140272bfe\nlea     rcx, [rsp+298h+var_238]                                        ; +0xb4, 0x140272c04\ncall    cs:?c_str@?$BasicWriter@D@fmt@@QEBAPEBDXZ; fmt::BasicWriter<char>::c_str(void) ; +0xb9, 0x140272c09\nxorps   xmm0, xmm0                                                     ; +0xbf, 0x140272c0f\nmovups  xmmword ptr [rsp+298h+Block], xmm0                             ; +0xc2, 0x140272c12\nxorps   xmm1, xmm1                                                     ; +0xc7, 0x140272c17\nmovdqu  [rsp+298h+var_250], xmm1                                       ; +0xca, 0x140272c1a\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0xd0, 0x140272c20\nnop     word ptr [rax+rax+00000000h]                                   ; +0xd7, 0x140272c27\ninc     r8                                                             ; +0xe0, 0x140272c30\ncmp     byte ptr [rax+r8], 0                                           ; +0xe3, 0x140272c33\njnz     short loc_140272C30                                            ; +0xe8, 0x140272c38\nmov     rdx, rax                                                       ; +0xea, 0x140272c3a\nlea     rcx, [rsp+298h+Block]                                          ; +0xed, 0x140272c3d\ncall    sub_14003D230                                                  ; +0xf2, 0x140272c42\nnop                                                                    ; +0xf7, 0x140272c47\nlea     rcx, [rsp+298h+var_238]                                        ; +0xf8, 0x140272c48\ncall    cs:__imp_??1?$BasicWriter@D@fmt@@QEAA@XZ; fmt::BasicWriter<char>::~BasicWriter<char>(void) ; +0xfd, 0x140272c4d\nnop                                                                    ; +0x103, 0x140272c53\nmov     rbx, [rsi+240h]                                                ; +0x104, 0x140272c54\nmov     rcx, rbp                                                       ; +0x10b, 0x140272c5b\ncall    GJGameLevel__getListSnapshot                                   ; +0x10e, 0x140272c5e\nmov     rdx, rax                                                       ; +0x113, 0x140272c63\nlea     r8, [rsp+298h+Block]                                           ; +0x116, 0x140272c66\nmov     rcx, rbx                                                       ; +0x11b, 0x140272c6b\ncall    cs:?setObject@CCDictionary@cocos2d@@QEAAXPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::setObject(cocos2d::CCObject *,std::string const &) ; +0x11e, 0x140272c6e\nnop                                                                    ; +0x124, 0x140272c74\nmov     rdx, qword ptr [rsp+298h+var_250+8]                            ; +0x125, 0x140272c75\ncmp     rdx, 0Fh                                                       ; +0x12a, 0x140272c7a\njbe     short loc_140272CC8                                            ; +0x12e, 0x140272c7e\ninc     rdx                                                            ; +0x130, 0x140272c80\nmov     rcx, [rsp+298h+Block]; Block                                   ; +0x133, 0x140272c83\nmov     rax, rcx                                                       ; +0x138, 0x140272c88\ncmp     rdx, 1000h                                                     ; +0x13b, 0x140272c8b\njb      short loc_140272CC3                                            ; +0x142, 0x140272c92\nadd     rdx, 27h ; '''                                                 ; +0x144, 0x140272c94\nmov     rcx, [rcx-8]                                                   ; +0x148, 0x140272c98\nsub     rax, rcx                                                       ; +0x14c, 0x140272c9c\nsub     rax, 8                                                         ; +0x14f, 0x140272c9f\ncmp     rax, 1Fh                                                       ; +0x153, 0x140272ca3\njbe     short loc_140272CC3                                            ; +0x157, 0x140272ca7\nmov     [rsp+298h+Reserved], 0; Reserved                               ; +0x159, 0x140272ca9\nxor     r9d, r9d; LineNo                                               ; +0x162, 0x140272cb2\nxor     r8d, r8d; FileName                                             ; +0x165, 0x140272cb5\nxor     edx, edx; FunctionName                                         ; +0x168, 0x140272cb8\nxor     ecx, ecx; Expression                                           ; +0x16a, 0x140272cba\ncall    cs:_invoke_watson                                              ; +0x16c, 0x140272cbc\ndb 0CCh                                                                ; +0x172, 0x140272cc2\ncall    j_j_free                                                       ; +0x173, 0x140272cc3\nmov     byte ptr [rsi+18Fh], 1                                         ; +0x178, 0x140272cc8\nmov     rcx, [rsp+298h+var_28]                                         ; +0x17f, 0x140272ccf\nxor     rcx, rsp; StackCookie                                          ; +0x187, 0x140272cd7\ncall    __security_check_cookie                                        ; +0x18a, 0x140272cda\nmov     rbx, [rsp+298h+arg_10]                                         ; +0x18f, 0x140272cdf\nadd     rsp, 280h                                                      ; +0x197, 0x140272ce7\npop     rdi                                                            ; +0x19e, 0x140272cee\npop     rsi                                                            ; +0x19f, 0x140272cef\npop     rbp                                                            ; +0x1a0, 0x140272cf0\nretn                                                                   ; +0x1a1, 0x140272cf1", "xrefs": ["LevelInfoLayer::cellPerformedAction @ 0x14041e888", "LevelListLayer::cloneList @ 0x140430231", "<???> @ 0x14091cb50"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}