{"type": "func", "start": 6442517760, "end": 6442518032, "name": "cocos2d::CCString::createWithData", "pseudocode": "// \n// cocos2d::CCString::createWithData from 0x180010500 to 0x180010610 (272 bytes)\n// \n// 3 xrefs:\n// > cocos2d::CCString::createWithContentsOfFile @ 0x1800104d0\n// > <???> @ 0x18014cf68\n// > <???> @ 0x1801b81c4\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:21:22 +0000\n// \n\n// Hidden C++ exception states: #wind=2\nstruct cocos2d::CCString *__fastcall cocos2d::CCString::createWithData(const unsigned __int8 *Src, size_t Size)\n{\n  __int64 v2; // rsi\n  cocos2d::CCObject *v4; // rbx\n  char *v5; // rax\n  char *v6; // rdi\n  __int64 v7; // rax\n  void *v8; // rcx\n  void *Block[3]; // [rsp+38h] [rbp-40h] BYREF\n  unsigned __int64 v11; // [rsp+50h] [rbp-28h]\n\n  v2 = (unsigned int)Size;\n  v4 = nullptr;\n  if ( Src )\n  {\n    v5 = (char *)malloc((unsigned int)(Size + 1));\n    v6 = v5;\n    if ( v5 )\n    {\n      v5[v2] = 0;\n      if ( (_DWORD)v2 )\n        memcpy(v5, Src, (unsigned int)v2);\n      sub_180005A10(Block, v6);\n      v7 = sub_1800E4AC0(0x58u);\n      if ( v7 )\n        v4 = (cocos2d::CCObject *)cocos2d::CCString::CCString(v7, (__int64)Block);\n      else\n        v4 = nullptr;\n      cocos2d::CCObject::autorelease(v4);\n      if ( v11 > 0xF )\n      {\n        v8 = Block[0];\n        if ( v11 + 1 >= 0x1000 )\n        {\n          v8 = *((void **)Block[0] - 1);\n          if ( (unsigned __int64)((char *)Block[0] - (char *)v8 - 8) > 0x1F )\n            invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n        }\n        j_j_free_0(v8);\n      }\n      free(v6);\n    }\n  }\n  return v4;\n}", "assembly": "; \n; cocos2d::CCString::createWithData from 0x180010500 to 0x180010610 (272 bytes)\n; \n; 3 xrefs:\n; > cocos2d::CCString::createWithContentsOfFile @ 0x1800104d0\n; > <???> @ 0x18014cf68\n; > <???> @ 0x1801b81c4\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:21:22 +0000\n; \nmov     [rsp+arg_10], rbx                                              ; +0x0, 0x180010500\npush    rbp                                                            ; +0x5, 0x180010505\npush    rsi                                                            ; +0x6, 0x180010506\npush    rdi                                                            ; +0x7, 0x180010507\nsub     rsp, 60h                                                       ; +0x8, 0x180010508\nmov     rax, cs:__security_cookie                                      ; +0xc, 0x18001050c\nxor     rax, rsp                                                       ; +0x13, 0x180010513\nmov     [rsp+78h+var_20], rax                                          ; +0x16, 0x180010516\nmov     esi, edx                                                       ; +0x1b, 0x18001051b\nmov     rbp, rcx                                                       ; +0x1d, 0x18001051d\nxor     ebx, ebx                                                       ; +0x20, 0x180010520\ntest    rcx, rcx                                                       ; +0x22, 0x180010522\njz      loc_1800105F0                                                  ; +0x25, 0x180010525\nlea     ecx, [rsi+1]; Size                                             ; +0x2b, 0x18001052b\ncall    cs:__imp_malloc                                                ; +0x2e, 0x18001052e\nmov     rdi, rax                                                       ; +0x34, 0x180010534\ntest    rax, rax                                                       ; +0x37, 0x180010537\njz      loc_1800105F0                                                  ; +0x3a, 0x18001053a\nmov     r8d, esi; Size                                                 ; +0x40, 0x180010540\nmov     [rsi+rax], bl                                                  ; +0x43, 0x180010543\ntest    esi, esi                                                       ; +0x46, 0x180010546\njz      short loc_180010555                                            ; +0x48, 0x180010548\nmov     rdx, rbp; Src                                                  ; +0x4a, 0x18001054a\nmov     rcx, rax; void *                                               ; +0x4d, 0x18001054d\ncall    memcpy                                                         ; +0x50, 0x180010550\nmov     rdx, rdi; Str                                                  ; +0x55, 0x180010555\nlea     rcx, [rsp+78h+Block]; void *                                   ; +0x58, 0x180010558\ncall    sub_180005A10                                                  ; +0x5d, 0x18001055d\nnop                                                                    ; +0x62, 0x180010562\nmov     ecx, 58h ; 'X'; Size                                           ; +0x63, 0x180010563\ncall    sub_1800E4AC0                                                  ; +0x68, 0x180010568\nmov     [rsp+78h+var_48], rax                                          ; +0x6d, 0x18001056d\ntest    rax, rax                                                       ; +0x72, 0x180010572\njz      short loc_180010589                                            ; +0x75, 0x180010575\nlea     rdx, [rsp+78h+Block]                                           ; +0x77, 0x180010577\nmov     rcx, rax                                                       ; +0x7c, 0x18001057c\ncall    ??0CCString@cocos2d@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCString::CCString(std::string const &) ; +0x7f, 0x18001057f\nmov     rbx, rax                                                       ; +0x84, 0x180010584\njmp     short loc_18001058B                                            ; +0x87, 0x180010587\nxor     ebx, ebx                                                       ; +0x89, 0x180010589\nmov     rcx, rbx; this                                                 ; +0x8b, 0x18001058b\ncall    ?autorelease@CCObject@cocos2d@@QEAAPEAV12@XZ; cocos2d::CCObject::autorelease(void) ; +0x8e, 0x18001058e\nnop                                                                    ; +0x93, 0x180010593\nmov     rdx, [rsp+78h+var_28]                                          ; +0x94, 0x180010594\ncmp     rdx, 0Fh                                                       ; +0x99, 0x180010599\njbe     short loc_1800105E7                                            ; +0x9d, 0x18001059d\ninc     rdx                                                            ; +0x9f, 0x18001059f\nmov     rcx, [rsp+78h+Block]; Block                                    ; +0xa2, 0x1800105a2\nmov     rax, rcx                                                       ; +0xa7, 0x1800105a7\ncmp     rdx, 1000h                                                     ; +0xaa, 0x1800105aa\njb      short loc_1800105E2                                            ; +0xb1, 0x1800105b1\nadd     rdx, 27h ; '''                                                 ; +0xb3, 0x1800105b3\nmov     rcx, [rcx-8]                                                   ; +0xb7, 0x1800105b7\nsub     rax, rcx                                                       ; +0xbb, 0x1800105bb\nsub     rax, 8                                                         ; +0xbe, 0x1800105be\ncmp     rax, 1Fh                                                       ; +0xc2, 0x1800105c2\njbe     short loc_1800105E2                                            ; +0xc6, 0x1800105c6\nmov     [rsp+78h+Reserved], 0; Reserved                                ; +0xc8, 0x1800105c8\nxor     r9d, r9d; LineNo                                               ; +0xd1, 0x1800105d1\nxor     r8d, r8d; FileName                                             ; +0xd4, 0x1800105d4\nxor     edx, edx; FunctionName                                         ; +0xd7, 0x1800105d7\nxor     ecx, ecx; Expression                                           ; +0xd9, 0x1800105d9\ncall    cs:_invoke_watson                                              ; +0xdb, 0x1800105db\nalign 2                                                                ; +0xe1, 0x1800105e1\ncall    j_j_free_0                                                     ; +0xe2, 0x1800105e2\nmov     rcx, rdi; Block                                                ; +0xe7, 0x1800105e7\ncall    cs:__imp_free                                                  ; +0xea, 0x1800105ea\nmov     rax, rbx                                                       ; +0xf0, 0x1800105f0\nmov     rcx, [rsp+78h+var_20]                                          ; +0xf3, 0x1800105f3\nxor     rcx, rsp; StackCookie                                          ; +0xf8, 0x1800105f8\ncall    __security_check_cookie                                        ; +0xfb, 0x1800105fb\nmov     rbx, [rsp+78h+arg_10]                                          ; +0x100, 0x180010600\nadd     rsp, 60h                                                       ; +0x108, 0x180010608\npop     rdi                                                            ; +0x10c, 0x18001060c\npop     rsi                                                            ; +0x10d, 0x18001060d\npop     rbp                                                            ; +0x10e, 0x18001060e\nretn                                                                   ; +0x10f, 0x18001060f", "xrefs": ["cocos2d::CCString::createWithContentsOfFile @ 0x1800104d0", "<???> @ 0x18014cf68", "<???> @ 0x1801b81c4"], "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"}