{"type": "func", "start": 6443254048, "end": 6443254399, "name": "sub_1800C4120", "pseudocode": "// \n// sub_1800C4120 from 0x1800c4120 to 0x1800c427f (351 bytes)\n// \n// 2 xrefs:\n// > sub_1800C3960 @ 0x1800c3a07\n// > <???> @ 0x1801fde18\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_1800C4120(__int64 a1)\n{\n  __int64 v1; // rbx\n  __int64 result; // rax\n  __int64 v3; // rcx\n  int v4; // eax\n  unsigned int v5; // edx\n  __int64 v6; // rcx\n  __int64 v7; // rcx\n  __int64 v8; // rdx\n  unsigned int v9; // eax\n  unsigned int v10; // [rsp+30h] [rbp+8h] BYREF\n  void *v11; // [rsp+38h] [rbp+10h] BYREF\n\n  v1 = a1 - 8;\n  if ( !a1 )\n    v1 = 0;\n  if ( WaitForSingleObject(*(HANDLE *)(v1 + 1848), 0xC8u) == -1 )\n    return 28;\n  v3 = *(_QWORD *)(v1 + 1832);\n  v10 = 0;\n  v4 = (*(__int64 (__fastcall **)(__int64, unsigned int *))(*(_QWORD *)v3 + 48LL))(v3, &v10);\n  if ( v4 == -2004287484 )\n  {\n    *(_BYTE *)(v1 + 785) = 1;\n    return 49;\n  }\n  else if ( v4 >= 0 )\n  {\n    v5 = *(_DWORD *)(v1 + 1864);\n    if ( v10 > *(_DWORD *)(v1 + 1872) - v5 )\n    {\n      return 0;\n    }\n    else\n    {\n      while ( 1 )\n      {\n        v6 = v1 + 8;\n        if ( !v1 )\n          v6 = 0;\n        result = (*(__int64 (__fastcall **)(__int64, _QWORD, _QWORD))(v1 + 16))(v6, *(_QWORD *)(v1 + 1856), v5);\n        if ( (_DWORD)result )\n          break;\n        if ( (*(int (__fastcall **)(_QWORD, unsigned int *))(**(_QWORD **)(v1 + 1832) + 48LL))(\n               *(_QWORD *)(v1 + 1832),\n               &v10) < 0 )\n          return 49;\n        v7 = *(_QWORD *)(v1 + 1840);\n        v8 = *(unsigned int *)(v1 + 1864);\n        v11 = nullptr;\n        if ( (*(int (__fastcall **)(__int64, __int64, void **))(*(_QWORD *)v7 + 24LL))(v7, v8, &v11) < 0 )\n          return 49;\n        memmove(v11, *(const void **)(v1 + 1856), *(int *)(v1 + 1868));\n        if ( (*(int (__fastcall **)(_QWORD, _QWORD, _QWORD))(**(_QWORD **)(v1 + 1840) + 32LL))(\n               *(_QWORD *)(v1 + 1840),\n               *(unsigned int *)(v1 + 1864),\n               0) < 0 )\n          return 49;\n        v5 = *(_DWORD *)(v1 + 1864);\n        v9 = *(_DWORD *)(v1 + 1872) - v5;\n        v10 += v5;\n        if ( v10 > v9 )\n          return 0;\n      }\n    }\n  }\n  else\n  {\n    return 49;\n  }\n  return result;\n}", "assembly": "; \n; sub_1800C4120 from 0x1800c4120 to 0x1800c427f (351 bytes)\n; \n; 2 xrefs:\n; > sub_1800C3960 @ 0x1800c3a07\n; > <???> @ 0x1801fde18\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_10], rbx                                              ; +0x0, 0x1800c4120\npush    rdi                                                            ; +0x5, 0x1800c4125\nsub     rsp, 20h                                                       ; +0x6, 0x1800c4126\nlea     rbx, [rcx-8]                                                   ; +0xa, 0x1800c412a\nxor     edi, edi                                                       ; +0xe, 0x1800c412e\ntest    rcx, rcx                                                       ; +0x10, 0x1800c4130\nmov     edx, 0C8h; dwMilliseconds                                      ; +0x13, 0x1800c4133\ncmovz   rbx, rdi                                                       ; +0x18, 0x1800c4138\nmov     rcx, [rbx+738h]; hHandle                                       ; +0x1c, 0x1800c413c\ncall    cs:WaitForSingleObject                                         ; +0x23, 0x1800c4143\ncmp     eax, 0FFFFFFFFh                                                ; +0x29, 0x1800c4149\njnz     short loc_1800C415C                                            ; +0x2c, 0x1800c414c\nlea     eax, [rdi+1Ch]                                                 ; +0x2e, 0x1800c414e\nmov     rbx, [rsp+28h+arg_10]                                          ; +0x31, 0x1800c4151\nadd     rsp, 20h                                                       ; +0x36, 0x1800c4156\npop     rdi                                                            ; +0x3a, 0x1800c415a\nretn                                                                   ; +0x3b, 0x1800c415b\nmov     rcx, [rbx+728h]                                                ; +0x3c, 0x1800c415c\nlea     rdx, [rsp+28h+arg_0]                                           ; +0x43, 0x1800c4163\nmov     [rsp+28h+arg_0], edi                                           ; +0x48, 0x1800c4168\nmov     rax, [rcx]                                                     ; +0x4c, 0x1800c416c\ncall    qword ptr [rax+30h]                                            ; +0x4f, 0x1800c416f\ncmp     eax, 88890004h                                                 ; +0x52, 0x1800c4172\njnz     short loc_1800C4190                                            ; +0x57, 0x1800c4177\nmov     byte ptr [rbx+311h], 1                                         ; +0x59, 0x1800c4179\nmov     eax, 31h ; '1'                                                 ; +0x60, 0x1800c4180\nmov     rbx, [rsp+28h+arg_10]                                          ; +0x65, 0x1800c4185\nadd     rsp, 20h                                                       ; +0x6a, 0x1800c418a\npop     rdi                                                            ; +0x6e, 0x1800c418e\nretn                                                                   ; +0x6f, 0x1800c418f\ntest    eax, eax                                                       ; +0x70, 0x1800c4190\njns     short loc_1800C41A4                                            ; +0x72, 0x1800c4192\nmov     eax, 31h ; '1'                                                 ; +0x74, 0x1800c4194\nmov     rbx, [rsp+28h+arg_10]                                          ; +0x79, 0x1800c4199\nadd     rsp, 20h                                                       ; +0x7e, 0x1800c419e\npop     rdi                                                            ; +0x82, 0x1800c41a2\nretn                                                                   ; +0x83, 0x1800c41a3\nmov     eax, [rbx+750h]                                                ; +0x84, 0x1800c41a4\nmov     edx, [rbx+748h]                                                ; +0x8a, 0x1800c41aa\nsub     eax, edx                                                       ; +0x90, 0x1800c41b0\ncmp     [rsp+28h+arg_0], eax                                           ; +0x92, 0x1800c41b2\nja      loc_1800C4272                                                  ; +0x96, 0x1800c41b6\nnop     dword ptr [rax+00h]                                            ; +0x9c, 0x1800c41bc\nlea     rcx, [rbx+8]                                                   ; +0xa0, 0x1800c41c0\ntest    rbx, rbx                                                       ; +0xa4, 0x1800c41c4\njnz     short loc_1800C41CC                                            ; +0xa7, 0x1800c41c7\nmov     rcx, rdi                                                       ; +0xa9, 0x1800c41c9\nmov     r8d, edx                                                       ; +0xac, 0x1800c41cc\nmov     rdx, [rbx+740h]                                                ; +0xaf, 0x1800c41cf\ncall    qword ptr [rbx+10h]                                            ; +0xb6, 0x1800c41d6\ntest    eax, eax                                                       ; +0xb9, 0x1800c41d9\njnz     loc_1800C4274                                                  ; +0xbb, 0x1800c41db\nmov     rcx, [rbx+728h]                                                ; +0xc1, 0x1800c41e1\nlea     rdx, [rsp+28h+arg_0]                                           ; +0xc8, 0x1800c41e8\nmov     rax, [rcx]                                                     ; +0xcd, 0x1800c41ed\ncall    qword ptr [rax+30h]                                            ; +0xd0, 0x1800c41f0\ntest    eax, eax                                                       ; +0xd3, 0x1800c41f3\njs      short loc_1800C4194                                            ; +0xd5, 0x1800c41f5\nmov     rcx, [rbx+730h]                                                ; +0xd7, 0x1800c41f7\nlea     r8, [rsp+28h+arg_8]                                            ; +0xde, 0x1800c41fe\nmov     edx, [rbx+748h]                                                ; +0xe3, 0x1800c4203\nmov     [rsp+28h+arg_8], rdi                                           ; +0xe9, 0x1800c4209\nmov     rax, [rcx]                                                     ; +0xee, 0x1800c420e\ncall    qword ptr [rax+18h]                                            ; +0xf1, 0x1800c4211\ntest    eax, eax                                                       ; +0xf4, 0x1800c4214\njs      loc_1800C4194                                                  ; +0xf6, 0x1800c4216\nmovsxd  r8, dword ptr [rbx+74Ch]; Size                                 ; +0xfc, 0x1800c421c\nmov     rdx, [rbx+740h]; Src                                           ; +0x103, 0x1800c4223\nmov     rcx, [rsp+28h+arg_8]; void *                                   ; +0x10a, 0x1800c422a\ncall    memmove                                                        ; +0x10f, 0x1800c422f\nmov     rcx, [rbx+730h]                                                ; +0x114, 0x1800c4234\nxor     r8d, r8d                                                       ; +0x11b, 0x1800c423b\nmov     edx, [rbx+748h]                                                ; +0x11e, 0x1800c423e\nmov     rax, [rcx]                                                     ; +0x124, 0x1800c4244\ncall    qword ptr [rax+20h]                                            ; +0x127, 0x1800c4247\ntest    eax, eax                                                       ; +0x12a, 0x1800c424a\njs      loc_1800C4194                                                  ; +0x12c, 0x1800c424c\nmov     ecx, [rsp+28h+arg_0]                                           ; +0x132, 0x1800c4252\nmov     edx, [rbx+748h]                                                ; +0x136, 0x1800c4256\nadd     ecx, edx                                                       ; +0x13c, 0x1800c425c\nmov     eax, [rbx+750h]                                                ; +0x13e, 0x1800c425e\nsub     eax, edx                                                       ; +0x144, 0x1800c4264\nmov     [rsp+28h+arg_0], ecx                                           ; +0x146, 0x1800c4266\ncmp     ecx, eax                                                       ; +0x14a, 0x1800c426a\njbe     loc_1800C41C0                                                  ; +0x14c, 0x1800c426c\nmov     eax, edi                                                       ; +0x152, 0x1800c4272\nmov     rbx, [rsp+28h+arg_10]                                          ; +0x154, 0x1800c4274\nadd     rsp, 20h                                                       ; +0x159, 0x1800c4279\npop     rdi                                                            ; +0x15d, 0x1800c427d\nretn                                                                   ; +0x15e, 0x1800c427e", "xrefs": ["sub_1800C3960 @ 0x1800c3a07", "<???> @ 0x1801fde18"], "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"}