{"type": "func", "start": 6442566640, "end": 6442566988, "name": "sub_18001C3F0", "pseudocode": "// \n// sub_18001C3F0 from 0x18001c3f0 to 0x18001c54c (348 bytes)\n// \n// 4 xrefs:\n// > <???> @ 0x1800ecbe0\n// > <???> @ 0x18013bb84\n// > <???> @ 0x18013bb94\n// > <???> @ 0x1801b8b6c\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 11:21:26 +0000\n// \n\n__int64 __fastcall sub_18001C3F0(__int64 a1, unsigned int a2)\n{\n  unsigned __int64 v5; // rbx\n  unsigned __int64 v6; // rax\n  unsigned __int64 v7; // rsi\n  __int64 v8; // rax\n  size_t v9; // rsi\n  void *v10; // r15\n  size_t v11; // rbx\n  char *v12; // r14\n  __int64 v13; // rcx\n  char *v14; // r9\n  char *v15; // r8\n  char *v16; // rbx\n  __int64 v17; // rax\n\n  if ( (*(_BYTE *)(a1 + 112) & 2) != 0 )\n    return 0xFFFFFFFFLL;\n  if ( a2 == -1 )\n    return 0;\n  v5 = std::streambuf::pptr(a1);\n  v6 = std::streambuf::epptr(a1);\n  v7 = v6;\n  if ( v5 && v5 < v6 )\n  {\n    *(_BYTE *)std::streambuf::_Pninc(a1) = a2;\n    *(_QWORD *)(a1 + 104) = v5 + 1;\n    return a2;\n  }\n  v8 = std::streambuf::eback(a1);\n  v9 = v7 - v8;\n  v10 = (void *)v8;\n  if ( !v5 )\n    v9 = 0;\n  if ( v9 >= 0x20 )\n  {\n    if ( v9 < 0x3FFFFFFF )\n    {\n      v11 = 2 * v9;\n      goto LABEL_14;\n    }\n    v11 = 0x7FFFFFFF;\n    if ( v9 < 0x7FFFFFFF )\n      goto LABEL_14;\n    return 0xFFFFFFFFLL;\n  }\n  v11 = 32;\nLABEL_14:\n  v12 = (char *)sub_18000CE80(v11);\n  memcpy(v12, v10, v9);\n  *(_QWORD *)(a1 + 104) = &v12[v9 + 1];\n  std::streambuf::setp(a1, v12, &v12[v9], &v12[v11]);\n  v13 = a1;\n  if ( (*(_BYTE *)(a1 + 112) & 4) != 0 )\n  {\n    v14 = v12;\n    v15 = v12;\n  }\n  else\n  {\n    v16 = *(char **)(a1 + 104);\n    v17 = std::streambuf::gptr(a1);\n    v14 = v16;\n    v13 = a1;\n    v15 = (char *)(v17 + v12 - (_BYTE *)v10);\n  }\n  std::streambuf::setg(v13, v12, v15, v14);\n  if ( (*(_BYTE *)(a1 + 112) & 1) != 0 )\n    sub_1800195D0(a1 + 116, v10, v9);\n  *(_DWORD *)(a1 + 112) |= 1u;\n  *(_BYTE *)std::streambuf::_Pninc(a1) = a2;\n  return a2;\n}", "assembly": "; \n; sub_18001C3F0 from 0x18001c3f0 to 0x18001c54c (348 bytes)\n; \n; 4 xrefs:\n; > <???> @ 0x1800ecbe0\n; > <???> @ 0x18013bb84\n; > <???> @ 0x18013bb94\n; > <???> @ 0x1801b8b6c\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 11:21:26 +0000\n; \nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x18001c3f0\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x18001c3f5\npush    rsi                                                            ; +0xa, 0x18001c3fa\npush    rdi                                                            ; +0xb, 0x18001c3fb\npush    r15                                                            ; +0xc, 0x18001c3fc\nsub     rsp, 20h                                                       ; +0xe, 0x18001c3fe\ntest    byte ptr [rcx+70h], 2                                          ; +0x12, 0x18001c402\nmov     ebp, edx                                                       ; +0x16, 0x18001c406\nmov     rdi, rcx                                                       ; +0x18, 0x18001c408\njnz     loc_18001C534                                                  ; +0x1b, 0x18001c40b\ncmp     edx, 0FFFFFFFFh                                                ; +0x21, 0x18001c411\njnz     short loc_18001C41D                                            ; +0x24, 0x18001c414\nxor     eax, eax                                                       ; +0x26, 0x18001c416\njmp     loc_18001C539                                                  ; +0x28, 0x18001c418\ncall    cs:?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ; std::streambuf::pptr(void) ; +0x2d, 0x18001c41d\nmov     rcx, rdi                                                       ; +0x33, 0x18001c423\nmov     rbx, rax                                                       ; +0x36, 0x18001c426\ncall    cs:?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ; std::streambuf::epptr(void) ; +0x39, 0x18001c429\nmov     rsi, rax                                                       ; +0x3f, 0x18001c42f\ntest    rbx, rbx                                                       ; +0x42, 0x18001c432\njz      short loc_18001C457                                            ; +0x45, 0x18001c435\ncmp     rbx, rax                                                       ; +0x47, 0x18001c437\njnb     short loc_18001C457                                            ; +0x4a, 0x18001c43a\nmov     rcx, rdi                                                       ; +0x4c, 0x18001c43c\ncall    cs:?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ; std::streambuf::_Pninc(void) ; +0x4f, 0x18001c43f\nmov     [rax], bpl                                                     ; +0x55, 0x18001c445\nlea     rax, [rbx+1]                                                   ; +0x58, 0x18001c448\nmov     [rdi+68h], rax                                                 ; +0x5c, 0x18001c44c\nmov     eax, ebp                                                       ; +0x60, 0x18001c450\njmp     loc_18001C539                                                  ; +0x62, 0x18001c452\nmov     rcx, rdi                                                       ; +0x67, 0x18001c457\ncall    cs:?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ; std::streambuf::eback(void) ; +0x6a, 0x18001c45a\nsub     rsi, rax                                                       ; +0x70, 0x18001c460\nmov     r15, rax                                                       ; +0x73, 0x18001c463\nxor     eax, eax                                                       ; +0x76, 0x18001c466\ntest    rbx, rbx                                                       ; +0x78, 0x18001c468\ncmovz   rsi, rax                                                       ; +0x7b, 0x18001c46b\ncmp     rsi, 20h ; ' '                                                 ; +0x7f, 0x18001c46f\njnb     short loc_18001C47C                                            ; +0x83, 0x18001c473\nmov     ebx, 20h ; ' '                                                 ; +0x85, 0x18001c475\njmp     short loc_18001C499                                            ; +0x8a, 0x18001c47a\ncmp     rsi, 3FFFFFFFh                                                 ; +0x8c, 0x18001c47c\njnb     short loc_18001C48B                                            ; +0x93, 0x18001c483\nlea     rbx, [rsi+rsi]                                                 ; +0x95, 0x18001c485\njmp     short loc_18001C499                                            ; +0x99, 0x18001c489\nmov     ebx, 7FFFFFFFh                                                 ; +0x9b, 0x18001c48b\ncmp     rsi, rbx                                                       ; +0xa0, 0x18001c490\njnb     loc_18001C534                                                  ; +0xa3, 0x18001c493\nmov     rcx, rbx                                                       ; +0xa9, 0x18001c499\nmov     [rsp+38h+arg_0], r14                                           ; +0xac, 0x18001c49c\ncall    sub_18000CE80                                                  ; +0xb1, 0x18001c4a1\nmov     r8, rsi; Size                                                  ; +0xb6, 0x18001c4a6\nmov     rdx, r15; Src                                                  ; +0xb9, 0x18001c4a9\nmov     rcx, rax; void *                                               ; +0xbc, 0x18001c4ac\nmov     r14, rax                                                       ; +0xbf, 0x18001c4af\ncall    memcpy                                                         ; +0xc2, 0x18001c4b2\nlea     r8, [rsi+r14]                                                  ; +0xc7, 0x18001c4b7\nmov     rdx, r14                                                       ; +0xcb, 0x18001c4bb\nlea     rcx, [r8+1]                                                    ; +0xce, 0x18001c4be\nmov     [rdi+68h], rcx                                                 ; +0xd2, 0x18001c4c2\nlea     r9, [r14+rbx]                                                  ; +0xd6, 0x18001c4c6\nmov     rcx, rdi                                                       ; +0xda, 0x18001c4ca\ncall    cs:?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z; std::streambuf::setp(char *,char *,char *) ; +0xdd, 0x18001c4cd\ntest    byte ptr [rdi+70h], 4                                          ; +0xe3, 0x18001c4d3\nmov     rcx, rdi                                                       ; +0xe7, 0x18001c4d7\njz      short loc_18001C4E4                                            ; +0xea, 0x18001c4da\nmov     r9, r14                                                        ; +0xec, 0x18001c4dc\nmov     r8, r14                                                        ; +0xef, 0x18001c4df\njmp     short loc_18001C4FD                                            ; +0xf2, 0x18001c4e2\nmov     rbx, [rdi+68h]                                                 ; +0xf4, 0x18001c4e4\ncall    cs:?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ; std::streambuf::gptr(void) ; +0xf8, 0x18001c4e8\nmov     r8, r14                                                        ; +0xfe, 0x18001c4ee\nmov     r9, rbx                                                        ; +0x101, 0x18001c4f1\nsub     r8, r15                                                        ; +0x104, 0x18001c4f4\nmov     rcx, rdi                                                       ; +0x107, 0x18001c4f7\nadd     r8, rax                                                        ; +0x10a, 0x18001c4fa\nmov     rdx, r14                                                       ; +0x10d, 0x18001c4fd\ncall    cs:?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z; std::streambuf::setg(char *,char *,char *) ; +0x110, 0x18001c500\ntest    byte ptr [rdi+70h], 1                                          ; +0x116, 0x18001c506\nmov     r14, [rsp+38h+arg_0]                                           ; +0x11a, 0x18001c50a\njz      short loc_18001C520                                            ; +0x11f, 0x18001c50f\nlea     rcx, [rdi+74h]                                                 ; +0x121, 0x18001c511\nmov     r8, rsi                                                        ; +0x125, 0x18001c515\nmov     rdx, r15                                                       ; +0x128, 0x18001c518\ncall    sub_1800195D0                                                  ; +0x12b, 0x18001c51b\nor      dword ptr [rdi+70h], 1                                         ; +0x130, 0x18001c520\nmov     rcx, rdi                                                       ; +0x134, 0x18001c524\ncall    cs:?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ; std::streambuf::_Pninc(void) ; +0x137, 0x18001c527\nmov     [rax], bpl                                                     ; +0x13d, 0x18001c52d\nmov     eax, ebp                                                       ; +0x140, 0x18001c530\njmp     short loc_18001C539                                            ; +0x142, 0x18001c532\nmov     eax, 0FFFFFFFFh                                                ; +0x144, 0x18001c534\nmov     rbx, [rsp+38h+arg_8]                                           ; +0x149, 0x18001c539\nmov     rbp, [rsp+38h+arg_10]                                          ; +0x14e, 0x18001c53e\nadd     rsp, 20h                                                       ; +0x153, 0x18001c543\npop     r15                                                            ; +0x157, 0x18001c547\npop     rdi                                                            ; +0x159, 0x18001c549\npop     rsi                                                            ; +0x15a, 0x18001c54a\nretn                                                                   ; +0x15b, 0x18001c54b", "xrefs": ["<???> @ 0x1800ecbe0", "<???> @ 0x18013bb84", "<???> @ 0x18013bb94", "<???> @ 0x1801b8b6c"], "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"}