{"type": "func", "start": 6442968848, "end": 6442969184, "name": "sub_18007E710", "pseudocode": "// \n// sub_18007E710 from 0x18007e710 to 0x18007e860 (336 bytes)\n// \n// 2 xrefs:\n// > sub_18007FBB0 @ 0x18007fd91\n// > <???> @ 0x1801b4f14\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\nchar __fastcall sub_18007E710(_QWORD *a1, _QWORD *a2, unsigned int *a3, unsigned __int64 a4)\n{\n  __int64 v4; // r10\n  unsigned int *v5; // rbx\n  unsigned int *i; // rdi\n  unsigned __int32 v9; // eax\n  __int64 v10; // rax\n  __int64 v11; // rsi\n  _BYTE *v12; // rax\n  _BYTE *v13; // r11\n  _BYTE *j; // rdx\n  unsigned __int32 v15; // eax\n  char v16; // r8\n\n  v4 = 0;\n  v5 = a3;\n  for ( i = &a3[a4 >> 2]; a3 < i; v4 += v10 )\n  {\n    v9 = _byteswap_ulong(*a3);\n    if ( v9 >= 0x10000 )\n    {\n      v10 = 4;\n    }\n    else if ( v9 >= 0x80 )\n    {\n      v10 = 3LL - (v9 < 0x800);\n    }\n    else\n    {\n      v10 = 1;\n    }\n    ++a3;\n  }\n  v11 = v4 + 1;\n  v12 = off_1801A2FA0(v4 + 1);\n  v13 = v12;\n  if ( v12 )\n  {\n    for ( j = v12; v5 < i; ++v5 )\n    {\n      v15 = _byteswap_ulong(*v5);\n      if ( v15 >= 0x10000 )\n      {\n        *j = (v15 >> 18) | 0xF0;\n        j[1] = (v15 >> 12) & 0x3F | 0x80;\n        j[3] = v15 & 0x3F | 0x80;\n        j[2] = (v15 >> 6) & 0x3F | 0x80;\n        j += 4;\n      }\n      else if ( v15 >= 0x80 )\n      {\n        v16 = v15 & 0x3F | 0x80;\n        if ( v15 >= 0x800 )\n        {\n          j[2] = v16;\n          j[1] = (v15 >> 6) & 0x3F | 0x80;\n          *j = (v15 >> 12) | 0xE0;\n          j += 3;\n        }\n        else\n        {\n          j[1] = v16;\n          *j = (v15 >> 6) | 0xC0;\n          j += 2;\n        }\n      }\n      else\n      {\n        *j++ = v15;\n      }\n    }\n    *j = 0;\n    *a1 = v13;\n    *a2 = v11;\n    LOBYTE(v12) = 1;\n  }\n  return (char)v12;\n}", "assembly": "; \n; sub_18007E710 from 0x18007e710 to 0x18007e860 (336 bytes)\n; \n; 2 xrefs:\n; > sub_18007FBB0 @ 0x18007fd91\n; > <???> @ 0x1801b4f14\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, 0x18007e710\nmov     [rsp+arg_8], rsi                                               ; +0x5, 0x18007e715\nmov     [rsp+arg_10], rdi                                              ; +0xa, 0x18007e71a\nmov     [rsp+arg_18], r14                                              ; +0xf, 0x18007e71f\npush    r15                                                            ; +0x14, 0x18007e724\nsub     rsp, 20h                                                       ; +0x16, 0x18007e726\nshr     r9, 2                                                          ; +0x1a, 0x18007e72a\nxor     r10d, r10d                                                     ; +0x1e, 0x18007e72e\nmov     rbx, r8                                                        ; +0x21, 0x18007e731\nmov     r14, rdx                                                       ; +0x24, 0x18007e734\nmov     r15, rcx                                                       ; +0x27, 0x18007e737\nlea     rdi, [r8+r9*4]                                                 ; +0x2a, 0x18007e73a\ncmp     r8, rdi                                                        ; +0x2e, 0x18007e73e\njnb     short loc_18007E77C                                            ; +0x31, 0x18007e741\nmov     eax, [r8]                                                      ; +0x33, 0x18007e743\nbswap   eax                                                            ; +0x36, 0x18007e746\ncmp     eax, 10000h                                                    ; +0x38, 0x18007e748\njnb     short loc_18007E76B                                            ; +0x3d, 0x18007e74d\ncmp     eax, 80h                                                       ; +0x3f, 0x18007e74f\njnb     short loc_18007E75D                                            ; +0x44, 0x18007e754\nmov     eax, 1                                                         ; +0x46, 0x18007e756\njmp     short loc_18007E770                                            ; +0x4b, 0x18007e75b\ncmp     eax, 800h                                                      ; +0x4d, 0x18007e75d\nsbb     rax, rax                                                       ; +0x52, 0x18007e762\nadd     rax, 3                                                         ; +0x55, 0x18007e765\njmp     short loc_18007E770                                            ; +0x59, 0x18007e769\nmov     eax, 4                                                         ; +0x5b, 0x18007e76b\nadd     r8, 4                                                          ; +0x60, 0x18007e770\nadd     r10, rax                                                       ; +0x64, 0x18007e774\ncmp     r8, rdi                                                        ; +0x67, 0x18007e777\njb      short loc_18007E743                                            ; +0x6a, 0x18007e77a\nlea     rsi, [r10+1]                                                   ; +0x6c, 0x18007e77c\nmov     rcx, rsi; Size                                                 ; +0x70, 0x18007e780\ncall    cs:off_1801A2FA0                                               ; +0x73, 0x18007e783\nmov     r11, rax                                                       ; +0x79, 0x18007e789\ntest    rax, rax                                                       ; +0x7c, 0x18007e78c\njz      loc_18007E845                                                  ; +0x7f, 0x18007e78f\nmov     rdx, r11                                                       ; +0x85, 0x18007e795\ncmp     rbx, rdi                                                       ; +0x88, 0x18007e798\njnb     loc_18007E83A                                                  ; +0x8b, 0x18007e79b\nmov     eax, [rbx]                                                     ; +0x91, 0x18007e7a1\nbswap   eax                                                            ; +0x93, 0x18007e7a3\ncmp     eax, 10000h                                                    ; +0x95, 0x18007e7a5\njnb     short loc_18007E7FC                                            ; +0x9a, 0x18007e7aa\ncmp     eax, 80h                                                       ; +0x9c, 0x18007e7ac\njnb     short loc_18007E7BA                                            ; +0xa1, 0x18007e7b1\nmov     [rdx], al                                                      ; +0xa3, 0x18007e7b3\ninc     rdx                                                            ; +0xa5, 0x18007e7b5\njmp     short loc_18007E82D                                            ; +0xa8, 0x18007e7b8\nmovzx   r8d, al                                                        ; +0xaa, 0x18007e7ba\nand     r8b, 3Fh                                                       ; +0xae, 0x18007e7be\nor      r8b, 80h                                                       ; +0xb2, 0x18007e7c2\ncmp     eax, 800h                                                      ; +0xb6, 0x18007e7c6\njnb     short loc_18007E7DE                                            ; +0xbb, 0x18007e7cb\nshr     eax, 6                                                         ; +0xbd, 0x18007e7cd\nor      al, 0C0h                                                       ; +0xc0, 0x18007e7d0\nmov     [rdx+1], r8b                                                   ; +0xc2, 0x18007e7d2\nmov     [rdx], al                                                      ; +0xc6, 0x18007e7d6\nadd     rdx, 2                                                         ; +0xc8, 0x18007e7d8\njmp     short loc_18007E82D                                            ; +0xcc, 0x18007e7dc\nmov     ecx, eax                                                       ; +0xce, 0x18007e7de\nmov     [rdx+2], r8b                                                   ; +0xd0, 0x18007e7e0\nshr     eax, 6                                                         ; +0xd4, 0x18007e7e4\nand     al, 3Fh                                                        ; +0xd7, 0x18007e7e7\nshr     ecx, 0Ch                                                       ; +0xd9, 0x18007e7e9\nor      al, 80h                                                        ; +0xdc, 0x18007e7ec\nor      cl, 0E0h                                                       ; +0xde, 0x18007e7ee\nmov     [rdx+1], al                                                    ; +0xe1, 0x18007e7f1\nmov     [rdx], cl                                                      ; +0xe4, 0x18007e7f4\nadd     rdx, 3                                                         ; +0xe6, 0x18007e7f6\njmp     short loc_18007E82D                                            ; +0xea, 0x18007e7fa\nmov     ecx, eax                                                       ; +0xec, 0x18007e7fc\nshr     ecx, 12h                                                       ; +0xee, 0x18007e7fe\nor      cl, 0F0h                                                       ; +0xf1, 0x18007e801\nmov     [rdx], cl                                                      ; +0xf4, 0x18007e804\nmov     ecx, eax                                                       ; +0xf6, 0x18007e806\nshr     ecx, 0Ch                                                       ; +0xf8, 0x18007e808\nand     cl, 3Fh                                                        ; +0xfb, 0x18007e80b\nor      cl, 80h                                                        ; +0xfe, 0x18007e80e\nmov     [rdx+1], cl                                                    ; +0x101, 0x18007e811\nmov     ecx, eax                                                       ; +0x104, 0x18007e814\nshr     ecx, 6                                                         ; +0x106, 0x18007e816\nand     al, 3Fh                                                        ; +0x109, 0x18007e819\nand     cl, 3Fh                                                        ; +0x10b, 0x18007e81b\nor      al, 80h                                                        ; +0x10e, 0x18007e81e\nor      cl, 80h                                                        ; +0x110, 0x18007e820\nmov     [rdx+3], al                                                    ; +0x113, 0x18007e823\nmov     [rdx+2], cl                                                    ; +0x116, 0x18007e826\nadd     rdx, 4                                                         ; +0x119, 0x18007e829\nadd     rbx, 4                                                         ; +0x11d, 0x18007e82d\ncmp     rbx, rdi                                                       ; +0x121, 0x18007e831\njb      loc_18007E7A1                                                  ; +0x124, 0x18007e834\nmov     byte ptr [rdx], 0                                              ; +0x12a, 0x18007e83a\nmov     al, 1                                                          ; +0x12d, 0x18007e83d\nmov     [r15], r11                                                     ; +0x12f, 0x18007e83f\nmov     [r14], rsi                                                     ; +0x132, 0x18007e842\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x135, 0x18007e845\nmov     rsi, [rsp+28h+arg_8]                                           ; +0x13a, 0x18007e84a\nmov     rdi, [rsp+28h+arg_10]                                          ; +0x13f, 0x18007e84f\nmov     r14, [rsp+28h+arg_18]                                          ; +0x144, 0x18007e854\nadd     rsp, 20h                                                       ; +0x149, 0x18007e859\npop     r15                                                            ; +0x14d, 0x18007e85d\nretn                                                                   ; +0x14f, 0x18007e85f", "xrefs": ["sub_18007FBB0 @ 0x18007fd91", "<???> @ 0x1801b4f14"], "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"}