{"type": "func", "start": 6442738256, "end": 6442739105, "name": "sub_180046250", "pseudocode": "// \n// sub_180046250 from 0x180046250 to 0x1800465a1 (849 bytes)\n// \n// 3 xrefs:\n// > sub_180045B60 @ 0x18004603e\n// > <???> @ 0x1801f81f0\n// > <???> @ 0x1801f81fc\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_180046250(__int64 a1, __int64 a2, __int64 a3)\n{\n  unsigned int v6; // eax\n  void *v7; // rax\n  __int64 v9; // r15\n  __int64 v10; // rdi\n  void *v11; // rax\n  unsigned int v12; // ebx\n  __int64 v13; // r14\n  size_t Count; // [rsp+58h] [rbp+10h] BYREF\n\n  memset((void *)a3, 0, 0xA0u);\n  if ( !(unsigned int)sub_180041BB0(a1, *(_QWORD *)(*(_QWORD *)(a2 + 8) + 120LL), (_BYTE *)a3, 0x80u) )\n    return 0;\n  if ( !(unsigned int)sub_180041EA0(a1, *(_QWORD *)(*(_QWORD *)(a2 + 8) + 120LL), (unsigned __int64 *)(a3 + 136), 0x40u) )\n    return 0;\n  if ( !(unsigned int)sub_180041D20(a1, *(_QWORD *)(*(_QWORD *)(a2 + 8) + 120LL), (unsigned int *)&Count, 1u) )\n    return 0;\n  *(_DWORD *)(a3 + 144) = Count != 0;\n  if ( !(unsigned int)sub_180042800(a1, *(_DWORD **)(*(_QWORD *)(a2 + 8) + 120LL), 0x817u)\n    || !(unsigned int)sub_180041D20(a1, *(_QWORD *)(*(_QWORD *)(a2 + 8) + 120LL), (unsigned int *)&Count, 8u) )\n  {\n    return 0;\n  }\n  v6 = Count;\n  *(_DWORD *)(a3 + 148) = Count;\n  if ( v6 )\n  {\n    v7 = j__calloc_base(v6, 0x28u);\n    *(_QWORD *)(a3 + 152) = v7;\n    if ( !v7 )\n    {\nLABEL_8:\n      **(_DWORD **)a2 = 8;\n      return 0;\n    }\n    v9 = 0;\n    if ( *(_DWORD *)(a3 + 148) )\n    {\n      while ( 1 )\n      {\n        v10 = *(_QWORD *)(a3 + 152) + 40 * v9;\n        if ( !(unsigned int)sub_180041EA0(a1, *(_QWORD *)(*(_QWORD *)(a2 + 8) + 120LL), (unsigned __int64 *)v10, 0x40u) )\n          return 0;\n        if ( !(unsigned int)sub_180041D20(a1, *(_QWORD *)(*(_QWORD *)(a2 + 8) + 120LL), (unsigned int *)&Count, 8u) )\n          return 0;\n        *(_BYTE *)(v10 + 8) = Count;\n        if ( !(unsigned int)sub_180041BB0(a1, *(_QWORD *)(*(_QWORD *)(a2 + 8) + 120LL), (_BYTE *)(v10 + 9), 0xCu) )\n          return 0;\n        if ( !(unsigned int)sub_180041D20(a1, *(_QWORD *)(*(_QWORD *)(a2 + 8) + 120LL), (unsigned int *)&Count, 1u) )\n          return 0;\n        *(_DWORD *)(v10 + 24) ^= (*(_DWORD *)(v10 + 24) ^ Count) & 1;\n        if ( !(unsigned int)sub_180041D20(a1, *(_QWORD *)(*(_QWORD *)(a2 + 8) + 120LL), (unsigned int *)&Count, 1u) )\n          return 0;\n        *(_DWORD *)(v10 + 24) ^= (*(_DWORD *)(v10 + 24) ^ (2 * Count)) & 2;\n        if ( !(unsigned int)sub_180042800(a1, *(_DWORD **)(*(_QWORD *)(a2 + 8) + 120LL), 0x6Eu)\n          || !(unsigned int)sub_180041D20(a1, *(_QWORD *)(*(_QWORD *)(a2 + 8) + 120LL), (unsigned int *)&Count, 8u) )\n        {\n          return 0;\n        }\n        *(_BYTE *)(v10 + 28) = Count;\n        if ( (_BYTE)Count )\n        {\n          v11 = j__calloc_base((unsigned __int8)Count, 0x10u);\n          *(_QWORD *)(v10 + 32) = v11;\n          if ( !v11 )\n            goto LABEL_8;\n          v12 = 0;\n          if ( *(_BYTE *)(v10 + 28) )\n          {\n            do\n            {\n              v13 = *(_QWORD *)(v10 + 32) + 16LL * v12;\n              if ( !(unsigned int)sub_180041EA0(\n                                    a1,\n                                    *(_QWORD *)(*(_QWORD *)(a2 + 8) + 120LL),\n                                    (unsigned __int64 *)v13,\n                                    0x40u) )\n                return 0;\n              if ( !(unsigned int)sub_180041D20(\n                                    a1,\n                                    *(_QWORD *)(*(_QWORD *)(a2 + 8) + 120LL),\n                                    (unsigned int *)&Count,\n                                    8u) )\n                return 0;\n              *(_BYTE *)(v13 + 8) = Count;\n              if ( !(unsigned int)sub_180042800(a1, *(_DWORD **)(*(_QWORD *)(a2 + 8) + 120LL), 0x18u) )\n                return 0;\n            }\n            while ( ++v12 < *(unsigned __int8 *)(v10 + 28) );\n          }\n        }\n        v9 = (unsigned int)(v9 + 1);\n        if ( (unsigned int)v9 >= *(_DWORD *)(a3 + 148) )\n          return 1;\n      }\n    }\n  }\n  return 1;\n}", "assembly": "; \n; sub_180046250 from 0x180046250 to 0x1800465a1 (849 bytes)\n; \n; 3 xrefs:\n; > sub_180045B60 @ 0x18004603e\n; > <???> @ 0x1801f81f0\n; > <???> @ 0x1801f81fc\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, 0x180046250\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x180046255\npush    rsi                                                            ; +0xa, 0x18004625a\npush    rdi                                                            ; +0xb, 0x18004625b\npush    r13                                                            ; +0xc, 0x18004625c\npush    r14                                                            ; +0xe, 0x18004625e\npush    r15                                                            ; +0x10, 0x180046260\nsub     rsp, 20h                                                       ; +0x12, 0x180046262\nmov     r13, r8                                                        ; +0x16, 0x180046266\nmov     rsi, rdx                                                       ; +0x19, 0x180046269\nmov     rbp, rcx                                                       ; +0x1c, 0x18004626c\nxor     edx, edx; Val                                                  ; +0x1f, 0x18004626f\nmov     rcx, r13; void *                                               ; +0x21, 0x180046271\nmov     r8d, 0A0h; Size                                                ; +0x24, 0x180046274\ncall    memset                                                         ; +0x2a, 0x18004627a\nmov     rdx, [rsi+8]                                                   ; +0x2f, 0x18004627f\nmov     r8, r13                                                        ; +0x33, 0x180046283\nmov     r9d, cs:dword_18016599C                                        ; +0x36, 0x180046286\nmov     rcx, rbp                                                       ; +0x3d, 0x18004628d\nshr     r9d, 3                                                         ; +0x40, 0x180046290\nmov     rdx, [rdx+78h]                                                 ; +0x44, 0x180046294\ncall    sub_180041BB0                                                  ; +0x48, 0x180046298\ntest    eax, eax                                                       ; +0x4d, 0x18004629d\njz      loc_18004636A                                                  ; +0x4f, 0x18004629f\nmov     rdx, [rsi+8]                                                   ; +0x55, 0x1800462a5\nlea     r8, [r13+88h]                                                  ; +0x59, 0x1800462a9\nmov     r9d, cs:dword_1801659A0                                        ; +0x60, 0x1800462b0\nmov     rcx, rbp                                                       ; +0x67, 0x1800462b7\nmov     rdx, [rdx+78h]                                                 ; +0x6a, 0x1800462ba\ncall    sub_180041EA0                                                  ; +0x6e, 0x1800462be\ntest    eax, eax                                                       ; +0x73, 0x1800462c3\njz      loc_18004636A                                                  ; +0x75, 0x1800462c5\nmov     rdx, [rsi+8]                                                   ; +0x7b, 0x1800462cb\nlea     r8, [rsp+48h+Count]                                            ; +0x7f, 0x1800462cf\nmov     r9d, cs:dword_1801659A4                                        ; +0x84, 0x1800462d4\nmov     rcx, rbp                                                       ; +0x8b, 0x1800462db\nmov     rdx, [rdx+78h]                                                 ; +0x8e, 0x1800462de\ncall    sub_180041D20                                                  ; +0x92, 0x1800462e2\ntest    eax, eax                                                       ; +0x97, 0x1800462e7\njz      short loc_18004636A                                            ; +0x99, 0x1800462e9\nxor     eax, eax                                                       ; +0x9b, 0x1800462eb\nmov     rcx, rbp                                                       ; +0x9d, 0x1800462ed\ncmp     dword ptr [rsp+48h+Count], eax                                 ; +0xa0, 0x1800462f0\nsetnz   al                                                             ; +0xa4, 0x1800462f4\nmov     [r13+90h], eax                                                 ; +0xa7, 0x1800462f7\nmov     rdx, [rsi+8]                                                   ; +0xae, 0x1800462fe\nmov     r8d, cs:dword_1801659A8                                        ; +0xb2, 0x180046302\nmov     rdx, [rdx+78h]                                                 ; +0xb9, 0x180046309\ncall    sub_180042800                                                  ; +0xbd, 0x18004630d\ntest    eax, eax                                                       ; +0xc2, 0x180046312\njz      short loc_18004636A                                            ; +0xc4, 0x180046314\nmov     rdx, [rsi+8]                                                   ; +0xc6, 0x180046316\nlea     r8, [rsp+48h+Count]                                            ; +0xca, 0x18004631a\nmov     r9d, cs:dword_1801659AC                                        ; +0xcf, 0x18004631f\nmov     rcx, rbp                                                       ; +0xd6, 0x180046326\nmov     rdx, [rdx+78h]                                                 ; +0xd9, 0x180046329\ncall    sub_180041D20                                                  ; +0xdd, 0x18004632d\ntest    eax, eax                                                       ; +0xe2, 0x180046332\njz      short loc_18004636A                                            ; +0xe4, 0x180046334\nmov     eax, dword ptr [rsp+48h+Count]                                 ; +0xe6, 0x180046336\nmov     [r13+94h], eax                                                 ; +0xea, 0x18004633a\ntest    eax, eax                                                       ; +0xf1, 0x180046341\njz      loc_180046597                                                  ; +0xf3, 0x180046343\nmov     ecx, eax; Count                                                ; +0xf9, 0x180046349\nmov     edx, 28h ; '('; Size                                           ; +0xfb, 0x18004634b\ncall    j__calloc_base                                                 ; +0x100, 0x180046350\nmov     [r13+98h], rax                                                 ; +0x105, 0x180046355\ntest    rax, rax                                                       ; +0x10c, 0x18004635c\njnz     short loc_180046383                                            ; +0x10f, 0x18004635f\nmov     rax, [rsi]                                                     ; +0x111, 0x180046361\nmov     dword ptr [rax], 8                                             ; +0x114, 0x180046364\nxor     eax, eax                                                       ; +0x11a, 0x18004636a\nmov     rbx, [rsp+48h+arg_0]                                           ; +0x11c, 0x18004636c\nmov     rbp, [rsp+48h+arg_10]                                          ; +0x121, 0x180046371\nadd     rsp, 20h                                                       ; +0x126, 0x180046376\npop     r15                                                            ; +0x12a, 0x18004637a\npop     r14                                                            ; +0x12c, 0x18004637c\npop     r13                                                            ; +0x12e, 0x18004637e\npop     rdi                                                            ; +0x130, 0x180046380\npop     rsi                                                            ; +0x131, 0x180046381\nretn                                                                   ; +0x132, 0x180046382\nxor     r15d, r15d                                                     ; +0x133, 0x180046383\ncmp     [r13+94h], r15d                                                ; +0x136, 0x180046386\njbe     loc_180046597                                                  ; +0x13d, 0x18004638d\nnop     dword ptr [rax+00h]                                            ; +0x143, 0x180046393\nnop     word ptr [rax+rax+00000000h]                                   ; +0x147, 0x180046397\nmov     rax, [r13+98h]                                                 ; +0x150, 0x1800463a0\nlea     rcx, [r15+r15*4]                                               ; +0x157, 0x1800463a7\nmov     rdx, [rsi+8]                                                   ; +0x15b, 0x1800463ab\nmov     r9d, cs:dword_180165980                                        ; +0x15f, 0x1800463af\nlea     rdi, [rax+rcx*8]                                               ; +0x166, 0x1800463b6\nmov     rcx, rbp                                                       ; +0x16a, 0x1800463ba\nmov     rdx, [rdx+78h]                                                 ; +0x16d, 0x1800463bd\nmov     r8, rdi                                                        ; +0x171, 0x1800463c1\ncall    sub_180041EA0                                                  ; +0x174, 0x1800463c4\ntest    eax, eax                                                       ; +0x179, 0x1800463c9\njz      short loc_18004636A                                            ; +0x17b, 0x1800463cb\nmov     rdx, [rsi+8]                                                   ; +0x17d, 0x1800463cd\nlea     r8, [rsp+48h+Count]                                            ; +0x181, 0x1800463d1\nmov     r9d, cs:dword_180165984                                        ; +0x186, 0x1800463d6\nmov     rcx, rbp                                                       ; +0x18d, 0x1800463dd\nmov     rdx, [rdx+78h]                                                 ; +0x190, 0x1800463e0\ncall    sub_180041D20                                                  ; +0x194, 0x1800463e4\ntest    eax, eax                                                       ; +0x199, 0x1800463e9\njz      loc_18004636A                                                  ; +0x19b, 0x1800463eb\nmovzx   eax, byte ptr [rsp+48h+Count]                                  ; +0x1a1, 0x1800463f1\nlea     r8, [rdi+9]                                                    ; +0x1a6, 0x1800463f6\nmov     [rdi+8], al                                                    ; +0x1aa, 0x1800463fa\nmov     rcx, rbp                                                       ; +0x1ad, 0x1800463fd\nmov     rdx, [rsi+8]                                                   ; +0x1b0, 0x180046400\nmov     r9d, cs:dword_180165988                                        ; +0x1b4, 0x180046404\nshr     r9d, 3                                                         ; +0x1bb, 0x18004640b\nmov     rdx, [rdx+78h]                                                 ; +0x1bf, 0x18004640f\ncall    sub_180041BB0                                                  ; +0x1c3, 0x180046413\ntest    eax, eax                                                       ; +0x1c8, 0x180046418\njz      loc_18004636A                                                  ; +0x1ca, 0x18004641a\nmov     rdx, [rsi+8]                                                   ; +0x1d0, 0x180046420\nlea     r8, [rsp+48h+Count]                                            ; +0x1d4, 0x180046424\nmov     r9d, cs:dword_18016598C                                        ; +0x1d9, 0x180046429\nmov     rcx, rbp                                                       ; +0x1e0, 0x180046430\nmov     rdx, [rdx+78h]                                                 ; +0x1e3, 0x180046433\ncall    sub_180041D20                                                  ; +0x1e7, 0x180046437\ntest    eax, eax                                                       ; +0x1ec, 0x18004643c\njz      loc_18004636A                                                  ; +0x1ee, 0x18004643e\nmov     eax, dword ptr [rsp+48h+Count]                                 ; +0x1f4, 0x180046444\nlea     r8, [rsp+48h+Count]                                            ; +0x1f8, 0x180046448\nxor     eax, [rdi+18h]                                                 ; +0x1fd, 0x18004644d\nmov     rcx, rbp                                                       ; +0x200, 0x180046450\nand     eax, 1                                                         ; +0x203, 0x180046453\nxor     [rdi+18h], eax                                                 ; +0x206, 0x180046456\nmov     rdx, [rsi+8]                                                   ; +0x209, 0x180046459\nmov     r9d, cs:dword_180165990                                        ; +0x20d, 0x18004645d\nmov     rdx, [rdx+78h]                                                 ; +0x214, 0x180046464\ncall    sub_180041D20                                                  ; +0x218, 0x180046468\ntest    eax, eax                                                       ; +0x21d, 0x18004646d\njz      loc_18004636A                                                  ; +0x21f, 0x18004646f\nmov     eax, dword ptr [rsp+48h+Count]                                 ; +0x225, 0x180046475\nmov     rcx, rbp                                                       ; +0x229, 0x180046479\nadd     eax, eax                                                       ; +0x22c, 0x18004647c\nxor     eax, [rdi+18h]                                                 ; +0x22e, 0x18004647e\nand     eax, 2                                                         ; +0x231, 0x180046481\nxor     [rdi+18h], eax                                                 ; +0x234, 0x180046484\nmov     rdx, [rsi+8]                                                   ; +0x237, 0x180046487\nmov     r8d, cs:dword_180165994                                        ; +0x23b, 0x18004648b\nmov     rdx, [rdx+78h]                                                 ; +0x242, 0x180046492\ncall    sub_180042800                                                  ; +0x246, 0x180046496\ntest    eax, eax                                                       ; +0x24b, 0x18004649b\njz      loc_18004636A                                                  ; +0x24d, 0x18004649d\nmov     rdx, [rsi+8]                                                   ; +0x253, 0x1800464a3\nlea     r8, [rsp+48h+Count]                                            ; +0x257, 0x1800464a7\nmov     r9d, cs:dword_180165998                                        ; +0x25c, 0x1800464ac\nmov     rcx, rbp                                                       ; +0x263, 0x1800464b3\nmov     rdx, [rdx+78h]                                                 ; +0x266, 0x1800464b6\ncall    sub_180041D20                                                  ; +0x26a, 0x1800464ba\ntest    eax, eax                                                       ; +0x26f, 0x1800464bf\njz      loc_18004636A                                                  ; +0x271, 0x1800464c1\nmovzx   eax, byte ptr [rsp+48h+Count]                                  ; +0x277, 0x1800464c7\nmov     [rdi+1Ch], al                                                  ; +0x27c, 0x1800464cc\nmov     eax, dword ptr [rsp+48h+Count]                                 ; +0x27f, 0x1800464cf\ntest    al, al                                                         ; +0x283, 0x1800464d3\njz      loc_180046587                                                  ; +0x285, 0x1800464d5\nmovzx   ecx, al; Count                                                 ; +0x28b, 0x1800464db\nmov     edx, 10h; Size                                                 ; +0x28e, 0x1800464de\ncall    j__calloc_base                                                 ; +0x293, 0x1800464e3\nmov     [rdi+20h], rax                                                 ; +0x298, 0x1800464e8\ntest    rax, rax                                                       ; +0x29c, 0x1800464ec\njz      loc_180046361                                                  ; +0x29f, 0x1800464ef\nxor     ebx, ebx                                                       ; +0x2a5, 0x1800464f5\ncmp     [rdi+1Ch], bl                                                  ; +0x2a7, 0x1800464f7\njbe     loc_180046587                                                  ; +0x2aa, 0x1800464fa\nmov     rdx, [rsi+8]                                                   ; +0x2b0, 0x180046500\nmov     rcx, rbp                                                       ; +0x2b4, 0x180046504\nmov     r9d, cs:dword_180165974                                        ; +0x2b7, 0x180046507\nmov     r14d, ebx                                                      ; +0x2be, 0x18004650e\nshl     r14, 4                                                         ; +0x2c1, 0x180046511\nadd     r14, [rdi+20h]                                                 ; +0x2c5, 0x180046515\nmov     rdx, [rdx+78h]                                                 ; +0x2c9, 0x180046519\nmov     r8, r14                                                        ; +0x2cd, 0x18004651d\ncall    sub_180041EA0                                                  ; +0x2d0, 0x180046520\ntest    eax, eax                                                       ; +0x2d5, 0x180046525\njz      loc_18004636A                                                  ; +0x2d7, 0x180046527\nmov     rdx, [rsi+8]                                                   ; +0x2dd, 0x18004652d\nlea     r8, [rsp+48h+Count]                                            ; +0x2e1, 0x180046531\nmov     r9d, cs:dword_180165978                                        ; +0x2e6, 0x180046536\nmov     rcx, rbp                                                       ; +0x2ed, 0x18004653d\nmov     rdx, [rdx+78h]                                                 ; +0x2f0, 0x180046540\ncall    sub_180041D20                                                  ; +0x2f4, 0x180046544\ntest    eax, eax                                                       ; +0x2f9, 0x180046549\njz      loc_18004636A                                                  ; +0x2fb, 0x18004654b\nmovzx   eax, byte ptr [rsp+48h+Count]                                  ; +0x301, 0x180046551\nmov     rcx, rbp                                                       ; +0x306, 0x180046556\nmov     [r14+8], al                                                    ; +0x309, 0x180046559\nmov     rdx, [rsi+8]                                                   ; +0x30d, 0x18004655d\nmov     r8d, cs:dword_18016597C                                        ; +0x311, 0x180046561\nmov     rdx, [rdx+78h]                                                 ; +0x318, 0x180046568\ncall    sub_180042800                                                  ; +0x31c, 0x18004656c\ntest    eax, eax                                                       ; +0x321, 0x180046571\njz      loc_18004636A                                                  ; +0x323, 0x180046573\nmovzx   eax, byte ptr [rdi+1Ch]                                        ; +0x329, 0x180046579\ninc     ebx                                                            ; +0x32d, 0x18004657d\ncmp     ebx, eax                                                       ; +0x32f, 0x18004657f\njb      loc_180046500                                                  ; +0x331, 0x180046581\ninc     r15d                                                           ; +0x337, 0x180046587\ncmp     r15d, [r13+94h]                                                ; +0x33a, 0x18004658a\njb      loc_1800463A0                                                  ; +0x341, 0x180046591\nmov     eax, 1                                                         ; +0x347, 0x180046597\njmp     loc_18004636C                                                  ; +0x34c, 0x18004659c", "xrefs": ["sub_180045B60 @ 0x18004603e", "<???> @ 0x1801f81f0", "<???> @ 0x1801f81fc"], "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"}