Function at 0x1400087c0
Capabilities:
Read file on windows

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x2d8
mov rax, qword [section..data]
xor rax, rsp
mov qword [rsp + 0x2c0], rax
mov ebp, r9d
mov rdi, r8
mov r12, rdx
mov rbx, rcx
mov qword [rsp + 0x88], rdx
mov rcx, r8
call qword [sym.imp.KERNEL32.dll_GetFileType]
mov esi, eax
test eax, eax
jne 0x140008817
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x140008b6b
mov rcx, qword [rbx + 0x40]
xor r13d, r13d
mov qword [rbx + 0x40], r13
test rcx, rcx
je 0x14000882d
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rbx + 0x48], r13
mov dword [rbx + 0x50], 0xfde9
mov word [rbx + 0x54], r13w
mov byte [rbx + 0x56], r13b
mov qword [rbx + 0x58], r13
mov qword [rbx + 0x60], r13
mov edx, ebp
mov rcx, rbx
call fcn.1400082f0
mov byte [rbx + 0x54], 3
movzx eax, byte [rsp + 0x340]
mov byte [rbx + 0x55], al
mov rax, qword [r12]
mov qword [r12], r13
mov rcx, qword [rbx + 0x40]
mov qword [rbx + 0x40], rax
test rcx, rcx
je 0x14000887d
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rbx + 0x48], rdi
test byte [rbx + 0x55], 0x10
je 0x14000891c
cmp esi, 2
jne 0x14000891c
lea rdx, [rsp + 0x90]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x14000891c
lea rsi, [rbx + 0x20]
mov rdi, qword [rsi + 0x10]
mov edx, 0x800
cmp rdi, rdx
jae 0x14000890c
cmp qword [rsi + 0x18], rdx
jae 0x1400088d0
sub rdx, rdi
mov rcx, rsi
call fcn.1400092c0
mov qword [rsi + 0x10], rdi
mov rdx, qword [rsi + 0x18]
mov qword [rsi + 0x10], rdx
cmp rdx, rdi
ja 0x1400088e8
cmp rdx, 7
jbe 0x140008907
mov rsi, qword [rsi]
jmp 0x140008907
mov rcx, rdx
sub rcx, rdi
cmp rdx, 7
jbe 0x1400088f7
mov rsi, qword [rsi]
lea rdi, [rsi + rdi*2]
test rcx, rcx
je 0x140008907
movzx eax, r13w
rep stosw word [rdi], ax
mov word [rsi + rdx*2], r13w
mov dword [rbx + 0x50], 0x4b0
mov byte [rbx + 0x54], 4
jmp 0x140008aee
mov rdi, qword [rbx + 0x10]
mov edx, 0x1000
cmp rdi, rdx
jae 0x140008981
cmp qword [rbx + 0x18], rdx
jae 0x14000893f
sub rdx, rdi
mov rcx, rbx
call fcn.140009430
mov qword [rbx + 0x10], rdi
mov rax, qword [rbx + 0x18]
mov qword [rbx + 0x10], rax
mov rcx, rbx
cmp rax, rdi
ja 0x14000895e
cmp rax, 0xf
jbe 0x140008958
mov rcx, qword [rbx]
mov byte [rcx + rax], r13b
jmp 0x140008981
mov rsi, rax
sub rsi, rdi
cmp rax, 0xf
jbe 0x14000896d
mov rcx, qword [rbx]
add rdi, rcx
mov r8, rsi
xor edx, edx
mov rcx, rdi
call fcn.140022e50
mov byte [rdi + rsi], r13b
test byte [rbx + 0x55], 2
je 0x140008aee
mov dword [rsp + 0x90], r13d
mov rcx, rbx
cmp qword [rbx + 0x18], 0xf
jbe 0x1400089a0
mov rcx, qword [rbx]
mov rdx, qword [rbx + 0x58]
add rdx, rcx
mov qword [rsp + 0x20], r13
lea r9, [rsp + 0x90]
mov r8d, 4
mov rcx, qword [rbx + 0x48]
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x1400089d7
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x6d
jne 0x140008b2a
mov ecx, dword [rsp + 0x90]
add qword [rbx + 0x58], rcx
test ecx, ecx
jne 0x1400089fd
mov rcx, qword [rbx + 0x40]
mov qword [rbx + 0x40], r13
test rcx, rcx
je 0x1400089f9
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rbx + 0x48], r13
lea rdi, [0x14002e9e0]
nop dword [rax]
nop dword [rax + rax]
mov rdx, rbx
mov r14, qword [rbx + 0x18]
cmp r14, 0xf
jbe 0x140008a20
mov rdx, qword [rbx]
mov rbp, qword [rbx + 0x58]
movzx esi, byte [rdi + 2]
mov ecx, esi
movzx eax, bpl
cmp rsi, rbp
cmova ecx, eax
movzx r15d, cl
mov r8d, r15d
mov rcx, qword [rdi + 8]
call fcn.140023890
test eax, eax
jne 0x140008a61
cmp r15b, sil
je 0x140008a73
cmp qword [rbx + 0x48], r13
je 0x140008a61
mov edx, esi
sub edx, ebp
mov rcx, rbx
call fcn.1400086d0
jmp 0x140008a10
add rdi, 0x10
lea rax, str.bad_array_new_length
cmp rdi, rax
jne 0x140008a10
jmp 0x140008aee
cmp rsi, rbp
jb 0x140008a7e
mov qword [rbx + 0x58], r13
jmp 0x140008aaa
test rsi, rsi
je 0x140008aaa
sub rbp, rsi
mov qword [rbx + 0x58], rbp
mov rax, rbx
cmp r14, 0xf
jbe 0x140008a9b
mov rax, qword [rbx]
mov rcx, rax
jmp 0x140008a9e
mov rcx, rbx
lea rdx, [rax + rsi]
mov r8, rbp
call fcn.140023210
movzx edi, word [rdi]
cmp edi, 3
ja 0x140008aeb
test edi, edi
jne 0x140008ac0
call qword [sym.imp.KERNEL32.dll_GetACP]
mov edi, eax
jmp 0x140008aeb
cmp edi, 1
jne 0x140008acf
call qword [sym.imp.KERNEL32.dll_GetOEMCP]
mov edi, eax
jmp 0x140008aeb
lea r8, [rsp + 0xa0]
xor edx, edx
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_GetCPInfoExW]
test eax, eax
cmovne edi, dword [rsp + 0xb4]
mov dword [rbx + 0x50], edi
mov rcx, rbx
call fcn.140008d30
nop
mov rcx, qword [r12]
test rcx, rcx
je 0x140008b06
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x2c0]
xor rcx, rsp
call fcn.14000b310
add rsp, 0x2d8
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret
mov edx, eax
lea rcx, [rsp + 0x68]
call fcn.140009d80
nop
mov r8, rax
lea rdx, str.ReadFile_error
lea rcx, [rsp + 0x48]
call fcn.140008f90
nop
mov rdx, rax
lea rcx, [rsp + 0x30]
call fcn.140009fa0
lea rdx, [0x1400329b0]
lea rcx, [rsp + 0x30]
call fcn.14000cf58
nop
mov edx, eax
lea rcx, [rsp + 0x48]
call fcn.140009d80
nop
mov r8, rax
lea rdx, str.GetFileType_error
lea rcx, [rsp + 0x68]
call fcn.140008f90
nop
mov rdx, rax
lea rcx, [rsp + 0x30]
call fcn.140009fa0
lea rdx, [0x1400329b0]
lea rcx, [rsp + 0x30]
call fcn.14000cf58
int3