{"type": "func", "start": 6442552560, "end": 6442552676, "name": "sub_180018CF0", "pseudocode": "// \n// sub_180018CF0 from 0x180018cf0 to 0x180018d64 (116 bytes)\n// \n// 4 xrefs:\n// > sub_180018D70 @ 0x180018e23\n// > cocos2d::extension::CCHttpRequest::setRequestData @ 0x18001d267\n// > sub_18001D910 @ 0x18001d94a\n// > <???> @ 0x18004ab90\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\nchar *__fastcall sub_180018CF0(_QWORD *a1, size_t a2)\n{\n  void *v4; // rax\n  void *v5; // rcx\n  _QWORD *v6; // rax\n  char *result; // rax\n\n  if ( a2 < 0x1000 )\n  {\n    if ( a2 )\n      v6 = operator new(a2);\n    else\n      v6 = nullptr;\n  }\n  else\n  {\n    if ( a2 + 39 < a2 )\n      Concurrency::cancel_current_task();\n    v4 = operator new(a2 + 39);\n    v5 = v4;\n    if ( !v4 )\n      invalid_parameter_noinfo_noreturn();\n    v6 = (_QWORD *)(((unsigned __int64)v4 + 39) & 0xFFFFFFFFFFFFFFE0uLL);\n    *(v6 - 1) = v5;\n  }\n  *a1 = v6;\n  a1[1] = v6;\n  result = (char *)v6 + a2;\n  a1[2] = result;\n  return result;\n}", "assembly": "; \n; sub_180018CF0 from 0x180018cf0 to 0x180018d64 (116 bytes)\n; \n; 4 xrefs:\n; > sub_180018D70 @ 0x180018e23\n; > cocos2d::extension::CCHttpRequest::setRequestData @ 0x18001d267\n; > sub_18001D910 @ 0x18001d94a\n; > <???> @ 0x18004ab90\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_0], rbx                                               ; +0x0, 0x180018cf0\npush    rdi                                                            ; +0x5, 0x180018cf5\nsub     rsp, 20h                                                       ; +0x6, 0x180018cf6\nmov     rbx, rdx                                                       ; +0xa, 0x180018cfa\nmov     rdi, rcx                                                       ; +0xd, 0x180018cfd\ncmp     rdx, 1000h                                                     ; +0x10, 0x180018d00\njb      short loc_180018D34                                            ; +0x17, 0x180018d07\nlea     rcx, [rdx+27h]; Size                                           ; +0x19, 0x180018d09\ncmp     rcx, rdx                                                       ; +0x1d, 0x180018d0d\njbe     short loc_180018D5E                                            ; +0x20, 0x180018d10\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x22, 0x180018d12\nmov     rcx, rax                                                       ; +0x27, 0x180018d17\ntest    rax, rax                                                       ; +0x2a, 0x180018d1a\njz      short loc_180018D2D                                            ; +0x2d, 0x180018d1d\nadd     rax, 27h ; '''                                                 ; +0x2f, 0x180018d1f\nand     rax, 0FFFFFFFFFFFFFFE0h                                        ; +0x33, 0x180018d23\nmov     [rax-8], rcx                                                   ; +0x37, 0x180018d27\njmp     short loc_180018D45                                            ; +0x3b, 0x180018d2b\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x3d, 0x180018d2d\nalign 4                                                                ; +0x43, 0x180018d33\ntest    rbx, rbx                                                       ; +0x44, 0x180018d34\njz      short loc_180018D43                                            ; +0x47, 0x180018d37\nmov     rcx, rbx; Size                                                 ; +0x49, 0x180018d39\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x4c, 0x180018d3c\njmp     short loc_180018D45                                            ; +0x51, 0x180018d41\nxor     eax, eax                                                       ; +0x53, 0x180018d43\nmov     [rdi], rax                                                     ; +0x55, 0x180018d45\nmov     [rdi+8], rax                                                   ; +0x58, 0x180018d48\nadd     rax, rbx                                                       ; +0x5c, 0x180018d4c\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x5f, 0x180018d4f\nmov     [rdi+10h], rax                                                 ; +0x64, 0x180018d54\nadd     rsp, 20h                                                       ; +0x68, 0x180018d58\npop     rdi                                                            ; +0x6c, 0x180018d5c\nretn                                                                   ; +0x6d, 0x180018d5d\ncall    ?cancel_current_task@Concurrency@@YAXXZ; Concurrency::cancel_current_task(void) ; +0x6e, 0x180018d5e\ndb 0CCh                                                                ; +0x73, 0x180018d63", "xrefs": ["sub_180018D70 @ 0x180018e23", "cocos2d::extension::CCHttpRequest::setRequestData @ 0x18001d267", "sub_18001D910 @ 0x18001d94a", "<???> @ 0x18004ab90"], "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"}