{"type": "func", "start": 6442585120, "end": 6442585340, "name": "sub_180020C20", "pseudocode": "// \n// sub_180020C20 from 0x180020c20 to 0x180020cfc (220 bytes)\n// \n// 4 xrefs:\n// > <???> @ 0x1800e7070\n// > <???> @ 0x180133b68\n// > <???> @ 0x180133b78\n// > <???> @ 0x1801aed7c\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_180020C20(__int64 a1, char *a2, size_t a3)\n{\n  bool v5; // zf\n  int v6; // r8d\n  FILE *v7; // rcx\n  FILE *v8; // rdi\n  int *Count; // [rsp+60h] [rbp+8h] BYREF\n  char **Pointer; // [rsp+68h] [rbp+10h] BYREF\n  char **Base; // [rsp+70h] [rbp+18h] BYREF\n\n  if ( a2 || (v5 = a3 == 0, v6 = 4, !v5) )\n    v6 = 0;\n  v7 = *(FILE **)(a1 + 128);\n  if ( !v7 || setvbuf(v7, a2, v6, a3) )\n    return 0;\n  v8 = *(FILE **)(a1 + 128);\n  *(_BYTE *)(a1 + 124) = 1;\n  *(_BYTE *)(a1 + 113) = 0;\n  std::streambuf::_Init(a1);\n  if ( v8 )\n  {\n    Base = nullptr;\n    Pointer = nullptr;\n    Count = nullptr;\n    get_stream_buffer_pointers(v8, &Base, &Pointer, &Count);\n    std::streambuf::_Init(a1);\n  }\n  *(_QWORD *)(a1 + 128) = v8;\n  *(_QWORD *)(a1 + 116) = qword_1801A8360;\n  *(_QWORD *)(a1 + 104) = 0;\n  return a1;\n}", "assembly": "; \n; sub_180020C20 from 0x180020c20 to 0x180020cfc (220 bytes)\n; \n; 4 xrefs:\n; > <???> @ 0x1800e7070\n; > <???> @ 0x180133b68\n; > <???> @ 0x180133b78\n; > <???> @ 0x1801aed7c\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\npush    rbx                                                            ; +0x0, 0x180020c20\npush    rsi                                                            ; +0x2, 0x180020c22\nsub     rsp, 48h                                                       ; +0x3, 0x180020c23\nxor     esi, esi                                                       ; +0x7, 0x180020c27\nmov     r9, r8; Size                                                   ; +0x9, 0x180020c29\nmov     rbx, rcx                                                       ; +0xc, 0x180020c2c\ntest    rdx, rdx                                                       ; +0xf, 0x180020c2f\njnz     short loc_180020C3D                                            ; +0x12, 0x180020c32\ntest    r8, r8                                                         ; +0x14, 0x180020c34\nlea     r8d, [rsi+4]                                                   ; +0x17, 0x180020c37\njz      short loc_180020C40                                            ; +0x1b, 0x180020c3b\nmov     r8d, esi; Mode                                                 ; +0x1d, 0x180020c3d\nmov     rcx, [rcx+80h]; Stream                                         ; +0x20, 0x180020c40\ntest    rcx, rcx                                                       ; +0x27, 0x180020c47\njz      loc_180020CF3                                                  ; +0x2a, 0x180020c4a\ncall    cs:setvbuf                                                     ; +0x30, 0x180020c50\ntest    eax, eax                                                       ; +0x36, 0x180020c56\njnz     loc_180020CF3                                                  ; +0x38, 0x180020c58\nmov     [rsp+58h+var_18], rdi                                          ; +0x3e, 0x180020c5e\nmov     rcx, rbx                                                       ; +0x43, 0x180020c63\nmov     rdi, [rbx+80h]                                                 ; +0x46, 0x180020c66\nmov     byte ptr [rbx+7Ch], 1                                          ; +0x4d, 0x180020c6d\nmov     [rbx+71h], sil                                                 ; +0x51, 0x180020c71\ncall    cs:?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXXZ; std::streambuf::_Init(void) ; +0x55, 0x180020c75\ntest    rdi, rdi                                                       ; +0x5b, 0x180020c7b\njz      short loc_180020CCE                                            ; +0x5e, 0x180020c7e\nlea     r9, [rsp+58h+Count]; Count                                     ; +0x60, 0x180020c80\nmov     [rsp+58h+Base], rsi                                            ; +0x65, 0x180020c85\nlea     r8, [rsp+58h+Pointer]; Pointer                                 ; +0x6a, 0x180020c8a\nmov     [rsp+58h+Pointer], rsi                                         ; +0x6f, 0x180020c8f\nlea     rdx, [rsp+58h+Base]; Base                                      ; +0x74, 0x180020c94\nmov     [rsp+58h+Count], rsi                                           ; +0x79, 0x180020c99\nmov     rcx, rdi; Stream                                               ; +0x7e, 0x180020c9e\ncall    cs:_get_stream_buffer_pointers                                 ; +0x81, 0x180020ca1\nmov     r9, [rsp+58h+Count]                                            ; +0x87, 0x180020ca7\nmov     rcx, rbx                                                       ; +0x8c, 0x180020cac\nmov     r8, [rsp+58h+Pointer]                                          ; +0x8f, 0x180020caf\nmov     rdx, [rsp+58h+Base]                                            ; +0x94, 0x180020cb4\nmov     [rsp+58h+var_28], r9                                           ; +0x99, 0x180020cb9\nmov     [rsp+58h+var_30], r8                                           ; +0x9e, 0x180020cbe\nmov     [rsp+58h+var_38], rdx                                          ; +0xa3, 0x180020cc3\ncall    cs:?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAPEAD0PEAH001@Z; std::streambuf::_Init(char * *,char * *,int *,char * *,char * *,int *) ; +0xa8, 0x180020cc8\nmov     [rbx+80h], rdi                                                 ; +0xae, 0x180020cce\nmov     rax, cs:qword_1801A8360                                        ; +0xb5, 0x180020cd5\nmov     rdi, [rsp+58h+var_18]                                          ; +0xbc, 0x180020cdc\nmov     [rbx+74h], rax                                                 ; +0xc1, 0x180020ce1\nmov     rax, rbx                                                       ; +0xc5, 0x180020ce5\nmov     [rbx+68h], rsi                                                 ; +0xc8, 0x180020ce8\nadd     rsp, 48h                                                       ; +0xcc, 0x180020cec\npop     rsi                                                            ; +0xd0, 0x180020cf0\npop     rbx                                                            ; +0xd1, 0x180020cf1\nretn                                                                   ; +0xd2, 0x180020cf2\nxor     eax, eax                                                       ; +0xd3, 0x180020cf3\nadd     rsp, 48h                                                       ; +0xd5, 0x180020cf5\npop     rsi                                                            ; +0xd9, 0x180020cf9\npop     rbx                                                            ; +0xda, 0x180020cfa\nretn                                                                   ; +0xdb, 0x180020cfb", "xrefs": ["<???> @ 0x1800e7070", "<???> @ 0x180133b68", "<???> @ 0x180133b78", "<???> @ 0x1801aed7c"], "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"}