{"type": "func", "start": 6442740320, "end": 6442740748, "name": "sub_180046A60", "pseudocode": "// \n// sub_180046A60 from 0x180046a60 to 0x180046c0c (428 bytes)\n// \n// 2 xrefs:\n// > sub_180045B60 @ 0x180046029\n// > <???> @ 0x1801f8220\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 10:53:13 +0000\n// \n\n__int64 __fastcall sub_180046A60(__int64 a1, __int64 a2, unsigned int *a3)\n{\n  unsigned __int64 v6; // rax\n  _BYTE *v7; // rax\n  unsigned int v8; // eax\n  void *v9; // rax\n  unsigned int v10; // esi\n  __int64 v11; // rdi\n  __int64 v12; // rdx\n  unsigned __int64 v13; // rax\n  void *v14; // rax\n\n  if ( !(unsigned int)sub_180042270(a1, *(_QWORD *)(*(_QWORD *)(a2 + 8) + 120LL), a3) )\n    return 0;\n  v6 = *a3;\n  if ( (_DWORD)v6 )\n  {\n    if ( v6 + 1 < v6 )\n    {\n      *((_QWORD *)a3 + 1) = 0;\nLABEL_23:\n      **(_DWORD **)a2 = 8;\n      return 0;\n    }\n    v7 = j__malloc_base(v6 + 1);\n    *((_QWORD *)a3 + 1) = v7;\n    if ( !v7 )\n      goto LABEL_23;\n    if ( !(unsigned int)sub_180041BB0(a1, *(_QWORD *)(*(_QWORD *)(a2 + 8) + 120LL), v7, *a3) )\n      return 0;\n    *(_BYTE *)(*a3 + *((_QWORD *)a3 + 1)) = 0;\n  }\n  else\n  {\n    *((_QWORD *)a3 + 1) = 0;\n  }\n  if ( !(unsigned int)sub_180042270(a1, *(_QWORD *)(*(_QWORD *)(a2 + 8) + 120LL), a3 + 4) )\n    return 0;\n  v8 = a3[4];\n  if ( v8 )\n  {\n    v9 = j__malloc_base(16LL * v8);\n    *((_QWORD *)a3 + 3) = v9;\n    if ( !v9 )\n      goto LABEL_23;\n    v10 = 0;\n    if ( a3[4] )\n    {\n      while ( 1 )\n      {\n        v11 = 16LL * v10;\n        if ( !(unsigned int)sub_180042270(\n                              a1,\n                              *(_QWORD *)(*(_QWORD *)(a2 + 8) + 120LL),\n                              (unsigned int *)(v11 + *((_QWORD *)a3 + 3))) )\n          return 0;\n        v12 = *((_QWORD *)a3 + 3);\n        v13 = *(unsigned int *)(v11 + v12);\n        if ( (_DWORD)v13 )\n        {\n          if ( v13 + 1 < v13 )\n          {\n            *(_QWORD *)(v12 + v11 + 8) = 0;\n            goto LABEL_23;\n          }\n          v14 = j__malloc_base(v13 + 1);\n          *(_QWORD *)(v11 + *((_QWORD *)a3 + 3) + 8) = v14;\n          if ( !v14 )\n            goto LABEL_23;\n          if ( !(unsigned int)sub_180041BB0(\n                                a1,\n                                *(_QWORD *)(*(_QWORD *)(a2 + 8) + 120LL),\n                                *(_BYTE **)(v11 + *((_QWORD *)a3 + 3) + 8),\n                                *(_DWORD *)(v11 + *((_QWORD *)a3 + 3))) )\n            return 0;\n          *(_BYTE *)(*(unsigned int *)(v11 + *((_QWORD *)a3 + 3)) + *(_QWORD *)(v11 + *((_QWORD *)a3 + 3) + 8)) = 0;\n        }\n        else\n        {\n          *(_QWORD *)(v11 + v12 + 8) = 0;\n        }\n        if ( ++v10 >= a3[4] )\n          return 1;\n      }\n    }\n  }\n  else\n  {\n    *((_QWORD *)a3 + 3) = 0;\n  }\n  return 1;\n}", "assembly": "; \n; sub_180046A60 from 0x180046a60 to 0x180046c0c (428 bytes)\n; \n; 2 xrefs:\n; > sub_180045B60 @ 0x180046029\n; > <???> @ 0x1801f8220\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 10:53:13 +0000\n; \nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x180046a60\nmov     [rsp+arg_8], rbp                                               ; +0x5, 0x180046a65\nmov     [rsp+arg_10], rsi                                              ; +0xa, 0x180046a6a\nmov     [rsp+arg_18], rdi                                              ; +0xf, 0x180046a6f\npush    r12                                                            ; +0x14, 0x180046a74\npush    r14                                                            ; +0x16, 0x180046a76\npush    r15                                                            ; +0x18, 0x180046a78\nsub     rsp, 20h                                                       ; +0x1a, 0x180046a7a\nmov     r14, rdx                                                       ; +0x1e, 0x180046a7e\nmov     rbx, r8                                                        ; +0x21, 0x180046a81\nmov     rdx, [rdx+8]                                                   ; +0x24, 0x180046a84\nmov     r12, rcx                                                       ; +0x28, 0x180046a88\nmov     rdx, [rdx+78h]                                                 ; +0x2b, 0x180046a8b\ncall    sub_180042270                                                  ; +0x2f, 0x180046a8f\ntest    eax, eax                                                       ; +0x34, 0x180046a94\njz      loc_180046BE0                                                  ; +0x36, 0x180046a96\nmov     eax, [rbx]                                                     ; +0x3c, 0x180046a9c\nxor     ebp, ebp                                                       ; +0x3e, 0x180046a9e\ntest    eax, eax                                                       ; +0x40, 0x180046aa0\njz      short loc_180046AF2                                            ; +0x42, 0x180046aa2\nlea     rcx, [rax+1]; Size                                             ; +0x44, 0x180046aa4\ncmp     rcx, rax                                                       ; +0x48, 0x180046aa8\njnb     short loc_180046AB6                                            ; +0x4b, 0x180046aab\nmov     [rbx+8], rbp                                                   ; +0x4d, 0x180046aad\njmp     loc_180046BD7                                                  ; +0x51, 0x180046ab1\ncall    j__malloc_base                                                 ; +0x56, 0x180046ab6\nmov     [rbx+8], rax                                                   ; +0x5b, 0x180046abb\ntest    rax, rax                                                       ; +0x5f, 0x180046abf\njz      loc_180046BD7                                                  ; +0x62, 0x180046ac2\nmov     rdx, [r14+8]                                                   ; +0x68, 0x180046ac8\nmov     r8, rax                                                        ; +0x6c, 0x180046acc\nmov     r9d, [rbx]                                                     ; +0x6f, 0x180046acf\nmov     rcx, r12                                                       ; +0x72, 0x180046ad2\nmov     rdx, [rdx+78h]                                                 ; +0x75, 0x180046ad5\ncall    sub_180041BB0                                                  ; +0x79, 0x180046ad9\ntest    eax, eax                                                       ; +0x7e, 0x180046ade\njz      loc_180046BE0                                                  ; +0x80, 0x180046ae0\nmov     ecx, [rbx]                                                     ; +0x86, 0x180046ae6\nmov     rax, [rbx+8]                                                   ; +0x88, 0x180046ae8\nmov     [rcx+rax], bpl                                                 ; +0x8c, 0x180046aec\njmp     short loc_180046AF6                                            ; +0x90, 0x180046af0\nmov     [rbx+8], rbp                                                   ; +0x92, 0x180046af2\nmov     rdx, [r14+8]                                                   ; +0x96, 0x180046af6\nlea     r8, [rbx+10h]                                                  ; +0x9a, 0x180046afa\nmov     rcx, r12                                                       ; +0x9e, 0x180046afe\nmov     rdx, [rdx+78h]                                                 ; +0xa1, 0x180046b01\ncall    sub_180042270                                                  ; +0xa5, 0x180046b05\ntest    eax, eax                                                       ; +0xaa, 0x180046b0a\njz      loc_180046BE0                                                  ; +0xac, 0x180046b0c\nmov     eax, [rbx+10h]                                                 ; +0xb2, 0x180046b12\ntest    eax, eax                                                       ; +0xb5, 0x180046b15\njz      loc_180046C01                                                  ; +0xb7, 0x180046b17\nmov     ecx, eax                                                       ; +0xbd, 0x180046b1d\nshl     rcx, 4; Size                                                   ; +0xbf, 0x180046b1f\ncall    j__malloc_base                                                 ; +0xc3, 0x180046b23\nmov     [rbx+18h], rax                                                 ; +0xc8, 0x180046b28\ntest    rax, rax                                                       ; +0xcc, 0x180046b2c\njz      loc_180046BD7                                                  ; +0xcf, 0x180046b2f\nmov     esi, ebp                                                       ; +0xd5, 0x180046b35\ncmp     [rbx+10h], ebp                                                 ; +0xd7, 0x180046b37\njbe     loc_180046C05                                                  ; +0xda, 0x180046b3a\nmov     rdx, [r14+8]                                                   ; +0xe0, 0x180046b40\nmov     rcx, r12                                                       ; +0xe4, 0x180046b44\nmov     r8, [rbx+18h]                                                  ; +0xe7, 0x180046b47\nmov     edi, esi                                                       ; +0xeb, 0x180046b4b\nshl     rdi, 4                                                         ; +0xed, 0x180046b4d\nmov     rdx, [rdx+78h]                                                 ; +0xf1, 0x180046b51\nadd     r8, rdi                                                        ; +0xf5, 0x180046b55\ncall    sub_180042270                                                  ; +0xf8, 0x180046b58\ntest    eax, eax                                                       ; +0xfd, 0x180046b5d\njz      short loc_180046BE0                                            ; +0xff, 0x180046b5f\nmov     rdx, [rbx+18h]                                                 ; +0x101, 0x180046b61\nmov     eax, [rdi+rdx]                                                 ; +0x105, 0x180046b65\ntest    eax, eax                                                       ; +0x108, 0x180046b68\njz      short loc_180046BBB                                            ; +0x10a, 0x180046b6a\nlea     rcx, [rax+1]; Size                                             ; +0x10c, 0x180046b6c\ncmp     rcx, rax                                                       ; +0x110, 0x180046b70\njb      short loc_180046BD2                                            ; +0x113, 0x180046b73\ncall    j__malloc_base                                                 ; +0x115, 0x180046b75\nmov     rcx, [rbx+18h]                                                 ; +0x11a, 0x180046b7a\nmov     [rdi+rcx+8], rax                                               ; +0x11e, 0x180046b7e\ntest    rax, rax                                                       ; +0x123, 0x180046b83\njz      short loc_180046BD7                                            ; +0x126, 0x180046b86\nmov     rax, [rbx+18h]                                                 ; +0x128, 0x180046b88\nmov     rcx, r12                                                       ; +0x12c, 0x180046b8c\nmov     rdx, [r14+8]                                                   ; +0x12f, 0x180046b8f\nmov     r9d, [rdi+rax]                                                 ; +0x133, 0x180046b93\nmov     r8, [rdi+rax+8]                                                ; +0x137, 0x180046b97\nmov     rdx, [rdx+78h]                                                 ; +0x13c, 0x180046b9c\ncall    sub_180041BB0                                                  ; +0x140, 0x180046ba0\ntest    eax, eax                                                       ; +0x145, 0x180046ba5\njz      short loc_180046BE0                                            ; +0x147, 0x180046ba7\nmov     rax, [rbx+18h]                                                 ; +0x149, 0x180046ba9\nmov     ecx, [rdi+rax]                                                 ; +0x14d, 0x180046bad\nmov     rax, [rdi+rax+8]                                               ; +0x150, 0x180046bb0\nmov     [rcx+rax], bpl                                                 ; +0x155, 0x180046bb5\njmp     short loc_180046BC0                                            ; +0x159, 0x180046bb9\nmov     [rdi+rdx+8], rbp                                               ; +0x15b, 0x180046bbb\ninc     esi                                                            ; +0x160, 0x180046bc0\ncmp     esi, [rbx+10h]                                                 ; +0x162, 0x180046bc2\njb      loc_180046B40                                                  ; +0x165, 0x180046bc5\nmov     eax, 1                                                         ; +0x16b, 0x180046bcb\njmp     short loc_180046BE2                                            ; +0x170, 0x180046bd0\nmov     [rdx+rdi+8], rbp                                               ; +0x172, 0x180046bd2\nmov     rax, [r14]                                                     ; +0x177, 0x180046bd7\nmov     dword ptr [rax], 8                                             ; +0x17a, 0x180046bda\nxor     eax, eax                                                       ; +0x180, 0x180046be0\nmov     rbx, [rsp+38h+arg_0]                                           ; +0x182, 0x180046be2\nmov     rbp, [rsp+38h+arg_8]                                           ; +0x187, 0x180046be7\nmov     rsi, [rsp+38h+arg_10]                                          ; +0x18c, 0x180046bec\nmov     rdi, [rsp+38h+arg_18]                                          ; +0x191, 0x180046bf1\nadd     rsp, 20h                                                       ; +0x196, 0x180046bf6\npop     r15                                                            ; +0x19a, 0x180046bfa\npop     r14                                                            ; +0x19c, 0x180046bfc\npop     r12                                                            ; +0x19e, 0x180046bfe\nretn                                                                   ; +0x1a0, 0x180046c00\nmov     [rbx+18h], rbp                                                 ; +0x1a1, 0x180046c01\nmov     eax, 1                                                         ; +0x1a5, 0x180046c05\njmp     short loc_180046BE2                                            ; +0x1aa, 0x180046c0a", "xrefs": ["sub_180045B60 @ 0x180046029", "<???> @ 0x1801f8220"], "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"}