Function at 0x408dd0
Capabilities:
Read file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x48
test dl, 7
jne 0x409065
mov rsi, rcx
mov r13, qword [rdx]
mov ecx, dword [r13 + 0x20]
test rcx, rcx
je 0x409079
mov rdi, r9
mov r14, r8
mov rax, qword [r13 + 8]
mov rdx, rax
shr rdx, 0x20
je 0x408fd3
xor edx, edx
div rcx
mov r15, rdx
mov rbx, rax
cmp rbx, qword [r13 + 0x18]
jae 0x408fe6
mov rdx, qword [r13 + 0x10]
mov eax, ecx
mul dword [rdx + rbx*4]
jo 0x409051
mov edx, eax
add rdx, r15
mov rcx, qword [r13]
xor r8d, r8d
xor r9d, r9d
call sub.KERNEL32.dll_SetFilePointerEx
test eax, eax
je 0x408fec
mov qword [rsp + 0x30], rbx
test rdi, rdi
je 0x408fbe
mov r12, qword [r13]
xor r8d, r8d
mov rbx, rdi
mov rbp, r14
mov qword [rsp + 0x40], r14
mov eax, dword [r13 + 0x20]
sub rax, r15
jb 0x409051
mov r14, rdi
mov qword [rsp + 0x38], r8
cmp rax, rbx
mov rdi, rbx
cmovb rdi, rax
mov eax, 0xffffffff
cmp rdi, rax
mov ebx, 0xffffffff
cmovb rbx, rdi
nop word cs:[rax + rax]
nop dword [rax]
mov dword [rsp + 0x2c], 0xaaaaaaaa
mov qword [rsp + 0x20], 0
mov rcx, r12
mov rdx, rbp
mov r8d, ebx
lea r9, [rsp + 0x2c]
call sub.KERNEL32.dll_ReadFile
test eax, eax
jne 0x408f16
call sub.KERNEL32.dll_GetLastError
movzx eax, ax
cmp eax, 0x3e3
je 0x408eb0
cmp eax, 0x6c
jg 0x408efc
cmp eax, 0x26
mov r8, qword [rsp + 0x38]
jne 0x409005
jmp 0x408f0a
cmp eax, 0x6d
mov r8, qword [rsp + 0x38]
jne 0x409036
xor eax, eax
add r8, rax
jae 0x408f28
jmp 0x409051
mov eax, dword [rsp + 0x2c]
mov r8, qword [rsp + 0x38]
add r8, rax
jb 0x409051
mov rbx, r14
sub rbx, r8
jb 0x40908d
add r15, rdi
jb 0x409051
mov eax, dword [r13 + 0x20]
cmp r15, rax
mov rdi, r14
jne 0x408fac
mov rcx, qword [rsp + 0x30]
inc rcx
mov r14, qword [rsp + 0x40]
je 0x409051
mov rdx, rcx
mov qword [rsp + 0x30], rcx
cmp rcx, qword [r13 + 0x18]
jae 0x408fbe
mov rcx, qword [r13 + 0x10]
mov rdx, qword [rsp + 0x30]
mul dword [rcx + rdx*4]
jo 0x409051
mov rbp, r8
mov edx, eax
mov rcx, qword [r13]
xor r8d, r8d
xor r9d, r9d
call sub.KERNEL32.dll_SetFilePointerEx
mov r15d, 0
test eax, eax
mov r8, rbp
je 0x408fec
lea rbp, [r14 + r8]
cmp rdi, r8
ja 0x408e73
jmp 0x408fbe
mov r14, qword [rsp + 0x40]
lea rbp, [r14 + r8]
cmp rdi, r8
ja 0x408e73
mov rax, qword [r13 + 8]
add rax, rdi
jb 0x409051
mov qword [r13 + 8], rax
xor eax, eax
jmp 0x40900e
xor edx, edx
div ecx
mov r15d, edx
mov ebx, eax
cmp rbx, qword [r13 + 0x18]
jb 0x408e28
xor eax, eax
xor edi, edi
jmp 0x40900e
call sub.KERNEL32.dll_GetLastError
cmp ax, 6
je 0x40903d
movzx eax, ax
cmp eax, 0x57
je 0x40903d
mov ax, 0xf
jmp 0x40900e
cmp eax, 0x40
jne 0x408fff
mov ax, 0xe
mov qword [rsi], rdi
mov word [rsi + 8], ax
mov dword [rsi + 0xa], 0
mov word [rsi + 0xe], 0
mov rax, rsi
add rsp, 0x48
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
cmp eax, 0x3e5
jne 0x408fff
lea rcx, str.reached_unreachable_code
mov edx, 0x18
xor r9d, r9d
call fcn.00402230
lea rcx, str.integer_overflow
mov edx, 0x10
xor r9d, r9d
call fcn.00402230
lea rcx, [0x00444f85]
mov edx, 0x13
xor r9d, r9d
call fcn.00402230
lea rcx, str.division_by_zero
mov edx, 0x10
xor r9d, r9d
call fcn.00402230
lea rcx, str.start_index_is_larger_than_end_index
mov edx, 0x24
xor r9d, r9d
call fcn.00402230
int3