{"type": "func", "start": 6443202592, "end": 6443202903, "name": "sub_1800B7820", "pseudocode": "// \n// sub_1800B7820 from 0x1800b7820 to 0x1800b7957 (311 bytes)\n// \n// 9 xrefs:\n// > sub_1800B4490 @ 0x1800b44fe\n// > sub_1800B4490 @ 0x1800b4567\n// > sub_1800B4680 @ 0x1800b48fc\n// > sub_1800B4680 @ 0x1800b4990\n// > sub_1800B4680 @ 0x1800b4e10\n// > <???> @ 0x1801898d8\n// > <???> @ 0x1801898f4\n// > <???> @ 0x180189904\n// > <???> @ 0x1801fd188\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:59 +0000\n// \n\n__int64 __fastcall sub_1800B7820(SOCKET s, _BYTE *a2, int a3)\n{\n  unsigned int v5; // esi\n  unsigned int v6; // r15d\n  int v7; // edi\n  char *p_buf; // rbx\n  __int64 result; // rax\n  __int64 v10; // rdx\n  __int64 v11; // r8\n  __int64 v12; // r9\n  __int64 v13; // rax\n  int v14; // [rsp+20h] [rbp-38h] BYREF\n  _DWORD v15[3]; // [rsp+24h] [rbp-34h] BYREF\n  char buf; // [rsp+68h] [rbp+10h] BYREF\n  unsigned int v17; // [rsp+78h] [rbp+20h]\n\n  v5 = 0;\n  if ( !a2 || !a3 )\n    return 31;\n  v6 = a3 - 1;\n  *a2 = 0;\n  if ( a3 == 1 )\n  {\nLABEL_12:\n    a2[v5] = 0;\n    return 0;\n  }\n  else\n  {\n    while ( 1 )\n    {\n      buf = 0;\n      v7 = 1;\n      v14 = 0;\n      p_buf = &buf;\n      sub_1800C1770(&v14);\n      v17 = 0;\n      result = sub_18010A250(s, &buf, 1);\n      if ( (_DWORD)result == 45 )\n        break;\nLABEL_7:\n      if ( (_DWORD)result )\n        return result;\n      if ( buf != 10 )\n      {\n        if ( buf != 13 )\n        {\n          v13 = v5++;\n          a2[v13] = buf;\n        }\n        if ( v5 < v6 )\n          continue;\n      }\n      goto LABEL_12;\n    }\n    while ( 1 )\n    {\n      p_buf += v17;\n      v7 -= v17;\n      FMOD_OS_Time_Sleep(1, v10, v11, v12);\n      sub_1800C1770(v15);\n      if ( v15[0] - v14 >= dword_1801AEA78 )\n        return 43;\n      v17 = 0;\n      result = sub_18010A250(s, p_buf, v7);\n      if ( (_DWORD)result != 45 )\n        goto LABEL_7;\n    }\n  }\n}", "assembly": "; \n; sub_1800B7820 from 0x1800b7820 to 0x1800b7957 (311 bytes)\n; \n; 9 xrefs:\n; > sub_1800B4490 @ 0x1800b44fe\n; > sub_1800B4490 @ 0x1800b4567\n; > sub_1800B4680 @ 0x1800b48fc\n; > sub_1800B4680 @ 0x1800b4990\n; > sub_1800B4680 @ 0x1800b4e10\n; > <???> @ 0x1801898d8\n; > <???> @ 0x1801898f4\n; > <???> @ 0x180189904\n; > <???> @ 0x1801fd188\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:59 +0000\n; \npush    rbp                                                            ; +0x0, 0x1800b7820\npush    rsi                                                            ; +0x2, 0x1800b7822\npush    r12                                                            ; +0x3, 0x1800b7823\npush    r14                                                            ; +0x5, 0x1800b7825\nsub     rsp, 38h                                                       ; +0x7, 0x1800b7827\nxor     r12d, r12d                                                     ; +0xb, 0x1800b782b\nmov     r14, rdx                                                       ; +0xe, 0x1800b782e\nmov     rbp, rcx                                                       ; +0x11, 0x1800b7831\nmov     esi, r12d                                                      ; +0x14, 0x1800b7834\ntest    rdx, rdx                                                       ; +0x17, 0x1800b7837\njz      loc_1800B7947                                                  ; +0x1a, 0x1800b783a\ntest    r8d, r8d                                                       ; +0x20, 0x1800b7840\njz      loc_1800B7947                                                  ; +0x23, 0x1800b7843\nmov     [rsp+58h+arg_0], rbx                                           ; +0x29, 0x1800b7849\nmov     [rsp+58h+arg_10], rdi                                          ; +0x2e, 0x1800b784e\nmov     [rsp+58h+var_28], r15                                          ; +0x33, 0x1800b7853\nlea     r15d, [r8-1]                                                   ; +0x38, 0x1800b7858\nmov     [rdx], sil                                                     ; +0x3c, 0x1800b785c\ntest    r15d, r15d                                                     ; +0x3f, 0x1800b785f\njz      loc_1800B791E                                                  ; +0x42, 0x1800b7862\nnop     dword ptr [rax+rax+00000000h]                                  ; +0x48, 0x1800b7868\nlea     rcx, [rsp+58h+var_38]                                          ; +0x50, 0x1800b7870\nmov     [rsp+58h+buf], r12b                                            ; +0x55, 0x1800b7875\nmov     edi, 1                                                         ; +0x5a, 0x1800b787a\nmov     [rsp+58h+var_38], r12d                                         ; +0x5f, 0x1800b787f\nlea     rbx, [rsp+58h+buf]                                             ; +0x64, 0x1800b7884\ncall    sub_1800C1770                                                  ; +0x69, 0x1800b7889\nlea     r9, [rsp+58h+arg_18]                                           ; +0x6e, 0x1800b788e\nmov     [rsp+58h+arg_18], r12d                                         ; +0x73, 0x1800b7893\nmov     r8d, edi; len                                                  ; +0x78, 0x1800b7898\nlea     rdx, [rsp+58h+buf]; buf                                        ; +0x7b, 0x1800b789b\nmov     rcx, rbp; s                                                    ; +0x80, 0x1800b78a0\ncall    sub_18010A250                                                  ; +0x83, 0x1800b78a3\ncmp     eax, 2Dh ; '-'                                                 ; +0x88, 0x1800b78a8\njnz     short loc_1800B78FA                                            ; +0x8b, 0x1800b78ab\nnop     dword ptr [rax]                                                ; +0x8d, 0x1800b78ad\nmov     ecx, [rsp+58h+arg_18]                                          ; +0x90, 0x1800b78b0\nadd     rbx, rcx                                                       ; +0x94, 0x1800b78b4\nsub     edi, ecx                                                       ; +0x97, 0x1800b78b7\nmov     ecx, 1                                                         ; +0x99, 0x1800b78b9\ncall    FMOD_OS_Time_Sleep                                             ; +0x9e, 0x1800b78be\nlea     rcx, [rsp+58h+var_34]                                          ; +0xa3, 0x1800b78c3\ncall    sub_1800C1770                                                  ; +0xa8, 0x1800b78c8\nmov     eax, [rsp+58h+var_34]                                          ; +0xad, 0x1800b78cd\nsub     eax, [rsp+58h+var_38]                                          ; +0xb1, 0x1800b78d1\ncmp     eax, cs:dword_1801AEA78                                        ; +0xb5, 0x1800b78d5\njge     short loc_1800B7940                                            ; +0xbb, 0x1800b78db\nlea     r9, [rsp+58h+arg_18]                                           ; +0xbd, 0x1800b78dd\nmov     [rsp+58h+arg_18], r12d                                         ; +0xc2, 0x1800b78e2\nmov     r8d, edi; len                                                  ; +0xc7, 0x1800b78e7\nmov     rdx, rbx; buf                                                  ; +0xca, 0x1800b78ea\nmov     rcx, rbp; s                                                    ; +0xcd, 0x1800b78ed\ncall    sub_18010A250                                                  ; +0xd0, 0x1800b78f0\ncmp     eax, 2Dh ; '-'                                                 ; +0xd5, 0x1800b78f5\njz      short loc_1800B78B0                                            ; +0xd8, 0x1800b78f8\ntest    eax, eax                                                       ; +0xda, 0x1800b78fa\njnz     short loc_1800B7926                                            ; +0xdc, 0x1800b78fc\nmovzx   ecx, [rsp+58h+buf]                                             ; +0xde, 0x1800b78fe\ncmp     cl, 0Ah                                                        ; +0xe3, 0x1800b7903\njz      short loc_1800B791E                                            ; +0xe6, 0x1800b7906\ncmp     cl, 0Dh                                                        ; +0xe8, 0x1800b7908\njz      short loc_1800B7915                                            ; +0xeb, 0x1800b790b\nmov     eax, esi                                                       ; +0xed, 0x1800b790d\ninc     esi                                                            ; +0xef, 0x1800b790f\nmov     [rax+r14], cl                                                  ; +0xf1, 0x1800b7911\ncmp     esi, r15d                                                      ; +0xf5, 0x1800b7915\njb      loc_1800B7870                                                  ; +0xf8, 0x1800b7918\nmov     eax, esi                                                       ; +0xfe, 0x1800b791e\nmov     [rax+r14], r12b                                                ; +0x100, 0x1800b7920\nxor     eax, eax                                                       ; +0x104, 0x1800b7924\nmov     rdi, [rsp+58h+arg_10]                                          ; +0x106, 0x1800b7926\nmov     rbx, [rsp+58h+arg_0]                                           ; +0x10b, 0x1800b792b\nmov     r15, [rsp+58h+var_28]                                          ; +0x110, 0x1800b7930\nadd     rsp, 38h                                                       ; +0x115, 0x1800b7935\npop     r14                                                            ; +0x119, 0x1800b7939\npop     r12                                                            ; +0x11b, 0x1800b793b\npop     rsi                                                            ; +0x11d, 0x1800b793d\npop     rbp                                                            ; +0x11e, 0x1800b793e\nretn                                                                   ; +0x11f, 0x1800b793f\nmov     eax, 2Bh ; '+'                                                 ; +0x120, 0x1800b7940\njmp     short loc_1800B7926                                            ; +0x125, 0x1800b7945\nmov     eax, 1Fh                                                       ; +0x127, 0x1800b7947\nadd     rsp, 38h                                                       ; +0x12c, 0x1800b794c\npop     r14                                                            ; +0x130, 0x1800b7950\npop     r12                                                            ; +0x132, 0x1800b7952\npop     rsi                                                            ; +0x134, 0x1800b7954\npop     rbp                                                            ; +0x135, 0x1800b7955\nretn                                                                   ; +0x136, 0x1800b7956", "xrefs": ["sub_1800B4490 @ 0x1800b44fe", "sub_1800B4490 @ 0x1800b4567", "sub_1800B4680 @ 0x1800b48fc", "sub_1800B4680 @ 0x1800b4990", "sub_1800B4680 @ 0x1800b4e10", "<???> @ 0x1801898d8", "<???> @ 0x1801898f4", "<???> @ 0x180189904", "<???> @ 0x1801fd188"], "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"}