{"type": "func", "start": 6443000688, "end": 6443001064, "name": "sub_180086370", "pseudocode": "// \n// sub_180086370 from 0x180086370 to 0x1800864e8 (376 bytes)\n// \n// 16 xrefs:\n// > sub_180081AE0 @ 0x180081b35\n// > sub_180081AE0 @ 0x180081bf0\n// > sub_180081AE0 @ 0x180081ca2\n// > sub_180081AE0 @ 0x180081d6c\n// > sub_180081AE0 @ 0x180081e53\n// > sub_180081AE0 @ 0x180081e82\n// > sub_180081AE0 @ 0x180081edf\n// > sub_180081AE0 @ 0x180081f5f\n// > sub_180081AE0 @ 0x180081fc0\n// > sub_180081AE0 @ 0x18008203f\n// > sub_180081AE0 @ 0x1800820cf\n// > sub_180082130 @ 0x1800821d3\n// > sub_180082130 @ 0x1800822ac\n// > <???> @ 0x18013c80c\n// > <???> @ 0x18013c81c\n// > <???> @ 0x1801b5688\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\nvoid *__fastcall sub_180086370(__int64 a1, char *a2, size_t a3)\n{\n  __int64 v3; // r15\n  size_t v4; // r14\n  void *result; // rax\n  unsigned __int64 v8; // rax\n  _BYTE *v9; // rdx\n  __int64 v10; // rdi\n  __int64 v11; // rax\n\n  v3 = *(_QWORD *)(a1 + 10248);\n  v4 = a3;\n  if ( v3 + a3 > 0x800 )\n  {\n    sub_180080D10(a1, a1, *(_QWORD *)(a1 + 10248));\n    v3 = 0;\n    *(_QWORD *)(a1 + 10248) = 0;\n    if ( v4 > 0x800 )\n    {\n      if ( *(_DWORD *)(a1 + 10256) == 1 )\n        return (void *)(*(__int64 (__fastcall **)(_QWORD, char *, size_t))(**(_QWORD **)(a1 + 10240) + 8LL))(\n                         *(_QWORD *)(a1 + 10240),\n                         a2,\n                         v4);\n      do\n      {\n        v8 = 1;\n        v9 = a2 + 2047;\n        while ( (*v9 & 0xC0) == 0x80 )\n        {\n          ++v8;\n          --v9;\n          if ( v8 > 4 )\n          {\n            v10 = 2048;\n            goto LABEL_10;\n          }\n        }\n        v10 = 2048 - v8;\nLABEL_10:\n        if ( *(_DWORD *)(a1 + 10256) == 1 )\n        {\n          (*(void (__fastcall **)(_QWORD, char *, __int64))(**(_QWORD **)(a1 + 10240) + 8LL))(\n            *(_QWORD *)(a1 + 10240),\n            a2,\n            v10);\n        }\n        else\n        {\n          v11 = sub_18007FF00(a1 + 2048, a1 + 2048, a1 + 2048, a1 + 2048, (__int64)a2, v10, *(_DWORD *)(a1 + 10256));\n          (*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 10240) + 8LL))(\n            *(_QWORD *)(a1 + 10240),\n            a1 + 2048,\n            v11);\n        }\n        a2 += v10;\n        v4 -= v10;\n      }\n      while ( v4 > 0x800 );\n      *(_QWORD *)(a1 + 10248) = 0;\n    }\n  }\n  result = memcpy((void *)(v3 + a1), a2, v4);\n  *(_QWORD *)(a1 + 10248) += v4;\n  return result;\n}", "assembly": "; \n; sub_180086370 from 0x180086370 to 0x1800864e8 (376 bytes)\n; \n; 16 xrefs:\n; > sub_180081AE0 @ 0x180081b35\n; > sub_180081AE0 @ 0x180081bf0\n; > sub_180081AE0 @ 0x180081ca2\n; > sub_180081AE0 @ 0x180081d6c\n; > sub_180081AE0 @ 0x180081e53\n; > sub_180081AE0 @ 0x180081e82\n; > sub_180081AE0 @ 0x180081edf\n; > sub_180081AE0 @ 0x180081f5f\n; > sub_180081AE0 @ 0x180081fc0\n; > sub_180081AE0 @ 0x18008203f\n; > sub_180081AE0 @ 0x1800820cf\n; > sub_180082130 @ 0x1800821d3\n; > sub_180082130 @ 0x1800822ac\n; > <???> @ 0x18013c80c\n; > <???> @ 0x18013c81c\n; > <???> @ 0x1801b5688\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_10], rbp                                              ; +0x0, 0x180086370\npush    rsi                                                            ; +0x5, 0x180086375\npush    r14                                                            ; +0x6, 0x180086376\npush    r15                                                            ; +0x8, 0x180086378\nsub     rsp, 40h                                                       ; +0xa, 0x18008637a\nmov     r15, [rcx+2808h]                                               ; +0xe, 0x18008637e\nmov     r14, r8                                                        ; +0x15, 0x180086385\nmov     rbp, rdx                                                       ; +0x18, 0x180086388\nmov     rsi, rcx                                                       ; +0x1b, 0x18008638b\nlea     rax, [r15+r8]                                                  ; +0x1e, 0x18008638e\ncmp     rax, 800h                                                      ; +0x22, 0x180086392\njbe     loc_1800864C3                                                  ; +0x28, 0x180086398\nmov     r8, r15                                                        ; +0x2e, 0x18008639e\nmov     rdx, rcx                                                       ; +0x31, 0x1800863a1\ncall    sub_180080D10                                                  ; +0x34, 0x1800863a4\nxor     r15d, r15d                                                     ; +0x39, 0x1800863a9\nmov     [rsi+2808h], r15                                               ; +0x3c, 0x1800863ac\ncmp     r14, 800h                                                      ; +0x43, 0x1800863b3\njbe     loc_1800864C3                                                  ; +0x4a, 0x1800863ba\ncmp     dword ptr [rsi+2810h], 1                                       ; +0x50, 0x1800863c0\njnz     short loc_1800863EB                                            ; +0x57, 0x1800863c7\nmov     rcx, [rsi+2800h]                                               ; +0x59, 0x1800863c9\nmov     r8, r14                                                        ; +0x60, 0x1800863d0\nmov     rdx, rbp                                                       ; +0x63, 0x1800863d3\nmov     rax, [rcx]                                                     ; +0x66, 0x1800863d6\nmov     rbp, [rsp+58h+arg_10]                                          ; +0x69, 0x1800863d9\nadd     rsp, 40h                                                       ; +0x6e, 0x1800863de\npop     r15                                                            ; +0x72, 0x1800863e2\npop     r14                                                            ; +0x74, 0x1800863e4\npop     rsi                                                            ; +0x76, 0x1800863e6\njmp     qword ptr [rax+8]                                              ; +0x77, 0x1800863e7\nmov     [rsp+58h+arg_8], rdi                                           ; +0x7b, 0x1800863eb\nmov     [rsp+58h+arg_0], rbx                                           ; +0x80, 0x1800863f0\nnop     word ptr [rax+rax+00000000h]                                   ; +0x85, 0x1800863f5\nmov     eax, 1                                                         ; +0x90, 0x180086400\nlea     rdx, [rbp+7FFh]                                                ; +0x95, 0x180086405\nnop     dword ptr [rax+00h]                                            ; +0x9c, 0x18008640c\nmovzx   ecx, byte ptr [rdx]                                            ; +0xa0, 0x180086410\nand     cl, 0C0h                                                       ; +0xa3, 0x180086413\ncmp     cl, 80h                                                        ; +0xa6, 0x180086416\njnz     short loc_18008642E                                            ; +0xa9, 0x180086419\ninc     rax                                                            ; +0xab, 0x18008641b\ndec     rdx                                                            ; +0xae, 0x18008641e\ncmp     rax, 4                                                         ; +0xb1, 0x180086421\njbe     short loc_180086410                                            ; +0xb5, 0x180086425\nmov     edi, 800h                                                      ; +0xb7, 0x180086427\njmp     short loc_180086438                                            ; +0xbc, 0x18008642c\nmov     edi, 800h                                                      ; +0xbe, 0x18008642e\nsub     rdi, rax                                                       ; +0xc3, 0x180086433\njz      short loc_18008649F                                            ; +0xc6, 0x180086436\nmov     eax, [rsi+2810h]                                               ; +0xc8, 0x180086438\ncmp     eax, 1                                                         ; +0xce, 0x18008643e\njnz     short loc_180086458                                            ; +0xd1, 0x180086441\nmov     rcx, [rsi+2800h]                                               ; +0xd3, 0x180086443\nmov     r8, rdi                                                        ; +0xda, 0x18008644a\nmov     rdx, rbp                                                       ; +0xdd, 0x18008644d\nmov     rax, [rcx]                                                     ; +0xe0, 0x180086450\ncall    qword ptr [rax+8]                                              ; +0xe3, 0x180086453\njmp     short loc_18008649F                                            ; +0xe6, 0x180086456\nmov     [rsp+58h+var_28], eax                                          ; +0xe8, 0x180086458\nlea     r9, [rsi+800h]                                                 ; +0xec, 0x18008645c\nmov     [rsp+58h+var_30], rdi                                          ; +0xf3, 0x180086463\nlea     r8, [rsi+800h]                                                 ; +0xf8, 0x180086468\nlea     rdx, [rsi+800h]                                                ; +0xff, 0x18008646f\nmov     [rsp+58h+var_38], rbp                                          ; +0x106, 0x180086476\nlea     rcx, [rsi+800h]                                                ; +0x10b, 0x18008647b\ncall    sub_18007FF00                                                  ; +0x112, 0x180086482\nmov     rcx, [rsi+2800h]                                               ; +0x117, 0x180086487\nlea     rdx, [rsi+800h]                                                ; +0x11e, 0x18008648e\nmov     r8, rax                                                        ; +0x125, 0x180086495\nmov     r9, [rcx]                                                      ; +0x128, 0x180086498\ncall    qword ptr [r9+8]                                               ; +0x12b, 0x18008649b\nadd     rbp, rdi                                                       ; +0x12f, 0x18008649f\nsub     r14, rdi                                                       ; +0x132, 0x1800864a2\ncmp     r14, 800h                                                      ; +0x135, 0x1800864a5\nja      loc_180086400                                                  ; +0x13c, 0x1800864ac\nmov     rdi, [rsp+58h+arg_8]                                           ; +0x142, 0x1800864b2\nmov     rbx, [rsp+58h+arg_0]                                           ; +0x147, 0x1800864b7\nmov     [rsi+2808h], r15                                               ; +0x14c, 0x1800864bc\nlea     rcx, [r15+rsi]; void *                                         ; +0x153, 0x1800864c3\nmov     r8, r14; Size                                                  ; +0x157, 0x1800864c7\nmov     rdx, rbp; Src                                                  ; +0x15a, 0x1800864ca\ncall    memcpy                                                         ; +0x15d, 0x1800864cd\nadd     [rsi+2808h], r14                                               ; +0x162, 0x1800864d2\nmov     rbp, [rsp+58h+arg_10]                                          ; +0x169, 0x1800864d9\nadd     rsp, 40h                                                       ; +0x16e, 0x1800864de\npop     r15                                                            ; +0x172, 0x1800864e2\npop     r14                                                            ; +0x174, 0x1800864e4\npop     rsi                                                            ; +0x176, 0x1800864e6\nretn                                                                   ; +0x177, 0x1800864e7", "xrefs": ["sub_180081AE0 @ 0x180081b35", "sub_180081AE0 @ 0x180081bf0", "sub_180081AE0 @ 0x180081ca2", "sub_180081AE0 @ 0x180081d6c", "sub_180081AE0 @ 0x180081e53", "sub_180081AE0 @ 0x180081e82", "sub_180081AE0 @ 0x180081edf", "sub_180081AE0 @ 0x180081f5f", "sub_180081AE0 @ 0x180081fc0", "sub_180081AE0 @ 0x18008203f", "sub_180081AE0 @ 0x1800820cf", "sub_180082130 @ 0x1800821d3", "sub_180082130 @ 0x1800822ac", "<???> @ 0x18013c80c", "<???> @ 0x18013c81c", "<???> @ 0x1801b5688"], "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"}