{"type": "func", "start": 6442740304, "end": 6442740414, "name": "sub_180046A50", "pseudocode": "// \n// sub_180046A50 from 0x180046a50 to 0x180046abe (110 bytes)\n// \n// 3 xrefs:\n// > sub_180046F20 @ 0x180046f47\n// > <???> @ 0x1801b177c\n// > <???> @ 0x1801b1788\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_QWORD *__fastcall sub_180046A50(__int64 a1, _QWORD *a2)\n{\n  size_t v2; // rcx\n  void *v3; // rax\n  void *v4; // rcx\n  _QWORD *result; // rax\n\n  if ( *a2 > 0x7FFFFFFFFFFFFFFFuLL )\n    goto LABEL_10;\n  v2 = 2LL * *a2;\n  if ( v2 < 0x1000 )\n  {\n    if ( v2 )\n      return operator new(v2);\n    else\n      return nullptr;\n  }\n  if ( v2 + 39 < v2 )\nLABEL_10:\n    Concurrency::cancel_current_task();\n  v3 = operator new(v2 + 39);\n  v4 = v3;\n  if ( !v3 )\n    invalid_parameter_noinfo_noreturn();\n  result = (_QWORD *)(((unsigned __int64)v3 + 39) & 0xFFFFFFFFFFFFFFE0uLL);\n  *(result - 1) = v4;\n  return result;\n}", "assembly": "; \n; sub_180046A50 from 0x180046a50 to 0x180046abe (110 bytes)\n; \n; 3 xrefs:\n; > sub_180046F20 @ 0x180046f47\n; > <???> @ 0x1801b177c\n; > <???> @ 0x1801b1788\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\nsub     rsp, 28h                                                       ; +0x0, 0x180046a50\nmov     rcx, [rdx]                                                     ; +0x4, 0x180046a54\nmov     rax, 7FFFFFFFFFFFFFFFh                                         ; +0x7, 0x180046a57\ncmp     rcx, rax                                                       ; +0x11, 0x180046a61\nja      short loc_180046AB8                                            ; +0x14, 0x180046a64\nadd     rcx, rcx; Size                                                 ; +0x16, 0x180046a66\ncmp     rcx, 1000h                                                     ; +0x19, 0x180046a69\njb      short loc_180046AA3                                            ; +0x20, 0x180046a70\nlea     rax, [rcx+27h]                                                 ; +0x22, 0x180046a72\ncmp     rax, rcx                                                       ; +0x26, 0x180046a76\njbe     short loc_180046AB8                                            ; +0x29, 0x180046a79\nmov     rcx, rax; Size                                                 ; +0x2b, 0x180046a7b\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x2e, 0x180046a7e\nmov     rcx, rax                                                       ; +0x33, 0x180046a83\ntest    rax, rax                                                       ; +0x36, 0x180046a86\njz      short loc_180046A9C                                            ; +0x39, 0x180046a89\nadd     rax, 27h ; '''                                                 ; +0x3b, 0x180046a8b\nand     rax, 0FFFFFFFFFFFFFFE0h                                        ; +0x3f, 0x180046a8f\nmov     [rax-8], rcx                                                   ; +0x43, 0x180046a93\nadd     rsp, 28h                                                       ; +0x47, 0x180046a97\nretn                                                                   ; +0x4b, 0x180046a9b\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x4c, 0x180046a9c\ndb 0CCh                                                                ; +0x52, 0x180046aa2\ntest    rcx, rcx                                                       ; +0x53, 0x180046aa3\njz      short loc_180046AB1                                            ; +0x56, 0x180046aa6\nadd     rsp, 28h                                                       ; +0x58, 0x180046aa8\njmp     ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x5c, 0x180046aac\nxor     eax, eax                                                       ; +0x61, 0x180046ab1\nadd     rsp, 28h                                                       ; +0x63, 0x180046ab3\nretn                                                                   ; +0x67, 0x180046ab7\ncall    ?cancel_current_task@Concurrency@@YAXXZ; Concurrency::cancel_current_task(void) ; +0x68, 0x180046ab8\ndb 0CCh                                                                ; +0x6d, 0x180046abd", "xrefs": ["sub_180046F20 @ 0x180046f47", "<???> @ 0x1801b177c", "<???> @ 0x1801b1788"], "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"}