{"type": "func", "start": 6442981104, "end": 6442981469, "name": "sub_1800816F0", "pseudocode": "// \n// sub_1800816F0 from 0x1800816f0 to 0x18008185d (365 bytes)\n// \n// 3 xrefs:\n// > sub_180082B00 @ 0x180082cc9\n// > <???> @ 0x1801bf1f0\n// > <???> @ 0x1801bf1fc\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:22:02 +0000\n// \n\nchar __fastcall sub_1800816F0(_QWORD *a1, _QWORD *a2, unsigned int *a3, unsigned __int64 a4)\n{\n  __int64 v4; // r11\n  unsigned int *v5; // rbx\n  unsigned int *v8; // r10\n  unsigned __int64 v9; // rdi\n  unsigned __int32 v10; // eax\n  __int64 v11; // rax\n  __int64 v12; // rsi\n  _BYTE *v13; // rax\n  _BYTE *v14; // r9\n  _BYTE *i; // rdx\n  unsigned __int32 v16; // eax\n  __int64 v17; // r8\n  unsigned __int32 v18; // ecx\n  char v19; // r8\n\n  v4 = 0;\n  v5 = a3;\n  v8 = a3;\n  v9 = (unsigned __int64)&a3[a4 >> 2];\n  if ( (unsigned __int64)a3 < v9 )\n  {\n    do\n    {\n      v10 = _byteswap_ulong(*v8);\n      if ( v10 >= 0x10000 )\n      {\n        v11 = 4;\n      }\n      else if ( v10 >= 0x80 )\n      {\n        v11 = 3LL - (v10 < 0x800);\n      }\n      else\n      {\n        v11 = 1;\n      }\n      ++v8;\n      v4 += v11;\n    }\n    while ( (unsigned __int64)v8 < v9 );\n  }\n  v12 = v4 + 1;\n  v13 = off_1801ACF70(v4 + 1);\n  v14 = v13;\n  if ( v13 )\n  {\n    for ( i = v13; (unsigned __int64)v5 < v9; i += v17 )\n    {\n      v16 = _byteswap_ulong(*v5);\n      if ( v16 >= 0x10000 )\n      {\n        v17 = 4;\n        *i = (v16 >> 18) | 0xF0;\n        i[1] = (v16 >> 12) & 0x3F | 0x80;\n        i[2] = (v16 >> 6) & 0x3F | 0x80;\n        i[3] = v16 & 0x3F | 0x80;\n      }\n      else if ( v16 >= 0x80 )\n      {\n        v18 = v16 >> 6;\n        v19 = v16 & 0x3F | 0x80;\n        if ( v16 >= 0x800 )\n        {\n          i[2] = v19;\n          i[1] = v18 & 0x3F | 0x80;\n          *i = (v16 >> 12) | 0xE0;\n          v17 = 3;\n        }\n        else\n        {\n          i[1] = v19;\n          *i = v18 | 0xC0;\n          v17 = 2;\n        }\n      }\n      else\n      {\n        v17 = 1;\n        *i = v16;\n      }\n      ++v5;\n    }\n    *i = 0;\n    *a1 = v14;\n    *a2 = v12;\n    LOBYTE(v13) = 1;\n  }\n  return (char)v13;\n}", "assembly": "; \n; sub_1800816F0 from 0x1800816f0 to 0x18008185d (365 bytes)\n; \n; 3 xrefs:\n; > sub_180082B00 @ 0x180082cc9\n; > <???> @ 0x1801bf1f0\n; > <???> @ 0x1801bf1fc\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:22:02 +0000\n; \nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x1800816f0\nmov     [rsp+arg_8], rsi                                               ; +0x5, 0x1800816f5\nmov     [rsp+arg_10], rdi                                              ; +0xa, 0x1800816fa\nmov     [rsp+arg_18], r14                                              ; +0xf, 0x1800816ff\npush    r15                                                            ; +0x14, 0x180081704\nsub     rsp, 20h                                                       ; +0x16, 0x180081706\nshr     r9, 2                                                          ; +0x1a, 0x18008170a\nxor     r11d, r11d                                                     ; +0x1e, 0x18008170e\nmov     rbx, r8                                                        ; +0x21, 0x180081711\nmov     r14, rdx                                                       ; +0x24, 0x180081714\nmov     r15, rcx                                                       ; +0x27, 0x180081717\nmov     r10, r8                                                        ; +0x2a, 0x18008171a\nlea     rdi, [r8+r9*4]                                                 ; +0x2d, 0x18008171d\ncmp     r8, rdi                                                        ; +0x31, 0x180081721\njnb     short loc_180081769                                            ; +0x34, 0x180081724\nnop     word ptr [rax+rax+00000000h]                                   ; +0x36, 0x180081726\nmov     eax, [r10]                                                     ; +0x40, 0x180081730\nbswap   eax                                                            ; +0x43, 0x180081733\ncmp     eax, 10000h                                                    ; +0x45, 0x180081735\njnb     short loc_180081758                                            ; +0x4a, 0x18008173a\ncmp     eax, 80h                                                       ; +0x4c, 0x18008173c\njnb     short loc_18008174A                                            ; +0x51, 0x180081741\nmov     eax, 1                                                         ; +0x53, 0x180081743\njmp     short loc_18008175D                                            ; +0x58, 0x180081748\ncmp     eax, 800h                                                      ; +0x5a, 0x18008174a\nsbb     rax, rax                                                       ; +0x5f, 0x18008174f\nadd     rax, 3                                                         ; +0x62, 0x180081752\njmp     short loc_18008175D                                            ; +0x66, 0x180081756\nmov     eax, 4                                                         ; +0x68, 0x180081758\nadd     r10, 4                                                         ; +0x6d, 0x18008175d\nadd     r11, rax                                                       ; +0x71, 0x180081761\ncmp     r10, rdi                                                       ; +0x74, 0x180081764\njb      short loc_180081730                                            ; +0x77, 0x180081767\nlea     rsi, [r11+1]                                                   ; +0x79, 0x180081769\nmov     rcx, rsi; Size                                                 ; +0x7d, 0x18008176d\ncall    cs:off_1801ACF70                                               ; +0x80, 0x180081770\nmov     r9, rax                                                        ; +0x86, 0x180081776\ntest    rax, rax                                                       ; +0x89, 0x180081779\njz      loc_180081842                                                  ; +0x8c, 0x18008177c\nmov     rdx, r9                                                        ; +0x92, 0x180081782\ncmp     rbx, rdi                                                       ; +0x95, 0x180081785\njnb     loc_180081837                                                  ; +0x98, 0x180081788\nxchg    ax, ax                                                         ; +0x9e, 0x18008178e\nmov     eax, [rbx]                                                     ; +0xa0, 0x180081790\nbswap   eax                                                            ; +0xa2, 0x180081792\ncmp     eax, 10000h                                                    ; +0xa4, 0x180081794\njnb     short loc_1800817F4                                            ; +0xa9, 0x180081799\ncmp     eax, 80h                                                       ; +0xab, 0x18008179b\njnb     short loc_1800817AC                                            ; +0xb0, 0x1800817a0\nmov     r8d, 1                                                         ; +0xb2, 0x1800817a2\nmov     [rdx], al                                                      ; +0xb8, 0x1800817a8\njmp     short loc_180081827                                            ; +0xba, 0x1800817aa\nmovzx   r8d, al                                                        ; +0xbc, 0x1800817ac\nmov     ecx, eax                                                       ; +0xc0, 0x1800817b0\nand     r8b, 3Fh                                                       ; +0xc2, 0x1800817b2\nshr     ecx, 6                                                         ; +0xc6, 0x1800817b6\nor      r8b, 80h                                                       ; +0xc9, 0x1800817b9\ncmp     eax, 800h                                                      ; +0xcd, 0x1800817bd\njnb     short loc_1800817D8                                            ; +0xd2, 0x1800817c2\nor      cl, 0C0h                                                       ; +0xd4, 0x1800817c4\nmov     [rdx+1], r8b                                                   ; +0xd7, 0x1800817c7\nmovzx   eax, cl                                                        ; +0xdb, 0x1800817cb\nmov     [rdx], cl                                                      ; +0xde, 0x1800817ce\nmov     r8d, 2                                                         ; +0xe0, 0x1800817d0\njmp     short loc_180081827                                            ; +0xe6, 0x1800817d6\nand     cl, 3Fh                                                        ; +0xe8, 0x1800817d8\nmov     [rdx+2], r8b                                                   ; +0xeb, 0x1800817db\nor      cl, 80h                                                        ; +0xef, 0x1800817df\nshr     eax, 0Ch                                                       ; +0xf2, 0x1800817e2\nor      al, 0E0h                                                       ; +0xf5, 0x1800817e5\nmov     [rdx+1], cl                                                    ; +0xf7, 0x1800817e7\nmov     [rdx], al                                                      ; +0xfa, 0x1800817ea\nmov     r8d, 3                                                         ; +0xfc, 0x1800817ec\njmp     short loc_180081827                                            ; +0x102, 0x1800817f2\nmov     ecx, eax                                                       ; +0x104, 0x1800817f4\nmov     r8d, 4                                                         ; +0x106, 0x1800817f6\nshr     ecx, 12h                                                       ; +0x10c, 0x1800817fc\nor      cl, 0F0h                                                       ; +0x10f, 0x1800817ff\nmov     [rdx], cl                                                      ; +0x112, 0x180081802\nmov     ecx, eax                                                       ; +0x114, 0x180081804\nshr     ecx, 0Ch                                                       ; +0x116, 0x180081806\nand     cl, 3Fh                                                        ; +0x119, 0x180081809\nor      cl, 80h                                                        ; +0x11c, 0x18008180c\nmov     [rdx+1], cl                                                    ; +0x11f, 0x18008180f\nmov     ecx, eax                                                       ; +0x122, 0x180081812\nshr     ecx, 6                                                         ; +0x124, 0x180081814\nand     al, 3Fh                                                        ; +0x127, 0x180081817\nand     cl, 3Fh                                                        ; +0x129, 0x180081819\nor      cl, 80h                                                        ; +0x12c, 0x18008181c\nor      al, 80h                                                        ; +0x12f, 0x18008181f\nmov     [rdx+2], cl                                                    ; +0x131, 0x180081821\nmov     [rdx+3], al                                                    ; +0x134, 0x180081824\nadd     rbx, 4                                                         ; +0x137, 0x180081827\nadd     rdx, r8                                                        ; +0x13b, 0x18008182b\ncmp     rbx, rdi                                                       ; +0x13e, 0x18008182e\njb      loc_180081790                                                  ; +0x141, 0x180081831\nmov     byte ptr [rdx], 0                                              ; +0x147, 0x180081837\nmov     al, 1                                                          ; +0x14a, 0x18008183a\nmov     [r15], r9                                                      ; +0x14c, 0x18008183c\nmov     [r14], rsi                                                     ; +0x14f, 0x18008183f\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x152, 0x180081842\nmov     rsi, [rsp+28h+arg_8]                                           ; +0x157, 0x180081847\nmov     rdi, [rsp+28h+arg_10]                                          ; +0x15c, 0x18008184c\nmov     r14, [rsp+28h+arg_18]                                          ; +0x161, 0x180081851\nadd     rsp, 20h                                                       ; +0x166, 0x180081856\npop     r15                                                            ; +0x16a, 0x18008185a\nretn                                                                   ; +0x16c, 0x18008185c", "xrefs": ["sub_180082B00 @ 0x180082cc9", "<???> @ 0x1801bf1f0", "<???> @ 0x1801bf1fc"], "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"}