Function at 0x140040270
Capabilities:
Read file on windows

Disassembly:
mov qword [rsp + 8], rcx
sub rsp, 0x88
lea rcx, [rsp + 0x90]
call fcn.140009570
movzx eax, al
test eax, eax
je 0x14004029a
mov dword [rsp + 0x30], 1
jmp 0x1400402a2
mov dword [rsp + 0x30], 0
mov eax, dword [rsp + 0x30]
mov dword [rsp + 0x34], eax
cmp dword [rsp + 0x34], 0
jne 0x1400402eb
lea rax, str.stream.valid__
mov qword [rsp + 0x28], rax
lea rax, [0x140062a90]
mov qword [rsp + 0x20], rax
xor r9d, r9d
mov r8d, 0x7e
lea rdx, str.minkernelcrtsucrt_src_appcrt_stdio_filbuf.cpp
mov ecx, 2
call fcn.140015070
cmp eax, 1
jne 0x1400402eb
int3
cmp dword [rsp + 0x34], 0
jne 0x140040330
call fcn.140021240
mov dword [rax], 0x16
mov qword [rsp + 0x20], 0
mov r9d, 0x7e
lea r8, str.minkernelcrtsucrt_src_appcrt_stdio_filbuf.cpp
lea rdx, str.common_refill_and_read_nolock
lea rcx, str.stream.valid__
call fcn.140015aa0
mov eax, 0xffffffff
jmp 0x140040638
lea rcx, [rsp + 0x90]
call fcn.14001b6b0
movzx eax, al
test eax, eax
je 0x140040358
lea rcx, [rsp + 0x90]
call fcn.14001b6f0
movzx eax, al
test eax, eax
je 0x140040362
mov eax, 0xffffffff
jmp 0x140040638
mov edx, 2
lea rcx, [rsp + 0x90]
call fcn.14001bea0
movzx eax, al
test eax, eax
je 0x140040397
mov edx, 0x10
lea rcx, [rsp + 0x90]
call fcn.14001bf80
mov eax, 0xffffffff
jmp 0x140040638
mov edx, 1
lea rcx, [rsp + 0x90]
call fcn.14001bf80
lea rcx, [rsp + 0x90]
call fcn.14001cc10
movzx eax, al
test eax, eax
jne 0x1400403d2
lea rcx, [rsp + 0x90]
call fcn.1400095a0
mov rcx, rax
call fcn.1400445e0
xor edx, edx
mov rcx, qword [rsp + 0x90]
call fcn.140040640
mov dword [rsp + 0x48], eax
lea rcx, [rsp + 0x90]
call fcn.1400095a0
mov rax, qword [rax + 8]
mov qword [rsp + 0x58], rax
lea rcx, [rsp + 0x90]
call fcn.1400095a0
mov rcx, qword [rsp + 0x58]
mov qword [rax], rcx
lea rcx, [rsp + 0x90]
call fcn.1400095a0
mov eax, dword [rax + 0x20]
mov dword [rsp + 0x3c], eax
lea rcx, [rsp + 0x90]
call fcn.1400095a0
mov rax, qword [rax + 8]
mov qword [rsp + 0x60], rax
lea rcx, [rsp + 0x90]
call fcn.1400095a0
mov rcx, rax
call fcn.14003d4c0
mov dword [rsp + 0x40], eax
mov r8d, dword [rsp + 0x3c]
mov rdx, qword [rsp + 0x60]
mov ecx, dword [rsp + 0x40]
call fcn.140042aa0
mov dword [rsp + 0x44], eax
lea rcx, [rsp + 0x90]
call fcn.1400095a0
mov ecx, dword [rsp + 0x44]
mov dword [rax + 0x10], ecx
xor edx, edx
mov rcx, qword [rsp + 0x90]
call fcn.140040650
movzx eax, al
test eax, eax
jne 0x1400404e8
lea rcx, [rsp + 0x90]
call fcn.1400095a0
cmp dword [rax + 0x10], 0
je 0x1400404b1
mov dword [rsp + 0x38], 0x10
jmp 0x1400404b9
mov dword [rsp + 0x38], 8
mov edx, dword [rsp + 0x38]
lea rcx, [rsp + 0x90]
call fcn.14001bf80
lea rcx, [rsp + 0x90]
call fcn.1400095a0
mov dword [rax + 0x10], 0
mov eax, 0xffffffff
jmp 0x140040638
mov edx, 6
lea rcx, [rsp + 0x90]
call fcn.14001cc30
movzx eax, al
test eax, eax
jne 0x1400405ca
lea rcx, [rsp + 0x90]
call fcn.1400095a0
mov rcx, rax
call fcn.14003d4c0
cmp eax, 0xffffffff
je 0x140040597
lea rcx, [rsp + 0x90]
call fcn.1400095a0
mov rcx, rax
call fcn.14003d4c0
cmp eax, 0xfffffffe
je 0x140040597
lea rcx, [rsp + 0x90]
call fcn.1400095a0
mov rcx, rax
call fcn.14003d4c0
sar eax, 6
cdqe
mov qword [rsp + 0x70], rax
lea rcx, [0x140081c00]
mov qword [rsp + 0x68], rcx
lea rcx, [rsp + 0x90]
call fcn.1400095a0
mov rcx, rax
call fcn.14003d4c0
and eax, 0x3f
cdqe
imul rax, rax, 0x48
mov rdx, qword [rsp + 0x68]
mov rcx, qword [rsp + 0x70]
add rax, qword [rdx + rcx*8]
mov qword [rsp + 0x50], rax
jmp 0x1400405a3
lea rax, [0x14007f480]
mov qword [rsp + 0x50], rax
mov rax, qword [rsp + 0x50]
movzx eax, byte [rax + 0x38]
and eax, 0x82
cmp eax, 0x82
jne 0x1400405ca
mov edx, 0x20
lea rcx, [rsp + 0x90]
call fcn.14001bf80
lea rcx, [rsp + 0x90]
call fcn.1400095a0
cmp dword [rax + 0x20], 0x200
jne 0x140040621
lea rcx, [rsp + 0x90]
call fcn.14003cf40
movzx eax, al
test eax, eax
je 0x140040621
mov edx, pe_nt_image_headers64
lea rcx, [rsp + 0x90]
call fcn.14001bea0
movzx eax, al
test eax, eax
jne 0x140040621
lea rcx, [rsp + 0x90]
call fcn.1400095a0
mov dword [rax + 0x20], 0x1000
xor r8d, r8d
mov edx, dword [rsp + 0x48]
mov rcx, qword [rsp + 0x90]
call fcn.1400406a0
movzx eax, al
add rsp, 0x88
ret