{"type": "func", "start": 6442517344, "end": 6442517593, "name": "cocos2d::CCString::createWithData", "pseudocode": "// \n// cocos2d::CCString::createWithData from 0x180010360 to 0x180010459 (249 bytes)\n// \n// 4 xrefs:\n// > cocos2d::CCString::createWithContentsOfFile @ 0x18001033d\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801ae104\n// > <???> @ 0x1801ae110\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=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  _BYTE *v5; // rax\n  _BYTE *v6; // rdi\n  void *v7; // rax\n  void *v8; // rcx\n  void *Block[3]; // [rsp+28h] [rbp-40h] BYREF\n  unsigned __int64 v11; // [rsp+40h] [rbp-28h]\n\n  v2 = (unsigned int)Size;\n  v4 = nullptr;\n  if ( Src )\n  {\n    v5 = 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_180005910(Block, v6);\n      v7 = operator new(0x58u);\n      if ( v7 )\n        v4 = (cocos2d::CCObject *)cocos2d::CCString::CCString((__int64)v7, (__int64)Block);\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            invalid_parameter_noinfo_noreturn();\n        }\n        j_j_free_0(v8);\n      }\n      free(v6);\n    }\n  }\n  return (struct cocos2d::CCString *)v4;\n}", "assembly": "; \n; cocos2d::CCString::createWithData from 0x180010360 to 0x180010459 (249 bytes)\n; \n; 4 xrefs:\n; > cocos2d::CCString::createWithContentsOfFile @ 0x18001033d\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801ae104\n; > <???> @ 0x1801ae110\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+arg_10], rbx                                              ; +0x0, 0x180010360\npush    rbp                                                            ; +0x5, 0x180010365\npush    rsi                                                            ; +0x6, 0x180010366\npush    rdi                                                            ; +0x7, 0x180010367\nsub     rsp, 50h                                                       ; +0x8, 0x180010368\nmov     rax, cs:__security_cookie                                      ; +0xc, 0x18001036c\nxor     rax, rsp                                                       ; +0x13, 0x180010373\nmov     [rsp+68h+var_20], rax                                          ; +0x16, 0x180010376\nmov     esi, edx                                                       ; +0x1b, 0x18001037b\nmov     rbp, rcx                                                       ; +0x1d, 0x18001037d\nxor     ebx, ebx                                                       ; +0x20, 0x180010380\ntest    rcx, rcx                                                       ; +0x22, 0x180010382\njz      loc_180010439                                                  ; +0x25, 0x180010385\nlea     ecx, [rsi+1]; Size                                             ; +0x2b, 0x18001038b\ncall    cs:__imp_malloc                                                ; +0x2e, 0x18001038e\nmov     rdi, rax                                                       ; +0x34, 0x180010394\ntest    rax, rax                                                       ; +0x37, 0x180010397\njz      loc_180010439                                                  ; +0x3a, 0x18001039a\nmov     r8d, esi; Size                                                 ; +0x40, 0x1800103a0\nmov     [rsi+rax], bl                                                  ; +0x43, 0x1800103a3\ntest    esi, esi                                                       ; +0x46, 0x1800103a6\njz      short loc_1800103B5                                            ; +0x48, 0x1800103a8\nmov     rdx, rbp; Src                                                  ; +0x4a, 0x1800103aa\nmov     rcx, rax; void *                                               ; +0x4d, 0x1800103ad\ncall    memcpy                                                         ; +0x50, 0x1800103b0\nmov     rdx, rdi                                                       ; +0x55, 0x1800103b5\nlea     rcx, [rsp+68h+Block]                                           ; +0x58, 0x1800103b8\ncall    sub_180005910                                                  ; +0x5d, 0x1800103bd\nnop                                                                    ; +0x62, 0x1800103c2\nmov     ecx, 58h ; 'X'; Size                                           ; +0x63, 0x1800103c3\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x68, 0x1800103c8\nmov     [rsp+68h+var_48], rax                                          ; +0x6d, 0x1800103cd\ntest    rax, rax                                                       ; +0x72, 0x1800103d2\njz      short loc_1800103E7                                            ; +0x75, 0x1800103d5\nlea     rdx, [rsp+68h+Block]                                           ; +0x77, 0x1800103d7\nmov     rcx, rax                                                       ; +0x7c, 0x1800103dc\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, 0x1800103df\nmov     rbx, rax                                                       ; +0x84, 0x1800103e4\nmov     rcx, rbx; this                                                 ; +0x87, 0x1800103e7\ncall    ?autorelease@CCObject@cocos2d@@QEAAPEAV12@XZ; cocos2d::CCObject::autorelease(void) ; +0x8a, 0x1800103ea\nnop                                                                    ; +0x8f, 0x1800103ef\nmov     rdx, [rsp+68h+var_28]                                          ; +0x90, 0x1800103f0\ncmp     rdx, 0Fh                                                       ; +0x95, 0x1800103f5\njbe     short loc_180010430                                            ; +0x99, 0x1800103f9\ninc     rdx                                                            ; +0x9b, 0x1800103fb\nmov     rcx, [rsp+68h+Block]; Block                                    ; +0x9e, 0x1800103fe\nmov     rax, rcx                                                       ; +0xa3, 0x180010403\ncmp     rdx, 1000h                                                     ; +0xa6, 0x180010406\njb      short loc_18001042B                                            ; +0xad, 0x18001040d\nadd     rdx, 27h ; '''                                                 ; +0xaf, 0x18001040f\nmov     rcx, [rcx-8]                                                   ; +0xb3, 0x180010413\nsub     rax, rcx                                                       ; +0xb7, 0x180010417\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0xba, 0x18001041a\ncmp     rax, 1Fh                                                       ; +0xbe, 0x18001041e\njbe     short loc_18001042B                                            ; +0xc2, 0x180010422\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0xc4, 0x180010424\ndb 0CCh                                                                ; +0xca, 0x18001042a\ncall    j_j_free_0                                                     ; +0xcb, 0x18001042b\nmov     rcx, rdi; Block                                                ; +0xd0, 0x180010430\ncall    cs:__imp_free                                                  ; +0xd3, 0x180010433\nmov     rax, rbx                                                       ; +0xd9, 0x180010439\nmov     rcx, [rsp+68h+var_20]                                          ; +0xdc, 0x18001043c\nxor     rcx, rsp; StackCookie                                          ; +0xe1, 0x180010441\ncall    __security_check_cookie                                        ; +0xe4, 0x180010444\nmov     rbx, [rsp+68h+arg_10]                                          ; +0xe9, 0x180010449\nadd     rsp, 50h                                                       ; +0xf1, 0x180010451\npop     rdi                                                            ; +0xf5, 0x180010455\npop     rsi                                                            ; +0xf6, 0x180010456\npop     rbp                                                            ; +0xf7, 0x180010457\nretn                                                                   ; +0xf8, 0x180010458", "xrefs": ["cocos2d::CCString::createWithContentsOfFile @ 0x18001033d", "<???> @ 0x1801438a8", "<???> @ 0x1801ae104", "<???> @ 0x1801ae110"], "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"}