{"type": "func", "start": 6443690016, "end": 6443690405, "name": "sub_18012E820", "pseudocode": "// \n// sub_18012E820 from 0x18012e820 to 0x18012e9a5 (389 bytes)\n// \n// 2 xrefs:\n// > __multtenpow12 @ 0x18012da0f\n// > <???> @ 0x180202cfc\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 10:54:58 +0000\n// \n\nchar __fastcall sub_18012E820(__int64 a1, unsigned int a2, char a3)\n{\n  __int64 v6; // rax\n  __int64 v7; // rsi\n  __int64 v9; // rdi\n  int v10; // eax\n  bool v11; // zf\n  __int64 v12; // rax\n  int v13; // eax\n  __int64 v14; // rax\n  int v15; // eax\n  __int64 v16; // rax\n  int v17; // ecx\n  unsigned __int64 v18; // rdx\n\n  v6 = __crt_stdio_output::to_integer_size(*(_DWORD *)(a1 + 60));\n  v7 = v6;\n  switch ( v6 )\n  {\n    case 1LL:\n      v15 = *(_DWORD *)(a1 + 48);\n      *(_QWORD *)(a1 + 32) += 8LL;\n      v11 = (v15 & 0x10) == 0;\n      v16 = *(_QWORD *)(a1 + 32);\n      if ( v11 )\n        v9 = *(unsigned __int8 *)(v16 - 8);\n      else\n        v9 = *(char *)(v16 - 8);\n      break;\n    case 2LL:\n      v13 = *(_DWORD *)(a1 + 48);\n      *(_QWORD *)(a1 + 32) += 8LL;\n      v11 = (v13 & 0x10) == 0;\n      v14 = *(_QWORD *)(a1 + 32);\n      if ( v11 )\n        v9 = *(unsigned __int16 *)(v14 - 8);\n      else\n        v9 = *(__int16 *)(v14 - 8);\n      break;\n    case 4LL:\n      v10 = *(_DWORD *)(a1 + 48);\n      *(_QWORD *)(a1 + 32) += 8LL;\n      v11 = (v10 & 0x10) == 0;\n      v12 = *(_QWORD *)(a1 + 32);\n      if ( v11 )\n        v9 = *(unsigned int *)(v12 - 8);\n      else\n        v9 = *(int *)(v12 - 8);\n      break;\n    case 8LL:\n      *(_QWORD *)(a1 + 32) += 8LL;\n      v9 = *(_QWORD *)(*(_QWORD *)(a1 + 32) - 8LL);\n      break;\n    default:\n      *errno() = 22;\n      invalid_parameter_noinfo();\n      return 0;\n  }\n  v17 = *(_DWORD *)(a1 + 48);\n  if ( (v17 & 0x10) != 0 && v9 < 0 )\n  {\n    v9 = -v9;\n    v17 |= 0x40u;\n    *(_DWORD *)(a1 + 48) = v17;\n  }\n  if ( *(int *)(a1 + 56) >= 0 )\n  {\n    v18 = *(int *)(a1 + 56);\n    *(_DWORD *)(a1 + 48) = v17 & 0xFFFFFFF7;\n    __crt_stdio_output::formatting_buffer::ensure_buffer_is_big_enough<wchar_t>(a1 + 88, v18);\n  }\n  else\n  {\n    *(_DWORD *)(a1 + 56) = 1;\n  }\n  if ( !v9 )\n    *(_DWORD *)(a1 + 48) &= ~0x20u;\n  *(_BYTE *)(a1 + 84) = 1;\n  if ( v7 == 8 )\n    unknown_libname_34(a1, v9, a2, a3);\n  else\n    unknown_libname_31(a1, v9, a2, a3);\n  if ( (*(_DWORD *)(a1 + 48) & 0x80) != 0 && (!*(_DWORD *)(a1 + 80) || **(_WORD **)(a1 + 72) != 48) )\n  {\n    *(_QWORD *)(a1 + 72) -= 2LL;\n    **(_WORD **)(a1 + 72) = 48;\n    ++*(_DWORD *)(a1 + 80);\n  }\n  return 1;\n}", "assembly": "; \n; sub_18012E820 from 0x18012e820 to 0x18012e9a5 (389 bytes)\n; \n; 2 xrefs:\n; > __multtenpow12 @ 0x18012da0f\n; > <???> @ 0x180202cfc\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 10:54:58 +0000\n; \nmov     rax, rsp                                                       ; +0x0, 0x18012e820\nmov     [rax+8], rbx                                                   ; +0x3, 0x18012e823\nmov     [rax+10h], rbp                                                 ; +0x7, 0x18012e827\nmov     [rax+18h], rsi                                                 ; +0xb, 0x18012e82b\nmov     [rax+20h], rdi                                                 ; +0xf, 0x18012e82f\npush    r14                                                            ; +0x13, 0x18012e833\nsub     rsp, 20h                                                       ; +0x15, 0x18012e835\nmov     rbx, rcx                                                       ; +0x19, 0x18012e839\nmov     bpl, r8b                                                       ; +0x1c, 0x18012e83c\nmov     ecx, [rcx+3Ch]                                                 ; +0x1f, 0x18012e83f\nmov     r14d, edx                                                      ; +0x22, 0x18012e842\ncall    ?to_integer_size@__crt_stdio_output@@YA_KW4length_modifier@1@@Z; __crt_stdio_output::to_integer_size(__crt_stdio_output::length_modifier) ; +0x25, 0x18012e845\nmov     rcx, rax                                                       ; +0x2a, 0x18012e84a\nmov     rsi, rax                                                       ; +0x2d, 0x18012e84d\nsub     rcx, 1                                                         ; +0x30, 0x18012e850\njz      short loc_18012E8D4                                            ; +0x34, 0x18012e854\nsub     rcx, 1                                                         ; +0x36, 0x18012e856\njz      short loc_18012E8B4                                            ; +0x3a, 0x18012e85a\nsub     rcx, 2                                                         ; +0x3c, 0x18012e85c\njz      short loc_18012E896                                            ; +0x40, 0x18012e860\ncmp     rcx, 4                                                         ; +0x42, 0x18012e862\njz      short loc_18012E87F                                            ; +0x46, 0x18012e866\ncall    _errno                                                         ; +0x48, 0x18012e868\nmov     dword ptr [rax], 16h                                           ; +0x4d, 0x18012e86d\ncall    _invalid_parameter_noinfo                                      ; +0x53, 0x18012e873\nxor     al, al                                                         ; +0x58, 0x18012e878\njmp     loc_18012E98A                                                  ; +0x5a, 0x18012e87a\nmov     eax, [rbx+30h]                                                 ; +0x5f, 0x18012e87f\nadd     qword ptr [rbx+20h], 8                                         ; +0x62, 0x18012e882\nshr     eax, 4                                                         ; +0x67, 0x18012e887\ntest    al, 1                                                          ; +0x6a, 0x18012e88a\nmov     rax, [rbx+20h]                                                 ; +0x6c, 0x18012e88c\nmov     rdi, [rax-8]                                                   ; +0x70, 0x18012e890\njmp     short loc_18012E8F2                                            ; +0x74, 0x18012e894\nmov     eax, [rbx+30h]                                                 ; +0x76, 0x18012e896\nadd     qword ptr [rbx+20h], 8                                         ; +0x79, 0x18012e899\nshr     eax, 4                                                         ; +0x7e, 0x18012e89e\ntest    al, 1                                                          ; +0x81, 0x18012e8a1\nmov     rax, [rbx+20h]                                                 ; +0x83, 0x18012e8a3\njz      short loc_18012E8AF                                            ; +0x87, 0x18012e8a7\nmovsxd  rdi, dword ptr [rax-8]                                         ; +0x89, 0x18012e8a9\njmp     short loc_18012E8F2                                            ; +0x8d, 0x18012e8ad\nmov     edi, [rax-8]                                                   ; +0x8f, 0x18012e8af\njmp     short loc_18012E8F2                                            ; +0x92, 0x18012e8b2\nmov     eax, [rbx+30h]                                                 ; +0x94, 0x18012e8b4\nadd     qword ptr [rbx+20h], 8                                         ; +0x97, 0x18012e8b7\nshr     eax, 4                                                         ; +0x9c, 0x18012e8bc\ntest    al, 1                                                          ; +0x9f, 0x18012e8bf\nmov     rax, [rbx+20h]                                                 ; +0xa1, 0x18012e8c1\njz      short loc_18012E8CE                                            ; +0xa5, 0x18012e8c5\nmovsx   rdi, word ptr [rax-8]                                          ; +0xa7, 0x18012e8c7\njmp     short loc_18012E8F2                                            ; +0xac, 0x18012e8cc\nmovzx   edi, word ptr [rax-8]                                          ; +0xae, 0x18012e8ce\njmp     short loc_18012E8F2                                            ; +0xb2, 0x18012e8d2\nmov     eax, [rbx+30h]                                                 ; +0xb4, 0x18012e8d4\nadd     qword ptr [rbx+20h], 8                                         ; +0xb7, 0x18012e8d7\nshr     eax, 4                                                         ; +0xbc, 0x18012e8dc\ntest    al, 1                                                          ; +0xbf, 0x18012e8df\nmov     rax, [rbx+20h]                                                 ; +0xc1, 0x18012e8e1\njz      short loc_18012E8EE                                            ; +0xc5, 0x18012e8e5\nmovsx   rdi, byte ptr [rax-8]                                          ; +0xc7, 0x18012e8e7\njmp     short loc_18012E8F2                                            ; +0xcc, 0x18012e8ec\nmovzx   edi, byte ptr [rax-8]                                          ; +0xce, 0x18012e8ee\nmov     ecx, [rbx+30h]                                                 ; +0xd2, 0x18012e8f2\nmov     eax, ecx                                                       ; +0xd5, 0x18012e8f5\nshr     eax, 4                                                         ; +0xd7, 0x18012e8f7\ntest    al, 1                                                          ; +0xda, 0x18012e8fa\njz      short loc_18012E90C                                            ; +0xdc, 0x18012e8fc\ntest    rdi, rdi                                                       ; +0xde, 0x18012e8fe\njns     short loc_18012E90C                                            ; +0xe1, 0x18012e901\nneg     rdi                                                            ; +0xe3, 0x18012e903\nor      ecx, 40h                                                       ; +0xe6, 0x18012e906\nmov     [rbx+30h], ecx                                                 ; +0xe9, 0x18012e909\ncmp     dword ptr [rbx+38h], 0                                         ; +0xec, 0x18012e90c\njge     short loc_18012E91B                                            ; +0xf0, 0x18012e910\nmov     dword ptr [rbx+38h], 1                                         ; +0xf2, 0x18012e912\njmp     short loc_18012E92E                                            ; +0xf9, 0x18012e919\nmovsxd  rdx, dword ptr [rbx+38h]                                       ; +0xfb, 0x18012e91b\nand     ecx, 0FFFFFFF7h                                                ; +0xff, 0x18012e91f\nmov     [rbx+30h], ecx                                                 ; +0x102, 0x18012e922\nlea     rcx, [rbx+58h]                                                 ; +0x105, 0x18012e925\ncall    ??$ensure_buffer_is_big_enough@_W@formatting_buffer@__crt_stdio_output@@QEAA_N_K@Z; __crt_stdio_output::formatting_buffer::ensure_buffer_is_big_enough<wchar_t>(unsigned __int64) ; +0x109, 0x18012e929\ntest    rdi, rdi                                                       ; +0x10e, 0x18012e92e\njnz     short loc_18012E937                                            ; +0x111, 0x18012e931\nand     dword ptr [rbx+30h], 0FFFFFFDFh                                ; +0x113, 0x18012e933\nmov     byte ptr [rbx+54h], 1                                          ; +0x117, 0x18012e937\nmov     r9b, bpl                                                       ; +0x11b, 0x18012e93b\nmov     r8d, r14d                                                      ; +0x11e, 0x18012e93e\nmov     rcx, rbx                                                       ; +0x121, 0x18012e941\ncmp     rsi, 8                                                         ; +0x124, 0x18012e944\njnz     short loc_18012E954                                            ; +0x128, 0x18012e948\nmov     rdx, rdi                                                       ; +0x12a, 0x18012e94a\ncall    unknown_libname_34; Microsoft VisualC 64bit universal runtime  ; +0x12d, 0x18012e94d\njmp     short loc_18012E95B                                            ; +0x132, 0x18012e952\nmov     edx, edi                                                       ; +0x134, 0x18012e954\ncall    unknown_libname_31; Microsoft VisualC 64bit universal runtime  ; +0x136, 0x18012e956\nmov     eax, [rbx+30h]                                                 ; +0x13b, 0x18012e95b\nshr     eax, 7                                                         ; +0x13e, 0x18012e95e\ntest    al, 1                                                          ; +0x141, 0x18012e961\njz      short loc_18012E988                                            ; +0x143, 0x18012e963\ncmp     dword ptr [rbx+50h], 0                                         ; +0x145, 0x18012e965\nmov     eax, 30h ; '0'                                                 ; +0x149, 0x18012e969\njz      short loc_18012E979                                            ; +0x14e, 0x18012e96e\nmov     rcx, [rbx+48h]                                                 ; +0x150, 0x18012e970\ncmp     [rcx], ax                                                      ; +0x154, 0x18012e974\njz      short loc_18012E988                                            ; +0x157, 0x18012e977\nadd     qword ptr [rbx+48h], 0FFFFFFFFFFFFFFFEh                        ; +0x159, 0x18012e979\nmov     rcx, [rbx+48h]                                                 ; +0x15e, 0x18012e97e\nmov     [rcx], ax                                                      ; +0x162, 0x18012e982\ninc     dword ptr [rbx+50h]                                            ; +0x165, 0x18012e985\nmov     al, 1                                                          ; +0x168, 0x18012e988\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x16a, 0x18012e98a\nmov     rbp, [rsp+28h+arg_8]                                           ; +0x16f, 0x18012e98f\nmov     rsi, [rsp+28h+arg_10]                                          ; +0x174, 0x18012e994\nmov     rdi, [rsp+28h+arg_18]                                          ; +0x179, 0x18012e999\nadd     rsp, 20h                                                       ; +0x17e, 0x18012e99e\npop     r14                                                            ; +0x182, 0x18012e9a2\nretn                                                                   ; +0x184, 0x18012e9a4", "xrefs": ["__multtenpow12 @ 0x18012da0f", "<???> @ 0x180202cfc"], "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"}