Function at 0x40a0a0
Capabilities:
Read file on windows

Disassembly:
mov rax, rsp
sub rsp, 0x68
mov qword [rax + 0x10], rbp
mov qword [rax + 0x18], rsi
mov qword [rax - 8], r12
mov qword [rax - 0x10], r13
mov qword [rax - 0x18], r14
xor esi, esi
test r8d, r8d
mov qword [rax - 0x20], r15
movsxd r14, ecx
mov r12, rdx
je 0x40a304
mov bpl, r14b
mov r13, r14
lea r15, [0x004110e0]
sar r13, 5
and ebp, 0x1f
mov rax, r14
mov rcx, qword [r15 + r13*8]
imul rbp, rbp, 0x38
movzx eax, byte [rcx + rbp + 8]
test al, 2
jne 0x40a304
test al, 0x48
je 0x40a121
movzx eax, byte [rcx + rbp + 9]
cmp al, 0xa
je 0x40a121
mov byte [rdx], al
mov rax, qword [r15 + r13*8]
lea rdx, [rdx + 1]
mov esi, 1
add r8d, 0xffffffff
mov byte [rax + rbp + 9], 0xa
mov rcx, qword [r15 + r13*8]
lea r9, [rsp + 0x34]
mov qword [rsp + 0x20], 0
mov rcx, qword [rcx + rbp]
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40a186
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 5
jne 0x40a16c
call fcn.00405610
mov dword [rax], 9
call fcn.00405640
mov dword [rax], 5
mov eax, 0xffffffff
jmp 0x40a306
cmp eax, 0x6d
je 0x40a304
mov ecx, eax
call fcn.00405670
mov eax, 0xffffffff
jmp 0x40a306
mov ecx, dword [rsp + 0x34]
mov rax, qword [r15 + r13*8]
add esi, ecx
test byte [rax + rbp + 8], 0x80
je 0x40a300
test ecx, ecx
je 0x40a1ad
cmp byte [r12], 0xa
jne 0x40a1ad
or byte [rax + rbp + 8], 4
jmp 0x40a1b2
and byte [rax + rbp + 8], 0xfb
mov qword [rsp + 0x70], rbx
movsxd rax, esi
mov qword [rsp + 0x88], rdi
lea rsi, [rax + r12]
mov rbx, r12
mov rdi, r12
cmp r12, rsi
jae 0x40a2ee
movzx eax, byte [rdi]
cmp al, 0x1a
je 0x40a2d3
cmp al, 0xd
je 0x40a1f1
mov byte [rbx], al
inc rbx
inc rdi
jmp 0x40a2c8
lea rax, [rsi - 1]
cmp rdi, rax
jae 0x40a221
cmp byte [rdi + 1], 0xa
lea rax, [rdi + 1]
jne 0x40a213
add rdi, 2
mov byte [rbx], 0xa
inc rbx
jmp 0x40a2c8
mov byte [rbx], 0xd
inc rbx
mov rdi, rax
jmp 0x40a2c8
mov rcx, qword [r15 + r13*8]
lea r9, [rsp + 0x34]
lea rdx, [rsp + 0x30]
mov rcx, qword [rcx + rbp]
mov r8d, 1
inc rdi
mov qword [rsp + 0x20], 0
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40a259
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x40a2c2
cmp dword [rsp + 0x34], 0
je 0x40a2c2
mov rax, qword [r15 + r13*8]
test byte [rax + rbp + 8], 0x48
je 0x40a28c
movzx ecx, byte [rsp + 0x30]
cmp cl, 0xa
jne 0x40a27c
mov byte [rbx], cl
inc rbx
jmp 0x40a2c8
mov byte [rbx], 0xd
mov rax, qword [r15 + r13*8]
inc rbx
mov byte [rax + rbp + 9], cl
jmp 0x40a2c8
cmp rbx, r12
jne 0x40a2a0
cmp byte [rsp + 0x30], 0xa
jne 0x40a2a0
mov byte [rbx], 0xa
inc rbx
jmp 0x40a2c8
mov rdx, 0xffffffffffffffff
mov ecx, r14d
lea r8d, [rdx + 2]
call fcn.00409e40
cmp byte [rsp + 0x30], 0xa
je 0x40a2c8
mov byte [rbx], 0xd
inc rbx
jmp 0x40a2c8
mov byte [rbx], 0xd
inc rbx
cmp rdi, rsi
jb 0x40a1d5
jmp 0x40a2ee
mov rax, qword [r15 + r13*8]
test byte [rax + rbp + 8], 0x40
jne 0x40a2e5
or byte [rax + rbp + 8], 2
jmp 0x40a2ee
movzx eax, byte [rdi]
inc rbx
mov byte [rbx - 1], al
mov rdi, qword [rsp + 0x88]
mov esi, ebx
mov rbx, qword [rsp + 0x70]
sub esi, r12d
mov eax, esi
jmp 0x40a306
xor eax, eax
mov r15, qword [rsp + 0x48]
mov r14, qword [rsp + 0x50]
mov r13, qword [rsp + 0x58]
mov r12, qword [rsp + 0x60]
mov rsi, qword [rsp + 0x80]
mov rbp, qword [rsp + 0x78]
add rsp, 0x68
ret