Function at 0x4068f0
Capabilities:
Read file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x78
mov dword [rsp + 0xc0], ecx
mov qword [rsp + 0xc8], rdx
call fcn.00404fb0
lea rdx, [0x004085a6]
mov ecx, 2
call sub.msvcrt.dll_setlocale
lea rdx, [rsp + 0xc8]
lea rcx, [rsp + 0xc0]
call fcn.00403980
mov rbx, qword [0x00409d50]
mov r13, rbx
mov r12, rbx
mov rbp, rbx
mov rdi, rbx
mov rsi, rbx
mov rdx, qword [rsp + 0xc8]
mov ecx, dword [rsp + 0xc0]
lea r9, str.input_mach
lea r8, [0x004085a7]
mov qword [rsp + 0x20], 0
call fcn.00404bb0
cmp eax, 0xffffffff
je 0x406b22
sub eax, 0x68
cmp eax, 0x33
ja case.0x40699e.105
lea rdx, [0x0040864c]
movsxd rax, dword [rdx + rax*4]
add rax, rdx
jmp rax
mov rcx, qword [rbx]
call fcn.004015b0
test eax, eax
mov dword [0x00407148], eax
jns 0x406950
mov ebx, 1
mov eax, ebx
add rsp, 0x78
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov rcx, qword [r13]
call fcn.004015b0
test eax, eax
mov dword [0x0040714c], eax
jns 0x406950
jmp 0x4069b2
mov rcx, qword [r12]
call fcn.004017b0
test eax, eax
mov dword [0x00407150], eax
jns 0x406950
jmp 0x4069b2
mov rcx, qword [rbp]
call fcn.004017b0
test eax, eax
mov dword [0x00407154], eax
jns 0x406950
jmp 0x4069b2
mov rcx, qword [rdi]
call fcn.004016e0
test eax, eax
mov dword [0x00407158], eax
js 0x4069b2
cmp eax, 6
je 0x406b1b
jle 0x406b12
cmp eax, 0x3e
je 0x406ae2
jl 0x406ae2
sub eax, 0xb4
cmp eax, 1
ja 0x406ae2
mov eax, 2
jmp 0x406ae7
mov rcx, qword [rsi]
call fcn.004016e0
test eax, eax
mov dword [0x0040715c], eax
js 0x4069b2
cmp eax, 6
je 0x406b0b
jle 0x406b02
cmp eax, 0x3e
je 0x406af2
jl 0x406af2
sub eax, 0xb4
cmp eax, 1
ja 0x406af2
mov eax, 2
jmp 0x406af7
mov rcx, qword [str.elfedit]
call fcn.00402370
jmp 0x406950
call qword [sym.imp.msvcrt.dll___iob_func]
lea rcx, [rax + 0x30]
xor edx, edx
call fcn.00401630
cmp dword [0x00407150], 0xffffffff
jne 0x406b44
cmp dword [0x00407148], 0xffffffff
jne 0x406b44
call qword [sym.imp.msvcrt.dll___iob_func]
lea rcx, [rax + 0x60]
mov edx, 1
call fcn.00401630
mov eax, 3
mov dword [0x00407140], eax
jmp 0x406950
mov eax, 3
mov dword [0x00407144], eax
jmp 0x406950
test eax, eax
je 0x406af2
cmp eax, 3
jne 0x406af2
mov eax, 1
jmp 0x406af7
test eax, eax
je 0x406ae2
cmp eax, 3
jne 0x406ae2
mov eax, 1
jmp 0x406ae7
mov rsi, qword [0x00409d60]
mov edx, dword [rsp + 0xc0]
movsxd rax, dword [rsi]
cmp eax, edx
je case.0x40699e.105
cmp dword [0x00407158], 0xffffffff
je 0x406abc
xor ebx, ebx
cmp eax, edx
jge 0x4069b7
lea rdi, [rsp + 0x30]
mov rbp, qword [sym.imp.msvcrt.dll__stat64]
lea r12, [0x00408554]
mov r13, qword [sym.imp.msvcrt.dll__errno]
jmp 0x406b92
lea rcx, str._s_is_not_an_ordinary_file_n
mov rdx, r14
call fcn.004023d0
mov r14d, 1
movsxd rax, dword [rsi]
or ebx, r14d
cmp eax, dword [rsp + 0xc0]
jge 0x4069b7
lea edx, [rax + 1]
mov dword [rsi], edx
mov rdx, qword [rsp + 0xc8]
mov r14, qword [rdx + rax*8]
mov rdx, rdi
mov rcx, r14
call rbp
test eax, eax
js 0x406c6e
movzx eax, word [rsp + 0x36]
and ax, 0xf000
cmp ax, 0x8000
jne 0x406b6a
mov rdx, r12
mov rcx, r14
call sub.msvcrt.dll_fopen
test rax, rax
mov r15, rax
je 0x406ccf
mov r9, r15
mov r8d, 1
mov edx, 8
mov rcx, rdi
call sub.msvcrt.dll_fread
sub rax, 1
jne 0x406c4c
lea rdx, str.__arch__n
mov r8d, 8
mov rcx, rdi
call sub.msvcrt.dll_memcmp
test eax, eax
je 0x406cb9
lea rdx, str.__thin__n
mov r8d, 8
mov rcx, rdi
call sub.msvcrt.dll_memcmp
test eax, eax
jne 0x406c97
mov rcx, r14
mov r8d, 1
mov rdx, r15
call fcn.00401f30
mov r14d, eax
mov rcx, r15
call sub.msvcrt.dll_fclose
jmp 0x406b7f
lea rcx, str._s:_Failed_to_read_files_magic_number_n
mov rdx, r14
mov r14d, 1
call fcn.004023d0
mov rcx, r15
call sub.msvcrt.dll_fclose
jmp 0x406b7f
call r13
cmp dword [rax], 2
je 0x406ce9
call r13
mov ecx, dword [rax]
call sub.msvcrt.dll_strerror
lea rcx, str.Could_not_locate__s.__System_error_message:__s_n
mov r8, rax
mov rdx, r14
call fcn.004023d0
jmp 0x406b79
mov rcx, r15
call sub.msvcrt.dll_rewind
mov rcx, r14
mov rdx, r15
mov dword [0x0040d110], 0
call fcn.00401830
mov r14d, eax
jmp 0x406c3f
mov rcx, r14
xor r8d, r8d
mov rdx, r15
call fcn.00401f30
mov r14d, eax
jmp 0x406c3f
lea rcx, str.Input_file__s_is_not_readable_n
mov rdx, r14
mov r14d, 1
call fcn.004023d0
jmp 0x406b7f
lea rcx, str._s:_No_such_file_n
mov rdx, r14
call fcn.004023d0
jmp 0x406b79