{"type": "func", "start": 5370244848, "end": 5370245244, "name": "GJLevelList::addLevelToList", "pseudocode": "// \n// GJLevelList::addLevelToList from 0x140176ef0 to 0x14017707c (396 bytes)\n// \n// 3 xrefs:\n// > LevelInfoLayer::cellPerformedAction @ 0x1402f9a18\n// > LevelListLayer::cloneList @ 0x140308361\n// > <???> @ 0x1406cafa4\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\n// Hidden C++ exception states: #wind=2\nvoid GJLevelList::addLevelToList(GJLevelList *a1, GJGameLevel *a2)\n{\n  std::_Vector_val<std::_Simple_types<int>>::pointer Myfirst; // rax\n  std::_Vector_val<std::_Simple_types<int>>::pointer Mylast; // rdx\n  int v6; // eax\n  std::_Vector_val<std::_Simple_types<int>>::pointer v7; // rdx\n  unsigned int v8; // ebx\n  _BYTE *v9; // rax\n  size_t v10; // r8\n  GJGameLevel *ListSnapshot; // rax\n  void *v12; // rcx\n  int v13; // [rsp+20h] [rbp-268h] BYREF\n  void *Block[2]; // [rsp+28h] [rbp-260h] BYREF\n  __int128 v15; // [rsp+38h] [rbp-250h]\n  _BYTE v16[528]; // [rsp+50h] [rbp-238h] BYREF\n\n  Myfirst = a1->m_levels._Mypair._Myval2._Myfirst;\n  Mylast = a1->m_levels._Mypair._Myval2._Mylast;\n  if ( Myfirst == Mylast )\n  {\nLABEL_4:\n    v6 = a2->m_levelID.random - a2->m_levelID.seed;\n    v13 = v6;\n    v7 = a1->m_levels._Mypair._Myval2._Mylast;\n    if ( v7 == a1->m_levels._Mypair._Myval2._Myend )\n    {\n      sub_140063270((const void **)&a1->m_levels._Mypair._Myval2._Myfirst, v7, &v13);\n    }\n    else\n    {\n      *v7 = v6;\n      ++a1->m_levels._Mypair._Myval2._Mylast;\n    }\n    GJLevelList::updateLevelsString(a1);\n    v8 = a2->m_levelID.random - a2->m_levelID.seed;\n    fmt::BasicWriter<char>::BasicWriter<char>(v16);\n    fmt::BasicWriter<char>::operator<<(v16, v8);\n    v9 = (_BYTE *)fmt::BasicWriter<char>::c_str(v16);\n    *(_OWORD *)Block = 0;\n    v15 = 0;\n    v10 = -1;\n    do\n      ++v10;\n    while ( v9[v10] );\n    sub_14003A930(Block, v9, v10);\n    fmt::BasicWriter<char>::~BasicWriter<char>(v16);\n    ListSnapshot = GJGameLevel::getListSnapshot(a2);\n    cocos2d::CCDictionary::setObject(a1->m_levelsDict, 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          invalid_parameter_noinfo_noreturn();\n      }\n      j_j_free(v12);\n    }\n    a1->m_modified = 1;\n  }\n  else\n  {\n    while ( *Myfirst != a2->m_levelID.random - a2->m_levelID.seed )\n    {\n      if ( ++Myfirst == Mylast )\n        goto LABEL_4;\n    }\n  }\n}", "assembly": "; \n; GJLevelList::addLevelToList from 0x140176ef0 to 0x14017707c (396 bytes)\n; \n; 3 xrefs:\n; > LevelInfoLayer::cellPerformedAction @ 0x1402f9a18\n; > LevelListLayer::cloneList @ 0x140308361\n; > <???> @ 0x1406cafa4\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\nmov     [rsp+arg_10], rbx                                              ; +0x0, 0x140176ef0\npush    rbp                                                            ; +0x5, 0x140176ef5\npush    rsi                                                            ; +0x6, 0x140176ef6\npush    rdi                                                            ; +0x7, 0x140176ef7\nsub     rsp, 270h                                                      ; +0x8, 0x140176ef8\nmov     rax, cs:__security_cookie                                      ; +0xf, 0x140176eff\nxor     rax, rsp                                                       ; +0x16, 0x140176f06\nmov     [rsp+288h+var_28], rax                                         ; +0x19, 0x140176f09\nmov     rbp, rdx                                                       ; +0x21, 0x140176f11\nmov     rsi, rcx                                                       ; +0x24, 0x140176f14\nmov     rax, [rcx+140h]                                                ; +0x27, 0x140176f17\nmov     rdx, [rcx+148h]                                                ; +0x2e, 0x140176f1e\ncmp     rax, rdx                                                       ; +0x35, 0x140176f25\njz      short loc_140176F47                                            ; +0x38, 0x140176f28\nmov     ecx, [rbp+148h]                                                ; +0x3a, 0x140176f2a\nsub     ecx, [rbp+14Ch]                                                ; +0x40, 0x140176f30\ncmp     [rax], ecx                                                     ; +0x46, 0x140176f36\njz      loc_140177059                                                  ; +0x48, 0x140176f38\nadd     rax, 4                                                         ; +0x4e, 0x140176f3e\ncmp     rax, rdx                                                       ; +0x52, 0x140176f42\njnz     short loc_140176F36                                            ; +0x55, 0x140176f45\nmov     eax, [rbp+148h]                                                ; +0x57, 0x140176f47\nsub     eax, [rbp+14Ch]                                                ; +0x5d, 0x140176f4d\nmov     [rsp+288h+var_268], eax                                        ; +0x63, 0x140176f53\nlea     rcx, [rsi+140h]                                                ; +0x67, 0x140176f57\nmov     rdx, [rcx+8]                                                   ; +0x6e, 0x140176f5e\ncmp     rdx, [rcx+10h]                                                 ; +0x72, 0x140176f62\njz      short loc_140176F71                                            ; +0x76, 0x140176f66\nmov     [rdx], eax                                                     ; +0x78, 0x140176f68\nadd     qword ptr [rcx+8], 4                                           ; +0x7a, 0x140176f6a\njmp     short loc_140176F7B                                            ; +0x7f, 0x140176f6f\nlea     r8, [rsp+288h+var_268]                                         ; +0x81, 0x140176f71\ncall    sub_140063270                                                  ; +0x86, 0x140176f76\nmov     rcx, rsi                                                       ; +0x8b, 0x140176f7b\ncall    GJLevelList__updateLevelsString                                ; +0x8e, 0x140176f7e\nmov     ebx, [rbp+148h]                                                ; +0x93, 0x140176f83\nsub     ebx, [rbp+14Ch]                                                ; +0x99, 0x140176f89\nlea     rcx, [rsp+288h+var_238]                                        ; +0x9f, 0x140176f8f\ncall    cs:??0?$BasicWriter@D@fmt@@QEAA@XZ; fmt::BasicWriter<char>::BasicWriter<char>(void) ; +0xa4, 0x140176f94\nnop                                                                    ; +0xaa, 0x140176f9a\nmov     edx, ebx                                                       ; +0xab, 0x140176f9b\nlea     rcx, [rsp+288h+var_238]                                        ; +0xad, 0x140176f9d\ncall    cs:??6?$BasicWriter@D@fmt@@QEAAAEAV01@H@Z; fmt::BasicWriter<char>::operator<<(int) ; +0xb2, 0x140176fa2\nlea     rcx, [rsp+288h+var_238]                                        ; +0xb8, 0x140176fa8\ncall    cs:?c_str@?$BasicWriter@D@fmt@@QEBAPEBDXZ; fmt::BasicWriter<char>::c_str(void) ; +0xbd, 0x140176fad\nxorps   xmm0, xmm0                                                     ; +0xc3, 0x140176fb3\nmovups  xmmword ptr [rsp+288h+Block], xmm0                             ; +0xc6, 0x140176fb6\nxorps   xmm1, xmm1                                                     ; +0xcb, 0x140176fbb\nmovdqu  [rsp+288h+var_250], xmm1                                       ; +0xce, 0x140176fbe\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0xd4, 0x140176fc4\nnop     dword ptr [rax+rax+00h]                                        ; +0xdb, 0x140176fcb\ninc     r8                                                             ; +0xe0, 0x140176fd0\ncmp     byte ptr [rax+r8], 0                                           ; +0xe3, 0x140176fd3\njnz     short loc_140176FD0                                            ; +0xe8, 0x140176fd8\nmov     rdx, rax                                                       ; +0xea, 0x140176fda\nlea     rcx, [rsp+288h+Block]                                          ; +0xed, 0x140176fdd\ncall    sub_14003A930                                                  ; +0xf2, 0x140176fe2\nnop                                                                    ; +0xf7, 0x140176fe7\nlea     rcx, [rsp+288h+var_238]                                        ; +0xf8, 0x140176fe8\ncall    cs:__imp_??1?$BasicWriter@D@fmt@@QEAA@XZ; fmt::BasicWriter<char>::~BasicWriter<char>(void) ; +0xfd, 0x140176fed\nnop                                                                    ; +0x103, 0x140176ff3\nmov     rcx, rbp                                                       ; +0x104, 0x140176ff4\ncall    GJGameLevel__getListSnapshot                                   ; +0x107, 0x140176ff7\nmov     rdx, rax                                                       ; +0x10c, 0x140176ffc\nlea     r8, [rsp+288h+Block]                                           ; +0x10f, 0x140176fff\nmov     rcx, [rsi+238h]                                                ; +0x114, 0x140177004\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 &) ; +0x11b, 0x14017700b\nnop                                                                    ; +0x121, 0x140177011\nmov     rdx, qword ptr [rsp+288h+var_250+8]                            ; +0x122, 0x140177012\ncmp     rdx, 0Fh                                                       ; +0x127, 0x140177017\njbe     short loc_140177052                                            ; +0x12b, 0x14017701b\ninc     rdx                                                            ; +0x12d, 0x14017701d\nmov     rcx, [rsp+288h+Block]; Block                                   ; +0x130, 0x140177020\nmov     rax, rcx                                                       ; +0x135, 0x140177025\ncmp     rdx, 1000h                                                     ; +0x138, 0x140177028\njb      short loc_14017704D                                            ; +0x13f, 0x14017702f\nadd     rdx, 27h ; '''                                                 ; +0x141, 0x140177031\nmov     rcx, [rcx-8]                                                   ; +0x145, 0x140177035\nsub     rax, rcx                                                       ; +0x149, 0x140177039\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x14c, 0x14017703c\ncmp     rax, 1Fh                                                       ; +0x150, 0x140177040\njbe     short loc_14017704D                                            ; +0x154, 0x140177044\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x156, 0x140177046\ndb 0CCh                                                                ; +0x15c, 0x14017704c\ncall    j_j_free                                                       ; +0x15d, 0x14017704d\nmov     byte ptr [rsi+18Fh], 1                                         ; +0x162, 0x140177052\nmov     rcx, [rsp+288h+var_28]                                         ; +0x169, 0x140177059\nxor     rcx, rsp; StackCookie                                          ; +0x171, 0x140177061\ncall    __security_check_cookie                                        ; +0x174, 0x140177064\nmov     rbx, [rsp+288h+arg_10]                                         ; +0x179, 0x140177069\nadd     rsp, 270h                                                      ; +0x181, 0x140177071\npop     rdi                                                            ; +0x188, 0x140177078\npop     rsi                                                            ; +0x189, 0x140177079\npop     rbp                                                            ; +0x18a, 0x14017707a\nretn                                                                   ; +0x18b, 0x14017707b", "xrefs": ["LevelInfoLayer::cellPerformedAction @ 0x1402f9a18", "LevelListLayer::cloneList @ 0x140308361", "<???> @ 0x1406cafa4"], "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"}