Function at 0x140042dc0
Capabilities:
Read file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x978
mov r15, r8
cmp qword [rdx + 8], 0
je 0x14004317d
mov rsi, rdx
mov r13, rcx
mov dword [rsp + 0x44], 0
lea rdx, [rsp + 0x44]
call sub.KERNEL32.dll_GetConsoleMode
mov r14, qword [rsi + 8]
cmp r14, 0x40000000
mov ebx, 0x40000000
cmovl rbx, r14
test eax, eax
je 0x140043181
test r14, r14
js 0x1400432e2
mov qword [rsp + 0x48], r15
test rbx, rbx
js 0x140043306
je 0x1400431c7
mov rsi, qword [rsi]
xor edi, edi
lea r15, [rsp + 0x6c]
mov r8d, 0x304
mov rcx, r15
xor edx, edx
call fcn.14007da20
lea rcx, [rsp + 0x370]
mov r8d, 0x608
xor edx, edx
call fcn.14007da20
xor eax, eax
test r14, r14
setne al
mov ecx, ebx
shr ecx, 2
cmp rcx, rax
cmovg rax, rcx
cmp rax, 0x182
mov r8d, 0x182
cmovb r8, rax
lea rbp, [rsp + 0x38]
mov qword [rsp + 0x50], r13
mov qword [rsp + 0x58], rsi
mov qword [rsp + 0x60], r8
test r8d, r8d
je 0x1400431c7
mov dword [rsp + 0x3c], 0
mov qword [rsp + 0x20], 0
mov rcx, r13
mov rdx, r15
lea r9, [rsp + 0x3c]
call sub.KERNEL32.dll_ReadConsoleW
test eax, eax
je 0x140042ed0
xor r12d, r12d
jmp 0x140042ed8
call sub.KERNEL32.dll_GetLastError
mov r12d, eax
mov r13d, dword [rsp + 0x3c]
cmp r13, 0x183
jae 0x140043292
test r13, r13
je 0x140043110
xor r15d, r15d
xor esi, esi
nop dword [rax + rax]
cmp r15, 0x607
jg 0x14004309e
cmp rsi, r13
jae 0x140043206
movzx eax, word [rsp + rsi*2 + 0x6c]
lea ecx, [rax + 0x2000]
movzx ecx, cx
cmp ecx, 0xf800
jae 0x140042f50
cmp ax, 0x7f
ja 0x140042ff0
mov r10d, 1
xor edx, edx
xor ecx, ecx
jmp 0x14004304c
mov ecx, 0xfffd
cmp eax, 0xdbff
ja 0x14004302e
lea r9, [rsi + 1]
cmp r9, r13
jge 0x14004302e
movzx edx, word [rsp + rsi*2 + 0x6e]
mov r8d, edx
and r8d, 0xfc00
cmp r8d, 0xdc00
jne 0x14004302e
shl eax, 0xa
add eax, 0xfca00000
add edx, 0xffff2400
or edx, eax
add edx, 0x10000
mov eax, edx
and eax, 0xfffff800
mov r8d, 0xfffd
cmp eax, 0xd800
je 0x140042fb6
mov r8d, edx
mov eax, r8d
shr eax, 0x12
or al, 0xf0
mov edx, r8d
shr edx, 0xc
and dl, 0x3f
or dl, 0x80
mov ecx, r8d
shr ecx, 6
and cl, 0x3f
or cl, 0x80
and r8b, 0x3f
or r8b, 0x80
mov r10d, 4
mov rsi, r9
jmp 0x14004304f
cmp eax, 0x800
jae 0x140043016
mov r8d, eax
shr r8d, 6
or r8b, 0xc0
and al, 0x3f
mov edx, eax
or dl, 0x80
mov r10d, 2
xor ecx, ecx
mov eax, r8d
jmp 0x14004304c
mov ecx, eax
and ecx, 0xf800
cmp ecx, 0xd800
mov ecx, 0xfffd
cmove eax, ecx
mov ecx, eax
mov eax, ecx
shr eax, 0xc
or al, 0xe0
mov edx, ecx
shr edx, 6
and dl, 0x3f
or dl, 0x80
and cl, 0x3f
or cl, 0x80
mov r10d, 3
xor r8d, r8d
mov byte [rsp + 0x38], al
mov byte [rsp + 0x39], dl
mov byte [rsp + 0x3a], cl
mov byte [rsp + 0x3b], r8b
test r15, r15
js 0x140043225
mov r14d, 0x608
sub r14, r15
cmp r14, r10
cmovge r14, r10
lea rcx, [rsp + r15]
add rcx, 0x370
mov rdx, rbp
mov r8, r14
call fcn.14007d380
add r15, r14
inc rsi
cmp rsi, r13
jl 0x140042f00
cmp r15, 0x608
ja 0x1400432ba
lea rcx, [rdi - 2]
mov rsi, qword [rsp + 0x58]
lea rdx, [rsi + rdi]
xor eax, eax
mov r13, qword [rsp + 0x50]
nop
lea r8, [rdi + rax]
add rcx, 2
cmp rcx, rbx
jge 0x140043119
cmp r15, rax
je 0x140043251
movzx r9d, byte [rsp + rax + 0x370]
cmp r9b, 0x1a
je 0x1400431d0
cmp r8, rbx
jae 0x140043270
mov byte [rdx + rax], r9b
inc rax
cmp r15, rax
jne 0x1400430c0
add rdi, rax
jmp 0x14004311c
xor eax, eax
mov r13, qword [rsp + 0x50]
jmp 0x140043125
mov rdi, r8
mov eax, dword [rsp + 0x3c]
lea r15, [rsp + 0x6c]
mov r8, qword [rsp + 0x60]
cmp eax, r8d
jb 0x1400431d3
jne 0x14004316d
cmp rdi, 2
jl 0x14004316d
lea r9, [rdi - 2]
cmp rdi, rbx
jg 0x14004332a
cmp r9, rbx
jg 0x14004332a
add r9, rsi
lea rax, [0x14008d1a3]
cmp r9, rax
je 0x1400431d3
cmp byte [r9], 0xd
jne 0x14004316d
cmp byte [r9 + 1], 0xa
je 0x1400431d3
cmp rdi, rbx
jge 0x1400431d3
test r12, r12
je 0x140042e99
jmp 0x1400431d3
xor edi, edi
jmp 0x1400431dd
mov dword [rsp + 0x40], 0
test r14, r14
je 0x14004334b
mov rdx, qword [rsi]
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x40]
mov rcx, r13
mov r8d, ebx
call sub.KERNEL32.dll_ReadFile
test eax, eax
je 0x1400431fa
mov edi, dword [rsp + 0x40]
xor eax, eax
test rdi, rdi
mov r12d, 0x26
cmovne r12, rax
jmp 0x1400431e0
xor edi, edi
mov r15, qword [rsp + 0x48]
jmp 0x1400431dd
add rdi, rax
test r12, r12
mov r15, qword [rsp + 0x48]
jne 0x1400431e0
xor r12d, r12d
mov qword [r15], rdi
mov rax, r12
add rsp, 0x978
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
call sub.KERNEL32.dll_GetLastError
mov r12d, eax
xor edi, edi
jmp 0x1400431e0
mov qword [rsp + 0x20], r13
lea rcx, str.c:_programs_odin_core_unicode_utf16_utf16.odin
mov edx, 0x75
mov r8d, 0x11
mov r9, rsi
call fcn.14005d190
mov qword [rsp + 0x28], 0x608
mov qword [rsp + 0x20], 0x608
lea rcx, str.c:_programs_odin_core_unicode_utf16_utf16.odin
mov edx, 0x7f
mov r8d, 0xe
mov r9, r15
call fcn.14000e260
mov qword [rsp + 0x20], r15
lea rcx, str.c:_programs_odin_core_os_file_windows.odin
mov edx, 0x81
mov r8d, 0xd
mov r9, r15
call fcn.14005d190
add rdi, rax
mov qword [rsp + 0x20], rbx
lea rcx, str.c:_programs_odin_core_os_file_windows.odin
mov edx, 0x86
mov r8d, 6
mov r9, rdi
call fcn.14005d190
mov qword [rsp + 0x20], r13
mov qword [rsp + 0x28], 0x182
lea rcx, str.c:_programs_odin_core_os_file_windows.odin
mov edx, 0x7c
mov r8d, 0x32
xor r9d, r9d
call fcn.14000e260
mov qword [rsp + 0x20], r15
mov qword [rsp + 0x28], 0x608
lea rcx, str.c:_programs_odin_core_os_file_windows.odin
mov edx, 0x7d
mov r8d, 0xe
xor r9d, r9d
call fcn.14000e260
mov qword [rsp + 0x28], r14
mov qword [rsp + 0x20], r14
lea rcx, str.c:_programs_odin_core_os_file_windows.odin
mov edx, 0xa7
mov r8d, 0x2e
xor r9d, r9d
call fcn.14000e260
mov qword [rsp + 0x28], r14
mov qword [rsp + 0x20], rbx
lea rcx, str.c:_programs_odin_core_os_file_windows.odin
mov edx, 0xa7
mov r8d, 0x3b
xor r9d, r9d
call fcn.14000e260
mov qword [rsp + 0x28], rbx
mov qword [rsp + 0x20], rdi
lea rcx, str.c:_programs_odin_core_os_file_windows.odin
mov edx, 0x8f
mov r8d, 0x3a
call fcn.14000e260
mov qword [rsp + 0x20], 0
lea rcx, str.c:_programs_odin_core_os_file_windows.odin
mov edx, 0xae
mov r8d, 0x28
xor r9d, r9d
call fcn.14005d190
int3