{"type": "func", "start": 6442567408, "end": 6442567690, "name": "sub_18001C6F0", "pseudocode": "// \n// sub_18001C6F0 from 0x18001c6f0 to 0x18001c80a (282 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x1800e7030\n// > <???> @ 0x1801aeb0c\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_18001C6F0(_QWORD *a1, unsigned int a2)\n{\n  unsigned __int64 v4; // rbx\n  FILE *v6; // rdx\n  _BYTE *v7; // rbx\n\n  if ( std::streambuf::gptr(a1) )\n  {\n    v4 = std::streambuf::eback(a1);\n    if ( v4 < std::streambuf::gptr(a1) && (a2 == -1 || *(unsigned __int8 *)(std::streambuf::gptr(a1) - 1) == a2) )\n    {\n      std::streambuf::_Gndec(a1);\n      if ( a2 == -1 )\n        return 0;\n      return a2;\n    }\n  }\n  v6 = (FILE *)a1[16];\n  if ( !v6 || a2 == -1 )\n    return 0xFFFFFFFFLL;\n  if ( !a1[13] && ungetc((unsigned __int8)a2, v6) != -1 )\n    return a2;\n  v7 = a1 + 14;\n  if ( (_QWORD *)std::streambuf::gptr(a1) == a1 + 14 )\n    return 0xFFFFFFFFLL;\n  *v7 = a2;\n  if ( (_BYTE *)std::streambuf::eback(a1) != v7 )\n  {\n    a1[17] = std::streambuf::eback(a1);\n    a1[18] = std::streambuf::egptr(a1);\n  }\n  std::streambuf::setg(a1, a1 + 14, a1 + 14, (char *)a1 + 113);\n  return a2;\n}", "assembly": "; \n; sub_18001C6F0 from 0x18001c6f0 to 0x18001c80a (282 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x1800e7030\n; > <???> @ 0x1801aeb0c\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_0], rbx                                               ; +0x0, 0x18001c6f0\nmov     [rsp+arg_8], rsi                                               ; +0x5, 0x18001c6f5\npush    rdi                                                            ; +0xa, 0x18001c6fa\nsub     rsp, 20h                                                       ; +0xb, 0x18001c6fb\nmov     esi, edx                                                       ; +0xf, 0x18001c6ff\nmov     rdi, rcx                                                       ; +0x11, 0x18001c701\ncall    cs:?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ; std::streambuf::gptr(void) ; +0x14, 0x18001c704\ntest    rax, rax                                                       ; +0x1a, 0x18001c70a\njz      short loc_18001C762                                            ; +0x1d, 0x18001c70d\nmov     rcx, rdi                                                       ; +0x1f, 0x18001c70f\ncall    cs:?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ; std::streambuf::eback(void) ; +0x22, 0x18001c712\nmov     rcx, rdi                                                       ; +0x28, 0x18001c718\nmov     rbx, rax                                                       ; +0x2b, 0x18001c71b\ncall    cs:?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ; std::streambuf::gptr(void) ; +0x2e, 0x18001c71e\ncmp     rbx, rax                                                       ; +0x34, 0x18001c724\njnb     short loc_18001C762                                            ; +0x37, 0x18001c727\ncmp     esi, 0FFFFFFFFh                                                ; +0x39, 0x18001c729\njz      short loc_18001C73F                                            ; +0x3c, 0x18001c72c\nmov     rcx, rdi                                                       ; +0x3e, 0x18001c72e\ncall    cs:?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ; std::streambuf::gptr(void) ; +0x41, 0x18001c731\nmovzx   ecx, byte ptr [rax-1]                                          ; +0x47, 0x18001c737\ncmp     ecx, esi                                                       ; +0x4b, 0x18001c73b\njnz     short loc_18001C762                                            ; +0x4d, 0x18001c73d\nmov     rcx, rdi                                                       ; +0x4f, 0x18001c73f\ncall    cs:?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ; std::streambuf::_Gndec(void) ; +0x52, 0x18001c742\nxor     eax, eax                                                       ; +0x58, 0x18001c748\ncmp     esi, 0FFFFFFFFh                                                ; +0x5a, 0x18001c74a\ncmovz   esi, eax                                                       ; +0x5d, 0x18001c74d\nmov     eax, esi                                                       ; +0x60, 0x18001c750\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x62, 0x18001c752\nmov     rsi, [rsp+28h+arg_8]                                           ; +0x67, 0x18001c757\nadd     rsp, 20h                                                       ; +0x6c, 0x18001c75c\npop     rdi                                                            ; +0x70, 0x18001c760\nretn                                                                   ; +0x71, 0x18001c761\nmov     rdx, [rdi+80h]; Stream                                         ; +0x72, 0x18001c762\ntest    rdx, rdx                                                       ; +0x79, 0x18001c769\njz      loc_18001C7F5                                                  ; +0x7c, 0x18001c76c\ncmp     esi, 0FFFFFFFFh                                                ; +0x82, 0x18001c772\njz      short loc_18001C7F5                                            ; +0x85, 0x18001c775\ncmp     qword ptr [rdi+68h], 0                                         ; +0x87, 0x18001c777\njnz     short loc_18001C78D                                            ; +0x8c, 0x18001c77c\nmovzx   ecx, sil; Character                                            ; +0x8e, 0x18001c77e\ncall    cs:ungetc                                                      ; +0x92, 0x18001c782\ncmp     eax, 0FFFFFFFFh                                                ; +0x98, 0x18001c788\njnz     short loc_18001C750                                            ; +0x9b, 0x18001c78b\nmov     rcx, rdi                                                       ; +0x9d, 0x18001c78d\nlea     rbx, [rdi+70h]                                                 ; +0xa0, 0x18001c790\ncall    cs:?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ; std::streambuf::gptr(void) ; +0xa4, 0x18001c794\ncmp     rax, rbx                                                       ; +0xaa, 0x18001c79a\njz      short loc_18001C7F5                                            ; +0xad, 0x18001c79d\nmov     rcx, rdi                                                       ; +0xaf, 0x18001c79f\nmov     [rbx], sil                                                     ; +0xb2, 0x18001c7a2\ncall    cs:?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ; std::streambuf::eback(void) ; +0xb5, 0x18001c7a5\ncmp     rax, rbx                                                       ; +0xbb, 0x18001c7ab\njz      short loc_18001C7D0                                            ; +0xbe, 0x18001c7ae\nmov     rcx, rdi                                                       ; +0xc0, 0x18001c7b0\ncall    cs:?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ; std::streambuf::eback(void) ; +0xc3, 0x18001c7b3\nmov     rcx, rdi                                                       ; +0xc9, 0x18001c7b9\nmov     [rdi+88h], rax                                                 ; +0xcc, 0x18001c7bc\ncall    cs:?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ; std::streambuf::egptr(void) ; +0xd3, 0x18001c7c3\nmov     [rdi+90h], rax                                                 ; +0xd9, 0x18001c7c9\nlea     r9, [rdi+71h]                                                  ; +0xe0, 0x18001c7d0\nmov     r8, rbx                                                        ; +0xe4, 0x18001c7d4\nmov     rdx, rbx                                                       ; +0xe7, 0x18001c7d7\nmov     rcx, rdi                                                       ; +0xea, 0x18001c7da\ncall    cs:?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z; std::streambuf::setg(char *,char *,char *) ; +0xed, 0x18001c7dd\nmov     eax, esi                                                       ; +0xf3, 0x18001c7e3\nmov     rbx, [rsp+28h+arg_0]                                           ; +0xf5, 0x18001c7e5\nmov     rsi, [rsp+28h+arg_8]                                           ; +0xfa, 0x18001c7ea\nadd     rsp, 20h                                                       ; +0xff, 0x18001c7ef\npop     rdi                                                            ; +0x103, 0x18001c7f3\nretn                                                                   ; +0x104, 0x18001c7f4\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x105, 0x18001c7f5\nmov     eax, 0FFFFFFFFh                                                ; +0x10a, 0x18001c7fa\nmov     rsi, [rsp+28h+arg_8]                                           ; +0x10f, 0x18001c7ff\nadd     rsp, 20h                                                       ; +0x114, 0x18001c804\npop     rdi                                                            ; +0x118, 0x18001c808\nretn                                                                   ; +0x119, 0x18001c809", "xrefs": ["<???> @ 0x1800e7030", "<???> @ 0x1801aeb0c"], "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"}