{"type": "func", "start": 4300501664, "end": 4300501844, "name": "GameLevelManager::getLeaderboardKey", "pseudocode": "// \n// GameLevelManager::getLeaderboardKey from 0x1005472a0 to 0x100547354 (180 bytes)\n// \n// 14 xrefs:\n// > LeaderboardsLayer::init @ 0x1005123bc\n// > LeaderboardsLayer::init @ 0x100512406\n// > LeaderboardsLayer::init @ 0x100512450\n// > LeaderboardsLayer::init @ 0x10051249a\n// > LeaderboardsLayer::init @ 0x1005124e1\n// > LeaderboardsLayer::init @ 0x10051252b\n// > LeaderboardsLayer::init @ 0x100512575\n// > LeaderboardsLayer::init @ 0x1005125bf\n// > LeaderboardsLayer::init @ 0x100512606\n// > LeaderboardsLayer::init @ 0x100512650\n// > LeaderboardsLayer::init @ 0x10051269a\n// > LeaderboardsLayer::init @ 0x1005126e4\n// > LeaderboardsLayer::selectLeaderboard @ 0x10051359d\n// > LeaderboardsLayer::isCorrect @ 0x100513e90\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_QWORD *__fastcall GameLevelManager::getLeaderboardKey(_QWORD *a1, double a2)\n{\n  char v2; // al\n  cocos2d::CCString *v3; // rax\n  const char *CString; // r15\n  size_t v5; // rax\n  size_t v6; // r14\n  void *v7; // r12\n  size_t v8; // r13\n\n  v3 = (cocos2d::CCString *)sub_1007AB580(\"lb_%i_%i\", v2);\n  CString = cocos2d::CCString::getCString(v3);\n  v5 = strlen(CString);\n  if ( v5 >= 0xFFFFFFFFFFFFFFF8LL )\n    sub_100006BF0(a2);\n  v6 = v5;\n  if ( v5 >= 0x17 )\n  {\n    v8 = 26;\n    if ( (v5 | 7) != 0x17 )\n      v8 = (v5 | 7) + 1;\n    v7 = operator new(v8);\n    a1[2] = v7;\n    *a1 = v8 + 1;\n    a1[1] = v6;\n  }\n  else\n  {\n    *(_BYTE *)a1 = 2 * v5;\n    v7 = (char *)a1 + 1;\n    if ( !v5 )\n      goto LABEL_9;\n  }\n  memmove(v7, CString, v6);\nLABEL_9:\n  *((_BYTE *)v7 + v6) = 0;\n  return a1;\n}", "assembly": "; \n; GameLevelManager::getLeaderboardKey from 0x1005472a0 to 0x100547354 (180 bytes)\n; \n; 14 xrefs:\n; > LeaderboardsLayer::init @ 0x1005123bc\n; > LeaderboardsLayer::init @ 0x100512406\n; > LeaderboardsLayer::init @ 0x100512450\n; > LeaderboardsLayer::init @ 0x10051249a\n; > LeaderboardsLayer::init @ 0x1005124e1\n; > LeaderboardsLayer::init @ 0x10051252b\n; > LeaderboardsLayer::init @ 0x100512575\n; > LeaderboardsLayer::init @ 0x1005125bf\n; > LeaderboardsLayer::init @ 0x100512606\n; > LeaderboardsLayer::init @ 0x100512650\n; > LeaderboardsLayer::init @ 0x10051269a\n; > LeaderboardsLayer::init @ 0x1005126e4\n; > LeaderboardsLayer::selectLeaderboard @ 0x10051359d\n; > LeaderboardsLayer::isCorrect @ 0x100513e90\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    rbp                                                            ; +0x0, 0x1005472a0\nmov     rbp, rsp                                                       ; +0x1, 0x1005472a1\npush    r15                                                            ; +0x4, 0x1005472a4\npush    r14                                                            ; +0x6, 0x1005472a6\npush    r13                                                            ; +0x8, 0x1005472a8\npush    r12                                                            ; +0xa, 0x1005472aa\npush    rbx                                                            ; +0xc, 0x1005472ac\npush    rax; char                                                      ; +0xd, 0x1005472ad\nmov     rbx, rdi                                                       ; +0xe, 0x1005472ae\nlea     rdi, aLbII; \"lb_%i_%i\"                                         ; +0x11, 0x1005472b1\nmov     esi, edx                                                       ; +0x18, 0x1005472b8\nmov     edx, ecx                                                       ; +0x1a, 0x1005472ba\nxor     eax, eax                                                       ; +0x1c, 0x1005472bc\ncall    sub_1007AB580                                                  ; +0x1e, 0x1005472be\nmov     rdi, rax                                                       ; +0x23, 0x1005472c3\ncall    cocos2d__CCString__getCString                                  ; +0x26, 0x1005472c6\nmov     r15, rax                                                       ; +0x2b, 0x1005472cb\nmov     rdi, rax; __s                                                  ; +0x2e, 0x1005472ce\ncall    _strlen                                                        ; +0x31, 0x1005472d1\ncmp     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x36, 0x1005472d6\njnb     short loc_10054734F                                            ; +0x3a, 0x1005472da\nmov     r14, rax                                                       ; +0x3c, 0x1005472dc\ncmp     rax, 17h                                                       ; +0x3f, 0x1005472df\njnb     short loc_1005472F8                                            ; +0x43, 0x1005472e3\nlea     eax, [r14+r14]                                                 ; +0x45, 0x1005472e5\nmov     [rbx], al                                                      ; +0x49, 0x1005472e9\nmov     r12, rbx                                                       ; +0x4b, 0x1005472eb\ninc     r12                                                            ; +0x4e, 0x1005472ee\ntest    r14, r14                                                       ; +0x51, 0x1005472f1\njnz     short loc_10054732A                                            ; +0x54, 0x1005472f4\njmp     short loc_100547338                                            ; +0x56, 0x1005472f6\nmov     rax, r14                                                       ; +0x58, 0x1005472f8\nor      rax, 7                                                         ; +0x5b, 0x1005472fb\nlea     rcx, [rax+1]                                                   ; +0x5f, 0x1005472ff\ncmp     rax, 17h                                                       ; +0x63, 0x100547303\nmov     r13d, 1Ah                                                      ; +0x67, 0x100547307\ncmovnz  r13, rcx                                                       ; +0x6d, 0x10054730d\nmov     rdi, r13; __sz                                                 ; +0x71, 0x100547311\ncall    __Znwm; operator new(ulong)                                    ; +0x74, 0x100547314\nmov     r12, rax                                                       ; +0x79, 0x100547319\nmov     [rbx+10h], rax                                                 ; +0x7c, 0x10054731c\ninc     r13                                                            ; +0x80, 0x100547320\nmov     [rbx], r13                                                     ; +0x83, 0x100547323\nmov     [rbx+8], r14                                                   ; +0x86, 0x100547326\nmov     rdi, r12; __dst                                                ; +0x8a, 0x10054732a\nmov     rsi, r15; __src                                                ; +0x8d, 0x10054732d\nmov     rdx, r14; __len                                                ; +0x90, 0x100547330\ncall    _memmove                                                       ; +0x93, 0x100547333\nmov     byte ptr [r12+r14], 0                                          ; +0x98, 0x100547338\nmov     rax, rbx                                                       ; +0x9d, 0x10054733d\nadd     rsp, 8                                                         ; +0xa0, 0x100547340\npop     rbx                                                            ; +0xa4, 0x100547344\npop     r12                                                            ; +0xa5, 0x100547345\npop     r13                                                            ; +0xa7, 0x100547347\npop     r14                                                            ; +0xa9, 0x100547349\npop     r15                                                            ; +0xab, 0x10054734b\npop     rbp                                                            ; +0xad, 0x10054734d\nretn                                                                   ; +0xae, 0x10054734e\ncall    sub_100006BF0                                                  ; +0xaf, 0x10054734f", "xrefs": ["LeaderboardsLayer::init @ 0x1005123bc", "LeaderboardsLayer::init @ 0x100512406", "LeaderboardsLayer::init @ 0x100512450", "LeaderboardsLayer::init @ 0x10051249a", "LeaderboardsLayer::init @ 0x1005124e1", "LeaderboardsLayer::init @ 0x10051252b", "LeaderboardsLayer::init @ 0x100512575", "LeaderboardsLayer::init @ 0x1005125bf", "LeaderboardsLayer::init @ 0x100512606", "LeaderboardsLayer::init @ 0x100512650", "LeaderboardsLayer::init @ 0x10051269a", "LeaderboardsLayer::init @ 0x1005126e4", "LeaderboardsLayer::selectLeaderboard @ 0x10051359d", "LeaderboardsLayer::isCorrect @ 0x100513e90"], "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"}