Function at 0x140015210
Capabilities:
Read file on windows

Disassembly:
push rbx
push rsi
push r12
sub rsp, 0x90
mov rax, qword [0x1400de438]
xor rax, rsp
mov qword [rsp + 0x68], rax
mov r12d, ecx
mov dword [rsp + 0x28], edx
mov rcx, qword [0x1400e1008]
mov ebx, r8d
mov esi, edx
cmp dword [rcx - 0x10], 0
je 0x140015541
lea rdx, [0x1400a55f8]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
mov qword [0x1400e0f68], rax
test rax, rax
je 0x140015541
mov edx, 0xe
lea rcx, [rsp + 0x30]
mov r9, rax
lea r8d, [rdx - 0xd]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
mov eax, 0x4d42
cmp word [rsp + 0x30], ax
je 0x1400152a5
mov rcx, qword [0x1400e0f68]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov qword [0x1400e0f68], 0
jmp 0x140015541
mov r9, qword [0x1400e0f68]
lea rcx, [rsp + 0x40]
mov edx, 0x28
lea r8d, [rdx - 0x27]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
cmp word [rsp + 0x4c], 1
jne 0x140015605
cmp word [rsp + 0x4e], 8
jne 0x140015605
cmp dword [rsp + 0x50], 1
ja 0x140015605
mov edx, dword [rsp + 0x3a]
xor r8d, r8d
mov rcx, qword [0x1400e0f68]
mov qword [rsp + 0xc0], rbp
mov qword [rsp + 0x88], rdi
mov edi, dword [rsp + 0x48]
mov qword [rsp + 0x80], r13
mov qword [rsp + 0x70], r15
mov r15d, dword [rsp + 0x44]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
mov ecx, ebx
sub ecx, 1
je 0x140015329
cmp ecx, 2
jne 0x140015334
mov eax, 1
sub eax, r15d
add r12d, eax
sub ebx, 2
je 0x14001533e
cmp ebx, 1
jne 0x14001534b
mov eax, 1
sub eax, edi
add esi, eax
mov dword [rsp + 0x28], esi
mov dword [rsp + 0x24], r15d
mov ebp, r15d
test r15b, 3
je 0x14001536c
nop dword [rax]
inc ebp
test bpl, 3
jne 0x140015360
mov dword [rsp + 0x24], ebp
mov ecx, dword [rsp + 0x50]
lea r13d, [rdi - 1]
mov qword [rsp + 0x78], r14
mov dword [rsp + 0x2c], ecx
test r13d, r13d
js 0x140015507
nop word [rax + rax]
add esi, r13d
test ecx, ecx
je 0x140015569
cmp ecx, 1
jne 0x1400154f5
xor ebx, ebx
test r15d, r15d
jle 0x1400154f5
nop
mov r9, qword [0x1400e0f68]
lea rcx, [rsp + 0x20]
mov edx, 1
mov r8d, edx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
mov r9, qword [0x1400e0f68]
lea rcx, [rsp + 0x20]
movzx edi, byte [rsp + 0x20]
mov edx, 1
mov r8d, edx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
test edi, edi
je 0x140015445
mov ecx, dword [0x1400dfe58]
lea r8d, [r12 + rbx]
cmp ebx, r15d
jge 0x1400154f1
test r8d, r8d
js 0x140015436
cmp r8d, ecx
jge 0x140015436
test esi, esi
js 0x140015436
cmp esi, dword [0x1400dfe5c]
jge 0x140015436
mov eax, esi
imul eax, ecx
movzx ecx, byte [rsp + 0x20]
add eax, r8d
movsxd rdx, eax
mov rax, qword [0x1400dfe98]
mov byte [rdx + rax], cl
mov ecx, dword [0x1400dfe58]
inc ebx
inc r8d
sub edi, 1
jne 0x1400153f7
jmp 0x1400154e8
movzx r14d, byte [rsp + 0x20]
cmp r14d, 2
jbe 0x1400154dd
mov ebp, r14d
lea edi, [r12 + rbx]
nop dword [rax]
cmp ebx, r15d
jge 0x1400154bb
mov r9, qword [0x1400e0f68]
lea rcx, [rsp + 0x20]
mov edx, 1
mov r8d, edx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
test edi, edi
js 0x1400154b2
mov ecx, dword [0x1400dfe58]
cmp edi, ecx
jge 0x1400154b2
test esi, esi
js 0x1400154b2
cmp esi, dword [0x1400dfe5c]
jge 0x1400154b2
mov eax, esi
imul eax, ecx
movzx ecx, byte [rsp + 0x20]
add eax, edi
movsxd rdx, eax
mov rax, qword [0x1400dfe98]
mov byte [rdx + rax], cl
inc ebx
inc edi
sub ebp, 1
jne 0x140015460
test r14b, 1
je 0x1400154e8
mov r9, qword [0x1400e0f68]
lea rcx, [rsp + 0x20]
mov edx, 1
mov r8d, edx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
jmp 0x1400154e8
test r14d, r14d
je 0x14001555a
cmp r14d, 1
je 0x14001551f
cmp ebx, r15d
jl 0x1400153b0
mov ebp, dword [rsp + 0x24]
sub r13d, 1
mov ecx, dword [rsp + 0x2c]
mov esi, dword [rsp + 0x28]
jns 0x140015390
mov rcx, qword [0x1400e0f68]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov qword [0x1400e0f68], 0
mov r14, qword [rsp + 0x78]
mov r13, qword [rsp + 0x80]
mov rdi, qword [rsp + 0x88]
mov rbp, qword [rsp + 0xc0]
mov r15, qword [rsp + 0x70]
mov rcx, qword [rsp + 0x68]
xor rcx, rsp
call fcn.14008bb30
add rsp, 0x90
pop r12
pop rsi
pop rbx
ret
lea eax, [r13 + 1]
test ebx, ebx
cmovne eax, r13d
mov r13d, eax
jmp 0x1400154f1
xor ebx, ebx
test r15d, r15d
jle 0x1400155cb
mov r9, qword [0x1400e0f68]
lea rcx, [rsp + 0x20]
mov edx, 1
mov r8d, edx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
lea eax, [r12 + rbx]
test eax, eax
js 0x1400155c4
mov ecx, dword [0x1400dfe58]
cmp eax, ecx
jge 0x1400155c4
test esi, esi
js 0x1400155c4
cmp esi, dword [0x1400dfe5c]
jge 0x1400155c4
mov eax, esi
imul eax, ecx
movzx ecx, byte [rsp + 0x20]
add eax, r12d
add eax, ebx
movsxd rdx, eax
mov rax, qword [0x1400dfe98]
mov byte [rdx + rax], cl
inc ebx
cmp ebx, r15d
jl 0x140015570
cmp ebx, ebp
jge 0x1400154f5
mov eax, ebp
sub eax, ebx
mov ebx, eax
nop dword [rax]
mov r9, qword [0x1400e0f68]
lea rcx, [rsp + 0x20]
mov edx, 1
mov r8d, edx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
sub rbx, 1
jne 0x1400155e0
jmp 0x1400154f5
mov rcx, qword [0x1400e0f68]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
xor edx, edx
mov qword [0x1400e0f68], 0
mov ecx, 0x102
mov r8d, 0xffffffff
call sub.mfc140.dll_Ordinal_2263
jmp 0x140015541