{"type": "func", "start": 5371850592, "end": 5371851184, "name": "LevelInfoLayer::onLevelInfo", "pseudocode": "// \n// LevelInfoLayer::onLevelInfo from 0x1402fef60 to 0x1402ff1b0 (592 bytes)\n// \n// 2 xrefs:\n// > LevelInfoLayer::init @ 0x1402f8ef8\n// > <???> @ 0x1406d4304\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=4\nvoid LevelInfoLayer::onLevelInfo(LevelInfoLayer *a1, cocos2d::CCObject *a2)\n{\n  GJGameLevel *m_level; // rax\n  const char *v4; // rdx\n  cocos2d::CCString *v5; // rax\n  const char *CString; // rax\n  size_t v7; // rbx\n  size_t v8; // r8\n  GJGameLevel *v9; // rcx\n  int v10; // edx\n  cocos2d::CCString *v11; // rax\n  char *v12; // rax\n  size_t v13; // r8\n  void **v14; // rdx\n  __int64 v15; // rax\n  FLAlertLayer *v16; // rbx\n  void *v17; // rcx\n  __int128 v18; // [rsp+58h] [rbp-41h] BYREF\n  __int64 v19; // [rsp+68h] [rbp-31h]\n  __int64 v20; // [rsp+70h] [rbp-29h]\n  _BYTE v21[32]; // [rsp+80h] [rbp-19h] BYREF\n  void *Block[2]; // [rsp+A0h] [rbp+7h] BYREF\n  __int128 v23; // [rsp+B0h] [rbp+17h]\n  _QWORD v24[4]; // [rsp+C0h] [rbp+27h] BYREF\n\n  if ( !a1->m_isBusy )\n  {\n    sub_14003BDB0((__int64)v24, (__int64)&a1->m_level->m_levelName);\n    v4 = (const char *)v24;\n    if ( v24[3] > 0xFu )\n      v4 = (const char *)v24[0];\n    m_level = a1->m_level;\n    v5 = cocos2d::CCString::createWithFormat(\n           \"<cy>%s</c>\\n\"\n           \"<cg>Total Attempts</c>: %i\\n\"\n           \"<cl>Total Jumps</c>: %i\\n\"\n           \"<cp>Normal</c>: %i%%\\n\"\n           \"<co>Practice</c>: %i%%\",\n           v4,\n           m_level->m_attempts.random - m_level->m_attempts.seed,\n           m_level->m_jumps.random - m_level->m_jumps.seed,\n           m_level->m_normalPercent.random - m_level->m_normalPercent.seed,\n           m_level->m_practicePercent);\n    CString = cocos2d::CCString::getCString(v5);\n    *(_OWORD *)Block = 0;\n    v23 = 0;\n    v7 = -1;\n    v8 = -1;\n    do\n      ++v8;\n    while ( CString[v8] );\n    sub_14003A930(Block, CString, v8);\n    sub_14003A830((__int64)v24);\n    v9 = a1->m_level;\n    v10 = v9->m_newNormalPercent2.random - v9->m_newNormalPercent2.seed;\n    if ( v9->m_normalPercent.random - v9->m_normalPercent.seed != v10 )\n    {\n      v11 = cocos2d::CCString::createWithFormat(\"\\n<cj>Leaderboard</c>: %i%%\", v10);\n      v12 = (char *)cocos2d::CCString::getCString(v11);\n      v13 = -1;\n      do\n        ++v13;\n      while ( v12[v13] );\n      sub_140041270(Block, v12, v13);\n    }\n    v14 = Block;\n    if ( *((_QWORD *)&v23 + 1) > 0xFu )\n      v14 = (void **)Block[0];\n    v18 = 0;\n    v19 = 0;\n    v20 = 0;\n    do\n      ++v7;\n    while ( *((_BYTE *)v14 + v7) );\n    sub_14003A930(&v18, v14, v7);\n    v15 = sub_14003BDB0((__int64)v21, (__int64)&v18);\n    v16 = FLAlertLayer::create(0, (int)\"Level Stats\", v15, (__int64)\"OK\", 0, 1133903872, 0, 0, 1065353216);\n    sub_14003A830((__int64)&v18);\n    v16->show(v16);\n    if ( *((_QWORD *)&v23 + 1) > 0xFu )\n    {\n      v17 = Block[0];\n      if ( (unsigned __int64)(*((_QWORD *)&v23 + 1) + 1LL) >= 0x1000 )\n      {\n        v17 = *((void **)Block[0] - 1);\n        if ( (unsigned __int64)((char *)Block[0] - (char *)v17 - 8) > 0x1F )\n          invalid_parameter_noinfo_noreturn();\n      }\n      j_j_free(v17);\n    }\n  }\n}", "assembly": "; \n; LevelInfoLayer::onLevelInfo from 0x1402fef60 to 0x1402ff1b0 (592 bytes)\n; \n; 2 xrefs:\n; > LevelInfoLayer::init @ 0x1402f8ef8\n; > <???> @ 0x1406d4304\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\nmov     [rsp-8+arg_8], rbx                                             ; +0x0, 0x1402fef60\nmov     [rsp-8+arg_10], rsi                                            ; +0x5, 0x1402fef65\nmov     [rsp-8+arg_18], rdi                                            ; +0xa, 0x1402fef6a\npush    rbp                                                            ; +0xf, 0x1402fef6f\nlea     rbp, [rsp-57h]                                                 ; +0x10, 0x1402fef70\nsub     rsp, 0F0h                                                      ; +0x15, 0x1402fef75\nmov     rax, cs:__security_cookie                                      ; +0x1c, 0x1402fef7c\nxor     rax, rsp                                                       ; +0x23, 0x1402fef83\nmov     [rbp+57h+var_10], rax                                          ; +0x26, 0x1402fef86\nmov     rdi, rcx                                                       ; +0x2a, 0x1402fef8a\nxor     esi, esi                                                       ; +0x2d, 0x1402fef8d\ncmp     [rcx+1E0h], sil                                                ; +0x2f, 0x1402fef8f\njnz     loc_1402FF18B                                                  ; +0x36, 0x1402fef96\nmov     rdx, [rcx+1F0h]                                                ; +0x3c, 0x1402fef9c\nadd     rdx, 158h                                                      ; +0x43, 0x1402fefa3\nlea     rcx, [rbp+57h+var_30]                                          ; +0x4a, 0x1402fefaa\ncall    sub_14003BDB0                                                  ; +0x4e, 0x1402fefae\nnop                                                                    ; +0x53, 0x1402fefb3\nmov     rax, [rdi+1F0h]                                                ; +0x54, 0x1402fefb4\nmov     ecx, [rax+330h]                                                ; +0x5b, 0x1402fefbb\nsub     ecx, [rax+32Ch]                                                ; +0x61, 0x1402fefc1\nmov     r9d, [rax+2FCh]                                                ; +0x67, 0x1402fefc7\nsub     r9d, [rax+300h]                                                ; +0x6e, 0x1402fefce\nmov     r8d, [rax+2F0h]                                                ; +0x75, 0x1402fefd5\nsub     r8d, [rax+2F4h]                                                ; +0x7c, 0x1402fefdc\nlea     rdx, [rbp+57h+var_30]                                          ; +0x83, 0x1402fefe3\ncmp     [rbp+57h+var_18], 0Fh                                          ; +0x87, 0x1402fefe7\ncmova   rdx, [rbp+57h+var_30]                                          ; +0x8c, 0x1402fefec\nmov     eax, [rax+34Ch]                                                ; +0x91, 0x1402feff1\nmov     [rsp+0F0h+var_C8], eax                                         ; +0x97, 0x1402feff7\nmov     dword ptr [rsp+0F0h+var_D0], ecx                               ; +0x9b, 0x1402feffb\nlea     rcx, aCySCCgTotalAtt_0; \"<cy>%s</c>\\n<cg>Total Attempts</c>: %i\"... ; +0x9f, 0x1402fefff\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0xa6, 0x1402ff006\nmov     rcx, rax                                                       ; +0xac, 0x1402ff00c\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0xaf, 0x1402ff00f\nxorps   xmm0, xmm0                                                     ; +0xb5, 0x1402ff015\nmovups  xmmword ptr [rbp+57h+Block], xmm0                              ; +0xb8, 0x1402ff018\nxorps   xmm1, xmm1                                                     ; +0xbc, 0x1402ff01c\nmovdqu  [rbp+57h+var_40], xmm1                                         ; +0xbf, 0x1402ff01f\nmov     rbx, 0FFFFFFFFFFFFFFFFh                                        ; +0xc4, 0x1402ff024\nmov     r8, rbx                                                        ; +0xcb, 0x1402ff02b\nxchg    ax, ax                                                         ; +0xce, 0x1402ff02e\ninc     r8                                                             ; +0xd0, 0x1402ff030\ncmp     byte ptr [rax+r8], 0                                           ; +0xd3, 0x1402ff033\njnz     short loc_1402FF030                                            ; +0xd8, 0x1402ff038\nmov     rdx, rax                                                       ; +0xda, 0x1402ff03a\nlea     rcx, [rbp+57h+Block]                                           ; +0xdd, 0x1402ff03d\ncall    sub_14003A930                                                  ; +0xe1, 0x1402ff041\nnop                                                                    ; +0xe6, 0x1402ff046\nlea     rcx, [rbp+57h+var_30]                                          ; +0xe7, 0x1402ff047\ncall    sub_14003A830                                                  ; +0xeb, 0x1402ff04b\nmov     rcx, [rdi+1F0h]                                                ; +0xf0, 0x1402ff050\nmov     edx, [rcx+340h]                                                ; +0xf7, 0x1402ff057\nsub     edx, [rcx+344h]                                                ; +0xfd, 0x1402ff05d\nmov     eax, [rcx+330h]                                                ; +0x103, 0x1402ff063\nsub     eax, [rcx+32Ch]                                                ; +0x109, 0x1402ff069\ncmp     eax, edx                                                       ; +0x10f, 0x1402ff06f\njz      short loc_1402FF0A6                                            ; +0x111, 0x1402ff071\nlea     rcx, aCjLeaderboardC; \"\\n<cj>Leaderboard</c>: %i%%\"            ; +0x113, 0x1402ff073\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x11a, 0x1402ff07a\nmov     rcx, rax                                                       ; +0x120, 0x1402ff080\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x123, 0x1402ff083\nmov     r8, rbx                                                        ; +0x129, 0x1402ff089\nnop     dword ptr [rax+00h]                                            ; +0x12c, 0x1402ff08c\ninc     r8; Size                                                       ; +0x130, 0x1402ff090\ncmp     byte ptr [rax+r8], 0                                           ; +0x133, 0x1402ff093\njnz     short loc_1402FF090                                            ; +0x138, 0x1402ff098\nmov     rdx, rax; void *                                               ; +0x13a, 0x1402ff09a\nlea     rcx, [rbp+57h+Block]; Src                                      ; +0x13d, 0x1402ff09d\ncall    sub_140041270                                                  ; +0x141, 0x1402ff0a1\nlea     rdx, [rbp+57h+Block]                                           ; +0x146, 0x1402ff0a6\ncmp     qword ptr [rbp+57h+var_40+8], 0Fh                              ; +0x14a, 0x1402ff0aa\ncmova   rdx, [rbp+57h+Block]                                           ; +0x14f, 0x1402ff0af\nxorps   xmm0, xmm0                                                     ; +0x154, 0x1402ff0b4\nmovups  [rbp+57h+var_98], xmm0                                         ; +0x157, 0x1402ff0b7\nmov     [rbp+57h+var_88], rsi                                          ; +0x15b, 0x1402ff0bb\nmov     [rbp+57h+var_80], rsi                                          ; +0x15f, 0x1402ff0bf\ninc     rbx                                                            ; +0x163, 0x1402ff0c3\ncmp     byte ptr [rdx+rbx], 0                                          ; +0x166, 0x1402ff0c6\njnz     short loc_1402FF0C3                                            ; +0x16a, 0x1402ff0ca\nmov     r8, rbx                                                        ; +0x16c, 0x1402ff0cc\nlea     rcx, [rbp+57h+var_98]                                          ; +0x16f, 0x1402ff0cf\ncall    sub_14003A930                                                  ; +0x173, 0x1402ff0d3\nlea     rax, [rbp+57h+var_98]                                          ; +0x178, 0x1402ff0d8\nmov     [rbp+57h+var_A0], rax                                          ; +0x17c, 0x1402ff0dc\nlea     rdx, [rbp+57h+var_98]                                          ; +0x180, 0x1402ff0e0\nlea     rcx, [rbp+57h+var_70]                                          ; +0x184, 0x1402ff0e4\ncall    sub_14003BDB0                                                  ; +0x188, 0x1402ff0e8\nmovss   xmm0, cs:flt_140622C24                                         ; +0x18d, 0x1402ff0ed\nmovss   [rsp+0F0h+var_B0], xmm0                                        ; +0x195, 0x1402ff0f5\nxorps   xmm1, xmm1                                                     ; +0x19b, 0x1402ff0fb\nmovss   [rsp+0F0h+var_B8], xmm1                                        ; +0x19e, 0x1402ff0fe\nmov     [rsp+0F0h+var_C0], 0                                           ; +0x1a4, 0x1402ff104\nmovss   xmm0, cs:dword_14062343C                                       ; +0x1a9, 0x1402ff109\nmovss   [rsp+0F0h+var_C8], xmm0                                        ; +0x1b1, 0x1402ff111\nmov     [rsp+0F0h+var_D0], rsi                                         ; +0x1b7, 0x1402ff117\nlea     r9, aOk; \"OK\"                                                  ; +0x1bc, 0x1402ff11c\nmov     r8, rax                                                        ; +0x1c3, 0x1402ff123\nlea     rdx, aLevelStats; \"Level Stats\"                                ; +0x1c6, 0x1402ff126\nxor     ecx, ecx                                                       ; +0x1cd, 0x1402ff12d\ncall    FLAlertLayer__create                                           ; +0x1cf, 0x1402ff12f\nmov     rbx, rax                                                       ; +0x1d4, 0x1402ff134\nlea     rcx, [rbp+57h+var_98]                                          ; +0x1d7, 0x1402ff137\ncall    sub_14003A830                                                  ; +0x1db, 0x1402ff13b\nmov     rdx, [rbx]                                                     ; +0x1e0, 0x1402ff140\nmov     rcx, rbx                                                       ; +0x1e3, 0x1402ff143\ncall    qword ptr [rdx+410h]                                           ; +0x1e6, 0x1402ff146\nnop                                                                    ; +0x1ec, 0x1402ff14c\nmov     rdx, qword ptr [rbp+57h+var_40+8]                              ; +0x1ed, 0x1402ff14d\ncmp     rdx, 0Fh                                                       ; +0x1f1, 0x1402ff151\njbe     short loc_1402FF18B                                            ; +0x1f5, 0x1402ff155\ninc     rdx                                                            ; +0x1f7, 0x1402ff157\nmov     rcx, [rbp+57h+Block]; Block                                    ; +0x1fa, 0x1402ff15a\nmov     rax, rcx                                                       ; +0x1fe, 0x1402ff15e\ncmp     rdx, 1000h                                                     ; +0x201, 0x1402ff161\njb      short loc_1402FF186                                            ; +0x208, 0x1402ff168\nadd     rdx, 27h ; '''                                                 ; +0x20a, 0x1402ff16a\nmov     rcx, [rcx-8]                                                   ; +0x20e, 0x1402ff16e\nsub     rax, rcx                                                       ; +0x212, 0x1402ff172\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x215, 0x1402ff175\ncmp     rax, 1Fh                                                       ; +0x219, 0x1402ff179\njbe     short loc_1402FF186                                            ; +0x21d, 0x1402ff17d\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x21f, 0x1402ff17f\nalign 2                                                                ; +0x225, 0x1402ff185\ncall    j_j_free                                                       ; +0x226, 0x1402ff186\nmov     rcx, [rbp+57h+var_10]                                          ; +0x22b, 0x1402ff18b\nxor     rcx, rsp; StackCookie                                          ; +0x22f, 0x1402ff18f\ncall    __security_check_cookie                                        ; +0x232, 0x1402ff192\nlea     r11, [rsp+0F0h+var_s0]                                         ; +0x237, 0x1402ff197\nmov     rbx, [r11+18h]                                                 ; +0x23f, 0x1402ff19f\nmov     rsi, [r11+20h]                                                 ; +0x243, 0x1402ff1a3\nmov     rdi, [r11+28h]                                                 ; +0x247, 0x1402ff1a7\nmov     rsp, r11                                                       ; +0x24b, 0x1402ff1ab\npop     rbp                                                            ; +0x24e, 0x1402ff1ae\nretn                                                                   ; +0x24f, 0x1402ff1af", "xrefs": ["LevelInfoLayer::init @ 0x1402f8ef8", "<???> @ 0x1406d4304"], "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"}