{"type": "func", "start": 6442590080, "end": 6442590277, "name": "sub_180021F80", "pseudocode": "// \n// sub_180021F80 from 0x180021f80 to 0x180022045 (197 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x1800ecbf8\n// > <???> @ 0x1801b8f38\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:28 +0000\n// \n\n__int64 __fastcall sub_180021F80(__int64 a1)\n{\n  unsigned __int8 *v2; // rbx\n  unsigned __int64 v4; // rax\n  unsigned __int64 v5; // rsi\n  __int64 v6; // rbx\n  __int64 v7; // rax\n\n  v2 = (unsigned __int8 *)std::streambuf::gptr(a1);\n  if ( !v2 )\n    return 0xFFFFFFFFLL;\n  if ( (unsigned __int64)v2 < std::streambuf::egptr(a1) )\n    return *v2;\n  v4 = std::streambuf::pptr(a1);\n  if ( !v4 || (*(_BYTE *)(a1 + 112) & 4) != 0 )\n    return 0xFFFFFFFFLL;\n  v5 = *(_QWORD *)(a1 + 104);\n  if ( v5 < v4 )\n    v5 = v4;\n  if ( v5 <= (unsigned __int64)v2 )\n    return 0xFFFFFFFFLL;\n  *(_QWORD *)(a1 + 104) = v5;\n  v6 = std::streambuf::gptr(a1);\n  v7 = std::streambuf::eback(a1);\n  std::streambuf::setg(a1, v7, v6, v5);\n  return *(unsigned __int8 *)std::streambuf::gptr(a1);\n}", "assembly": "; \n; sub_180021F80 from 0x180021f80 to 0x180022045 (197 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x1800ecbf8\n; > <???> @ 0x1801b8f38\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:28 +0000\n; \nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x180021f80\nmov     [rsp+arg_8], rsi                                               ; +0x5, 0x180021f85\npush    rdi                                                            ; +0xa, 0x180021f8a\nsub     rsp, 20h                                                       ; +0xb, 0x180021f8b\nmov     rdi, rcx                                                       ; +0xf, 0x180021f8f\ncall    cs:?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ; std::streambuf::gptr(void) ; +0x12, 0x180021f92\nmov     rbx, rax                                                       ; +0x18, 0x180021f98\ntest    rax, rax                                                       ; +0x1b, 0x180021f9b\njz      loc_180022030                                                  ; +0x1e, 0x180021f9e\nmov     rcx, rdi                                                       ; +0x24, 0x180021fa4\ncall    cs:?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ; std::streambuf::egptr(void) ; +0x27, 0x180021fa7\ncmp     rbx, rax                                                       ; +0x2d, 0x180021fad\njnb     short loc_180021FC5                                            ; +0x30, 0x180021fb0\nmovzx   eax, byte ptr [rbx]                                            ; +0x32, 0x180021fb2\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x35, 0x180021fb5\nmov     rsi, [rsp+28h+arg_8]                                           ; +0x3a, 0x180021fba\nadd     rsp, 20h                                                       ; +0x3f, 0x180021fbf\npop     rdi                                                            ; +0x43, 0x180021fc3\nretn                                                                   ; +0x44, 0x180021fc4\nmov     rcx, rdi                                                       ; +0x45, 0x180021fc5\ncall    cs:?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ; std::streambuf::pptr(void) ; +0x48, 0x180021fc8\ntest    rax, rax                                                       ; +0x4e, 0x180021fce\njz      short loc_180022030                                            ; +0x51, 0x180021fd1\ntest    byte ptr [rdi+70h], 4                                          ; +0x53, 0x180021fd3\njnz     short loc_180022030                                            ; +0x57, 0x180021fd7\nmov     rsi, [rdi+68h]                                                 ; +0x59, 0x180021fd9\ncmp     rsi, rax                                                       ; +0x5d, 0x180021fdd\ncmovb   rsi, rax                                                       ; +0x60, 0x180021fe0\ncmp     rsi, rbx                                                       ; +0x64, 0x180021fe4\njbe     short loc_180022030                                            ; +0x67, 0x180021fe7\nmov     rcx, rdi                                                       ; +0x69, 0x180021fe9\nmov     [rdi+68h], rsi                                                 ; +0x6c, 0x180021fec\ncall    cs:?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ; std::streambuf::gptr(void) ; +0x70, 0x180021ff0\nmov     rcx, rdi                                                       ; +0x76, 0x180021ff6\nmov     rbx, rax                                                       ; +0x79, 0x180021ff9\ncall    cs:?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ; std::streambuf::eback(void) ; +0x7c, 0x180021ffc\nmov     r9, rsi                                                        ; +0x82, 0x180022002\nmov     r8, rbx                                                        ; +0x85, 0x180022005\nmov     rdx, rax                                                       ; +0x88, 0x180022008\nmov     rcx, rdi                                                       ; +0x8b, 0x18002200b\ncall    cs:?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z; std::streambuf::setg(char *,char *,char *) ; +0x8e, 0x18002200e\nmov     rcx, rdi                                                       ; +0x94, 0x180022014\ncall    cs:?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ; std::streambuf::gptr(void) ; +0x97, 0x180022017\nmovzx   eax, byte ptr [rax]                                            ; +0x9d, 0x18002201d\nmov     rbx, [rsp+28h+arg_0]                                           ; +0xa0, 0x180022020\nmov     rsi, [rsp+28h+arg_8]                                           ; +0xa5, 0x180022025\nadd     rsp, 20h                                                       ; +0xaa, 0x18002202a\npop     rdi                                                            ; +0xae, 0x18002202e\nretn                                                                   ; +0xaf, 0x18002202f\nmov     rbx, [rsp+28h+arg_0]                                           ; +0xb0, 0x180022030\nmov     eax, 0FFFFFFFFh                                                ; +0xb5, 0x180022035\nmov     rsi, [rsp+28h+arg_8]                                           ; +0xba, 0x18002203a\nadd     rsp, 20h                                                       ; +0xbf, 0x18002203f\npop     rdi                                                            ; +0xc3, 0x180022043\nretn                                                                   ; +0xc4, 0x180022044", "xrefs": ["<???> @ 0x1800ecbf8", "<???> @ 0x1801b8f38"], "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"}