{"type": "func", "start": 4300543200, "end": 4300543430, "name": "GameLevelManager::pageFromCommentKey", "pseudocode": "// \n// GameLevelManager::pageFromCommentKey from 0x1005514e0 to 0x1005515c6 (230 bytes)\n// \n// 1 xrefs:\n// > GameLevelManager::onDeleteCommentCompleted @ 0x10052265d\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\nint __fastcall GameLevelManager::pageFromCommentKey(GameLevelManager *a1, const char *a2)\n{\n  double v2; // xmm0_8\n  size_t v3; // rax\n  size_t v4; // rbx\n  char *v5; // r15\n  size_t v6; // r12\n  __int64 v7; // rbx\n  unsigned int v8; // ecx\n  int result; // eax\n  cocos2d::CCString *v10; // rax\n  const char *CString; // rax\n  _QWORD __dst[2]; // [rsp+8h] [rbp-38h] BYREF\n  void *__p; // [rsp+18h] [rbp-28h]\n\n  v3 = strlen(a2);\n  if ( v3 >= 0xFFFFFFFFFFFFFFF8LL )\n    sub_100006BF0(v2);\n  v4 = v3;\n  if ( v3 >= 0x17 )\n  {\n    v6 = 26;\n    if ( (v3 | 7) != 0x17 )\n      v6 = (v3 | 7) + 1;\n    v5 = (char *)operator new(v6);\n    __p = v5;\n    __dst[0] = v6 + 1;\n    __dst[1] = v4;\n    goto LABEL_8;\n  }\n  LOBYTE(__dst[0]) = 2 * v3;\n  v5 = (char *)__dst + 1;\n  if ( v3 )\nLABEL_8:\n    memcpy(v5, a2, v4);\n  v5[v4] = 0;\n  v7 = sub_10052DD30((unsigned __int8 *)__dst, \"_\", v2);\n  if ( (__dst[0] & 1) != 0 )\n    operator delete(__p);\n  v8 = sub_100720070(v7);\n  result = 0;\n  if ( v8 >= 3 )\n  {\n    v10 = (cocos2d::CCString *)sub_1007200C0(v7, 2);\n    CString = cocos2d::CCString::getCString(v10);\n    return atoi(CString);\n  }\n  return result;\n}", "assembly": "; \n; GameLevelManager::pageFromCommentKey from 0x1005514e0 to 0x1005515c6 (230 bytes)\n; \n; 1 xrefs:\n; > GameLevelManager::onDeleteCommentCompleted @ 0x10052265d\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, 0x1005514e0\nmov     rbp, rsp                                                       ; +0x1, 0x1005514e1\npush    r15                                                            ; +0x4, 0x1005514e4\npush    r14                                                            ; +0x6, 0x1005514e6\npush    r12                                                            ; +0x8, 0x1005514e8\npush    rbx                                                            ; +0xa, 0x1005514ea\nsub     rsp, 20h                                                       ; +0xb, 0x1005514eb\nmov     r14, rsi                                                       ; +0xf, 0x1005514ef\nmov     rdi, rsi; __s                                                  ; +0x12, 0x1005514f2\ncall    _strlen                                                        ; +0x15, 0x1005514f5\ncmp     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x1a, 0x1005514fa\njnb     loc_1005515C1                                                  ; +0x1e, 0x1005514fe\nmov     rbx, rax                                                       ; +0x24, 0x100551504\ncmp     rax, 17h                                                       ; +0x27, 0x100551507\njnb     short loc_10055151E                                            ; +0x2b, 0x10055150b\nlea     eax, [rbx+rbx]                                                 ; +0x2d, 0x10055150d\nmov     byte ptr [rbp+__dst], al                                       ; +0x30, 0x100551510\nlea     r15, [rbp+__dst+1]                                             ; +0x33, 0x100551513\ntest    rbx, rbx                                                       ; +0x37, 0x100551517\njnz     short loc_100551551                                            ; +0x3a, 0x10055151a\njmp     short loc_10055155F                                            ; +0x3c, 0x10055151c\nmov     rax, rbx                                                       ; +0x3e, 0x10055151e\nor      rax, 7                                                         ; +0x41, 0x100551521\nlea     rcx, [rax+1]                                                   ; +0x45, 0x100551525\ncmp     rax, 17h                                                       ; +0x49, 0x100551529\nmov     r12d, 1Ah                                                      ; +0x4d, 0x10055152d\ncmovnz  r12, rcx                                                       ; +0x53, 0x100551533\nmov     rdi, r12; __sz                                                 ; +0x57, 0x100551537\ncall    __Znwm; operator new(ulong)                                    ; +0x5a, 0x10055153a\nmov     r15, rax                                                       ; +0x5f, 0x10055153f\nmov     [rbp+__p], rax                                                 ; +0x62, 0x100551542\ninc     r12                                                            ; +0x66, 0x100551546\nmov     [rbp+__dst], r12                                               ; +0x69, 0x100551549\nmov     [rbp+var_30], rbx                                              ; +0x6d, 0x10055154d\nmov     rdi, r15; __dst                                                ; +0x71, 0x100551551\nmov     rsi, r14; __src                                                ; +0x74, 0x100551554\nmov     rdx, rbx; __n                                                  ; +0x77, 0x100551557\ncall    _memcpy                                                        ; +0x7a, 0x10055155a\nmov     byte ptr [r15+rbx], 0                                          ; +0x7f, 0x10055155f\nlea     rsi, asc_10086913E; \"_\"                                        ; +0x84, 0x100551564\nlea     rdi, [rbp+__dst]                                               ; +0x8b, 0x10055156b\ncall    sub_10052DD30                                                  ; +0x8f, 0x10055156f\nmov     rbx, rax                                                       ; +0x94, 0x100551574\ntest    byte ptr [rbp+__dst], 1                                        ; +0x97, 0x100551577\njz      short loc_100551586                                            ; +0x9b, 0x10055157b\nmov     rdi, [rbp+__p]; __p                                            ; +0x9d, 0x10055157d\ncall    __ZdlPv; operator delete(void *)                               ; +0xa1, 0x100551581\nmov     rdi, rbx                                                       ; +0xa6, 0x100551586\ncall    sub_100720070                                                  ; +0xa9, 0x100551589\nmov     ecx, eax                                                       ; +0xae, 0x10055158e\nxor     eax, eax                                                       ; +0xb0, 0x100551590\ncmp     ecx, 3                                                         ; +0xb2, 0x100551592\njb      short loc_1005515B4                                            ; +0xb5, 0x100551595\nmov     rdi, rbx                                                       ; +0xb7, 0x100551597\nmov     esi, 2                                                         ; +0xba, 0x10055159a\ncall    sub_1007200C0                                                  ; +0xbf, 0x10055159f\nmov     rdi, rax                                                       ; +0xc4, 0x1005515a4\ncall    cocos2d__CCString__getCString                                  ; +0xc7, 0x1005515a7\nmov     rdi, rax; char *                                               ; +0xcc, 0x1005515ac\ncall    _atoi                                                          ; +0xcf, 0x1005515af\nadd     rsp, 20h                                                       ; +0xd4, 0x1005515b4\npop     rbx                                                            ; +0xd8, 0x1005515b8\npop     r12                                                            ; +0xd9, 0x1005515b9\npop     r14                                                            ; +0xdb, 0x1005515bb\npop     r15                                                            ; +0xdd, 0x1005515bd\npop     rbp                                                            ; +0xdf, 0x1005515bf\nretn                                                                   ; +0xe0, 0x1005515c0\ncall    sub_100006BF0                                                  ; +0xe1, 0x1005515c1", "xrefs": ["GameLevelManager::onDeleteCommentCompleted @ 0x10052265d"], "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"}