{"type": "func", "start": 5372940000, "end": 5372940745, "name": "LevelEditorLayer::prepareSaveData", "pseudocode": "// \n// LevelEditorLayer::prepareSaveData from 0x140408ee0 to 0x1404091c9 (745 bytes)\n// \n// 3 xrefs:\n// > LevelEditorLayer::doAutoSave @ 0x1404092e2\n// > LevelEditorLayer::doAutoBackup @ 0x14040979b\n// > <???> @ 0x140925c34\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:31:59 +0000\n// \n\n// Hidden C++ exception states: #wind=5\n__int64 __fastcall LevelEditorLayer::prepareSaveData(__int64 a1, __int64 a2, _QWORD *a3)\n{\n  _QWORD *v3; // rdi\n  __int64 v6; // rbx\n  __int64 v7; // rax\n  __int64 v8; // rdi\n  void *v9; // rdx\n  __int128 v10; // xmm6\n  __int128 v11; // xmm7\n  __int128 v12; // xmm8\n  __int128 v13; // xmm9\n  __int128 v14; // xmm10\n  __int128 v15; // xmm11\n  __int64 v16; // xmm12_8\n  DS_Dictionary *v17; // rdi\n  __int64 v18; // rax\n  __int64 v19; // rdi\n  void *v20; // rdx\n  DS_Dictionary *v22; // [rsp+38h] [rbp-110h]\n  _BYTE v23[32]; // [rsp+48h] [rbp-100h] BYREF\n  _BYTE v24[32]; // [rsp+68h] [rbp-E0h] BYREF\n  _BYTE v25[32]; // [rsp+88h] [rbp-C0h] BYREF\n\n  v3 = a3;\n  v6 = *(_QWORD *)(a1 + 2168);\n  cocos2d::ZipUtils::compressString(v25, a3, 0, 0xFFFFFFFFLL, 11);\n  v3[2] = 0;\n  if ( v3[3] > 0xFu )\n    v3 = (_QWORD *)*v3;\n  *(_BYTE *)v3 = 0;\n  sub_14003F4F0((__int64)v24, v6 + 408);\n  v7 = sub_14003F4F0((__int64)v23, (__int64)v25);\n  v8 = v7;\n  if ( v6 + 408 != v7 )\n  {\n    v9 = (void *)v7;\n    if ( *(_QWORD *)(v7 + 24) > 0xFu )\n      v9 = *(void **)v7;\n    sub_1400405A0((void **)(v6 + 408), v9, *(_QWORD *)(v7 + 16));\n  }\n  sub_14003D310(v8);\n  LevelEditorLayer::updateLevelSaveInfo(a1);\n  *(_DWORD *)(v6 + 724) += (int)*(double *)(a1 + 15392);\n  v10 = *(_OWORD *)(v6 + 736);\n  v11 = *(_OWORD *)(v6 + 752);\n  v12 = *(_OWORD *)(v6 + 768);\n  v13 = *(_OWORD *)(v6 + 784);\n  v14 = *(_OWORD *)(v6 + 800);\n  v15 = *(_OWORD *)(v6 + 816);\n  v16 = *(_QWORD *)(v6 + 832);\n  *(_OWORD *)(v6 + 736) = *(_OWORD *)(a1 + 15408);\n  *(_OWORD *)(v6 + 752) = *(_OWORD *)(a1 + 15424);\n  *(_OWORD *)(v6 + 768) = *(_OWORD *)(a1 + 15440);\n  *(_OWORD *)(v6 + 784) = *(_OWORD *)(a1 + 15456);\n  *(_OWORD *)(v6 + 800) = *(_OWORD *)(a1 + 15472);\n  *(_OWORD *)(v6 + 816) = *(_OWORD *)(a1 + 15488);\n  *(_QWORD *)(v6 + 832) = *(_QWORD *)(a1 + 15504);\n  v22 = (DS_Dictionary *)operator new(0xF0u);\n  v17 = DS_Dictionary::DS_Dictionary(v22);\n  (*(void (__fastcall **)(__int64, DS_Dictionary *))(*(_QWORD *)v6 + 40LL))(v6, v17);\n  DS_Dictionary::saveRootSubDictToString(v17, a2);\n  if ( v17 )\n  {\n    DS_Dictionary::~DS_Dictionary(v17);\n    j_j_free(v17);\n  }\n  v18 = sub_14003F4F0((__int64)v23, (__int64)v24);\n  v19 = v18;\n  if ( v6 + 408 != v18 )\n  {\n    v20 = (void *)v18;\n    if ( *(_QWORD *)(v18 + 24) > 0xFu )\n      v20 = *(void **)v18;\n    sub_1400405A0((void **)(v6 + 408), v20, *(_QWORD *)(v18 + 16));\n  }\n  sub_14003D310(v19);\n  *(_DWORD *)(v6 + 724) -= (int)*(double *)(a1 + 15392);\n  *(_OWORD *)(v6 + 736) = v10;\n  *(_OWORD *)(v6 + 752) = v11;\n  *(_OWORD *)(v6 + 768) = v12;\n  *(_OWORD *)(v6 + 784) = v13;\n  *(_OWORD *)(v6 + 800) = v14;\n  *(_OWORD *)(v6 + 816) = v15;\n  *(_QWORD *)(v6 + 832) = v16;\n  sub_14003D310((__int64)v24);\n  sub_14003D310((__int64)v25);\n  return a2;\n}", "assembly": "; \n; LevelEditorLayer::prepareSaveData from 0x140408ee0 to 0x1404091c9 (745 bytes)\n; \n; 3 xrefs:\n; > LevelEditorLayer::doAutoSave @ 0x1404092e2\n; > LevelEditorLayer::doAutoBackup @ 0x14040979b\n; > <???> @ 0x140925c34\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:31:59 +0000\n; \nmov     rax, rsp                                                       ; +0x0, 0x140408ee0\npush    rbx                                                            ; +0x3, 0x140408ee3\npush    rbp                                                            ; +0x4, 0x140408ee4\npush    rsi                                                            ; +0x5, 0x140408ee5\npush    rdi                                                            ; +0x6, 0x140408ee6\npush    r14                                                            ; +0x7, 0x140408ee7\nsub     rsp, 120h                                                      ; +0x9, 0x140408ee9\nmovaps  xmmword ptr [rax-38h], xmm6                                    ; +0x10, 0x140408ef0\nmovaps  xmmword ptr [rax-48h], xmm7                                    ; +0x14, 0x140408ef4\nmovaps  xmmword ptr [rax-58h], xmm8                                    ; +0x18, 0x140408ef8\nmovaps  xmmword ptr [rax-68h], xmm9                                    ; +0x1d, 0x140408efd\nmovaps  xmmword ptr [rax-78h], xmm10                                   ; +0x22, 0x140408f02\nmovaps  xmmword ptr [rax-88h], xmm11                                   ; +0x27, 0x140408f07\nmovaps  xmmword ptr [rax-98h], xmm12                                   ; +0x2f, 0x140408f0f\nmov     rax, cs:__security_cookie                                      ; +0x37, 0x140408f17\nxor     rax, rsp                                                       ; +0x3e, 0x140408f1e\nmov     [rsp+148h+var_A0], rax                                         ; +0x41, 0x140408f21\nmov     rdi, r8                                                        ; +0x49, 0x140408f29\nmov     rbp, rdx                                                       ; +0x4c, 0x140408f2c\nmov     r14, rcx                                                       ; +0x4f, 0x140408f2f\nmov     [rsp+148h+var_108], rdx                                        ; +0x52, 0x140408f32\nxor     esi, esi                                                       ; +0x57, 0x140408f37\nmov     [rsp+148h+var_118], esi                                        ; +0x59, 0x140408f39\nmov     rbx, [rcx+878h]                                                ; +0x5d, 0x140408f3d\nmov     [rsp+148h+var_128], 0Bh                                        ; +0x64, 0x140408f44\nmov     r9d, 0FFFFFFFFh                                                ; +0x6c, 0x140408f4c\nxor     r8d, r8d                                                       ; +0x72, 0x140408f52\nmov     rdx, rdi                                                       ; +0x75, 0x140408f55\nlea     rcx, [rsp+148h+var_C0]                                         ; +0x78, 0x140408f58\ncall    cs:?compressString@ZipUtils@cocos2d@@SA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV34@_NHH@Z; cocos2d::ZipUtils::compressString(std::string const &,bool,int,int) ; +0x80, 0x140408f60\nnop                                                                    ; +0x86, 0x140408f66\nmov     [rdi+10h], rsi                                                 ; +0x87, 0x140408f67\ncmp     qword ptr [rdi+18h], 0Fh                                       ; +0x8b, 0x140408f6b\njbe     short loc_140408F75                                            ; +0x90, 0x140408f70\nmov     rdi, [rdi]                                                     ; +0x92, 0x140408f72\nmov     byte ptr [rdi], 0                                              ; +0x95, 0x140408f75\nlea     rsi, [rbx+198h]                                                ; +0x98, 0x140408f78\nmov     rdx, rsi                                                       ; +0x9f, 0x140408f7f\nlea     rcx, [rsp+148h+var_E0]                                         ; +0xa2, 0x140408f82\ncall    sub_14003F4F0                                                  ; +0xa7, 0x140408f87\nmov     [rsp+148h+var_118], 2                                          ; +0xac, 0x140408f8c\nlea     rdx, [rsp+148h+var_C0]                                         ; +0xb4, 0x140408f94\nlea     rcx, [rsp+148h+var_100]                                        ; +0xbc, 0x140408f9c\ncall    sub_14003F4F0                                                  ; +0xc1, 0x140408fa1\nmov     rdi, rax                                                       ; +0xc6, 0x140408fa6\nmov     [rsp+148h+var_110], rax                                        ; +0xc9, 0x140408fa9\ncmp     rsi, rax                                                       ; +0xce, 0x140408fae\njz      short loc_140408FCD                                            ; +0xd1, 0x140408fb1\nmov     rdx, rax                                                       ; +0xd3, 0x140408fb3\ncmp     qword ptr [rax+18h], 0Fh                                       ; +0xd6, 0x140408fb6\njbe     short loc_140408FC0                                            ; +0xdb, 0x140408fbb\nmov     rdx, [rax]; Src                                                ; +0xdd, 0x140408fbd\nmov     r8, [rax+10h]; Size                                            ; +0xe0, 0x140408fc0\nmov     rcx, rsi; void *                                               ; +0xe4, 0x140408fc4\ncall    sub_1400405A0                                                  ; +0xe7, 0x140408fc7\nnop                                                                    ; +0xec, 0x140408fcc\nmov     rcx, rdi                                                       ; +0xed, 0x140408fcd\ncall    sub_14003D310                                                  ; +0xf0, 0x140408fd0\nmov     rcx, r14                                                       ; +0xf5, 0x140408fd5\ncall    LevelEditorLayer__updateLevelSaveInfo                          ; +0xf8, 0x140408fd8\ncvttsd2si eax, qword ptr [r14+3C20h]                                   ; +0xfd, 0x140408fdd\nadd     [rbx+2D4h], eax                                                ; +0x106, 0x140408fe6\nmovups  xmm6, xmmword ptr [rbx+2E0h]                                   ; +0x10c, 0x140408fec\nmovups  xmm7, xmmword ptr [rbx+2F0h]                                   ; +0x113, 0x140408ff3\nmovups  xmm8, xmmword ptr [rbx+300h]                                   ; +0x11a, 0x140408ffa\nmovups  xmm9, xmmword ptr [rbx+310h]                                   ; +0x122, 0x140409002\nmovups  xmm10, xmmword ptr [rbx+320h]                                  ; +0x12a, 0x14040900a\nmovups  xmm11, xmmword ptr [rbx+330h]                                  ; +0x132, 0x140409012\nmovsd   xmm12, qword ptr [rbx+340h]                                    ; +0x13a, 0x14040901a\nmovups  xmm0, xmmword ptr [r14+3C30h]                                  ; +0x143, 0x140409023\nmovups  xmmword ptr [rbx+2E0h], xmm0                                   ; +0x14b, 0x14040902b\nmovups  xmm1, xmmword ptr [r14+3C40h]                                  ; +0x152, 0x140409032\nmovups  xmmword ptr [rbx+2F0h], xmm1                                   ; +0x15a, 0x14040903a\nmovups  xmm0, xmmword ptr [r14+3C50h]                                  ; +0x161, 0x140409041\nmovups  xmmword ptr [rbx+300h], xmm0                                   ; +0x169, 0x140409049\nmovups  xmm1, xmmword ptr [r14+3C60h]                                  ; +0x170, 0x140409050\nmovups  xmmword ptr [rbx+310h], xmm1                                   ; +0x178, 0x140409058\nmovups  xmm0, xmmword ptr [r14+3C70h]                                  ; +0x17f, 0x14040905f\nmovups  xmmword ptr [rbx+320h], xmm0                                   ; +0x187, 0x140409067\nmovups  xmm1, xmmword ptr [r14+3C80h]                                  ; +0x18e, 0x14040906e\nmovups  xmmword ptr [rbx+330h], xmm1                                   ; +0x196, 0x140409076\nmovsd   xmm0, qword ptr [r14+3C90h]                                    ; +0x19d, 0x14040907d\nmovsd   qword ptr [rbx+340h], xmm0                                     ; +0x1a6, 0x140409086\nmov     ecx, 0F0h; Size                                                ; +0x1ae, 0x14040908e\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x1b3, 0x140409093\nmov     [rsp+148h+var_110], rax                                        ; +0x1b8, 0x140409098\nmov     rcx, rax                                                       ; +0x1bd, 0x14040909d\ncall    cs:??0DS_Dictionary@@QEAA@XZ; DS_Dictionary::DS_Dictionary(void) ; +0x1c0, 0x1404090a0\nmov     rdi, rax                                                       ; +0x1c6, 0x1404090a6\nmov     rax, [rbx]                                                     ; +0x1c9, 0x1404090a9\nmov     rdx, rdi                                                       ; +0x1cc, 0x1404090ac\nmov     rcx, rbx                                                       ; +0x1cf, 0x1404090af\ncall    qword ptr [rax+28h]                                            ; +0x1d2, 0x1404090b2\nmov     rdx, rbp                                                       ; +0x1d5, 0x1404090b5\nmov     rcx, rdi                                                       ; +0x1d8, 0x1404090b8\ncall    cs:?saveRootSubDictToString@DS_Dictionary@@QEAA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ; DS_Dictionary::saveRootSubDictToString(void) ; +0x1db, 0x1404090bb\ntest    rdi, rdi                                                       ; +0x1e1, 0x1404090c1\njz      short loc_1404090DC                                            ; +0x1e4, 0x1404090c4\nmov     rcx, rdi                                                       ; +0x1e6, 0x1404090c6\ncall    cs:??1DS_Dictionary@@QEAA@XZ; DS_Dictionary::~DS_Dictionary(void) ; +0x1e9, 0x1404090c9\nmov     edx, 0F0h                                                      ; +0x1ef, 0x1404090cf\nmov     rcx, rdi; Block                                                ; +0x1f4, 0x1404090d4\ncall    j_j_free                                                       ; +0x1f7, 0x1404090d7\nmov     [rsp+148h+var_118], 7                                          ; +0x1fc, 0x1404090dc\nlea     rdx, [rsp+148h+var_E0]                                         ; +0x204, 0x1404090e4\nlea     rcx, [rsp+148h+var_100]                                        ; +0x209, 0x1404090e9\ncall    sub_14003F4F0                                                  ; +0x20e, 0x1404090ee\nmov     rdi, rax                                                       ; +0x213, 0x1404090f3\nmov     [rsp+148h+var_110], rax                                        ; +0x216, 0x1404090f6\ncmp     rsi, rax                                                       ; +0x21b, 0x1404090fb\njz      short loc_14040911A                                            ; +0x21e, 0x1404090fe\nmov     rdx, rax                                                       ; +0x220, 0x140409100\ncmp     qword ptr [rax+18h], 0Fh                                       ; +0x223, 0x140409103\njbe     short loc_14040910D                                            ; +0x228, 0x140409108\nmov     rdx, [rax]; Src                                                ; +0x22a, 0x14040910a\nmov     r8, [rax+10h]; Size                                            ; +0x22d, 0x14040910d\nmov     rcx, rsi; void *                                               ; +0x231, 0x140409111\ncall    sub_1400405A0                                                  ; +0x234, 0x140409114\nnop                                                                    ; +0x239, 0x140409119\nmov     rcx, rdi                                                       ; +0x23a, 0x14040911a\ncall    sub_14003D310                                                  ; +0x23d, 0x14040911d\ncvttsd2si eax, qword ptr [r14+3C20h]                                   ; +0x242, 0x140409122\nsub     [rbx+2D4h], eax                                                ; +0x24b, 0x14040912b\nmovups  xmmword ptr [rbx+2E0h], xmm6                                   ; +0x251, 0x140409131\nmovups  xmmword ptr [rbx+2F0h], xmm7                                   ; +0x258, 0x140409138\nmovups  xmmword ptr [rbx+300h], xmm8                                   ; +0x25f, 0x14040913f\nmovups  xmmword ptr [rbx+310h], xmm9                                   ; +0x267, 0x140409147\nmovups  xmmword ptr [rbx+320h], xmm10                                  ; +0x26f, 0x14040914f\nmovups  xmmword ptr [rbx+330h], xmm11                                  ; +0x277, 0x140409157\nmovsd   qword ptr [rbx+340h], xmm12                                    ; +0x27f, 0x14040915f\nlea     rcx, [rsp+148h+var_E0]                                         ; +0x288, 0x140409168\ncall    sub_14003D310                                                  ; +0x28d, 0x14040916d\nnop                                                                    ; +0x292, 0x140409172\nlea     rcx, [rsp+148h+var_C0]                                         ; +0x293, 0x140409173\ncall    sub_14003D310                                                  ; +0x29b, 0x14040917b\nmov     rax, rbp                                                       ; +0x2a0, 0x140409180\nmov     rcx, [rsp+148h+var_A0]                                         ; +0x2a3, 0x140409183\nxor     rcx, rsp; StackCookie                                          ; +0x2ab, 0x14040918b\ncall    __security_check_cookie                                        ; +0x2ae, 0x14040918e\nlea     r11, [rsp+148h+var_28]                                         ; +0x2b3, 0x140409193\nmovaps  xmm6, xmmword ptr [r11-10h]                                    ; +0x2bb, 0x14040919b\nmovaps  xmm7, xmmword ptr [r11-20h]                                    ; +0x2c0, 0x1404091a0\nmovaps  xmm8, xmmword ptr [r11-30h]                                    ; +0x2c5, 0x1404091a5\nmovaps  xmm9, xmmword ptr [r11-40h]                                    ; +0x2ca, 0x1404091aa\nmovaps  xmm10, xmmword ptr [r11-50h]                                   ; +0x2cf, 0x1404091af\nmovaps  xmm11, xmmword ptr [r11-60h]                                   ; +0x2d4, 0x1404091b4\nmovaps  xmm12, xmmword ptr [r11-70h]                                   ; +0x2d9, 0x1404091b9\nmov     rsp, r11                                                       ; +0x2de, 0x1404091be\npop     r14                                                            ; +0x2e1, 0x1404091c1\npop     rdi                                                            ; +0x2e3, 0x1404091c3\npop     rsi                                                            ; +0x2e4, 0x1404091c4\npop     rbp                                                            ; +0x2e5, 0x1404091c5\npop     rbx                                                            ; +0x2e6, 0x1404091c6\nretn                                                                   ; +0x2e7, 0x1404091c7\ndb 0CCh                                                                ; +0x2e8, 0x1404091c8", "xrefs": ["LevelEditorLayer::doAutoSave @ 0x1404092e2", "LevelEditorLayer::doAutoBackup @ 0x14040979b", "<???> @ 0x140925c34"], "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"}