Function at 0x408370
Capabilities:
Read file on windows

Disassembly:
push r14
lea rax, [0x0040a005]
mov r9, rdx
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x270
mov qword [rsp + 0x40], rax
cmp ecx, 1
je 0x40841b
cmp ecx, 2
je 0x408431
xor r12d, r12d
test ecx, ecx
jne 0x408646
lea rdx, [rsp + 0x68]
mov ecx, 0x104
call fcn.00407bc0
test eax, eax
je 0x408463
mov rax, qword [rsp + 0x40]
lea rcx, [rsp + 0x68]
xor r9d, r9d
mov edx, 0x80000000
mov dword [rsp + 0x5c], 0
mov r8d, 1
mov ebx, dword [rax]
lea rax, [0x0040a00a]
mov qword [rsp + 0x30], 0
mov qword [rsp + 0x48], rax
mov dword [rsp + 0x28], pe_nt_image_headers64
mov dword [rsp + 0x20], 3
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov r12, rax
test rax, rax
jne 0x408449
jmp 0x408463
lea rdx, [rsp + 0x68]
mov r8d, 0x104
mov rcx, r9
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
jmp 0x4083bc
lea rcx, [rsp + 0x68]
mov r8d, 0x104
call fcn.00407a00
test rax, rax
jmp 0x4083be
mov rax, qword [rsp + 0x48]
xor r9d, r9d
xor r8d, r8d
mov rcx, r12
mov edx, dword [rax]
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
inc eax
jne 0x40846b
xor r12d, r12d
jmp 0x408646
mov rax, qword gs:[0x30]
mov rax, qword [rax + 0x60]
mov rsi, qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov r8d, ebx
mov edx, 8
mov rcx, qword [rax + 0x30]
call rsi
mov rbp, rax
test rax, rax
je 0x408463
mov rdi, qword [sym.imp.KERNEL32.dll_ReadFile]
xor r13d, r13d
lea r14, [rsp + 0x5c]
cmp ebx, r13d
jbe 0x4084f1
mov edx, r13d
mov r8d, ebx
mov r9, r14
mov rcx, r12
mov qword [rsp + 0x20], 0
add rdx, rbp
sub r8d, r13d
call rdi
test eax, eax
jne 0x4084ea
mov rax, qword gs:[0x30]
mov rax, qword [rax + 0x60]
mov r8, rbp
xor edx, edx
xor ebp, ebp
mov rcx, qword [rax + 0x30]
call qword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x4084f1
add r13d, dword [rsp + 0x5c]
jmp 0x4084a4
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test rbp, rbp
je 0x408463
mov rax, qword [rsp + 0x40]
mov edx, 8
xor r12d, r12d
mov r14d, dword [rax]
lea rax, [0x0040a00f]
mov qword [rsp + 0x50], rax
mov rax, qword gs:[0x30]
mov rax, qword [rax + 0x60]
mov r8, r14
mov rdi, r14
mov rcx, qword [rax + 0x30]
call rsi
mov r13, rax
test rax, rax
je 0x408620
lea rbx, [rsp + 0x5c]
lea rsi, str._08d
mov r8, rsi
mov r9d, r12d
mov edx, 9
mov rcx, rbx
call fcn.00408940
mov edx, 8
mov rcx, rbx
call fcn.00408910
mov r8d, eax
mov rax, qword [rsp + 0x50]
cmp r8d, dword [rax]
je 0x40858b
inc r12d
cmp r12d, 0x5f5e100
jne 0x408550
jmp 0x4085b3
mov dword [rsp + 0x20], edi
mov r9, r13
mov r8, rbp
mov edx, 8
mov rcx, rbx
call fcn.004086c0
test eax, eax
jne 0x4085f2
mov rcx, r13
call fcn.00407c10
test rax, rax
je 0x40857d
xor eax, eax
mov rdi, rbp
mov rcx, r14
mov r8, rbp
rep stosb byte [rdi], al
xor edx, edx
xor ebp, ebp
mov rax, qword gs:[0x30]
mov rax, qword [rax + 0x60]
mov rcx, qword [rax + 0x30]
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov r12d, eax
test eax, eax
je 0x4085f5
mov rdx, r14
mov rcx, r13
call fcn.00407b20
mov r12d, eax
jmp 0x4085f5
xor r12d, r12d
xor eax, eax
mov rdi, r13
mov rcx, r14
xor edx, edx
rep stosb byte [rdi], al
mov r8, r13
mov rax, qword gs:[0x30]
mov rax, qword [rax + 0x60]
mov rcx, qword [rax + 0x30]
call qword [sym.imp.KERNEL32.dll_HeapFree]
test rbp, rbp
je 0x408646
xor eax, eax
mov rdi, rbp
mov rcx, r14
mov r8, rbp
rep stosb byte [rdi], al
xor edx, edx
mov rax, qword gs:[0x30]
mov rax, qword [rax + 0x60]
mov rcx, qword [rax + 0x30]
call qword [sym.imp.KERNEL32.dll_HeapFree]
add rsp, 0x270
mov eax, r12d
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret