Function at 0x140016354
Capabilities:
Read file on windows

Disassembly:
mov qword [rsp + 0x10], rdx
mov dword [rsp + 8], ecx
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x58
mov r12d, 0xfffffffe
movsxd rax, ecx
mov ebx, r8d
mov dword [rsp + 0x34], r12d
mov dword [rsp + 0x38], ebx
cmp eax, r12d
jne 0x140015d90
call fcn.14001458c
xor edi, edi
mov dword [rax], edi
call fcn.14001456c
mov dword [rax], 9
jmp 0x1400164af
xor edi, edi
cmp eax, edi
jl 0x140016489
cmp eax, dword [0x140027364]
jae 0x140016489
mov rsi, rax
mov r14, rax
lea r9, [0x140011000]
sar r14, 5
and esi, 0x1f
mov rcx, qword [r9 + r14*8 + 0x16380]
imul rsi, rsi, 0x58
mov al, byte [rcx + rsi + 8]
test al, 1
je 0x140016489
cmp ebx, 0x7fffffff
jbe 0x140015df1
call fcn.14001458c
mov dword [rax], edi
call fcn.14001456c
mov dword [rax], 0x16
jmp 0x14001649b
mov ebp, edi
cmp ebx, edi
je 0x140016485
test al, 2
jne 0x140016485
cmp rdx, rdi
je 0x140015dda
mov r15b, byte [rcx + rsi + 0x38]
mov r8d, 4
add r15b, r15b
sar r15b, 1
movsx ecx, r15b
sub ecx, 1
je 0x140015e37
sub ecx, 1
jne 0x140015e32
mov eax, ebx
not eax
test al, 1
je 0x140015dda
and ebx, 0xfffffffe
mov r13, rdx
jmp 0x140015e9b
mov eax, ebx
not eax
test al, 1
je 0x140015dda
shr ebx, 1
cmp ebx, r8d
cmovb ebx, r8d
mov ecx, ebx
call fcn.14001a0d4
mov r13, rax
cmp rax, rdi
jne 0x140015e72
call fcn.14001456c
mov dword [rax], 0xc
call fcn.14001458c
mov dword [rax], 8
jmp 0x1400164af
mov ecx, dword [rsp + 0xa0]
xor edx, edx
lea r8d, [rdx + 1]
call fcn.14001a3c0
lea r9, [0x140011000]
mov r11, rax
mov rax, qword [r9 + r14*8 + 0x16380]
mov qword [rax + rsi + 0x40], r11
mov rax, qword [r9 + r14*8 + 0x16380]
mov rdx, r13
mov r8d, 0xa
test byte [rax + rsi + 8], 0x48
je 0x140015f53
mov cl, byte [rax + rsi + 9]
cmp cl, r8b
je 0x140015f53
cmp ebx, edi
je 0x140015f53
mov byte [r13], cl
mov rax, qword [r9 + r14*8 + 0x16380]
or r10d, 0xffffffff
add ebx, r10d
lea rdx, [r13 + 1]
lea ebp, [r8 - 9]
mov byte [rax + rsi + 9], r8b
cmp r15b, dil
je 0x140015f53
mov rax, qword [r9 + r14*8 + 0x16380]
mov cl, byte [rax + rsi + 0x39]
cmp cl, r8b
je 0x140015f53
cmp ebx, edi
je 0x140015f53
mov byte [rdx], cl
mov rax, qword [r9 + r14*8 + 0x16380]
add ebx, r10d
inc rdx
lea ebp, [r8 - 8]
mov byte [rax + rsi + 0x39], r8b
cmp r15b, 1
jne 0x140015f53
mov rax, qword [r9 + r14*8 + 0x16380]
mov cl, byte [rax + rsi + 0x3a]
cmp cl, r8b
je 0x140015f53
cmp ebx, edi
je 0x140015f53
mov byte [rdx], cl
mov rax, qword [r9 + r14*8 + 0x16380]
inc rdx
lea ebp, [r8 - 7]
add ebx, r10d
mov byte [rax + rsi + 0x3a], r8b
mov rcx, qword [r9 + r14*8 + 0x16380]
lea r9, [rsp + 0x30]
mov r8d, ebx
mov rcx, qword [rcx + rsi]
mov qword [rsp + 0x20], rdi
call qword [sym.imp.KERNEL32.dll_ReadFile]
cmp eax, edi
je 0x140016449
movsxd rdx, dword [rsp + 0x30]
cmp edx, edi
jl 0x140016449
mov eax, ebx
cmp rdx, rax
ja 0x140016449
lea r8, [0x140011000]
add ebp, edx
mov rax, qword [r8 + r14*8 + 0x16380]
test byte [rax + rsi + 8], 0x80
je 0x140016427
cmp r15b, 2
je 0x140016270
cmp edx, edi
je 0x140015fca
cmp byte [r13], 0xa
jne 0x140015fca
or byte [rax + rsi + 8], 4
jmp 0x140015fcf
and byte [rax + rsi + 8], 0xfb
movsxd rax, ebp
mov rbx, r13
mov r12, r13
add rax, r13
mov qword [rsp + 0x40], rax
cmp r13, rax
jae 0x140016123
mov ebp, 0xd
mov al, byte [r12]
cmp al, 0x1a
je 0x140016104
cmp al, bpl
je 0x14001600c
mov byte [rbx], al
inc rbx
inc r12
jmp 0x1400160f7
mov rax, qword [rsp + 0x40]
dec rax
cmp r12, rax
jae 0x140016034
lea rax, [r12 + 1]
cmp byte [rax], 0xa
jne 0x14001602c
add r12, 2
jmp 0x1400160bc
mov r12, rax
jmp 0x1400160f1
mov rcx, qword [r8 + r14*8 + 0x16380]
lea r9, [rsp + 0x30]
lea rdx, [rsp + 0xb0]
mov rcx, qword [rcx + rsi]
mov r8d, 1
inc r12
mov qword [rsp + 0x20], rdi
call qword [sym.imp.KERNEL32.dll_ReadFile]
cmp eax, edi
jne 0x14001606f
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, edi
jne 0x1400160ea
cmp dword [rsp + 0x30], edi
je 0x1400160ea
lea r8, [0x140011000]
mov rax, qword [r8 + r14*8 + 0x16380]
test byte [rax + rsi + 8], 0x48
je 0x1400160ad
cmp byte [rsp + 0xb0], 0xa
je 0x1400160bc
mov byte [rbx], bpl
mov rcx, qword [r8 + r14*8 + 0x16380]
mov al, byte [rsp + 0xb0]
mov byte [rcx + rsi + 9], al
jmp 0x1400160f4
cmp rbx, r13
jne 0x1400160c1
cmp byte [rsp + 0xb0], 0xa
jne 0x1400160c1
mov byte [rbx], 0xa
jmp 0x1400160f4
mov ecx, dword [rsp + 0xa0]
mov r8d, 1
or rdx, 0xffffffffffffffff
call fcn.14001a3c0
cmp byte [rsp + 0xb0], 0xa
lea r8, [0x140011000]
je 0x1400160f7
jmp 0x1400160f1
lea r8, [0x140011000]
mov byte [rbx], bpl
inc rbx
cmp r12, qword [rsp + 0x40]
jb 0x140015fee
jmp 0x140016123
mov rax, qword [r8 + r14*8 + 0x16380]
test byte [rax + rsi + 8], 0x40
jne 0x14001611a
or byte [rax + rsi + 8], 2
jmp 0x140016123
mov al, byte [r12]
mov byte [rbx], al
inc rbx
mov ebp, ebx
sub ebp, r13d
cmp r15b, 1
jne 0x140016422
cmp ebp, edi
je 0x140016422
mov r15d, 1
sub rbx, r15
test byte [rbx], 0x80
jne 0x140016150
add rbx, r15
jmp 0x140016202
mov edx, r15d
jmp 0x140016165
cmp edx, 4
jg 0x140016172
cmp rbx, r13
jb 0x140016172
sub rbx, r15
add edx, r15d
movzx eax, byte [rbx]
cmp byte [rax + r8 + 0x14560], dil
je 0x140016155
movzx ecx, byte [rbx]
movsx eax, byte [rcx + r8 + 0x14560]
cmp eax, edi
jne 0x140016196
call fcn.14001456c
mov dword [rax], 0x2a
or r12d, 0xffffffff
jmp 0x140016427
inc eax
cmp eax, edx
jne 0x1400161a4
movsxd rax, edx
add rbx, rax
jmp 0x140016202
mov rax, qword [r8 + r14*8 + 0x16380]
test byte [rax + rsi + 8], 0x48
je 0x1400161ee
add rbx, r15
cmp edx, 2
mov byte [rax + rsi + 9], cl
jl 0x1400161d0
mov al, byte [rbx]
mov rcx, qword [r8 + r14*8 + 0x16380]
add rbx, r15
mov byte [rcx + rsi + 0x39], al
cmp edx, 3
jne 0x1400161e6
mov al, byte [rbx]
mov rcx, qword [r8 + r14*8 + 0x16380]
add rbx, r15
mov byte [rcx + rsi + 0x3a], al
movsxd rax, edx
sub rbx, rax
jmp 0x140016202
mov ecx, dword [rsp + 0xa0]
neg edx
mov r8d, r15d
movsxd rdx, edx
call fcn.14001a3c0
mov eax, dword [rsp + 0x38]
mov r15, qword [rsp + 0xa8]
sub ebx, r13d
shr eax, 1
mov r9d, ebx
mov r8, r13
mov dword [rsp + 0x28], eax
xor edx, edx
mov ecx, 0xfde9
mov qword [rsp + 0x20], r15
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov ebp, eax
cmp eax, edi
jne 0x14001624b
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.1400145ac
or r12d, 0xffffffff
jmp 0x14001642f
mov r12d, dword [rsp + 0x34]
cmp eax, ebx
lea rax, [0x140011000]
mov rax, qword [rax + r14*8 + 0x16380]
setne dil
add ebp, ebp
mov dword [rax + rsi + 0x48], edi
jmp 0x14001642f
cmp edx, edi
mov edx, 0xa
je 0x140016287
cmp word [r13], dx
jne 0x140016287
or byte [rax + rsi + 8], 4
jmp 0x14001628c
and byte [rax + rsi + 8], 0xfb
movsxd rax, ebp
mov rbx, r13
mov r12, r13
lea r15, [rax + r13]
cmp r13, r15
jae 0x14001641d
mov ebp, 0xd
movzx eax, word [r12]
cmp ax, 0x1a
je 0x1400163fb
cmp ax, bp
je 0x1400162cb
mov word [rbx], ax
add rbx, 2
add r12, 2
jmp 0x1400163f0
lea rax, [r15 - 2]
cmp r12, rax
jae 0x1400162ef
lea rax, [r12 + 2]
cmp word [rax], dx
jne 0x1400162e7
add r12, 4
jmp 0x1400163a9
mov r12, rax
jmp 0x1400163e9
mov rcx, qword [r8 + r14*8 + 0x16380]
lea r9, [rsp + 0x30]
lea rdx, [rsp + 0xb8]
mov rcx, qword [rcx + rsi]
mov r8d, 2
add r12, 2
mov qword [rsp + 0x20], rdi
call qword [sym.imp.KERNEL32.dll_ReadFile]
cmp eax, edi
jne 0x14001632f
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, edi
jne 0x1400163dd
cmp dword [rsp + 0x30], edi
je 0x1400163dd
lea r8, [0x140011000]
mov rax, qword [r8 + r14*8 + 0x16380]
test byte [rax + rsi + 8], 0x48
je 0x140016395
mov edx, 0xa
cmp word [rsp + 0xb8], dx
je 0x1400163a9
mov word [rbx], bp
mov al, byte [rsp + 0xb8]
mov rcx, qword [r8 + r14*8 + 0x16380]
mov byte [rcx + rsi + 9], al
mov al, byte [rsp + 0xb9]
mov rcx, qword [r8 + r14*8 + 0x16380]
mov byte [rcx + rsi + 0x39], al
mov rax, qword [r8 + r14*8 + 0x16380]
mov byte [rax + rsi + 0x3a], dl
jmp 0x1400163ec
cmp rbx, r13
jne 0x1400163ae
mov edx, 0xa
cmp word [rsp + 0xb8], dx
jne 0x1400163ae
mov word [rbx], dx
jmp 0x1400163ec
mov ecx, dword [rsp + 0xa0]
mov rdx, 0xfffffffffffffffe
lea r8d, [rdx + 3]
call fcn.14001a3c0
mov edx, 0xa
lea r8, [0x140011000]
cmp word [rsp + 0xb8], dx
je 0x1400163f0
jmp 0x1400163e9
mov edx, 0xa
lea r8, [0x140011000]
mov word [rbx], bp
add rbx, 2
cmp r12, r15
jb 0x1400162a7
jmp 0x14001641d
mov rax, qword [r8 + r14*8 + 0x16380]
test byte [rax + rsi + 8], 0x40
jne 0x140016411
or byte [rax + rsi + 8], 2
jmp 0x14001641d
movzx eax, word [r12]
mov word [rbx], ax
add rbx, 2
mov ebp, ebx
sub ebp, r13d
mov r12d, dword [rsp + 0x34]
mov r15, qword [rsp + 0xa8]
cmp r13, r15
je 0x14001643c
mov rcx, r13
call fcn.140013c70
cmp r12d, 0xfffffffe
cmove r12d, ebp
mov eax, r12d
jmp 0x1400164b2
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 5
jne 0x14001646f
call fcn.14001456c
mov dword [rax], 9
call fcn.14001458c
mov dword [rax], 5
jmp 0x14001618d
cmp eax, 0x6d
jne 0x140016479
mov r12d, edi
jmp 0x140016427
mov ecx, eax
call fcn.1400145ac
jmp 0x14001618d
xor eax, eax
jmp 0x1400164b2
call fcn.14001458c
mov dword [rax], edi
call fcn.14001456c
mov dword [rax], 9
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
mov qword [rsp + 0x20], rdi
call fcn.14001449c
or eax, 0xffffffff
add rsp, 0x58
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret