{"type": "func", "start": 6442740752, "end": 6442741453, "name": "sub_180046C10", "pseudocode": "// \n// sub_180046C10 from 0x180046c10 to 0x180046ecd (701 bytes)\n// \n// 5 xrefs:\n// > sub_180047260 @ 0x18004743f\n// > sub_1800474C0 @ 0x1800477a5\n// > <???> @ 0x180181028\n// > <???> @ 0x180181064\n// > <???> @ 0x1801f822c\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__int64 __fastcall sub_180046C10(\n        __int64 a1,\n        __int64 a2,\n        unsigned int a3,\n        unsigned int a4,\n        _QWORD *a5,\n        __int64 a6,\n        unsigned int a7)\n{\n  __int64 v7; // r10\n  int v10; // r15d\n  unsigned int v11; // esi\n  int v12; // ebp\n  int v13; // edi\n  unsigned int v14; // esi\n  int v16; // edx\n  int v17; // edx\n  _QWORD *v18; // rbx\n  unsigned int v19; // edx\n  __int64 v20; // rdi\n  unsigned int v21; // ebp\n  __int64 v22; // r15\n  unsigned int v23; // ebx\n  unsigned int v24; // ebx\n  unsigned int v25; // [rsp+30h] [rbp-48h]\n  unsigned int v26; // [rsp+34h] [rbp-44h]\n  int v27; // [rsp+38h] [rbp-40h] BYREF\n  unsigned int v28; // [rsp+3Ch] [rbp-3Ch]\n\n  v7 = *(_QWORD *)(a2 + 8);\n  v10 = 1 << a4;\n  v11 = *(_DWORD *)(v7 + 1368);\n  v28 = 1 << a4;\n  if ( a4 )\n  {\n    v12 = 4;\n    v13 = 15;\n    v14 = v11 >> a4;\n    if ( a7 )\n    {\n      v12 = 5;\n      v13 = 31;\n    }\n    v25 = v12;\n    v26 = v13;\n    if ( v14 < a3 )\n    {\n      if ( !*(_DWORD *)(v7 + 4112) )\n        (*(void (__fastcall **)(__int64, _QWORD, _QWORD))(v7 + 56))(a2, 0, *(_QWORD *)(v7 + 104));\n      **(_DWORD **)a2 = 2;\n      return 1;\n    }\n  }\n  else\n  {\n    v16 = 4;\n    if ( a7 )\n      v16 = 5;\n    v25 = v16;\n    v17 = 15;\n    if ( a7 )\n      v17 = 31;\n    v26 = v17;\n    if ( v11 < a3 )\n    {\n      if ( !*(_DWORD *)(v7 + 4112) )\n        (*(void (__fastcall **)(__int64, _QWORD, _QWORD))(v7 + 56))(a2, 0, *(_QWORD *)(v7 + 104));\n      **(_DWORD **)a2 = 2;\n      return 1;\n    }\n    v14 = v11 - a3;\n  }\n  v18 = a5;\n  v19 = a4;\n  if ( a4 < 6 )\n    v19 = 6;\n  if ( (unsigned int)sub_180042E20((__int64)a5, v19) )\n  {\n    v20 = 0;\n    v21 = 0;\n    if ( v10 )\n    {\n      v22 = 0;\n      while ( (unsigned int)sub_180041D20(a1, *(_QWORD *)(*(_QWORD *)(a2 + 8) + 120LL), &a7, v25) )\n      {\n        *(_DWORD *)(v22 + *v18) = a7;\n        if ( a7 >= v26 )\n        {\n          if ( !(unsigned int)sub_180041D20(a1, *(_QWORD *)(*(_QWORD *)(a2 + 8) + 120LL), &a7, 5u) )\n            return 0;\n          *(_DWORD *)(v22 + v18[1]) = a7;\n          if ( !a4 || v21 )\n            v24 = 0;\n          else\n            v24 = a3;\n          if ( v24 < v14 )\n          {\n            while ( (unsigned int)sub_180041CD0(a1, *(_QWORD *)(*(_QWORD *)(a2 + 8) + 120LL), &v27, a7) )\n            {\n              ++v24;\n              *(_DWORD *)(a6 + 4 * v20) = v27;\n              v20 = (unsigned int)(v20 + 1);\n              if ( v24 >= v14 )\n                goto LABEL_39;\n            }\n            return 0;\n          }\n        }\n        else\n        {\n          *(_DWORD *)(v22 + v18[1]) = 0;\n          if ( !a4 || v21 )\n            v23 = v14;\n          else\n            v23 = v14 - a3;\n          if ( !(*(unsigned int (__fastcall **)(__int64, _QWORD, __int64, _QWORD, unsigned int))(*(_QWORD *)(a2 + 8)\n                                                                                               + 96LL))(\n                  a1,\n                  *(_QWORD *)(*(_QWORD *)(a2 + 8) + 120LL),\n                  a6 + 4 * v20,\n                  v23,\n                  a7) )\n            return 0;\n          v20 = v23 + (unsigned int)v20;\n        }\nLABEL_39:\n        v18 = a5;\n        ++v21;\n        v22 += 4;\n        if ( v21 >= v28 )\n          return 1;\n      }\n      return 0;\n    }\n    else\n    {\n      return 1;\n    }\n  }\n  else\n  {\n    **(_DWORD **)a2 = 8;\n    return 0;\n  }\n}", "assembly": "; \n; sub_180046C10 from 0x180046c10 to 0x180046ecd (701 bytes)\n; \n; 5 xrefs:\n; > sub_180047260 @ 0x18004743f\n; > sub_1800474C0 @ 0x1800477a5\n; > <???> @ 0x180181028\n; > <???> @ 0x180181064\n; > <???> @ 0x1801f822c\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_18], r9d                                              ; +0x0, 0x180046c10\nmov     [rsp+arg_10], r8d                                              ; +0x5, 0x180046c15\npush    rbp                                                            ; +0xa, 0x180046c1a\npush    rsi                                                            ; +0xb, 0x180046c1b\npush    rdi                                                            ; +0xc, 0x180046c1c\npush    r13                                                            ; +0xd, 0x180046c1d\npush    r14                                                            ; +0xf, 0x180046c1f\npush    r15                                                            ; +0x11, 0x180046c21\nsub     rsp, 48h                                                       ; +0x13, 0x180046c23\nmov     r10, [rdx+8]                                                   ; +0x17, 0x180046c27\nmov     r13, rcx                                                       ; +0x1b, 0x180046c2b\nmov     eax, [rsp+78h+arg_30]                                          ; +0x1e, 0x180046c2e\nmov     ecx, r9d                                                       ; +0x25, 0x180046c35\nmov     r15d, 1                                                        ; +0x28, 0x180046c38\nmov     r14, rdx                                                       ; +0x2e, 0x180046c3e\nshl     r15d, cl                                                       ; +0x31, 0x180046c41\nmov     esi, [r10+558h]                                                ; +0x34, 0x180046c44\nmov     [rsp+78h+var_3C], r15d                                         ; +0x3b, 0x180046c4b\ntest    r9d, r9d                                                       ; +0x40, 0x180046c50\njz      short loc_180046CB7                                            ; +0x43, 0x180046c53\nmov     ebp, cs:dword_180165840                                        ; +0x45, 0x180046c55\nmov     edi, cs:dword_18016584C                                        ; +0x4b, 0x180046c5b\nshr     esi, cl                                                        ; +0x51, 0x180046c61\ntest    eax, eax                                                       ; +0x53, 0x180046c63\ncmovnz  ebp, cs:dword_180165844                                        ; +0x55, 0x180046c65\ncmovnz  edi, cs:dword_180165850                                        ; +0x5c, 0x180046c6c\nmov     [rsp+78h+var_48], ebp                                          ; +0x63, 0x180046c73\nmov     [rsp+78h+var_44], edi                                          ; +0x67, 0x180046c77\ncmp     esi, r8d                                                       ; +0x6b, 0x180046c7b\njnb     loc_180046D1A                                                  ; +0x6e, 0x180046c7e\ncmp     dword ptr [r10+1010h], 0                                       ; +0x74, 0x180046c84\njnz     short loc_180046C9B                                            ; +0x7c, 0x180046c8c\nmov     r8, [r10+68h]                                                  ; +0x7e, 0x180046c8e\nxor     edx, edx                                                       ; +0x82, 0x180046c92\nmov     rcx, r14                                                       ; +0x84, 0x180046c94\ncall    qword ptr [r10+38h]                                            ; +0x87, 0x180046c97\nmov     rcx, [r14]                                                     ; +0x8b, 0x180046c9b\nmov     eax, 1                                                         ; +0x8e, 0x180046c9e\nmov     dword ptr [rcx], 2                                             ; +0x93, 0x180046ca3\nadd     rsp, 48h                                                       ; +0x99, 0x180046ca9\npop     r15                                                            ; +0x9d, 0x180046cad\npop     r14                                                            ; +0x9f, 0x180046caf\npop     r13                                                            ; +0xa1, 0x180046cb1\npop     rdi                                                            ; +0xa3, 0x180046cb3\npop     rsi                                                            ; +0xa4, 0x180046cb4\npop     rbp                                                            ; +0xa5, 0x180046cb5\nretn                                                                   ; +0xa6, 0x180046cb6\nmov     edx, cs:dword_180165840                                        ; +0xa7, 0x180046cb7\nmov     ecx, esi                                                       ; +0xad, 0x180046cbd\nsub     ecx, r8d                                                       ; +0xaf, 0x180046cbf\ntest    eax, eax                                                       ; +0xb2, 0x180046cc2\ncmovnz  edx, cs:dword_180165844                                        ; +0xb4, 0x180046cc4\nmov     [rsp+78h+var_48], edx                                          ; +0xbb, 0x180046ccb\nmov     edx, cs:dword_18016584C                                        ; +0xbf, 0x180046ccf\ncmovnz  edx, cs:dword_180165850                                        ; +0xc5, 0x180046cd5\nmov     [rsp+78h+var_44], edx                                          ; +0xcc, 0x180046cdc\ncmp     esi, r8d                                                       ; +0xd0, 0x180046ce0\njnb     short loc_180046D18                                            ; +0xd3, 0x180046ce3\ncmp     dword ptr [r10+1010h], 0                                       ; +0xd5, 0x180046ce5\njnz     short loc_180046CFC                                            ; +0xdd, 0x180046ced\nmov     r8, [r10+68h]                                                  ; +0xdf, 0x180046cef\nxor     edx, edx                                                       ; +0xe3, 0x180046cf3\nmov     rcx, r14                                                       ; +0xe5, 0x180046cf5\ncall    qword ptr [r10+38h]                                            ; +0xe8, 0x180046cf8\nmov     rax, [r14]                                                     ; +0xec, 0x180046cfc\nmov     dword ptr [rax], 2                                             ; +0xef, 0x180046cff\nmov     eax, 1                                                         ; +0xf5, 0x180046d05\nadd     rsp, 48h                                                       ; +0xfa, 0x180046d0a\npop     r15                                                            ; +0xfe, 0x180046d0e\npop     r14                                                            ; +0x100, 0x180046d10\npop     r13                                                            ; +0x102, 0x180046d12\npop     rdi                                                            ; +0x104, 0x180046d14\npop     rsi                                                            ; +0x105, 0x180046d15\npop     rbp                                                            ; +0x106, 0x180046d16\nretn                                                                   ; +0x107, 0x180046d17\nmov     esi, ecx                                                       ; +0x108, 0x180046d18\nmov     eax, 6                                                         ; +0x10a, 0x180046d1a\nmov     [rsp+78h+arg_0], rbx                                           ; +0x10f, 0x180046d1f\nmov     rbx, [rsp+78h+arg_20]                                          ; +0x117, 0x180046d27\ncmp     r9d, eax                                                       ; +0x11f, 0x180046d2f\nmov     edx, r9d                                                       ; +0x122, 0x180046d32\nmov     rcx, rbx                                                       ; +0x125, 0x180046d35\ncmovb   edx, eax                                                       ; +0x128, 0x180046d38\ncall    sub_180042E20                                                  ; +0x12b, 0x180046d3b\ntest    eax, eax                                                       ; +0x130, 0x180046d40\njnz     short loc_180046D54                                            ; +0x132, 0x180046d42\nmov     rax, [r14]                                                     ; +0x134, 0x180046d44\nmov     dword ptr [rax], 8                                             ; +0x137, 0x180046d47\nxor     eax, eax                                                       ; +0x13d, 0x180046d4d\njmp     loc_180046EB3                                                  ; +0x13f, 0x180046d4f\nxor     edi, edi                                                       ; +0x144, 0x180046d54\nmov     [rsp+78h+var_38], r12                                          ; +0x146, 0x180046d56\nxor     ebp, ebp                                                       ; +0x14b, 0x180046d5b\ntest    r15d, r15d                                                     ; +0x14d, 0x180046d5d\njz      loc_180046EA9                                                  ; +0x150, 0x180046d60\nmov     r12, [rsp+78h+arg_28]                                          ; +0x156, 0x180046d66\nxor     r15d, r15d                                                     ; +0x15e, 0x180046d6e\nmov     rdx, [r14+8]                                                   ; +0x161, 0x180046d71\nlea     r8, [rsp+78h+arg_30]                                           ; +0x165, 0x180046d75\nmov     r9d, [rsp+78h+var_48]                                          ; +0x16d, 0x180046d7d\nmov     rcx, r13                                                       ; +0x172, 0x180046d82\nmov     rdx, [rdx+78h]                                                 ; +0x175, 0x180046d85\ncall    sub_180041D20                                                  ; +0x179, 0x180046d89\ntest    eax, eax                                                       ; +0x17e, 0x180046d8e\njz      loc_180046EC9                                                  ; +0x180, 0x180046d90\nmov     eax, [rsp+78h+arg_30]                                          ; +0x186, 0x180046d96\nmov     rcx, [rbx]                                                     ; +0x18d, 0x180046d9d\nmov     [r15+rcx], eax                                                 ; +0x190, 0x180046da0\nmov     eax, [rsp+78h+var_44]                                          ; +0x194, 0x180046da4\ncmp     [rsp+78h+arg_30], eax                                          ; +0x198, 0x180046da8\njnb     short loc_180046E08                                            ; +0x19f, 0x180046daf\ncmp     [rsp+78h+arg_18], 0                                            ; +0x1a1, 0x180046db1\nmov     rax, [rbx+8]                                                   ; +0x1a9, 0x180046db9\nmov     dword ptr [r15+rax], 0                                         ; +0x1ad, 0x180046dbd\njz      short loc_180046DD6                                            ; +0x1b5, 0x180046dc5\ntest    ebp, ebp                                                       ; +0x1b7, 0x180046dc7\njnz     short loc_180046DD6                                            ; +0x1b9, 0x180046dc9\nmov     ebx, esi                                                       ; +0x1bb, 0x180046dcb\nsub     ebx, [rsp+78h+arg_10]                                          ; +0x1bd, 0x180046dcd\njmp     short loc_180046DD8                                            ; +0x1c4, 0x180046dd4\nmov     ebx, esi                                                       ; +0x1c6, 0x180046dd6\nmov     r10, [r14+8]                                                   ; +0x1c8, 0x180046dd8\nlea     r8, [r12+rdi*4]                                                ; +0x1cc, 0x180046ddc\nmov     eax, [rsp+78h+arg_30]                                          ; +0x1d0, 0x180046de0\nmov     r9d, ebx                                                       ; +0x1d7, 0x180046de7\nmov     rcx, r13                                                       ; +0x1da, 0x180046dea\nmov     [rsp+78h+var_58], eax                                          ; +0x1dd, 0x180046ded\nmov     rdx, [r10+78h]                                                 ; +0x1e1, 0x180046df1\ncall    qword ptr [r10+60h]                                            ; +0x1e5, 0x180046df5\ntest    eax, eax                                                       ; +0x1e9, 0x180046df9\njz      loc_180046EC9                                                  ; +0x1eb, 0x180046dfb\nadd     edi, ebx                                                       ; +0x1f1, 0x180046e01\njmp     loc_180046E91                                                  ; +0x1f3, 0x180046e03\nmov     rdx, [r14+8]                                                   ; +0x1f8, 0x180046e08\nlea     r8, [rsp+78h+arg_30]                                           ; +0x1fc, 0x180046e0c\nmov     r9d, cs:dword_180165848                                        ; +0x204, 0x180046e14\nmov     rcx, r13                                                       ; +0x20b, 0x180046e1b\nmov     rdx, [rdx+78h]                                                 ; +0x20e, 0x180046e1e\ncall    sub_180041D20                                                  ; +0x212, 0x180046e22\ntest    eax, eax                                                       ; +0x217, 0x180046e27\njz      loc_180046EC9                                                  ; +0x219, 0x180046e29\ncmp     [rsp+78h+arg_18], 0                                            ; +0x21f, 0x180046e2f\nmov     rcx, [rbx+8]                                                   ; +0x227, 0x180046e37\nmov     eax, [rsp+78h+arg_30]                                          ; +0x22b, 0x180046e3b\nmov     [r15+rcx], eax                                                 ; +0x232, 0x180046e42\njz      short loc_180046E55                                            ; +0x236, 0x180046e46\ntest    ebp, ebp                                                       ; +0x238, 0x180046e48\njnz     short loc_180046E55                                            ; +0x23a, 0x180046e4a\nmov     ebx, [rsp+78h+arg_10]                                          ; +0x23c, 0x180046e4c\njmp     short loc_180046E57                                            ; +0x243, 0x180046e53\nxor     ebx, ebx                                                       ; +0x245, 0x180046e55\ncmp     ebx, esi                                                       ; +0x247, 0x180046e57\njnb     short loc_180046E91                                            ; +0x249, 0x180046e59\nnop     dword ptr [rax+rax+00h]                                        ; +0x24b, 0x180046e5b\nmov     rdx, [r14+8]                                                   ; +0x250, 0x180046e60\nlea     r8, [rsp+78h+var_40]                                           ; +0x254, 0x180046e64\nmov     r9d, [rsp+78h+arg_30]                                          ; +0x259, 0x180046e69\nmov     rcx, r13                                                       ; +0x261, 0x180046e71\nmov     rdx, [rdx+78h]                                                 ; +0x264, 0x180046e74\ncall    sub_180041CD0                                                  ; +0x268, 0x180046e78\ntest    eax, eax                                                       ; +0x26d, 0x180046e7d\njz      short loc_180046EC9                                            ; +0x26f, 0x180046e7f\nmov     eax, [rsp+78h+var_40]                                          ; +0x271, 0x180046e81\ninc     ebx                                                            ; +0x275, 0x180046e85\nmov     [r12+rdi*4], eax                                               ; +0x277, 0x180046e87\ninc     edi                                                            ; +0x27b, 0x180046e8b\ncmp     ebx, esi                                                       ; +0x27d, 0x180046e8d\njb      short loc_180046E60                                            ; +0x27f, 0x180046e8f\nmov     rbx, [rsp+78h+arg_20]                                          ; +0x281, 0x180046e91\ninc     ebp                                                            ; +0x289, 0x180046e99\nadd     r15, 4                                                         ; +0x28b, 0x180046e9b\ncmp     ebp, [rsp+78h+var_3C]                                          ; +0x28f, 0x180046e9f\njb      loc_180046D71                                                  ; +0x293, 0x180046ea3\nmov     eax, 1                                                         ; +0x299, 0x180046ea9\nmov     r12, [rsp+78h+var_38]                                          ; +0x29e, 0x180046eae\nmov     rbx, [rsp+78h+arg_0]                                           ; +0x2a3, 0x180046eb3\nadd     rsp, 48h                                                       ; +0x2ab, 0x180046ebb\npop     r15                                                            ; +0x2af, 0x180046ebf\npop     r14                                                            ; +0x2b1, 0x180046ec1\npop     r13                                                            ; +0x2b3, 0x180046ec3\npop     rdi                                                            ; +0x2b5, 0x180046ec5\npop     rsi                                                            ; +0x2b6, 0x180046ec6\npop     rbp                                                            ; +0x2b7, 0x180046ec7\nretn                                                                   ; +0x2b8, 0x180046ec8\nxor     eax, eax                                                       ; +0x2b9, 0x180046ec9\njmp     short loc_180046EAE                                            ; +0x2bb, 0x180046ecb", "xrefs": ["sub_180047260 @ 0x18004743f", "sub_1800474C0 @ 0x1800477a5", "<???> @ 0x180181028", "<???> @ 0x180181064", "<???> @ 0x1801f822c"], "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"}