{"type": "func", "start": 5370204720, "end": 5370205178, "name": "GJGameLevel::saveNewScore", "pseudocode": "// \n// GJGameLevel::saveNewScore from 0x14016d230 to 0x14016d3fa (458 bytes)\n// \n// 5 xrefs:\n// > GJGameLevel::handleStatsConflict @ 0x14016fd61\n// > GJGameLevel::handleStatsConflict @ 0x14016fdbc\n// > PlayLayer::levelComplete @ 0x1403a82d2\n// > PlayLayer::levelComplete @ 0x1403a8387\n// > <???> @ 0x1406cae00\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=1\n__int64 __fastcall GJGameLevel::saveNewScore(\n        GJGameLevel *a1,\n        int a2,\n        int a3,\n        int a4,\n        int a5,\n        int a6,\n        std::string *a7,\n        char a8)\n{\n  unsigned __int8 v11; // bp\n  int m_bestTime; // eax\n  _QWORD *m_bigStorage; // rdx\n  int m_bestPoints; // eax\n  _QWORD *p_m_bigStorage; // rdx\n\n  v11 = 0;\n  if ( a3 )\n  {\n    if ( a2 )\n    {\n      m_bestPoints = a1->m_bestPoints;\n      if ( a2 > m_bestPoints || !m_bestPoints || a8 )\n      {\n        a1->m_bestPoints = a2;\n        a1->m_ticksPoints = a4;\n        a1->m_clicksPoints = a5;\n        a1->m_coinsPoints = a6;\n        a1->m_platformerSeed = sub_14016D0E0(\n                                 a1->m_bestTime,\n                                 a2,\n                                 a1->m_clicksTime,\n                                 a1->m_ticksTime,\n                                 a1->m_coinsTime,\n                                 a5,\n                                 a4,\n                                 a6);\n        if ( &a1->m_inputsPoints != a7 )\n        {\n          p_m_bigStorage = &a7->m_data.m_bigStorage;\n          if ( a7->m_data.m_capacity > 0xF )\n            p_m_bigStorage = a7->m_data.m_bigStorage;\n          sub_14003CCE0((void **)&a1->m_inputsPoints, p_m_bigStorage, a7->m_data.m_size);\n        }\n        a1->m_savedPoints = 1;\n        goto LABEL_20;\n      }\n    }\n  }\n  else if ( a2 > 0 )\n  {\n    m_bestTime = a1->m_bestTime;\n    if ( a2 < m_bestTime || !m_bestTime || a8 )\n    {\n      a1->m_bestTime = a2;\n      a1->m_ticksTime = a4;\n      a1->m_clicksTime = a5;\n      a1->m_coinsTime = a6;\n      a1->m_platformerSeed = sub_14016D0E0(\n                               a2,\n                               a1->m_bestPoints,\n                               a5,\n                               a4,\n                               a6,\n                               a1->m_clicksPoints,\n                               a1->m_ticksPoints,\n                               a1->m_coinsPoints);\n      if ( &a1->m_inputsTime != a7 )\n      {\n        m_bigStorage = &a7->m_data.m_bigStorage;\n        if ( a7->m_data.m_capacity > 0xF )\n          m_bigStorage = a7->m_data.m_bigStorage;\n        sub_14003CCE0((void **)&a1->m_inputsTime, m_bigStorage, a7->m_data.m_size);\n      }\n      a1->m_savedTime = 1;\nLABEL_20:\n      v11 = 1;\n    }\n  }\n  GJGameLevel::storeNewLocalScore(a1, a2, a3);\n  sub_14003A830((__int64)a7);\n  return v11;\n}", "assembly": "; \n; GJGameLevel::saveNewScore from 0x14016d230 to 0x14016d3fa (458 bytes)\n; \n; 5 xrefs:\n; > GJGameLevel::handleStatsConflict @ 0x14016fd61\n; > GJGameLevel::handleStatsConflict @ 0x14016fdbc\n; > PlayLayer::levelComplete @ 0x1403a82d2\n; > PlayLayer::levelComplete @ 0x1403a8387\n; > <???> @ 0x1406cae00\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\npush    rbx                                                            ; +0x0, 0x14016d230\npush    rbp                                                            ; +0x2, 0x14016d232\npush    rsi                                                            ; +0x3, 0x14016d233\npush    rdi                                                            ; +0x4, 0x14016d234\npush    r14                                                            ; +0x5, 0x14016d235\nsub     rsp, 50h                                                       ; +0x7, 0x14016d237\nmov     rax, cs:__security_cookie                                      ; +0xb, 0x14016d23b\nxor     rax, rsp                                                       ; +0x12, 0x14016d242\nmov     [rsp+78h+var_30], rax                                          ; +0x15, 0x14016d245\nmov     r14d, r8d                                                      ; +0x1a, 0x14016d24a\nmov     esi, edx                                                       ; +0x1d, 0x14016d24d\nmov     rbx, rcx                                                       ; +0x1f, 0x14016d24f\nmov     rdi, [rsp+78h+arg_30]                                          ; +0x22, 0x14016d252\nmov     [rsp+78h+var_38], rdi                                          ; +0x2a, 0x14016d25a\nxor     bpl, bpl                                                       ; +0x2f, 0x14016d25f\ntest    r8d, r8d                                                       ; +0x32, 0x14016d262\njnz     loc_14016D31B                                                  ; +0x35, 0x14016d265\ntest    edx, edx                                                       ; +0x3b, 0x14016d26b\njle     loc_14016D3C8                                                  ; +0x3d, 0x14016d26d\nmov     eax, [rcx+514h]                                                ; +0x43, 0x14016d273\ncmp     edx, eax                                                       ; +0x49, 0x14016d279\njl      short loc_14016D28F                                            ; +0x4b, 0x14016d27b\ntest    eax, eax                                                       ; +0x4d, 0x14016d27d\njz      short loc_14016D28F                                            ; +0x4f, 0x14016d27f\ncmp     [rsp+78h+arg_38], bpl                                          ; +0x51, 0x14016d281\njz      loc_14016D3C8                                                  ; +0x59, 0x14016d289\nmov     [rcx+514h], esi                                                ; +0x5f, 0x14016d28f\nmov     [rcx+518h], r9d                                                ; +0x65, 0x14016d295\nmov     r8d, [rsp+78h+arg_20]                                          ; +0x6c, 0x14016d29c\nmov     [rcx+51Ch], r8d                                                ; +0x74, 0x14016d2a4\nmov     ecx, [rsp+78h+arg_28]                                          ; +0x7b, 0x14016d2ab\nmov     [rbx+520h], ecx                                                ; +0x82, 0x14016d2b2\nmov     eax, [rbx+554h]                                                ; +0x88, 0x14016d2b8\nmov     [rsp+78h+var_40], eax                                          ; +0x8e, 0x14016d2be\nmov     eax, [rbx+54Ch]                                                ; +0x92, 0x14016d2c2\nmov     [rsp+78h+var_48], eax                                          ; +0x98, 0x14016d2c8\nmov     eax, [rbx+550h]                                                ; +0x9c, 0x14016d2cc\nmov     [rsp+78h+var_50], eax                                          ; +0xa2, 0x14016d2d2\nmov     [rsp+78h+var_58], ecx                                          ; +0xa6, 0x14016d2d6\nmov     edx, [rbx+548h]                                                ; +0xaa, 0x14016d2da\nmov     ecx, esi                                                       ; +0xb0, 0x14016d2e0\ncall    sub_14016D0E0                                                  ; +0xb2, 0x14016d2e2\nmov     [rbx+578h], eax                                                ; +0xb7, 0x14016d2e7\nlea     rcx, [rbx+528h]; void *                                        ; +0xbd, 0x14016d2ed\ncmp     rcx, rdi                                                       ; +0xc4, 0x14016d2f4\njz      short loc_14016D30F                                            ; +0xc7, 0x14016d2f7\nmov     rdx, rdi                                                       ; +0xc9, 0x14016d2f9\ncmp     qword ptr [rdi+18h], 0Fh                                       ; +0xcc, 0x14016d2fc\njbe     short loc_14016D306                                            ; +0xd1, 0x14016d301\nmov     rdx, [rdi]; Src                                                ; +0xd3, 0x14016d303\nmov     r8, [rdi+10h]; Size                                            ; +0xd6, 0x14016d306\ncall    sub_14003CCE0                                                  ; +0xda, 0x14016d30a\nmov     byte ptr [rbx+5C0h], 1                                         ; +0xdf, 0x14016d30f\njmp     loc_14016D3C5                                                  ; +0xe6, 0x14016d316\ntest    esi, esi                                                       ; +0xeb, 0x14016d31b\njz      loc_14016D3C8                                                  ; +0xed, 0x14016d31d\nmov     eax, [rcx+548h]                                                ; +0xf3, 0x14016d323\ncmp     esi, eax                                                       ; +0xf9, 0x14016d329\njg      short loc_14016D33F                                            ; +0xfb, 0x14016d32b\ntest    eax, eax                                                       ; +0xfd, 0x14016d32d\njz      short loc_14016D33F                                            ; +0xff, 0x14016d32f\ncmp     [rsp+78h+arg_38], bpl                                          ; +0x101, 0x14016d331\njz      loc_14016D3C8                                                  ; +0x109, 0x14016d339\nmov     [rcx+548h], esi                                                ; +0x10f, 0x14016d33f\nmov     [rcx+54Ch], r9d                                                ; +0x115, 0x14016d345\nmov     ecx, [rsp+78h+arg_20]                                          ; +0x11c, 0x14016d34c\nmov     [rbx+550h], ecx                                                ; +0x123, 0x14016d353\nmov     eax, [rsp+78h+arg_28]                                          ; +0x129, 0x14016d359\nmov     [rbx+554h], eax                                                ; +0x130, 0x14016d360\nmov     [rsp+78h+var_40], eax                                          ; +0x136, 0x14016d366\nmov     [rsp+78h+var_48], r9d                                          ; +0x13a, 0x14016d36a\nmov     [rsp+78h+var_50], ecx                                          ; +0x13f, 0x14016d36f\nmov     eax, [rbx+520h]                                                ; +0x143, 0x14016d373\nmov     [rsp+78h+var_58], eax                                          ; +0x149, 0x14016d379\nmov     r9d, [rbx+518h]                                                ; +0x14d, 0x14016d37d\nmov     r8d, [rbx+51Ch]                                                ; +0x154, 0x14016d384\nmov     ecx, [rbx+514h]                                                ; +0x15b, 0x14016d38b\ncall    sub_14016D0E0                                                  ; +0x161, 0x14016d391\nmov     [rbx+578h], eax                                                ; +0x166, 0x14016d396\nlea     rcx, [rbx+558h]; void *                                        ; +0x16c, 0x14016d39c\ncmp     rcx, rdi                                                       ; +0x173, 0x14016d3a3\njz      short loc_14016D3BE                                            ; +0x176, 0x14016d3a6\nmov     rdx, rdi                                                       ; +0x178, 0x14016d3a8\ncmp     qword ptr [rdi+18h], 0Fh                                       ; +0x17b, 0x14016d3ab\njbe     short loc_14016D3B5                                            ; +0x180, 0x14016d3b0\nmov     rdx, [rdi]; Src                                                ; +0x182, 0x14016d3b2\nmov     r8, [rdi+10h]; Size                                            ; +0x185, 0x14016d3b5\ncall    sub_14003CCE0                                                  ; +0x189, 0x14016d3b9\nmov     byte ptr [rbx+5C1h], 1                                         ; +0x18e, 0x14016d3be\nmov     bpl, 1                                                         ; +0x195, 0x14016d3c5\nmov     r8d, r14d                                                      ; +0x198, 0x14016d3c8\nmov     edx, esi                                                       ; +0x19b, 0x14016d3cb\nmov     rcx, rbx                                                       ; +0x19d, 0x14016d3cd\ncall    GJGameLevel__storeNewLocalScore                                ; +0x1a0, 0x14016d3d0\nnop                                                                    ; +0x1a5, 0x14016d3d5\nmov     rcx, rdi                                                       ; +0x1a6, 0x14016d3d6\ncall    sub_14003A830                                                  ; +0x1a9, 0x14016d3d9\nmovzx   eax, bpl                                                       ; +0x1ae, 0x14016d3de\nmov     rcx, [rsp+78h+var_30]                                          ; +0x1b2, 0x14016d3e2\nxor     rcx, rsp; StackCookie                                          ; +0x1b7, 0x14016d3e7\ncall    __security_check_cookie                                        ; +0x1ba, 0x14016d3ea\nadd     rsp, 50h                                                       ; +0x1bf, 0x14016d3ef\npop     r14                                                            ; +0x1c3, 0x14016d3f3\npop     rdi                                                            ; +0x1c5, 0x14016d3f5\npop     rsi                                                            ; +0x1c6, 0x14016d3f6\npop     rbp                                                            ; +0x1c7, 0x14016d3f7\npop     rbx                                                            ; +0x1c8, 0x14016d3f8\nretn                                                                   ; +0x1c9, 0x14016d3f9", "xrefs": ["GJGameLevel::handleStatsConflict @ 0x14016fd61", "GJGameLevel::handleStatsConflict @ 0x14016fdbc", "PlayLayer::levelComplete @ 0x1403a82d2", "PlayLayer::levelComplete @ 0x1403a8387", "<???> @ 0x1406cae00"], "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"}