{"type": "func", "start": 5373259360, "end": 5373259684, "name": "ControlSlotsPopup::onSave", "pseudocode": "// \n// ControlSlotsPopup::onSave from 0x140456e60 to 0x140456fa4 (324 bytes)\n// \n// 2 xrefs:\n// > ControlSlotsPopup::init @ 0x140456a16\n// > <???> @ 0x140927b48\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:32:29 +0000\n// \n\n// Hidden C++ exception states: #wind=2\n__int64 __fastcall ControlSlotsPopup::onSave(__int64 *a1, __int64 a2)\n{\n  int v3; // ebx\n  __int64 v4; // rcx\n  __int64 v5; // rcx\n  cocos2d::CCString *v6; // rax\n  const char *CString; // rax\n  size_t v8; // r8\n  __int64 v9; // rbx\n  __int64 v10; // rdx\n  __int64 v11; // r8\n  cocos2d::CCNode *v12; // rax\n  __int128 v14; // [rsp+30h] [rbp-48h] BYREF\n  __int64 v15; // [rsp+40h] [rbp-38h]\n  __int64 v16; // [rsp+48h] [rbp-30h]\n  __int128 v17; // [rsp+50h] [rbp-28h] BYREF\n  __int64 v18; // [rsp+60h] [rbp-18h]\n  __int64 v19; // [rsp+68h] [rbp-10h]\n  void *v20; // [rsp+80h] [rbp+8h]\n\n  v3 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2);\n  v4 = a1[125];\n  if ( v4 )\n    TouchControlEditLayer::saveTarget(v4);\n  v5 = qword_14090BFD0;\n  if ( !qword_14090BFD0 )\n  {\n    v20 = operator new(0x6E8u);\n    qword_14090BFD0 = GameManager::GameManager((__int64)v20);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);\n    v5 = qword_14090BFD0;\n  }\n  GameManager::saveDPadLayout(v5, v3, *((_BYTE *)a1 + 1008));\n  v14 = 0;\n  v15 = 0;\n  v16 = 15;\n  LOBYTE(v14) = 0;\n  v6 = cocos2d::CCString::createWithFormat(\"Slot %i saved\", v3);\n  CString = cocos2d::CCString::getCString(v6);\n  v17 = 0;\n  v18 = 0;\n  v19 = 0;\n  v8 = -1;\n  do\n    ++v8;\n  while ( CString[v8] );\n  sub_14003D230(&v17, CString, v8);\n  v9 = *a1;\n  v12 = TextAlertPopup::create((__int64)&v17, v10, v11, 150, (__int64)&v14);\n  return (*(__int64 (__fastcall **)(__int64 *, cocos2d::CCNode *, __int64))(v9 + 456))(a1, v12, 100);\n}", "assembly": "; \n; ControlSlotsPopup::onSave from 0x140456e60 to 0x140456fa4 (324 bytes)\n; \n; 2 xrefs:\n; > ControlSlotsPopup::init @ 0x140456a16\n; > <???> @ 0x140927b48\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:32:29 +0000\n; \nmov     [rsp+arg_10], rbx                                              ; +0x0, 0x140456e60\npush    rdi                                                            ; +0x5, 0x140456e65\nsub     rsp, 70h                                                       ; +0x6, 0x140456e66\nmov     rdi, rcx                                                       ; +0xa, 0x140456e6a\nmov     rax, [rdx]                                                     ; +0xd, 0x140456e6d\nmov     rcx, rdx                                                       ; +0x10, 0x140456e70\ncall    qword ptr [rax+38h]                                            ; +0x13, 0x140456e73\nmov     ebx, eax                                                       ; +0x16, 0x140456e76\nmov     rcx, [rdi+3E8h]                                                ; +0x18, 0x140456e78\ntest    rcx, rcx                                                       ; +0x1f, 0x140456e7f\njz      short loc_140456E89                                            ; +0x22, 0x140456e82\ncall    TouchControlEditLayer__saveTarget                              ; +0x24, 0x140456e84\nmov     rcx, cs:qword_14090BFD0                                        ; +0x29, 0x140456e89\ntest    rcx, rcx                                                       ; +0x30, 0x140456e90\njnz     short loc_140456ECA                                            ; +0x33, 0x140456e93\nmov     ecx, 6E8h; Size                                                ; +0x35, 0x140456e95\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x3a, 0x140456e9a\nmov     [rsp+78h+arg_0], rax                                           ; +0x3f, 0x140456e9f\nmov     rcx, rax                                                       ; +0x47, 0x140456ea7\ncall    GameManager__GameManager                                       ; +0x4a, 0x140456eaa\nnop                                                                    ; +0x4f, 0x140456eaf\nmov     cs:qword_14090BFD0, rax                                        ; +0x50, 0x140456eb0\nmov     rcx, [rax]                                                     ; +0x57, 0x140456eb7\nmov     rdx, [rcx+48h]                                                 ; +0x5a, 0x140456eba\nmov     rcx, rax                                                       ; +0x5e, 0x140456ebe\ncall    rdx                                                            ; +0x61, 0x140456ec1\nmov     rcx, cs:qword_14090BFD0                                        ; +0x63, 0x140456ec3\nmovzx   r8d, byte ptr [rdi+3F0h]                                       ; +0x6a, 0x140456eca\nmov     edx, ebx                                                       ; +0x72, 0x140456ed2\ncall    GameManager__saveDPadLayout                                    ; +0x74, 0x140456ed4\nlea     rax, [rsp+78h+var_48]                                          ; +0x79, 0x140456ed9\nmov     [rsp+78h+arg_0], rax                                           ; +0x7e, 0x140456ede\nxorps   xmm0, xmm0                                                     ; +0x86, 0x140456ee6\nmovups  [rsp+78h+var_48], xmm0                                         ; +0x89, 0x140456ee9\nmov     [rsp+78h+var_38], 0                                            ; +0x8e, 0x140456eee\nmov     [rsp+78h+var_30], 0Fh                                          ; +0x97, 0x140456ef7\nmov     byte ptr [rsp+78h+var_48], 0                                   ; +0xa0, 0x140456f00\nmov     edx, ebx                                                       ; +0xa5, 0x140456f05\nlea     rcx, aSlotISaved; \"Slot %i saved\"                              ; +0xa7, 0x140456f07\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0xae, 0x140456f0e\nmov     rcx, rax                                                       ; +0xb4, 0x140456f14\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0xb7, 0x140456f17\nxorps   xmm0, xmm0                                                     ; +0xbd, 0x140456f1d\nmovups  [rsp+78h+var_28], xmm0                                         ; +0xc0, 0x140456f20\nmov     [rsp+78h+var_18], 0                                            ; +0xc5, 0x140456f25\nmov     [rsp+78h+var_10], 0                                            ; +0xce, 0x140456f2e\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0xd7, 0x140456f37\nxchg    ax, ax                                                         ; +0xde, 0x140456f3e\ninc     r8                                                             ; +0xe0, 0x140456f40\ncmp     byte ptr [rax+r8], 0                                           ; +0xe3, 0x140456f43\njnz     short loc_140456F40                                            ; +0xe8, 0x140456f48\nmov     rdx, rax                                                       ; +0xea, 0x140456f4a\nlea     rcx, [rsp+78h+var_28]                                          ; +0xed, 0x140456f4d\ncall    sub_14003D230                                                  ; +0xf2, 0x140456f52\nmov     rbx, [rdi]                                                     ; +0xf7, 0x140456f57\nlea     rax, [rsp+78h+var_48]                                          ; +0xfa, 0x140456f5a\nmov     [rsp+78h+var_58], rax                                          ; +0xff, 0x140456f5f\nmov     r9d, 96h                                                       ; +0x104, 0x140456f64\nmovss   xmm2, cs:dword_140834F64                                       ; +0x10a, 0x140456f6a\nmovss   xmm1, cs:dword_140834F20                                       ; +0x112, 0x140456f72\nlea     rcx, [rsp+78h+var_28]                                          ; +0x11a, 0x140456f7a\ncall    TextAlertPopup__create                                         ; +0x11f, 0x140456f7f\nmov     rdx, rax                                                       ; +0x124, 0x140456f84\nmov     r8d, 64h ; 'd'                                                 ; +0x127, 0x140456f87\nmov     rcx, rdi                                                       ; +0x12d, 0x140456f8d\ncall    qword ptr [rbx+1C8h]                                           ; +0x130, 0x140456f90\nmov     rbx, [rsp+78h+arg_10]                                          ; +0x136, 0x140456f96\nadd     rsp, 70h                                                       ; +0x13e, 0x140456f9e\npop     rdi                                                            ; +0x142, 0x140456fa2\nretn                                                                   ; +0x143, 0x140456fa3", "xrefs": ["ControlSlotsPopup::init @ 0x140456a16", "<???> @ 0x140927b48"], "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"}