{"type": "func", "start": 5371218704, "end": 5371219162, "name": "GJGameLevel::saveNewScore", "pseudocode": "// \n// GJGameLevel::saveNewScore from 0x140264b10 to 0x140264cda (458 bytes)\n// \n// 6 xrefs:\n// > GJGameLevel::handleStatsConflict @ 0x14026a851\n// > GJGameLevel::handleStatsConflict @ 0x14026a8ac\n// > PlayLayer::levelComplete @ 0x140506a63\n// > PlayLayer::levelComplete @ 0x140506af4\n// > PlayLayer::levelComplete @ 0x140506b6c\n// > <???> @ 0x14091c8b0\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:49 +0000\n// \n\n// Hidden C++ exception states: #wind=1\n__int64 __fastcall GJGameLevel::saveNewScore(\n        __int64 a1,\n        int a2,\n        unsigned int a3,\n        int a4,\n        int a5,\n        int a6,\n        _QWORD *a7,\n        char a8)\n{\n  unsigned __int8 v11; // bp\n  int v12; // eax\n  _QWORD *v13; // rdx\n  int v14; // eax\n  _QWORD *v15; // rdx\n\n  v11 = 0;\n  if ( a3 )\n  {\n    if ( a2 )\n    {\n      v14 = *(_DWORD *)(a1 + 1464);\n      if ( a2 > v14 || !v14 || a8 )\n      {\n        *(_DWORD *)(a1 + 1464) = a2;\n        *(_DWORD *)(a1 + 1468) = a4;\n        *(_DWORD *)(a1 + 1472) = a5;\n        *(_DWORD *)(a1 + 1476) = a6;\n        *(_DWORD *)(a1 + 1512) = sub_1402649C0(\n                                   *(_DWORD *)(a1 + 1416),\n                                   a2,\n                                   *(_DWORD *)(a1 + 1424),\n                                   *(_DWORD *)(a1 + 1420),\n                                   *(_DWORD *)(a1 + 1428),\n                                   a5,\n                                   a4,\n                                   a6);\n        if ( (_QWORD *)(a1 + 1480) != a7 )\n        {\n          v15 = a7;\n          if ( a7[3] > 0xFu )\n            v15 = (_QWORD *)*a7;\n          sub_1400405A0((void **)(a1 + 1480), v15, a7[2]);\n        }\n        *(_BYTE *)(a1 + 1585) = 1;\n        goto LABEL_20;\n      }\n    }\n  }\n  else if ( a2 > 0 )\n  {\n    v12 = *(_DWORD *)(a1 + 1416);\n    if ( a2 < v12 || !v12 || a8 )\n    {\n      *(_DWORD *)(a1 + 1416) = a2;\n      *(_DWORD *)(a1 + 1420) = a4;\n      *(_DWORD *)(a1 + 1424) = a5;\n      *(_DWORD *)(a1 + 1428) = a6;\n      *(_DWORD *)(a1 + 1512) = sub_1402649C0(\n                                 a2,\n                                 *(_DWORD *)(a1 + 1464),\n                                 a5,\n                                 a4,\n                                 a6,\n                                 *(_DWORD *)(a1 + 1472),\n                                 *(_DWORD *)(a1 + 1468),\n                                 *(_DWORD *)(a1 + 1476));\n      if ( (_QWORD *)(a1 + 1432) != a7 )\n      {\n        v13 = a7;\n        if ( a7[3] > 0xFu )\n          v13 = (_QWORD *)*a7;\n        sub_1400405A0((void **)(a1 + 1432), v13, a7[2]);\n      }\n      *(_BYTE *)(a1 + 1584) = 1;\nLABEL_20:\n      v11 = 1;\n    }\n  }\n  GJGameLevel::storeNewLocalScore(a1, (unsigned int)a2, a3);\n  sub_14003D310((__int64)a7);\n  return v11;\n}", "assembly": "; \n; GJGameLevel::saveNewScore from 0x140264b10 to 0x140264cda (458 bytes)\n; \n; 6 xrefs:\n; > GJGameLevel::handleStatsConflict @ 0x14026a851\n; > GJGameLevel::handleStatsConflict @ 0x14026a8ac\n; > PlayLayer::levelComplete @ 0x140506a63\n; > PlayLayer::levelComplete @ 0x140506af4\n; > PlayLayer::levelComplete @ 0x140506b6c\n; > <???> @ 0x14091c8b0\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:49 +0000\n; \npush    rbx                                                            ; +0x0, 0x140264b10\npush    rbp                                                            ; +0x2, 0x140264b12\npush    rsi                                                            ; +0x3, 0x140264b13\npush    rdi                                                            ; +0x4, 0x140264b14\npush    r14                                                            ; +0x5, 0x140264b15\nsub     rsp, 50h                                                       ; +0x7, 0x140264b17\nmov     rax, cs:__security_cookie                                      ; +0xb, 0x140264b1b\nxor     rax, rsp                                                       ; +0x12, 0x140264b22\nmov     [rsp+78h+var_30], rax                                          ; +0x15, 0x140264b25\nmov     r14d, r8d                                                      ; +0x1a, 0x140264b2a\nmov     esi, edx                                                       ; +0x1d, 0x140264b2d\nmov     rbx, rcx                                                       ; +0x1f, 0x140264b2f\nmov     rdi, [rsp+78h+arg_30]                                          ; +0x22, 0x140264b32\nmov     [rsp+78h+var_38], rdi                                          ; +0x2a, 0x140264b3a\nxor     bpl, bpl                                                       ; +0x2f, 0x140264b3f\ntest    r8d, r8d                                                       ; +0x32, 0x140264b42\njnz     loc_140264BFB                                                  ; +0x35, 0x140264b45\ntest    edx, edx                                                       ; +0x3b, 0x140264b4b\njle     loc_140264CA8                                                  ; +0x3d, 0x140264b4d\nmov     eax, [rcx+588h]                                                ; +0x43, 0x140264b53\ncmp     edx, eax                                                       ; +0x49, 0x140264b59\njl      short loc_140264B6F                                            ; +0x4b, 0x140264b5b\ntest    eax, eax                                                       ; +0x4d, 0x140264b5d\njz      short loc_140264B6F                                            ; +0x4f, 0x140264b5f\ncmp     [rsp+78h+arg_38], bpl                                          ; +0x51, 0x140264b61\njz      loc_140264CA8                                                  ; +0x59, 0x140264b69\nmov     [rcx+588h], esi                                                ; +0x5f, 0x140264b6f\nmov     [rcx+58Ch], r9d                                                ; +0x65, 0x140264b75\nmov     r8d, [rsp+78h+arg_20]                                          ; +0x6c, 0x140264b7c\nmov     [rcx+590h], r8d                                                ; +0x74, 0x140264b84\nmov     ecx, [rsp+78h+arg_28]                                          ; +0x7b, 0x140264b8b\nmov     [rbx+594h], ecx                                                ; +0x82, 0x140264b92\nmov     eax, [rbx+5C4h]                                                ; +0x88, 0x140264b98\nmov     [rsp+78h+var_40], eax                                          ; +0x8e, 0x140264b9e\nmov     eax, [rbx+5BCh]                                                ; +0x92, 0x140264ba2\nmov     [rsp+78h+var_48], eax                                          ; +0x98, 0x140264ba8\nmov     eax, [rbx+5C0h]                                                ; +0x9c, 0x140264bac\nmov     [rsp+78h+var_50], eax                                          ; +0xa2, 0x140264bb2\nmov     [rsp+78h+var_58], ecx                                          ; +0xa6, 0x140264bb6\nmov     edx, [rbx+5B8h]                                                ; +0xaa, 0x140264bba\nmov     ecx, esi                                                       ; +0xb0, 0x140264bc0\ncall    sub_1402649C0                                                  ; +0xb2, 0x140264bc2\nmov     [rbx+5E8h], eax                                                ; +0xb7, 0x140264bc7\nlea     rcx, [rbx+598h]; void *                                        ; +0xbd, 0x140264bcd\ncmp     rcx, rdi                                                       ; +0xc4, 0x140264bd4\njz      short loc_140264BEF                                            ; +0xc7, 0x140264bd7\nmov     rdx, rdi                                                       ; +0xc9, 0x140264bd9\ncmp     qword ptr [rdi+18h], 0Fh                                       ; +0xcc, 0x140264bdc\njbe     short loc_140264BE6                                            ; +0xd1, 0x140264be1\nmov     rdx, [rdi]; Src                                                ; +0xd3, 0x140264be3\nmov     r8, [rdi+10h]; Size                                            ; +0xd6, 0x140264be6\ncall    sub_1400405A0                                                  ; +0xda, 0x140264bea\nmov     byte ptr [rbx+630h], 1                                         ; +0xdf, 0x140264bef\njmp     loc_140264CA5                                                  ; +0xe6, 0x140264bf6\ntest    esi, esi                                                       ; +0xeb, 0x140264bfb\njz      loc_140264CA8                                                  ; +0xed, 0x140264bfd\nmov     eax, [rcx+5B8h]                                                ; +0xf3, 0x140264c03\ncmp     esi, eax                                                       ; +0xf9, 0x140264c09\njg      short loc_140264C1F                                            ; +0xfb, 0x140264c0b\ntest    eax, eax                                                       ; +0xfd, 0x140264c0d\njz      short loc_140264C1F                                            ; +0xff, 0x140264c0f\ncmp     [rsp+78h+arg_38], bpl                                          ; +0x101, 0x140264c11\njz      loc_140264CA8                                                  ; +0x109, 0x140264c19\nmov     [rcx+5B8h], esi                                                ; +0x10f, 0x140264c1f\nmov     [rcx+5BCh], r9d                                                ; +0x115, 0x140264c25\nmov     ecx, [rsp+78h+arg_20]                                          ; +0x11c, 0x140264c2c\nmov     [rbx+5C0h], ecx                                                ; +0x123, 0x140264c33\nmov     eax, [rsp+78h+arg_28]                                          ; +0x129, 0x140264c39\nmov     [rbx+5C4h], eax                                                ; +0x130, 0x140264c40\nmov     [rsp+78h+var_40], eax                                          ; +0x136, 0x140264c46\nmov     [rsp+78h+var_48], r9d                                          ; +0x13a, 0x140264c4a\nmov     [rsp+78h+var_50], ecx                                          ; +0x13f, 0x140264c4f\nmov     eax, [rbx+594h]                                                ; +0x143, 0x140264c53\nmov     [rsp+78h+var_58], eax                                          ; +0x149, 0x140264c59\nmov     r9d, [rbx+58Ch]                                                ; +0x14d, 0x140264c5d\nmov     r8d, [rbx+590h]                                                ; +0x154, 0x140264c64\nmov     ecx, [rbx+588h]                                                ; +0x15b, 0x140264c6b\ncall    sub_1402649C0                                                  ; +0x161, 0x140264c71\nmov     [rbx+5E8h], eax                                                ; +0x166, 0x140264c76\nlea     rcx, [rbx+5C8h]; void *                                        ; +0x16c, 0x140264c7c\ncmp     rcx, rdi                                                       ; +0x173, 0x140264c83\njz      short loc_140264C9E                                            ; +0x176, 0x140264c86\nmov     rdx, rdi                                                       ; +0x178, 0x140264c88\ncmp     qword ptr [rdi+18h], 0Fh                                       ; +0x17b, 0x140264c8b\njbe     short loc_140264C95                                            ; +0x180, 0x140264c90\nmov     rdx, [rdi]; Src                                                ; +0x182, 0x140264c92\nmov     r8, [rdi+10h]; Size                                            ; +0x185, 0x140264c95\ncall    sub_1400405A0                                                  ; +0x189, 0x140264c99\nmov     byte ptr [rbx+631h], 1                                         ; +0x18e, 0x140264c9e\nmov     bpl, 1                                                         ; +0x195, 0x140264ca5\nmov     r8d, r14d                                                      ; +0x198, 0x140264ca8\nmov     edx, esi                                                       ; +0x19b, 0x140264cab\nmov     rcx, rbx                                                       ; +0x19d, 0x140264cad\ncall    GJGameLevel__storeNewLocalScore                                ; +0x1a0, 0x140264cb0\nnop                                                                    ; +0x1a5, 0x140264cb5\nmov     rcx, rdi                                                       ; +0x1a6, 0x140264cb6\ncall    sub_14003D310                                                  ; +0x1a9, 0x140264cb9\nmovzx   eax, bpl                                                       ; +0x1ae, 0x140264cbe\nmov     rcx, [rsp+78h+var_30]                                          ; +0x1b2, 0x140264cc2\nxor     rcx, rsp; StackCookie                                          ; +0x1b7, 0x140264cc7\ncall    __security_check_cookie                                        ; +0x1ba, 0x140264cca\nadd     rsp, 50h                                                       ; +0x1bf, 0x140264ccf\npop     r14                                                            ; +0x1c3, 0x140264cd3\npop     rdi                                                            ; +0x1c5, 0x140264cd5\npop     rsi                                                            ; +0x1c6, 0x140264cd6\npop     rbp                                                            ; +0x1c7, 0x140264cd7\npop     rbx                                                            ; +0x1c8, 0x140264cd8\nretn                                                                   ; +0x1c9, 0x140264cd9", "xrefs": ["GJGameLevel::handleStatsConflict @ 0x14026a851", "GJGameLevel::handleStatsConflict @ 0x14026a8ac", "PlayLayer::levelComplete @ 0x140506a63", "PlayLayer::levelComplete @ 0x140506af4", "PlayLayer::levelComplete @ 0x140506b6c", "<???> @ 0x14091c8b0"], "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"}