Function at 0x140046030
Capabilities:
Read file on windows

Disassembly:
mov dword [rsp + 0x18], r8d
mov qword [rsp + 0x10], rdx
push rbx
push rsi
push r12
push r13
push r14
push r15
sub rsp, 0x58
mov r13d, dword [rdx]
mov rbx, rcx
mov ecx, r13d
movsxd r12, r8d
mov edx, r13d
xor esi, esi
and ecx, 1
mov dword [rsp + 0xa8], esi
mov eax, dword [rbx + 0x68]
and edx, 2
and r13d, 4
mov dword [rsp + 0x90], ecx
mov dword [rsp + 0x30], edx
bt eax, 9
jae 0x140046086
lea r15d, [rsi + 1]
test ecx, ecx
jne 0x140046089
mov r15d, esi
mov qword [rsp + 0x50], rbp
test edx, edx
je 0x1400460ad
bt eax, 0x1a
jb 0x1400460ad
mov rcx, qword [rbx + 0x88]
call fcn.14004e270
mov ebp, 1
test eax, eax
jne 0x1400460af
mov ebp, esi
test dword [rbx + 0x68], 0x4000000
mov qword [rsp + 0x48], rdi
je 0x1400460c7
mov edi, 1
test r13d, r13d
jne 0x1400460c9
mov edi, esi
call fcn.140040820
mov rcx, qword [rsp + 0x98]
add r12, rax
mov r14, rax
mov dword [rcx], esi
mov rax, qword [0x1402590d0]
test rax, rax
je 0x1400460ff
mov rax, qword [rax + 0x38]
test rax, rax
je 0x1400460ff
mov ecx, dword [rbx]
call rax
mov rcx, qword [rsp + 0x98]
test r15d, r15d
jne 0x1400463e6
test ebp, ebp
jne 0x1400463df
test edi, edi
jne 0x1400463d6
cmp dword [rsp + 0x90], esi
je 0x1400462c0
test dword [rbx + 0x68], 0x400
jne 0x1400462c0
mov rax, qword [rbx + 0x138]
xor ecx, ecx
mov dword [rsp + 0xa8], 1
mov qword [rax], rcx
mov qword [rax + 8], rcx
mov qword [rax + 0x10], rcx
mov qword [rax + 0x18], rcx
mov rax, qword [rbx + 0x138]
mov qword [rax + 0x18], rbx
lock inc dword [rbx + 0x120]
or dword [rbx + 0x68], 0x400
mov rcx, rbx
call fcn.14004a2f0
movsxd rcx, dword [rbx + 0x70]
lea rax, [0x140042da0]
mov r9, qword [rbx + 0x138]
lea rdx, [rbx + 0x164]
lea r8d, [r15 + 1]
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_ReadFileEx]
movsxd rdi, eax
mov rcx, rdi
call fcn.140170a40
test rax, rax
jne 0x1400461f1
mov rcx, qword gs:[0x58]
mov eax, 0x2fe0
mov rdx, qword [rcx]
mov rax, qword [rax + rdx]
test rax, rax
jne 0x1400461cd
call fcn.140174cc4
mov ecx, dword [rax]
mov edx, 3
mov dword [rsp + 0x20], 6
lea r9d, [rdx + 0x6a]
lea r8d, [r9 + 0x7b]
call fcn.140040f40
test eax, eax
je 0x14004640b
test edi, edi
jne 0x1400462aa
lea rcx, [0x140270f40]
call sub.KERNEL32.dll_EnterCriticalSection
cmp rbx, qword [0x140270f88]
mov rcx, qword [rbx + 0xf0]
jne 0x14004621e
mov qword [0x140270f88], rcx
jmp 0x140046233
mov rax, qword [rbx + 0xf8]
mov qword [rax + 0xf0], rcx
mov rcx, qword [0x140270f88]
mov rdx, qword [rbx + 0xf0]
test rdx, rdx
je 0x14004624f
mov rax, qword [rbx + 0xf8]
mov qword [rdx + 0xf8], rax
jmp 0x140046262
test rcx, rcx
je 0x140046262
mov rax, qword [rbx + 0xf8]
mov qword [rcx + 0xf8], rax
lea rcx, [0x140270f40]
mov qword [rbx + 0xf0], rsi
mov qword [rbx + 0xf8], rsi
call fcn.14002e7d0
and dword [rbx + 0x68], 0xfffffbff
or eax, 0xffffffff
lock xadd dword [rbx + 0x120], eax
cmp eax, 1
jne 0x14004629b
mov rcx, rbx
call fcn.140042450
or dword [rbx + 0x68], 0x100000
mov rcx, rbx
call fcn.14004a390
test dword [rbx + 0x68], 0x4000000
je 0x1400462bd
mov edi, 1
test r13d, r13d
jne 0x1400462c0
mov edi, esi
nop
test ebp, ebp
jne 0x1400463b9
test edi, edi
jne 0x1400463b9
cmp dword [rsp + 0xa0], esi
jl 0x1400462ea
cmp r14, r12
jae 0x1400463b9
mov ecx, r12d
sub ecx, r14d
jmp 0x1400462ed
or ecx, 0xffffffff
mov edx, 1
call qword [sym.imp.KERNEL32.dll_SleepEx]
mov eax, dword [rbx + 0x68]
bt eax, 9
jae 0x140046310
mov r15d, 1
cmp dword [rsp + 0x90], esi
jne 0x140046313
mov r15d, esi
cmp dword [rsp + 0x30], esi
je 0x140046334
bt eax, 0x1a
jb 0x140046334
mov rcx, qword [rbx + 0x88]
call fcn.14004e270
mov ebp, 1
test eax, eax
jne 0x140046336
mov ebp, esi
test dword [rbx + 0x68], 0x4000000
je 0x140046349
mov edi, 1
test r13d, r13d
jne 0x14004634b
mov edi, esi
call fcn.140040820
mov r14, rax
test r15d, r15d
je 0x1400462c0
mov edi, 1
mov rax, qword [rsp + 0x98]
mov esi, 1
mov dword [rax], edi
cmp dword [rsp + 0xa8], 0
je 0x1400463b5
test dword [rbx + 0x68], 0x400
je 0x1400463b5
movsxd rcx, dword [rbx + 0x70]
call fcn.14003e110
test dword [rbx + 0x68], 0x400
je 0x1400463b5
nop word [rax + rax]
or edx, 0xffffffff
or ecx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_SleepEx]
test dword [rbx + 0x68], 0x400
jne 0x1400463a0
mov eax, esi
jmp 0x1400463f2
test r15d, r15d
jne 0x14004635c
test ebp, ebp
jne 0x1400463cf
test edi, edi
je 0x140046370
neg edi
sbb edi, edi
and edi, 4
jmp 0x140046361
mov edi, 2
jmp 0x140046361
lea edi, [rdi*4]
jmp 0x1400463eb
mov edi, 2
jmp 0x1400463eb
mov edi, 1
mov dword [rcx], edi
mov eax, 1
mov rdi, qword [rsp + 0x48]
mov rbp, qword [rsp + 0x50]
add rsp, 0x58
pop r15
pop r14
pop r13
pop r12
pop rsi
pop rbx
ret
lea rdx, str.cant_read_from_handle:__m
mov ecx, 0x580000
call fcn.1400292e0
int3