{"type": "func", "start": 5369197872, "end": 5369198305, "name": "GManager::save", "pseudocode": "// \n// GManager::save from 0x140077530 to 0x1400776e1 (433 bytes)\n// \n// 6 xrefs:\n// > AppDelegate::trySaveGame @ 0x140098bb5\n// > AppDelegate::trySaveGame @ 0x140098bda\n// > EndLevelLayer::onMenu @ 0x140206456\n// > LevelEditorLayer::saveLevel @ 0x1403ff53a\n// > <???> @ 0x140911ba0\n// > <???> @ 0x140911bac\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:25:51 +0000\n// \n\n// Hidden C++ exception states: #wind=4\nchar __fastcall GManager::save(_BYTE *a1, char a2)\n{\n  char v4; // al\n  __int64 v6; // rdi\n  DS_Dictionary *v7; // rbx\n  _Thrd_t *v8; // rax\n  unsigned int ThrdAddr[4]; // [rsp+30h] [rbp-78h] BYREF\n  __int128 v10; // [rsp+40h] [rbp-68h]\n  _Thrd_t v11; // [rsp+50h] [rbp-58h] BYREF\n  _BYTE v12[72]; // [rsp+60h] [rbp-48h] BYREF\n  DS_Dictionary *v13; // [rsp+C0h] [rbp+18h]\n\n  if ( !a2 )\n    GManager::waitForSave();\n  v4 = a1[353];\n  a1[353] = 1;\n  if ( v4 )\n    return 0;\n  v6 = sub_14003F4F0((__int64)v12, (__int64)(a1 + 320));\n  v13 = (DS_Dictionary *)operator new(0xF0u);\n  v7 = DS_Dictionary::DS_Dictionary(v13);\n  (*(void (__fastcall **)(_BYTE *, DS_Dictionary *))(*(_QWORD *)a1 + 896LL))(a1, v7);\n  (*(void (__fastcall **)(_BYTE *))(*(_QWORD *)a1 + 904LL))(a1);\n  v11._Hnd = a1;\n  *(_QWORD *)&v11._Id = v7;\n  if ( a2 )\n  {\n    v8 = (_Thrd_t *)operator new(0x30u);\n    *v8 = 0;\n    v8[1]._Hnd = nullptr;\n    *(_QWORD *)&v8[1]._Id = 0;\n    *v8 = *(_Thrd_t *)v6;\n    v8[1] = *(_Thrd_t *)(v6 + 16);\n    *(_QWORD *)(v6 + 16) = 0;\n    *(_QWORD *)(v6 + 24) = 15;\n    *(_BYTE *)v6 = 0;\n    v8[2] = v11;\n    *(_QWORD *)ThrdAddr = beginthreadex(nullptr, 0, StartAddress, v8, 0, &ThrdAddr[2]);\n    if ( *(_QWORD *)ThrdAddr )\n    {\n      if ( ThrdAddr[2] )\n      {\n        v11 = *(_Thrd_t *)ThrdAddr;\n        if ( !Thrd_detach(&v11) )\n          goto LABEL_12;\n      }\n      std::_Throw_Cpp_error(1);\n    }\n    ThrdAddr[2] = 0;\n    std::_Throw_Cpp_error(6);\n  }\n  *(_OWORD *)ThrdAddr = *(_OWORD *)v6;\n  v10 = *(_OWORD *)(v6 + 16);\n  *(_QWORD *)(v6 + 16) = 0;\n  *(_QWORD *)(v6 + 24) = 15;\n  *(_BYTE *)v6 = 0;\n  sub_140077700(&v11, ThrdAddr);\nLABEL_12:\n  sub_14003D310(v6);\n  return 1;\n}", "assembly": "; \n; GManager::save from 0x140077530 to 0x1400776e1 (433 bytes)\n; \n; 6 xrefs:\n; > AppDelegate::trySaveGame @ 0x140098bb5\n; > AppDelegate::trySaveGame @ 0x140098bda\n; > EndLevelLayer::onMenu @ 0x140206456\n; > LevelEditorLayer::saveLevel @ 0x1403ff53a\n; > <???> @ 0x140911ba0\n; > <???> @ 0x140911bac\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:25:51 +0000\n; \npush    rbx                                                            ; +0x0, 0x140077530\npush    rbp                                                            ; +0x2, 0x140077532\npush    rsi                                                            ; +0x3, 0x140077533\npush    rdi                                                            ; +0x4, 0x140077534\npush    r14                                                            ; +0x5, 0x140077535\nsub     rsp, 80h                                                       ; +0x7, 0x140077537\nmovzx   ebp, dl                                                        ; +0xe, 0x14007753e\nmov     rsi, rcx                                                       ; +0x11, 0x140077541\nxor     r14d, r14d                                                     ; +0x14, 0x140077544\ntest    dl, dl                                                         ; +0x17, 0x140077547\njnz     short loc_140077558                                            ; +0x19, 0x140077549\nmovsd   xmm1, cs:qword_140835380                                       ; +0x1b, 0x14007754b\ncall    GManager__waitForSave                                          ; +0x23, 0x140077553\nmov     eax, 1                                                         ; +0x28, 0x140077558\nxchg    al, [rsi+161h]                                                 ; +0x2d, 0x14007755d\ntest    al, al                                                         ; +0x33, 0x140077563\njz      short loc_140077577                                            ; +0x35, 0x140077565\nxor     al, al                                                         ; +0x37, 0x140077567\nadd     rsp, 80h                                                       ; +0x39, 0x140077569\npop     r14                                                            ; +0x40, 0x140077570\npop     rdi                                                            ; +0x42, 0x140077572\npop     rsi                                                            ; +0x43, 0x140077573\npop     rbp                                                            ; +0x44, 0x140077574\npop     rbx                                                            ; +0x45, 0x140077575\nretn                                                                   ; +0x46, 0x140077576\nlea     rdx, [rsi+140h]                                                ; +0x47, 0x140077577\nlea     rcx, [rsp+0A8h+var_48]                                         ; +0x4e, 0x14007757e\ncall    sub_14003F4F0                                                  ; +0x53, 0x140077583\nmov     rdi, rax                                                       ; +0x58, 0x140077588\nmov     [rsp+0A8h+arg_0], rax                                          ; +0x5b, 0x14007758b\nmov     ecx, 0F0h; Size                                                ; +0x63, 0x140077593\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x68, 0x140077598\nmov     [rsp+0A8h+arg_10], rax                                         ; +0x6d, 0x14007759d\nmov     rcx, rax                                                       ; +0x75, 0x1400775a5\ncall    cs:??0DS_Dictionary@@QEAA@XZ; DS_Dictionary::DS_Dictionary(void) ; +0x78, 0x1400775a8\nmov     rbx, rax                                                       ; +0x7e, 0x1400775ae\nmov     rcx, [rsi]                                                     ; +0x81, 0x1400775b1\nmov     r8, [rcx+380h]                                                 ; +0x84, 0x1400775b4\nmov     rdx, rax                                                       ; +0x8b, 0x1400775bb\nmov     rcx, rsi                                                       ; +0x8e, 0x1400775be\ncall    r8                                                             ; +0x91, 0x1400775c1\nmov     rcx, [rsi]                                                     ; +0x94, 0x1400775c4\nmov     rdx, [rcx+388h]                                                ; +0x97, 0x1400775c7\nmov     rcx, rsi                                                       ; +0x9e, 0x1400775ce\ncall    rdx                                                            ; +0xa1, 0x1400775d1\nmov     [rsp+0A8h+var_58._Hnd], rsi                                    ; +0xa3, 0x1400775d3\nmov     qword ptr [rsp+0A8h+var_58._Id], rbx                           ; +0xa8, 0x1400775d8\ntest    bpl, bpl                                                       ; +0xad, 0x1400775dd\njz      loc_140077699                                                  ; +0xb0, 0x1400775e0\nmov     ecx, 30h ; '0'; Size                                           ; +0xb6, 0x1400775e6\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xbb, 0x1400775eb\nxorps   xmm0, xmm0                                                     ; +0xc0, 0x1400775f0\nmovups  xmmword ptr [rax], xmm0                                        ; +0xc3, 0x1400775f3\nmov     [rax+10h], r14                                                 ; +0xc6, 0x1400775f6\nmov     [rax+18h], r14                                                 ; +0xca, 0x1400775fa\nmovups  xmm0, xmmword ptr [rdi]                                        ; +0xce, 0x1400775fe\nmovups  xmmword ptr [rax], xmm0                                        ; +0xd1, 0x140077601\nmovups  xmm1, xmmword ptr [rdi+10h]                                    ; +0xd4, 0x140077604\nmovups  xmmword ptr [rax+10h], xmm1                                    ; +0xd8, 0x140077608\nmov     [rdi+10h], r14                                                 ; +0xdc, 0x14007760c\nmov     qword ptr [rdi+18h], 0Fh                                       ; +0xe0, 0x140077610\nmov     byte ptr [rdi], 0                                              ; +0xe8, 0x140077618\nmovups  xmm0, xmmword ptr [rsp+0A8h+var_58._Hnd]                       ; +0xeb, 0x14007761b\nmovups  xmmword ptr [rax+20h], xmm0                                    ; +0xf0, 0x140077620\nmov     [rsp+0A8h+arg_10], rax                                         ; +0xf4, 0x140077624\nlea     rcx, [rsp+0A8h+var_78+8]                                       ; +0xfc, 0x14007762c\nmov     [rsp+0A8h+ThrdAddr], rcx; ThrdAddr                             ; +0x101, 0x140077631\nmov     [rsp+0A8h+InitFlag], r14d; InitFlag                            ; +0x106, 0x140077636\nmov     r9, rax; ArgList                                               ; +0x10b, 0x14007763b\nlea     r8, StartAddress; StartAddress                                 ; +0x10e, 0x14007763e\nxor     edx, edx; StackSize                                            ; +0x115, 0x140077645\nxor     ecx, ecx; Security                                             ; +0x117, 0x140077647\ncall    cs:_beginthreadex                                              ; +0x119, 0x140077649\nmov     qword ptr [rsp+0A8h+var_78], rax                               ; +0x11f, 0x14007764f\ntest    rax, rax                                                       ; +0x124, 0x140077654\njz      short loc_140077688                                            ; +0x127, 0x140077657\ncmp     [rsp+0A8h+var_78+8], 0                                         ; +0x129, 0x140077659\njz      short loc_14007767C                                            ; +0x12e, 0x14007765e\nmovaps  xmm0, xmmword ptr [rsp+0A8h+var_78]                            ; +0x130, 0x140077660\nmovdqa  xmmword ptr [rsp+0A8h+var_58._Hnd], xmm0                       ; +0x135, 0x140077665\nlea     rcx, [rsp+0A8h+var_58]; _Thrd_t                                ; +0x13b, 0x14007766b\ncall    cs:_Thrd_detach                                                ; +0x140, 0x140077670\ntest    eax, eax                                                       ; +0x146, 0x140077676\njnz     short loc_14007767C                                            ; +0x148, 0x140077678\njmp     short loc_1400776C9                                            ; +0x14a, 0x14007767a\nmov     ecx, 1                                                         ; +0x14c, 0x14007767c\ncall    cs:?_Throw_Cpp_error@std@@YAXH@Z; std::_Throw_Cpp_error(int)   ; +0x151, 0x140077681\nnop                                                                    ; +0x157, 0x140077687\nmov     [rsp+0A8h+var_78+8], r14d                                      ; +0x158, 0x140077688\nmov     ecx, 6                                                         ; +0x15d, 0x14007768d\ncall    cs:?_Throw_Cpp_error@std@@YAXH@Z; std::_Throw_Cpp_error(int)   ; +0x162, 0x140077692\nnop                                                                    ; +0x168, 0x140077698\nmovups  xmm0, xmmword ptr [rdi]                                        ; +0x169, 0x140077699\nmovups  xmmword ptr [rsp+0A8h+var_78], xmm0                            ; +0x16c, 0x14007769c\nmovups  xmm1, xmmword ptr [rdi+10h]                                    ; +0x171, 0x1400776a1\nmovups  [rsp+0A8h+var_68], xmm1                                        ; +0x175, 0x1400776a5\nmov     [rdi+10h], r14                                                 ; +0x17a, 0x1400776aa\nmov     qword ptr [rdi+18h], 0Fh                                       ; +0x17e, 0x1400776ae\nmov     byte ptr [rdi], 0                                              ; +0x186, 0x1400776b6\nlea     rdx, [rsp+0A8h+var_78]                                         ; +0x189, 0x1400776b9\nlea     rcx, [rsp+0A8h+var_58]                                         ; +0x18e, 0x1400776be\ncall    sub_140077700                                                  ; +0x193, 0x1400776c3\nnop                                                                    ; +0x198, 0x1400776c8\nmov     rcx, rdi                                                       ; +0x199, 0x1400776c9\ncall    sub_14003D310                                                  ; +0x19c, 0x1400776cc\nmov     al, 1                                                          ; +0x1a1, 0x1400776d1\nadd     rsp, 80h                                                       ; +0x1a3, 0x1400776d3\npop     r14                                                            ; +0x1aa, 0x1400776da\npop     rdi                                                            ; +0x1ac, 0x1400776dc\npop     rsi                                                            ; +0x1ad, 0x1400776dd\npop     rbp                                                            ; +0x1ae, 0x1400776de\npop     rbx                                                            ; +0x1af, 0x1400776df\nretn                                                                   ; +0x1b0, 0x1400776e0", "xrefs": ["AppDelegate::trySaveGame @ 0x140098bb5", "AppDelegate::trySaveGame @ 0x140098bda", "EndLevelLayer::onMenu @ 0x140206456", "LevelEditorLayer::saveLevel @ 0x1403ff53a", "<???> @ 0x140911ba0", "<???> @ 0x140911bac"], "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"}