Function at 0x1400599c0
Capabilities:
Check if file exists
Get common file path
Read file on windows

Disassembly:
mov rax, rsp
push r13
push r14
push r15
sub rsp, 0x5c0
mov qword [rsp + 0x88], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rsi
mov qword [rax + 0x18], rdi
mov qword [rax + 0x20], r12
mov rax, qword [0x14011d8d0]
xor rax, rsp
mov qword [rsp + 0x5b0], rax
lea rcx, [0x14011d880]
mov rax, qword [0x14011d880]
call qword [rax + 0x18]
lea rbx, [rax + 0x18]
mov qword [rsp + 0x40], rbx
xor esi, esi
mov word [rsp + 0x3a0], si
xor edx, edx
mov r8d, 0x206
lea rcx, [rsp + 0x3a2]
call sub.MSVCR100.dll_memset
call fcn.1400193c0
xor r9d, r9d
lea rdx, [rsp + 0x3a0]
xor ecx, ecx
cmp eax, 0x60
jl 0x140059b93
lea r8d, [rsi + 0x24]
call qword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
xor eax, eax
or r13, 0xffffffffffffffff
mov rcx, r13
lea rdi, [rsp + 0x3a0]
repne scasw ax, word [rdi]
not rcx
dec rcx
mov rdi, rcx
test ecx, ecx
jne 0x140059ae3
lea rdx, [rbx - 0x18]
mov rdi, qword [rdx]
cmp dword [rdx + 8], eax
je 0x140059ad8
cmp dword [rdx + 0x10], eax
jge 0x140059aaf
cmp dword [rbx - 0xc], eax
jge 0x140059a9e
mov ecx, 0x80070057
call fcn.140001000
int3
mov dword [rbx - 0x10], esi
mov word [rbx], si
mov r12d, 1
jmp 0x140059b6a
mov eax, r13d
lock xadd dword [rdx + 0x10], eax
dec eax
test eax, eax
jg 0x140059ac6
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + 8]
mov rax, qword [rdi]
mov rcx, rdi
call qword [rax + 0x18]
add rax, 0x18
mov qword [rsp + 0x40], rax
mov r12d, 1
jmp 0x140059b6a
mov r15d, dword [rbx - 0x10]
lea r14, [rsp + 0x3a0]
sub r14, rbx
sar r14, 1
test ecx, ecx
jns 0x140059b04
mov ecx, 0x80070057
call fcn.140001000
int3
mov r12d, 1
mov ecx, r12d
sub ecx, dword [rbx - 8]
mov eax, dword [rbx - 0xc]
sub eax, edi
or eax, ecx
jge 0x140059b2a
mov edx, edi
lea rcx, [rsp + 0x40]
call fcn.140001c20
mov rbx, qword [rsp + 0x40]
movsxd rax, edi
movsxd rdx, dword [rbx - 0xc]
mov rcx, rbx
add rdx, rdx
cmp r14, r15
lea r15, [rax + rax]
mov r9, r15
ja 0x140059b4f
lea r8, [rbx + r14*2]
call qword [sym.imp.MSVCR100.dll_memmove_s]
jmp 0x140059b5d
lea r8, [rsp + 0x3a0]
call qword [sym.imp.MSVCR100.dll_memcpy_s]
cmp edi, dword [rbx - 0xc]
jg 0x140059b88
mov dword [rbx - 0x10], edi
mov word [r15 + rbx], si
mov r8d, 9
lea rdx, str.csup.txt
lea rcx, [rsp + 0x40]
call fcn.140003c10
mov bl, 1
jmp 0x140059cca
mov ecx, 0x80070057
call fcn.140001000
int3
mov r8d, 0x25
call qword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
xor eax, eax
or r13, 0xffffffffffffffff
mov rcx, r13
lea rdi, [rsp + 0x3a0]
repne scasw ax, word [rdi]
not rcx
dec rcx
mov rdi, rcx
test ecx, ecx
jne 0x140059c26
lea rdx, [rbx - 0x18]
mov rdi, qword [rdx]
cmp dword [rdx + 8], eax
je 0x140059c1b
cmp dword [rdx + 0x10], eax
jge 0x140059bf2
cmp dword [rbx - 0xc], eax
jge 0x140059be1
mov ecx, 0x80070057
call fcn.140001000
int3
mov dword [rbx - 0x10], esi
mov word [rbx], si
mov r12d, 1
jmp 0x140059cb1
mov eax, r13d
lock xadd dword [rdx + 0x10], eax
dec eax
test eax, eax
jg 0x140059c09
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + 8]
mov rax, qword [rdi]
mov rcx, rdi
call qword [rax + 0x18]
add rax, 0x18
mov qword [rsp + 0x40], rax
mov r12d, 1
jmp 0x140059cb1
mov r15d, dword [rbx - 0x10]
lea r14, [rsp + 0x3a0]
sub r14, rbx
sar r14, 1
test ecx, ecx
jns 0x140059c47
mov ecx, 0x80070057
call fcn.140001000
int3
mov r12d, 1
mov ecx, r12d
sub ecx, dword [rbx - 8]
mov eax, dword [rbx - 0xc]
sub eax, edi
or eax, ecx
jge 0x140059c6d
mov edx, edi
lea rcx, [rsp + 0x40]
call fcn.140001c20
mov rbx, qword [rsp + 0x40]
movsxd rax, edi
movsxd rdx, dword [rbx - 0xc]
mov rcx, rbx
add rdx, rdx
cmp r14, r15
lea r15, [rax + rax]
mov r9, r15
ja 0x140059c92
lea r8, [rbx + r14*2]
call qword [sym.imp.MSVCR100.dll_memmove_s]
jmp 0x140059ca0
lea r8, [rsp + 0x3a0]
call qword [sym.imp.MSVCR100.dll_memcpy_s]
cmp edi, dword [rbx - 0xc]
jg 0x14005a069
mov dword [rbx - 0x10], edi
mov word [r15 + rbx], si
mov r8d, Ordinal_17
lea rdx, str.oeminfo.ini
lea rcx, [rsp + 0x40]
call fcn.140003c10
xor bl, bl
mov dword [rsp + 0xd0], esi
xor edx, edx
mov r8d, 0x24c
lea rcx, [rsp + 0xd4]
call sub.MSVCR100.dll_memset
mov qword [rsp + 0x58], rsi
mov rdi, qword [rsp + 0x40]
mov rcx, rdi
call qword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x14005a049
test bl, bl
je 0x140059f5b
mov qword [rsp + 0x50], rsi
lea r8, [0x1400e5ff0]
mov rdx, rdi
lea rcx, [rsp + 0x50]
call qword [sym.imp.MSVCR100.dll__wfopen_s]
test eax, eax
jne 0x14005a021
mov byte [rsp + 0x320], sil
xor edx, edx
lea r8d, [rax + 0x7f]
lea rcx, [rsp + 0x321]
call sub.MSVCR100.dll_memset
nop
mov r9, qword [rsp + 0x50]
mov r8d, 0x80
mov rdx, r12
lea rcx, [rsp + 0x320]
call qword [sym.imp.MSVCR100.dll_fread]
mov rdi, rax
lea rcx, [0x14011d880]
mov rdx, qword [0x14011d880]
call qword [rdx + 0x18]
add rax, 0x18
mov qword [rsp + 0x48], rax
cmp edi, 0x14
jl 0x140059dc4
lea rdx, [rsp + 0x322]
lea rcx, [rsp + 0x320]
mov eax, 0xfeff
cmp ax, word [rsp + 0x320]
cmovne rdx, rcx
xor eax, eax
mov rcx, r13
mov rdi, rdx
repne scasw ax, word [rdi]
not rcx
lea r8d, [rcx - 1]
lea rcx, [rsp + 0x48]
call fcn.140001e80
jmp 0x140059dd6
lea rdx, [rsp + 0x320]
lea rcx, [rsp + 0x48]
call fcn.14000d9a0
mov r9d, 4
lea r8d, [r9 + 2]
lea rdx, [rsp + 0x70]
lea rcx, [rsp + 0x48]
call fcn.140006840
mov rcx, qword [rax]
call qword [sym.imp.MSVCR100.dll__wtoi]
mov r14d, eax
mov rdx, qword [rsp + 0x70]
add rdx, 0xffffffffffffffe8
mov ecx, r13d
lock xadd dword [rdx + 0x10], ecx
dec ecx
test ecx, ecx
jg 0x140059e1b
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + 8]
mov eax, 0x76c
cmp r14d, eax
jl 0x140059f19
mov r8d, 2
lea rdx, [rsp + 0x78]
lea rcx, [rsp + 0x48]
call fcn.140001d30
mov rcx, qword [rax]
call qword [sym.imp.MSVCR100.dll__wtoi]
mov edi, eax
mov rdx, qword [rsp + 0x78]
add rdx, 0xffffffffffffffe8
mov ecx, r13d
lock xadd dword [rdx + 0x10], ecx
dec ecx
test ecx, ecx
jg 0x140059e69
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + 8]
dec edi
cmp edi, 0xb
ja 0x140059f19
mov r9d, 2
lea r8d, [r9 + 1]
lea rdx, [rsp + 0x68]
lea rcx, [rsp + 0x48]
call fcn.140006840
mov rcx, qword [rax]
call qword [sym.imp.MSVCR100.dll__wtoi]
mov ebx, eax
mov rdx, qword [rsp + 0x68]
add rdx, 0xffffffffffffffe8
mov ecx, r13d
lock xadd dword [rdx + 0x10], ecx
dec ecx
test ecx, ecx
jg 0x140059eb8
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + 8]
lea eax, [rbx - 1]
cmp eax, 0x1e
ja 0x140059f19
mov qword [rsp + 0xa0], rsi
mov dword [rsp + 0xa8], esi
mov dword [rsp + 0xac], ebx
mov dword [rsp + 0xb0], edi
lea eax, [r14 - 0x76c]
mov dword [rsp + 0xb4], eax
mov dword [rsp + 0xc0], r13d
lea rcx, [rsp + 0xa0]
call qword [sym.imp.MSVCR100.dll__mktime64]
mov rsi, rax
cmp rax, 0xffffffffffffffff
jne 0x140059f14
mov ecx, 0x80070057
call fcn.140001000
mov qword [rsp + 0x58], rax
mov rdx, qword [rsp + 0x48]
add rdx, 0xffffffffffffffe8
mov eax, r13d
lock xadd dword [rdx + 0x10], eax
dec eax
test eax, eax
jg 0x140059f3a
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + 8]
nop
mov rdi, qword [rsp + 0x40]
jmp 0x14005a021
lea rdx, [rsp + 0xd0]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_FindFirstFileW]
cmp rax, 0xffffffffffffffff
je 0x14005a049
lea rdx, [rsp + 0x60]
lea rcx, [rsp + 0xd4]
call qword [sym.imp.KERNEL32.dll_FileTimeToLocalFileTime]
test eax, eax
jne 0x140059f98
mov ecx, 0x80070057
call fcn.140001000
int3
lea rdx, [rsp + 0x90]
lea rcx, [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_FileTimeToSystemTime]
test eax, eax
jne 0x140059fba
mov ecx, 0x80070057
call fcn.140001000
int3
mov eax, 0x76c
movzx edx, word [rsp + 0x90]
cmp dx, ax
jb 0x14005a021
movzx eax, word [rsp + 0x9c]
movzx ecx, word [rsp + 0x9a]
movzx r10d, word [rsp + 0x98]
movzx r9d, word [rsp + 0x96]
movzx r8d, word [rsp + 0x92]
movzx edx, dx
mov dword [rsp + 0x38], r13d
mov dword [rsp + 0x30], eax
mov dword [rsp + 0x28], ecx
mov dword [rsp + 0x20], r10d
lea rcx, [rsp + 0x80]
call fcn.14000fec0
mov rsi, qword [rsp + 0x80]
call qword [sym.imp.MSVCR100.dll__tzset]
xor ecx, ecx
call qword [sym.imp.MSVCR100.dll__time64]
mov r11, rax
test rax, rax
js 0x14005a043
lea rax, [rsi + 0x1e13380]
cmp r11, rax
jl 0x14005a049
mov r12d, 7
lea rdx, [rdi - 0x18]
lock xadd dword [rdx + 0x10], r13d
dec r13d
test r13d, r13d
jg 0x14005a064
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + 8]
mov eax, r12d
jmp 0x14005a074
mov ecx, 0x80070057
call fcn.140001000
nop
mov rcx, qword [rsp + 0x5b0]
xor rcx, rsp
call fcn.1400cafa0
lea r11, [rsp + 0x5c0]
mov rbx, qword [r11 + 0x20]
mov rsi, qword [r11 + 0x28]
mov rdi, qword [r11 + 0x30]
mov r12, qword [r11 + 0x38]
mov rsp, r11
pop r15
pop r14
pop r13
ret