{"type": "func", "start": 4300542944, "end": 4300543174, "name": "GameLevelManager::levelIDFromPostCommentKey", "pseudocode": "// \n// GameLevelManager::levelIDFromPostCommentKey from 0x1005513e0 to 0x1005514c6 (230 bytes)\n// \n// 1 xrefs:\n// > GameLevelManager::onUploadCommentCompleted @ 0x1005216d9\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::levelIDFromPostCommentKey(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 >= 2 )\n  {\n    v10 = (cocos2d::CCString *)sub_1007200C0(v7, 1);\n    CString = cocos2d::CCString::getCString(v10);\n    return atoi(CString);\n  }\n  return result;\n}", "assembly": "; \n; GameLevelManager::levelIDFromPostCommentKey from 0x1005513e0 to 0x1005514c6 (230 bytes)\n; \n; 1 xrefs:\n; > GameLevelManager::onUploadCommentCompleted @ 0x1005216d9\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, 0x1005513e0\nmov     rbp, rsp                                                       ; +0x1, 0x1005513e1\npush    r15                                                            ; +0x4, 0x1005513e4\npush    r14                                                            ; +0x6, 0x1005513e6\npush    r12                                                            ; +0x8, 0x1005513e8\npush    rbx                                                            ; +0xa, 0x1005513ea\nsub     rsp, 20h                                                       ; +0xb, 0x1005513eb\nmov     r14, rsi                                                       ; +0xf, 0x1005513ef\nmov     rdi, rsi; __s                                                  ; +0x12, 0x1005513f2\ncall    _strlen                                                        ; +0x15, 0x1005513f5\ncmp     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x1a, 0x1005513fa\njnb     loc_1005514C1                                                  ; +0x1e, 0x1005513fe\nmov     rbx, rax                                                       ; +0x24, 0x100551404\ncmp     rax, 17h                                                       ; +0x27, 0x100551407\njnb     short loc_10055141E                                            ; +0x2b, 0x10055140b\nlea     eax, [rbx+rbx]                                                 ; +0x2d, 0x10055140d\nmov     byte ptr [rbp+__dst], al                                       ; +0x30, 0x100551410\nlea     r15, [rbp+__dst+1]                                             ; +0x33, 0x100551413\ntest    rbx, rbx                                                       ; +0x37, 0x100551417\njnz     short loc_100551451                                            ; +0x3a, 0x10055141a\njmp     short loc_10055145F                                            ; +0x3c, 0x10055141c\nmov     rax, rbx                                                       ; +0x3e, 0x10055141e\nor      rax, 7                                                         ; +0x41, 0x100551421\nlea     rcx, [rax+1]                                                   ; +0x45, 0x100551425\ncmp     rax, 17h                                                       ; +0x49, 0x100551429\nmov     r12d, 1Ah                                                      ; +0x4d, 0x10055142d\ncmovnz  r12, rcx                                                       ; +0x53, 0x100551433\nmov     rdi, r12; __sz                                                 ; +0x57, 0x100551437\ncall    __Znwm; operator new(ulong)                                    ; +0x5a, 0x10055143a\nmov     r15, rax                                                       ; +0x5f, 0x10055143f\nmov     [rbp+__p], rax                                                 ; +0x62, 0x100551442\ninc     r12                                                            ; +0x66, 0x100551446\nmov     [rbp+__dst], r12                                               ; +0x69, 0x100551449\nmov     [rbp+var_30], rbx                                              ; +0x6d, 0x10055144d\nmov     rdi, r15; __dst                                                ; +0x71, 0x100551451\nmov     rsi, r14; __src                                                ; +0x74, 0x100551454\nmov     rdx, rbx; __n                                                  ; +0x77, 0x100551457\ncall    _memcpy                                                        ; +0x7a, 0x10055145a\nmov     byte ptr [r15+rbx], 0                                          ; +0x7f, 0x10055145f\nlea     rsi, asc_10086913E; \"_\"                                        ; +0x84, 0x100551464\nlea     rdi, [rbp+__dst]                                               ; +0x8b, 0x10055146b\ncall    sub_10052DD30                                                  ; +0x8f, 0x10055146f\nmov     rbx, rax                                                       ; +0x94, 0x100551474\ntest    byte ptr [rbp+__dst], 1                                        ; +0x97, 0x100551477\njz      short loc_100551486                                            ; +0x9b, 0x10055147b\nmov     rdi, [rbp+__p]; __p                                            ; +0x9d, 0x10055147d\ncall    __ZdlPv; operator delete(void *)                               ; +0xa1, 0x100551481\nmov     rdi, rbx                                                       ; +0xa6, 0x100551486\ncall    sub_100720070                                                  ; +0xa9, 0x100551489\nmov     ecx, eax                                                       ; +0xae, 0x10055148e\nxor     eax, eax                                                       ; +0xb0, 0x100551490\ncmp     ecx, 2                                                         ; +0xb2, 0x100551492\njb      short loc_1005514B4                                            ; +0xb5, 0x100551495\nmov     rdi, rbx                                                       ; +0xb7, 0x100551497\nmov     esi, 1                                                         ; +0xba, 0x10055149a\ncall    sub_1007200C0                                                  ; +0xbf, 0x10055149f\nmov     rdi, rax                                                       ; +0xc4, 0x1005514a4\ncall    cocos2d__CCString__getCString                                  ; +0xc7, 0x1005514a7\nmov     rdi, rax; char *                                               ; +0xcc, 0x1005514ac\ncall    _atoi                                                          ; +0xcf, 0x1005514af\nadd     rsp, 20h                                                       ; +0xd4, 0x1005514b4\npop     rbx                                                            ; +0xd8, 0x1005514b8\npop     r12                                                            ; +0xd9, 0x1005514b9\npop     r14                                                            ; +0xdb, 0x1005514bb\npop     r15                                                            ; +0xdd, 0x1005514bd\npop     rbp                                                            ; +0xdf, 0x1005514bf\nretn                                                                   ; +0xe0, 0x1005514c0\ncall    sub_100006BF0                                                  ; +0xe1, 0x1005514c1", "xrefs": ["GameLevelManager::onUploadCommentCompleted @ 0x1005216d9"], "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"}