Function at 0x140090180
Capabilities:
Read file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x98
cmp dword [rcx], 1
mov r9, qword [rdx]
mov rbp, rcx
mov r15, rdx
jle 0x1400903fd
mov qword [rsp + 0x48], r9
mov r13d, 1
mov rcx, r9
xor edi, edi
mov dword [rsp + 0x40], 0x7d0
mov r12d, r13d
movsxd rbx, r12d
mov rax, qword [rcx + rbx*8]
lea r14, [rbx*8]
cmp byte [rax], 0x40
jne 0x1400903f0
sub dword [rsp + 0x40], 1
je 0x14009047b
lea rsi, [rax + 1]
lea rdx, [rsp + 0x50]
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_filesystem_l1_1_0.dll__stat64]
test eax, eax
js 0x1400903f0
movzx eax, word [rsp + 0x56]
and ax, 0xf000
cmp ax, 0x4000
je 0x1400904a5
mov rcx, rsi
lea rdx, [0x1400ccbd1]
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fopen
mov rsi, rax
test rax, rax
je 0x1400903f0
xor edx, edx
mov r8d, 2
mov rcx, rax
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fseek
cmp eax, 0xffffffff
je 0x140090428
mov rcx, rsi
call sub.api_ms_win_crt_stdio_l1_1_0.dll_ftell
movsxd r13, eax
cmp r13d, 0xffffffff
je 0x140090428
xor r8d, r8d
xor edx, edx
mov rcx, rsi
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fseek
cmp eax, 0xffffffff
je 0x140090428
lea rcx, [r13 + 1]
call fcn.1400aacd0
mov edx, 1
mov r9, rsi
mov r8, r13
mov rcx, rax
mov qword [rsp + 0x20], rax
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fread
mov rdx, rax
cmp r13, rax
je 0x1400902b2
mov rcx, rsi
mov qword [rsp + 0x28], rax
call sub.api_ms_win_crt_stdio_l1_1_0.dll_ferror
mov rdx, qword [rsp + 0x28]
test eax, eax
jne 0x140090418
mov rax, qword [rsp + 0x20]
mov byte [rax + rdx], 0
mov rdx, rax
movzx eax, byte [rax]
test al, al
jne 0x1400902e0
jmp 0x140090430
movzx eax, byte [rdx + 1]
add rdx, 1
test al, al
je 0x140090430
mov rcx, qword [0x1400ce2f0]
test byte [rcx + rax*2], 0x40
jne 0x1400902d0
mov rcx, qword [rsp + 0x20]
call fcn.1400594d0
mov rdx, qword [rsp + 0x48]
mov r13, rax
mov rax, qword [r15]
cmp rax, rdx
je 0x140090451
cmp qword [r13], 0
je 0x140090463
xor edx, edx
nop dword [rax + rax]
add rdx, 1
cmp qword [r13 + rdx*8], 0
jne 0x140090320
lea rcx, [rdx*8]
mov r11d, edx
mov qword [rsp + 0x28], rcx
lea rcx, [rbx + rdx]
shl rcx, 3
mov qword [rsp + 0x30], rcx
mov rcx, qword [rax + rbx*8]
mov dword [rsp + 0x44], r11d
mov qword [rsp + 0x38], rdx
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
movsxd rax, dword [rbp]
mov rdx, qword [rsp + 0x38]
mov rcx, qword [r15]
lea rdx, [rdx + rax + 1]
shl rdx, 3
call fcn.1400aad70
mov edx, dword [rbp]
mov rcx, qword [rsp + 0x30]
mov qword [r15], rax
lea r10, [rax + r14 + 8]
sub edx, r12d
add rcx, rax
movsxd rdx, edx
lea r8, [rdx*8]
mov rdx, r10
call sub.api_ms_win_crt_private_l1_1_0.dll_memmove
mov rcx, qword [r15]
mov r8, qword [rsp + 0x28]
mov rdx, r13
add rcx, r14
call sub.api_ms_win_crt_private_l1_1_0.dll_memcpy
mov eax, dword [rbp]
mov r11d, dword [rsp + 0x44]
mov rcx, r13
lea eax, [r11 + rax - 1]
mov dword [rbp], eax
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov rcx, qword [rsp + 0x20]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov rcx, rsi
lea r12d, [rdi + 1]
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fclose
cmp dword [rbp], r12d
jle 0x1400903fd
mov rcx, qword [r15]
jmp 0x1400901c0
mov edi, r12d
lea r12d, [rdi + 1]
cmp dword [rbp], r12d
jg 0x1400903e6
add rsp, 0x98
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov rcx, qword [rsp + 0x20]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
nop word [rax + rax]
mov edi, r12d
jmp 0x1400903d4
mov ecx, 8
call fcn.1400aacd0
mov rdx, qword [rsp + 0x48]
mov qword [rax], 0
mov r13, rax
mov rax, qword [r15]
cmp rax, rdx
jne 0x140090463
mov rcx, qword [rsp + 0x48]
call fcn.140070fc0
mov qword [r15], rax
jmp 0x14009030b
mov qword [rsp + 0x30], r14
xor r11d, r11d
xor edx, edx
mov qword [rsp + 0x28], 0
jmp 0x140090349
mov rbx, qword [rcx]
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
lea rdx, str._s:_error:_too_many___files_encountered_n
mov rcx, rax
mov r8, rbx
call fcn.140092940
mov ecx, 1
call fcn.1400aacb0
mov rax, qword [r15]
mov ecx, 2
mov rbx, qword [rax]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
lea rdx, str._s:_error:___file_refers_to_a_directory_n
mov rcx, rax
mov r8, rbx
call fcn.140092940
mov ecx, 1
call fcn.1400aacb0
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov eax, dword [rcx]
bswap eax
mov eax, eax
ret