{"type": "func", "start": 5371739792, "end": 5371740500, "name": "GameStatsManager::getBaseCurrencyForLevel", "pseudocode": "// \n// GameStatsManager::getBaseCurrencyForLevel from 0x1402e3e90 to 0x1402e4154 (708 bytes)\n// \n// 6 xrefs:\n// > LevelCell::loadCustomLevelCell @ 0x14014bf52\n// > GameStatsManager::getAwardedCurrencyForLevel @ 0x1402e42cc\n// > GameStatsManager::awardCurrencyForLevel @ 0x1402e4564\n// > LevelInfoLayer::updateLabelValues @ 0x140424c3a\n// > LevelPage::updateDynamicPage @ 0x14044480d\n// > <???> @ 0x14091df3c\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:29:49 +0000\n// \n\n// Hidden C++ exception states: #wind=2\n__int64 __fastcall GameStatsManager::getBaseCurrencyForLevel(__int64 a1, _DWORD *a2)\n{\n  unsigned int v3; // ebx\n  int v4; // esi\n  int v5; // ebp\n  cocos2d::CCString *v6; // rax\n  const char *CString; // rax\n  size_t v8; // rdi\n  size_t v9; // r8\n  cocos2d::CCString *v10; // rax\n  __int64 v11; // rax\n  __int64 v12; // rbp\n  void **v13; // rdx\n  cocos2d::CCString *v14; // rax\n  int v15; // edi\n  void *v16; // rcx\n  void *v17; // rcx\n  int v18; // ecx\n  void *v20[2]; // [rsp+38h] [rbp-60h] BYREF\n  __int128 v21; // [rsp+48h] [rbp-50h]\n  void *Block[2]; // [rsp+58h] [rbp-40h] BYREF\n  __int128 v23; // [rsp+68h] [rbp-30h]\n\n  v3 = 0;\n  v4 = a2[255] - a2[256];\n  v5 = a2[248] - a2[249];\n  if ( a2[305] == 1 )\n  {\n    v18 = a2[82] - a2[83];\n    if ( v18 == 14 || ((v18 - 18) & 0xFFFFFFFD) == 0 )\n      return 400;\n    else\n      return (unsigned int)(20 * (v4 + 1));\n  }\n  else\n  {\n    if ( v5 <= 0 )\n    {\n      v10 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, (unsigned int)(a2[82] - a2[83]));\n      CString = cocos2d::CCString::getCString(v10);\n      *(_OWORD *)v20 = 0;\n      v21 = 0;\n      v8 = -1;\n      v9 = -1;\n      do\n        ++v9;\n      while ( CString[v9] );\n    }\n    else\n    {\n      v6 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, (unsigned int)v5);\n      CString = cocos2d::CCString::getCString(v6);\n      *(_OWORD *)v20 = 0;\n      v21 = 0;\n      v8 = -1;\n      v9 = -1;\n      do\n        ++v9;\n      while ( CString[v9] );\n    }\n    sub_14003D230(v20, CString, v9);\n    v11 = 784;\n    if ( v5 <= 0 )\n      v11 = 776;\n    v12 = *(_QWORD *)(v11 + a1);\n    v13 = v20;\n    if ( *((_QWORD *)&v21 + 1) > 0xFu )\n      v13 = (void **)v20[0];\n    *(_OWORD *)Block = 0;\n    v23 = 0;\n    do\n      ++v8;\n    while ( *((_BYTE *)v13 + v8) );\n    sub_14003D230(Block, v13, v8);\n    v14 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v12, Block);\n    v15 = cocos2d::CCString::intValue(v14);\n    if ( *((_QWORD *)&v23 + 1) > 0xFu )\n    {\n      v16 = Block[0];\n      if ( (unsigned __int64)(*((_QWORD *)&v23 + 1) + 1LL) >= 0x1000 )\n      {\n        v16 = *((void **)Block[0] - 1);\n        if ( (unsigned __int64)((char *)Block[0] - (char *)v16 - 8) > 0x1F )\n          invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n      }\n      j_j_free(v16);\n    }\n    if ( v15 > v4 )\n      v4 = v15;\n    if ( *((_QWORD *)&v21 + 1) > 0xFu )\n    {\n      v17 = v20[0];\n      if ( (unsigned __int64)(*((_QWORD *)&v21 + 1) + 1LL) >= 0x1000 )\n      {\n        v17 = *((void **)v20[0] - 1);\n        if ( (unsigned __int64)((char *)v20[0] - (char *)v17 - 8) > 0x1F )\n          invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n      }\n      j_j_free(v17);\n    }\n    switch ( v4 )\n    {\n      case 2:\n        v3 = 40;\n        break;\n      case 3:\n        v3 = 60;\n        break;\n      case 4:\n        v3 = 100;\n        break;\n      case 5:\n        v3 = 140;\n        break;\n      case 6:\n        v3 = 180;\n        break;\n      case 7:\n        v3 = 220;\n        break;\n      case 8:\n        v3 = 280;\n        break;\n      case 9:\n        v3 = 340;\n        break;\n      case 10:\n        return 400;\n      default:\n        return v3;\n    }\n  }\n  return v3;\n}", "assembly": "; \n; GameStatsManager::getBaseCurrencyForLevel from 0x1402e3e90 to 0x1402e4154 (708 bytes)\n; \n; 6 xrefs:\n; > LevelCell::loadCustomLevelCell @ 0x14014bf52\n; > GameStatsManager::getAwardedCurrencyForLevel @ 0x1402e42cc\n; > GameStatsManager::awardCurrencyForLevel @ 0x1402e4564\n; > LevelInfoLayer::updateLabelValues @ 0x140424c3a\n; > LevelPage::updateDynamicPage @ 0x14044480d\n; > <???> @ 0x14091df3c\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:29:49 +0000\n; \nmov     [rsp+arg_10], rbx                                              ; +0x0, 0x1402e3e90\nmov     [rsp+arg_18], rbp                                              ; +0x5, 0x1402e3e95\npush    rsi                                                            ; +0xa, 0x1402e3e9a\npush    rdi                                                            ; +0xb, 0x1402e3e9b\npush    r14                                                            ; +0xc, 0x1402e3e9c\nsub     rsp, 80h                                                       ; +0xe, 0x1402e3e9e\nmov     rax, cs:__security_cookie                                      ; +0x15, 0x1402e3ea5\nxor     rax, rsp                                                       ; +0x1c, 0x1402e3eac\nmov     [rsp+98h+var_20], rax                                          ; +0x1f, 0x1402e3eaf\nmov     rax, rdx                                                       ; +0x24, 0x1402e3eb4\nmov     r14, rcx                                                       ; +0x27, 0x1402e3eb7\nxor     ebx, ebx                                                       ; +0x2a, 0x1402e3eba\nmov     esi, [rdx+3FCh]                                                ; +0x2c, 0x1402e3ebc\nsub     esi, [rdx+400h]                                                ; +0x32, 0x1402e3ec2\nmov     ebp, [rdx+3E0h]                                                ; +0x38, 0x1402e3ec8\nsub     ebp, [rdx+3E4h]                                                ; +0x3e, 0x1402e3ece\ncmp     dword ptr [rdx+4C4h], 1                                        ; +0x44, 0x1402e3ed4\njz      loc_1402E40D8                                                  ; +0x4b, 0x1402e3edb\nlea     rcx, word_1406ED6F8                                            ; +0x51, 0x1402e3ee1\ntest    ebp, ebp                                                       ; +0x58, 0x1402e3ee8\njle     short loc_1402E3F2B                                            ; +0x5a, 0x1402e3eea\nmov     edx, ebp                                                       ; +0x5c, 0x1402e3eec\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x5e, 0x1402e3eee\nmov     rcx, rax                                                       ; +0x64, 0x1402e3ef4\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x67, 0x1402e3ef7\nxorps   xmm0, xmm0                                                     ; +0x6d, 0x1402e3efd\nmovups  xmmword ptr [rsp+98h+var_60], xmm0                             ; +0x70, 0x1402e3f00\nxorps   xmm1, xmm1                                                     ; +0x75, 0x1402e3f05\nmovdqu  [rsp+98h+var_50], xmm1                                         ; +0x78, 0x1402e3f08\nmov     rdi, 0FFFFFFFFFFFFFFFFh                                        ; +0x7e, 0x1402e3f0e\nmov     r8, rdi                                                        ; +0x85, 0x1402e3f15\nnop     dword ptr [rax+rax+00000000h]                                  ; +0x88, 0x1402e3f18\ninc     r8                                                             ; +0x90, 0x1402e3f20\ncmp     [rax+r8], bl                                                   ; +0x93, 0x1402e3f23\njnz     short loc_1402E3F20                                            ; +0x97, 0x1402e3f27\njmp     short loc_1402E3F6A                                            ; +0x99, 0x1402e3f29\nmov     edx, [rdx+148h]                                                ; +0x9b, 0x1402e3f2b\nsub     edx, [rax+14Ch]                                                ; +0xa1, 0x1402e3f31\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0xa7, 0x1402e3f37\nmov     rcx, rax                                                       ; +0xad, 0x1402e3f3d\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0xb0, 0x1402e3f40\nxorps   xmm0, xmm0                                                     ; +0xb6, 0x1402e3f46\nmovups  xmmword ptr [rsp+98h+var_60], xmm0                             ; +0xb9, 0x1402e3f49\nxorps   xmm1, xmm1                                                     ; +0xbe, 0x1402e3f4e\nmovdqu  [rsp+98h+var_50], xmm1                                         ; +0xc1, 0x1402e3f51\nmov     rdi, 0FFFFFFFFFFFFFFFFh                                        ; +0xc7, 0x1402e3f57\nmov     r8, rdi                                                        ; +0xce, 0x1402e3f5e\ninc     r8                                                             ; +0xd1, 0x1402e3f61\ncmp     [rax+r8], bl                                                   ; +0xd4, 0x1402e3f64\njnz     short loc_1402E3F61                                            ; +0xd8, 0x1402e3f68\nmov     rdx, rax                                                       ; +0xda, 0x1402e3f6a\nlea     rcx, [rsp+98h+var_60]                                          ; +0xdd, 0x1402e3f6d\ncall    sub_14003D230                                                  ; +0xe2, 0x1402e3f72\nnop                                                                    ; +0xe7, 0x1402e3f77\nmov     eax, 310h                                                      ; +0xe8, 0x1402e3f78\nmov     ecx, 308h                                                      ; +0xed, 0x1402e3f7d\ntest    ebp, ebp                                                       ; +0xf2, 0x1402e3f82\ncmovle  eax, ecx                                                       ; +0xf4, 0x1402e3f84\nmov     rbp, [rax+r14]                                                 ; +0xf7, 0x1402e3f87\nlea     rdx, [rsp+98h+var_60]                                          ; +0xfb, 0x1402e3f8b\ncmp     qword ptr [rsp+98h+var_50+8], 0Fh                              ; +0x100, 0x1402e3f90\ncmova   rdx, [rsp+98h+var_60]                                          ; +0x106, 0x1402e3f96\nxorps   xmm0, xmm0                                                     ; +0x10c, 0x1402e3f9c\nmovups  xmmword ptr [rsp+98h+Block], xmm0                              ; +0x10f, 0x1402e3f9f\nxorps   xmm1, xmm1                                                     ; +0x114, 0x1402e3fa4\nmovdqu  [rsp+98h+var_30], xmm1                                         ; +0x117, 0x1402e3fa7\nnop     dword ptr [rax]                                                ; +0x11d, 0x1402e3fad\ninc     rdi                                                            ; +0x120, 0x1402e3fb0\ncmp     byte ptr [rdx+rdi], 0                                          ; +0x123, 0x1402e3fb3\njnz     short loc_1402E3FB0                                            ; +0x127, 0x1402e3fb7\nmov     r8, rdi                                                        ; +0x129, 0x1402e3fb9\nlea     rcx, [rsp+98h+Block]                                           ; +0x12c, 0x1402e3fbc\ncall    sub_14003D230                                                  ; +0x131, 0x1402e3fc1\nnop                                                                    ; +0x136, 0x1402e3fc6\nlea     rdx, [rsp+98h+Block]                                           ; +0x137, 0x1402e3fc7\nmov     rcx, rbp                                                       ; +0x13c, 0x1402e3fcc\ncall    cs:?valueForKey@CCDictionary@cocos2d@@QEAAPEBVCCString@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::valueForKey(std::string const &) ; +0x13f, 0x1402e3fcf\nmov     rcx, rax                                                       ; +0x145, 0x1402e3fd5\ncall    cs:?intValue@CCString@cocos2d@@QEBAHXZ; cocos2d::CCString::intValue(void) ; +0x148, 0x1402e3fd8\nmov     edi, eax                                                       ; +0x14e, 0x1402e3fde\nmov     rdx, qword ptr [rsp+98h+var_30+8]                              ; +0x150, 0x1402e3fe0\ncmp     rdx, 0Fh                                                       ; +0x155, 0x1402e3fe5\njbe     short loc_1402E402F                                            ; +0x159, 0x1402e3fe9\ninc     rdx                                                            ; +0x15b, 0x1402e3feb\nmov     rcx, [rsp+98h+Block]; Block                                    ; +0x15e, 0x1402e3fee\nmov     rax, rcx                                                       ; +0x163, 0x1402e3ff3\ncmp     rdx, 1000h                                                     ; +0x166, 0x1402e3ff6\njb      short loc_1402E402A                                            ; +0x16d, 0x1402e3ffd\nadd     rdx, 27h ; '''                                                 ; +0x16f, 0x1402e3fff\nmov     rcx, [rcx-8]                                                   ; +0x173, 0x1402e4003\nsub     rax, rcx                                                       ; +0x177, 0x1402e4007\nsub     rax, 8                                                         ; +0x17a, 0x1402e400a\ncmp     rax, 1Fh                                                       ; +0x17e, 0x1402e400e\njbe     short loc_1402E402A                                            ; +0x182, 0x1402e4012\nmov     [rsp+98h+Reserved], rbx; Reserved                              ; +0x184, 0x1402e4014\nxor     r9d, r9d; LineNo                                               ; +0x189, 0x1402e4019\nxor     r8d, r8d; FileName                                             ; +0x18c, 0x1402e401c\nxor     edx, edx; FunctionName                                         ; +0x18f, 0x1402e401f\nxor     ecx, ecx; Expression                                           ; +0x191, 0x1402e4021\ncall    cs:_invoke_watson                                              ; +0x193, 0x1402e4023\nalign 2                                                                ; +0x199, 0x1402e4029\ncall    j_j_free                                                       ; +0x19a, 0x1402e402a\ncmp     edi, esi                                                       ; +0x19f, 0x1402e402f\ncmovg   esi, edi                                                       ; +0x1a1, 0x1402e4031\nmov     rdx, qword ptr [rsp+98h+var_50+8]                              ; +0x1a4, 0x1402e4034\ncmp     rdx, 0Fh                                                       ; +0x1a9, 0x1402e4039\njbe     short loc_1402E4083                                            ; +0x1ad, 0x1402e403d\ninc     rdx                                                            ; +0x1af, 0x1402e403f\nmov     rcx, [rsp+98h+var_60]; Block                                   ; +0x1b2, 0x1402e4042\nmov     rax, rcx                                                       ; +0x1b7, 0x1402e4047\ncmp     rdx, 1000h                                                     ; +0x1ba, 0x1402e404a\njb      short loc_1402E407E                                            ; +0x1c1, 0x1402e4051\nadd     rdx, 27h ; '''                                                 ; +0x1c3, 0x1402e4053\nmov     rcx, [rcx-8]                                                   ; +0x1c7, 0x1402e4057\nsub     rax, rcx                                                       ; +0x1cb, 0x1402e405b\nsub     rax, 8                                                         ; +0x1ce, 0x1402e405e\ncmp     rax, 1Fh                                                       ; +0x1d2, 0x1402e4062\njbe     short loc_1402E407E                                            ; +0x1d6, 0x1402e4066\nmov     [rsp+98h+Reserved], rbx; Reserved                              ; +0x1d8, 0x1402e4068\nxor     r9d, r9d; LineNo                                               ; +0x1dd, 0x1402e406d\nxor     r8d, r8d; FileName                                             ; +0x1e0, 0x1402e4070\nxor     edx, edx; FunctionName                                         ; +0x1e3, 0x1402e4073\nxor     ecx, ecx; Expression                                           ; +0x1e5, 0x1402e4075\ncall    cs:_invoke_watson                                              ; +0x1e7, 0x1402e4077\nalign 2                                                                ; +0x1ed, 0x1402e407d\ncall    j_j_free                                                       ; +0x1ee, 0x1402e407e\ndec     esi; switch 10 cases                                           ; +0x1f3, 0x1402e4083\ncmp     esi, 9                                                         ; +0x1f5, 0x1402e4085\nja      short def_1402E409E; jumptable 00000001402E409E default case, case 1 ; +0x1f8, 0x1402e4088\nmovsxd  rax, esi                                                       ; +0x1fa, 0x1402e408a\nlea     rdx, cs:140000000h                                             ; +0x1fd, 0x1402e408d\nmov     ecx, ds:(jpt_1402E409E - 140000000h)[rdx+rax*4]                ; +0x204, 0x1402e4094\nadd     rcx, rdx                                                       ; +0x20b, 0x1402e409b\njmp     rcx; switch jump                                               ; +0x20e, 0x1402e409e\nmov     ebx, 28h ; '('; jumptable 00000001402E409E case 2              ; +0x210, 0x1402e40a0\njmp     short def_1402E409E; jumptable 00000001402E409E default case, case 1 ; +0x215, 0x1402e40a5\nmov     ebx, 3Ch ; '<'; jumptable 00000001402E409E case 3              ; +0x217, 0x1402e40a7\njmp     short def_1402E409E; jumptable 00000001402E409E default case, case 1 ; +0x21c, 0x1402e40ac\nmov     ebx, 64h ; 'd'; jumptable 00000001402E409E case 4              ; +0x21e, 0x1402e40ae\njmp     short def_1402E409E; jumptable 00000001402E409E default case, case 1 ; +0x223, 0x1402e40b3\nmov     ebx, 8Ch; jumptable 00000001402E409E case 5                    ; +0x225, 0x1402e40b5\njmp     short def_1402E409E; jumptable 00000001402E409E default case, case 1 ; +0x22a, 0x1402e40ba\nmov     ebx, 0B4h; jumptable 00000001402E409E case 6                   ; +0x22c, 0x1402e40bc\njmp     short def_1402E409E; jumptable 00000001402E409E default case, case 1 ; +0x231, 0x1402e40c1\nmov     ebx, 0DCh; jumptable 00000001402E409E case 7                   ; +0x233, 0x1402e40c3\njmp     short def_1402E409E; jumptable 00000001402E409E default case, case 1 ; +0x238, 0x1402e40c8\nmov     ebx, 118h; jumptable 00000001402E409E case 8                   ; +0x23a, 0x1402e40ca\njmp     short def_1402E409E; jumptable 00000001402E409E default case, case 1 ; +0x23f, 0x1402e40cf\nmov     ebx, 154h; jumptable 00000001402E409E case 9                   ; +0x241, 0x1402e40d1\njmp     short def_1402E409E; jumptable 00000001402E409E default case, case 1 ; +0x246, 0x1402e40d6\nmov     ecx, [rdx+148h]                                                ; +0x248, 0x1402e40d8\nsub     ecx, [rdx+14Ch]                                                ; +0x24e, 0x1402e40de\ncmp     ecx, 0Eh                                                       ; +0x254, 0x1402e40e4\njz      short loc_1402E40FE; jumptable 00000001402E409E case 10        ; +0x257, 0x1402e40e7\nlea     eax, [rcx-12h]                                                 ; +0x259, 0x1402e40e9\ntest    eax, 0FFFFFFFDh                                                ; +0x25c, 0x1402e40ec\njz      short loc_1402E40FE; jumptable 00000001402E409E case 10        ; +0x261, 0x1402e40f1\nlea     eax, [rsi+1]                                                   ; +0x263, 0x1402e40f3\nlea     ebx, [rax+rax*4]                                               ; +0x266, 0x1402e40f6\nshl     ebx, 2                                                         ; +0x269, 0x1402e40f9\njmp     short def_1402E409E; jumptable 00000001402E409E default case, case 1 ; +0x26c, 0x1402e40fc\nmov     ebx, 190h; jumptable 00000001402E409E case 10                  ; +0x26e, 0x1402e40fe\nmov     eax, ebx; jumptable 00000001402E409E default case, case 1      ; +0x273, 0x1402e4103\nmov     rcx, [rsp+98h+var_20]                                          ; +0x275, 0x1402e4105\nxor     rcx, rsp; StackCookie                                          ; +0x27a, 0x1402e410a\ncall    __security_check_cookie                                        ; +0x27d, 0x1402e410d\nlea     r11, [rsp+98h+var_18]                                          ; +0x282, 0x1402e4112\nmov     rbx, [r11+30h]                                                 ; +0x28a, 0x1402e411a\nmov     rbp, [r11+38h]                                                 ; +0x28e, 0x1402e411e\nmov     rsp, r11                                                       ; +0x292, 0x1402e4122\npop     r14                                                            ; +0x295, 0x1402e4125\npop     rdi                                                            ; +0x297, 0x1402e4127\npop     rsi                                                            ; +0x298, 0x1402e4128\nretn                                                                   ; +0x299, 0x1402e4129\nalign 4                                                                ; +0x29a, 0x1402e412a\ndd offset def_1402E409E - 140000000h; jump table for switch statement  ; +0x29c, 0x1402e412c", "xrefs": ["LevelCell::loadCustomLevelCell @ 0x14014bf52", "GameStatsManager::getAwardedCurrencyForLevel @ 0x1402e42cc", "GameStatsManager::awardCurrencyForLevel @ 0x1402e4564", "LevelInfoLayer::updateLabelValues @ 0x140424c3a", "LevelPage::updateDynamicPage @ 0x14044480d", "<???> @ 0x14091df3c"], "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"}