{"type": "func", "start": 6442960192, "end": 6442960802, "name": "sub_18007C540", "pseudocode": "// \n// sub_18007C540 from 0x18007c540 to 0x18007c7a2 (610 bytes)\n// \n// 2 xrefs:\n// > sub_18007C8F0 @ 0x18007cc46\n// > <???> @ 0x1801f9f18\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:35 +0000\n// \n\n__int64 __fastcall sub_18007C540(__int64 a1, void *a2, int *a3, unsigned int a4)\n{\n  int v4; // ebp\n  __int64 v6; // rcx\n  unsigned int v8; // edi\n  int v9; // r15d\n  unsigned int v10; // edx\n  __int64 v11; // r13\n  __int64 v12; // rsi\n  __int64 result; // rax\n  int v14; // ecx\n  __int64 v15; // r14\n  __int64 v16; // rax\n  unsigned int v17; // esi\n  float *v18; // rax\n  __int64 (__fastcall *v19)(__int64, void *, _QWORD, int *, unsigned int *); // rax\n  int v20; // [rsp+30h] [rbp-158h]\n  unsigned int v21; // [rsp+50h] [rbp-138h] BYREF\n  void *v22; // [rsp+58h] [rbp-130h]\n  __int64 v23; // [rsp+60h] [rbp-128h] BYREF\n  __int64 v24; // [rsp+68h] [rbp-120h]\n  int v25; // [rsp+70h] [rbp-118h]\n  _BYTE *v26; // [rsp+78h] [rbp-110h]\n  _BYTE *v27; // [rsp+80h] [rbp-108h]\n  __int128 v28; // [rsp+90h] [rbp-F8h]\n  _BYTE v29[128]; // [rsp+A0h] [rbp-E8h] BYREF\n\n  v4 = 0;\n  *(_QWORD *)(a1 + 176) = a1;\n  v22 = a2;\n  v6 = *(_QWORD *)(a1 + 680);\n  v8 = 0;\n  if ( v6 )\n  {\n    v9 = *a3;\n    v23 = *(_QWORD *)(a1 + 168);\n    v27 = v29;\n    v24 = 16;\n    v26 = v29;\n    v20 = *(_DWORD *)(a1 + 688);\n    v28 = 0;\n    v25 = 0;\n    sub_180099840(v6, (unsigned int)&v23, v6, v9, 0, v9, v20, 0);\n    if ( SHIDWORD(v24) > 0 )\n    {\n      v10 = sub_18007C870(a4);\n      v21 = v10;\n      v11 = 0;\n      while ( 1 )\n      {\n        v12 = *(_QWORD *)(*(_QWORD *)&v27[v11] + 96LL);\n        while ( 1 )\n        {\n          v8 = sub_180099C50(v12, v9, v10, a4, *(_DWORD *)(a1 + 688));\n          if ( !v8 )\n            break;\n          result = sub_1800FC680(*(_QWORD *)(a1 + 168));\n          if ( (_DWORD)result )\n            return result;\n          v10 = v21;\n        }\n        v14 = HIDWORD(v24);\n        if ( v4 == HIDWORD(v24) - 1 )\n        {\n          v15 = v12 + 312;\n          v16 = sub_180096DA0(v12 + 312);\n          v17 = v9 * *(_DWORD *)(v12 + 328);\n          if ( v16 )\n          {\n            v18 = (float *)sub_180096DA0(v15);\n            sub_180062BA0((float *)v22, v18, *(_DWORD *)(a1 + 708), 5, v17, 1u, 1, 1.0, 0);\n          }\n          else\n          {\n            memset(v22, 0, 4LL * v17);\n          }\n          sub_180098560(v15);\n          v14 = HIDWORD(v24);\n        }\n        ++v4;\n        v11 += 8;\n        if ( v4 >= v14 )\n          break;\n        v10 = v21;\n      }\n    }\n    ++*(_DWORD *)(a1 + 688);\n    sub_180098560(a1 + 312);\n  }\n  else\n  {\n    v19 = *(__int64 (__fastcall **)(__int64, void *, _QWORD, int *, unsigned int *))(a1 + 672);\n    if ( v19 )\n    {\n      v21 = a4;\n      v8 = v19(a1 + 176, a2, 0, a3, &v21);\n      if ( v8 == 16 && (*(_BYTE *)(a1 + 712) & 2) != 0 && *(_DWORD *)(a1 + 608) )\n        return 0;\n    }\n  }\n  return v8;\n}", "assembly": "; \n; sub_18007C540 from 0x18007c540 to 0x18007c7a2 (610 bytes)\n; \n; 2 xrefs:\n; > sub_18007C8F0 @ 0x18007cc46\n; > <???> @ 0x1801f9f18\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:35 +0000\n; \npush    rbx                                                            ; +0x0, 0x18007c540\npush    rbp                                                            ; +0x2, 0x18007c542\npush    rsi                                                            ; +0x3, 0x18007c543\npush    rdi                                                            ; +0x4, 0x18007c544\npush    r12                                                            ; +0x5, 0x18007c545\npush    r13                                                            ; +0x7, 0x18007c547\npush    r14                                                            ; +0x9, 0x18007c549\npush    r15                                                            ; +0xb, 0x18007c54b\nsub     rsp, 148h                                                      ; +0xd, 0x18007c54d\nmovaps  [rsp+188h+var_58], xmm6                                        ; +0x14, 0x18007c554\nmov     rax, cs:__security_cookie                                      ; +0x1c, 0x18007c55c\nxor     rax, rsp                                                       ; +0x23, 0x18007c563\nmov     [rsp+188h+var_68], rax                                         ; +0x26, 0x18007c566\nxor     ebp, ebp                                                       ; +0x2e, 0x18007c56e\nmov     [rcx+0B0h], rcx                                                ; +0x30, 0x18007c570\nmov     rbx, rcx                                                       ; +0x37, 0x18007c577\nmov     [rsp+188h+var_130], rdx                                        ; +0x3a, 0x18007c57a\nmov     rcx, [rcx+2A8h]                                                ; +0x3f, 0x18007c57f\nmov     r12d, r9d                                                      ; +0x46, 0x18007c586\nmov     edi, ebp                                                       ; +0x49, 0x18007c589\ntest    rcx, rcx                                                       ; +0x4b, 0x18007c58b\njz      loc_18007C731                                                  ; +0x4e, 0x18007c58e\nmov     r15d, [r8]                                                     ; +0x54, 0x18007c594\nlea     rdx, [rsp+188h+var_128]                                        ; +0x57, 0x18007c597\nmov     rax, [rbx+0A8h]                                                ; +0x5c, 0x18007c59c\nxorps   xmm0, xmm0                                                     ; +0x63, 0x18007c5a3\nmov     [rsp+188h+var_128], rax                                        ; +0x66, 0x18007c5a6\nmov     r9d, r15d                                                      ; +0x6b, 0x18007c5ab\nmov     [rsp+188h+var_150], rbp                                        ; +0x6e, 0x18007c5ae\nlea     rax, [rsp+188h+var_E8]                                         ; +0x73, 0x18007c5b3\nmov     [rsp+188h+var_108], rax                                        ; +0x7b, 0x18007c5bb\nmov     r8, rcx                                                        ; +0x83, 0x18007c5c3\nlea     rax, [rsp+188h+var_E8]                                         ; +0x86, 0x18007c5c6\nmov     [rsp+188h+var_120], 10h                                        ; +0x8e, 0x18007c5ce\nmov     [rsp+188h+var_110], rax                                        ; +0x97, 0x18007c5d7\nmov     eax, [rbx+2B0h]                                                ; +0x9c, 0x18007c5dc\nmov     [rsp+188h+var_158], eax                                        ; +0xa2, 0x18007c5e2\nmov     [rsp+188h+var_160], r15d                                       ; +0xa6, 0x18007c5e6\nmov     dword ptr [rsp+188h+var_168], ebp                              ; +0xab, 0x18007c5eb\nmovdqa  [rsp+188h+var_F8], xmm0                                        ; +0xaf, 0x18007c5ef\nmov     [rsp+188h+var_118], ebp                                        ; +0xb8, 0x18007c5f8\ncall    sub_180099840                                                  ; +0xbc, 0x18007c5fc\ncmp     dword ptr [rsp+188h+var_120+4], ebp                            ; +0xc1, 0x18007c601\njle     loc_18007C71D                                                  ; +0xc5, 0x18007c605\nmov     ecx, r12d                                                      ; +0xcb, 0x18007c60b\ncall    sub_18007C870                                                  ; +0xce, 0x18007c60e\nmovss   xmm6, cs:dword_180145744                                       ; +0xd3, 0x18007c613\nmov     edx, eax                                                       ; +0xdb, 0x18007c61b\nmov     [rsp+188h+var_138], eax                                        ; +0xdd, 0x18007c61d\nmov     r13d, ebp                                                      ; +0xe1, 0x18007c621\nnop     dword ptr [rax+00h]                                            ; +0xe4, 0x18007c624\nnop     dword ptr [rax+rax+00000000h]                                  ; +0xe8, 0x18007c628\nmov     rax, [rsp+188h+var_108]                                        ; +0xf0, 0x18007c630\nmov     rcx, [rax+r13]                                                 ; +0xf8, 0x18007c638\nmov     rsi, [rcx+60h]                                                 ; +0xfc, 0x18007c63c\nmov     eax, [rbx+2B0h]                                                ; +0x100, 0x18007c640\nmov     r8d, edx                                                       ; +0x106, 0x18007c646\nmov     edx, r15d                                                      ; +0x109, 0x18007c649\nmov     dword ptr [rsp+188h+var_168], eax                              ; +0x10c, 0x18007c64c\nmov     r9d, r12d                                                      ; +0x110, 0x18007c650\nmov     rcx, rsi                                                       ; +0x113, 0x18007c653\ncall    sub_180099C50                                                  ; +0x116, 0x18007c656\nmov     edi, eax                                                       ; +0x11b, 0x18007c65b\ntest    eax, eax                                                       ; +0x11d, 0x18007c65d\njz      short loc_18007C67B                                            ; +0x11f, 0x18007c65f\nmov     rcx, [rbx+0A8h]                                                ; +0x121, 0x18007c661\ncall    sub_1800FC680                                                  ; +0x128, 0x18007c668\ntest    eax, eax                                                       ; +0x12d, 0x18007c66d\njnz     loc_18007C776                                                  ; +0x12f, 0x18007c66f\nmov     edx, [rsp+188h+var_138]                                        ; +0x135, 0x18007c675\njmp     short loc_18007C640                                            ; +0x139, 0x18007c679\nmov     ecx, dword ptr [rsp+188h+var_120+4]                            ; +0x13b, 0x18007c67b\nlea     eax, [rcx-1]                                                   ; +0x13f, 0x18007c67f\ncmp     ebp, eax                                                       ; +0x142, 0x18007c682\njnz     loc_18007C70A                                                  ; +0x144, 0x18007c684\nlea     r14, [rsi+138h]                                                ; +0x14a, 0x18007c68a\nmov     rcx, r14                                                       ; +0x151, 0x18007c691\ncall    sub_180096DA0                                                  ; +0x154, 0x18007c694\nmov     esi, [rsi+148h]                                                ; +0x159, 0x18007c699\nimul    esi, r15d                                                      ; +0x15f, 0x18007c69f\ntest    rax, rax                                                       ; +0x163, 0x18007c6a3\njz      short loc_18007C6EB                                            ; +0x166, 0x18007c6a6\nmov     rcx, r14                                                       ; +0x168, 0x18007c6a8\ncall    sub_180096DA0                                                  ; +0x16b, 0x18007c6ab\nmov     r8d, [rbx+2C4h]                                                ; +0x170, 0x18007c6b0\nmov     rdx, rax                                                       ; +0x177, 0x18007c6b7\nmov     rcx, [rsp+188h+var_130]                                        ; +0x17a, 0x18007c6ba\nmov     r9d, 5                                                         ; +0x17f, 0x18007c6bf\nmov     [rsp+188h+var_148], 0                                          ; +0x185, 0x18007c6c5\nmovss   dword ptr [rsp+188h+var_150], xmm6                             ; +0x18a, 0x18007c6ca\nmov     [rsp+188h+var_158], 1                                          ; +0x190, 0x18007c6d0\nmov     [rsp+188h+var_160], 1                                          ; +0x198, 0x18007c6d8\nmov     dword ptr [rsp+188h+var_168], esi                              ; +0x1a0, 0x18007c6e0\ncall    sub_180062BA0                                                  ; +0x1a4, 0x18007c6e4\njmp     short loc_18007C6FE                                            ; +0x1a9, 0x18007c6e9\nmov     rcx, [rsp+188h+var_130]; void *                                ; +0x1ab, 0x18007c6eb\nxor     edx, edx; Val                                                  ; +0x1b0, 0x18007c6f0\nmov     r8d, esi                                                       ; +0x1b2, 0x18007c6f2\nshl     r8, 2; Size                                                    ; +0x1b5, 0x18007c6f5\ncall    memset                                                         ; +0x1b9, 0x18007c6f9\nmov     rcx, r14                                                       ; +0x1be, 0x18007c6fe\ncall    sub_180098560                                                  ; +0x1c1, 0x18007c701\nmov     ecx, dword ptr [rsp+188h+var_120+4]                            ; +0x1c6, 0x18007c706\ninc     ebp                                                            ; +0x1ca, 0x18007c70a\nadd     r13, 8                                                         ; +0x1cc, 0x18007c70c\ncmp     ebp, ecx                                                       ; +0x1d0, 0x18007c710\njge     short loc_18007C71D                                            ; +0x1d2, 0x18007c712\nmov     edx, [rsp+188h+var_138]                                        ; +0x1d4, 0x18007c714\njmp     loc_18007C630                                                  ; +0x1d8, 0x18007c718\ninc     dword ptr [rbx+2B0h]                                           ; +0x1dd, 0x18007c71d\nlea     rcx, [rbx+138h]                                                ; +0x1e3, 0x18007c723\ncall    sub_180098560                                                  ; +0x1ea, 0x18007c72a\njmp     short loc_18007C774                                            ; +0x1ef, 0x18007c72f\nmov     rax, [rbx+2A0h]                                                ; +0x1f1, 0x18007c731\ntest    rax, rax                                                       ; +0x1f8, 0x18007c738\njz      short loc_18007C774                                            ; +0x1fb, 0x18007c73b\nlea     rcx, [rsp+188h+var_138]                                        ; +0x1fd, 0x18007c73d\nmov     [rsp+188h+var_138], r12d                                       ; +0x202, 0x18007c742\nmov     [rsp+188h+var_168], rcx                                        ; +0x207, 0x18007c747\nmov     r9, r8                                                         ; +0x20c, 0x18007c74c\nlea     rcx, [rbx+0B0h]                                                ; +0x20f, 0x18007c74f\nxor     r8d, r8d                                                       ; +0x216, 0x18007c756\ncall    rax                                                            ; +0x219, 0x18007c759\nmov     edi, eax                                                       ; +0x21b, 0x18007c75b\ncmp     eax, 10h                                                       ; +0x21d, 0x18007c75d\njnz     short loc_18007C774                                            ; +0x220, 0x18007c760\ntest    byte ptr [rbx+2C8h], 2                                         ; +0x222, 0x18007c762\njz      short loc_18007C774                                            ; +0x229, 0x18007c769\ncmp     [rbx+260h], ebp                                                ; +0x22b, 0x18007c76b\ncmovnz  edi, ebp                                                       ; +0x231, 0x18007c771\nmov     eax, edi                                                       ; +0x234, 0x18007c774\nmov     rcx, [rsp+188h+var_68]                                         ; +0x236, 0x18007c776\nxor     rcx, rsp; StackCookie                                          ; +0x23e, 0x18007c77e\ncall    __security_check_cookie                                        ; +0x241, 0x18007c781\nmovaps  xmm6, [rsp+188h+var_58]                                        ; +0x246, 0x18007c786\nadd     rsp, 148h                                                      ; +0x24e, 0x18007c78e\npop     r15                                                            ; +0x255, 0x18007c795\npop     r14                                                            ; +0x257, 0x18007c797\npop     r13                                                            ; +0x259, 0x18007c799\npop     r12                                                            ; +0x25b, 0x18007c79b\npop     rdi                                                            ; +0x25d, 0x18007c79d\npop     rsi                                                            ; +0x25e, 0x18007c79e\npop     rbp                                                            ; +0x25f, 0x18007c79f\npop     rbx                                                            ; +0x260, 0x18007c7a0\nretn                                                                   ; +0x261, 0x18007c7a1", "xrefs": ["sub_18007C8F0 @ 0x18007cc46", "<???> @ 0x1801f9f18"], "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"}