Function at 0x140046810
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 0x140046866
lea r15d, [rsi + 1]
test ecx, ecx
jne 0x140046869
mov r15d, esi
mov qword [rsp + 0x50], rbp
test edx, edx
je 0x14004688d
bt eax, 0x1a
jb 0x14004688d
mov rcx, qword [rbx + 0x88]
call fcn.14004ed50
mov ebp, 1
test eax, eax
jne 0x14004688f
mov ebp, esi
test dword [rbx + 0x68], 0x4000000
mov qword [rsp + 0x48], rdi
je 0x1400468a7
mov edi, 1
test r13d, r13d
jne 0x1400468a9
mov edi, esi
call fcn.140040ec0
mov rcx, qword [rsp + 0x98]
add r12, rax
mov r14, rax
mov dword [rcx], esi
mov rax, qword [0x14025b110]
test rax, rax
je 0x1400468df
mov rax, qword [rax + 0x38]
test rax, rax
je 0x1400468df
mov ecx, dword [rbx]
call rax
mov rcx, qword [rsp + 0x98]
test r15d, r15d
jne 0x140046bc6
test ebp, ebp
jne 0x140046bbf
test edi, edi
jne 0x140046bb6
cmp dword [rsp + 0x90], esi
je 0x140046aa0
test dword [rbx + 0x68], 0x400
jne 0x140046aa0
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.14004aae0
movsxd rcx, dword [rbx + 0x70]
lea rax, [0x140043440]
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.140172320
test rax, rax
jne 0x1400469d1
mov rcx, qword gs:[0x58]
mov eax, 0x2fe0
mov rdx, qword [rcx]
mov rax, qword [rax + rdx]
test rax, rax
jne 0x1400469ad
call fcn.140176664
mov ecx, dword [rax]
mov edx, 3
mov dword [rsp + 0x20], 6
lea r9d, [rdx + 0x6a]
lea r8d, [r9 + 0x7b]
call fcn.1400415e0
test eax, eax
je 0x140046beb
test edi, edi
jne 0x140046a8a
lea rcx, [0x140272f60]
call sub.KERNEL32.dll_EnterCriticalSection
cmp rbx, qword [0x140272fa8]
mov rcx, qword [rbx + 0xf0]
jne 0x1400469fe
mov qword [0x140272fa8], rcx
jmp 0x140046a13
mov rax, qword [rbx + 0xf8]
mov qword [rax + 0xf0], rcx
mov rcx, qword [0x140272fa8]
mov rdx, qword [rbx + 0xf0]
test rdx, rdx
je 0x140046a2f
mov rax, qword [rbx + 0xf8]
mov qword [rdx + 0xf8], rax
jmp 0x140046a42
test rcx, rcx
je 0x140046a42
mov rax, qword [rbx + 0xf8]
mov qword [rcx + 0xf8], rax
lea rcx, [0x140272f60]
mov qword [rbx + 0xf0], rsi
mov qword [rbx + 0xf8], rsi
call fcn.14002ec90
and dword [rbx + 0x68], 0xfffffbff
or eax, 0xffffffff
lock xadd dword [rbx + 0x120], eax
cmp eax, 1
jne 0x140046a7b
mov rcx, rbx
call fcn.140042af0
or dword [rbx + 0x68], 0x100000
mov rcx, rbx
call fcn.14004ab80
test dword [rbx + 0x68], 0x4000000
je 0x140046a9d
mov edi, 1
test r13d, r13d
jne 0x140046aa0
mov edi, esi
nop
test ebp, ebp
jne 0x140046b99
test edi, edi
jne 0x140046b99
cmp dword [rsp + 0xa0], esi
jl 0x140046aca
cmp r14, r12
jae 0x140046b99
mov ecx, r12d
sub ecx, r14d
jmp 0x140046acd
or ecx, 0xffffffff
mov edx, 1
call qword [sym.imp.KERNEL32.dll_SleepEx]
mov eax, dword [rbx + 0x68]
bt eax, 9
jae 0x140046af0
mov r15d, 1
cmp dword [rsp + 0x90], esi
jne 0x140046af3
mov r15d, esi
cmp dword [rsp + 0x30], esi
je 0x140046b14
bt eax, 0x1a
jb 0x140046b14
mov rcx, qword [rbx + 0x88]
call fcn.14004ed50
mov ebp, 1
test eax, eax
jne 0x140046b16
mov ebp, esi
test dword [rbx + 0x68], 0x4000000
je 0x140046b29
mov edi, 1
test r13d, r13d
jne 0x140046b2b
mov edi, esi
call fcn.140040ec0
mov r14, rax
test r15d, r15d
je 0x140046aa0
mov edi, 1
mov rax, qword [rsp + 0x98]
mov esi, 1
mov dword [rax], edi
cmp dword [rsp + 0xa8], 0
je 0x140046b95
test dword [rbx + 0x68], 0x400
je 0x140046b95
movsxd rcx, dword [rbx + 0x70]
call fcn.14003e750
test dword [rbx + 0x68], 0x400
je 0x140046b95
nop word [rax + rax]
or edx, 0xffffffff
or ecx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_SleepEx]
test dword [rbx + 0x68], 0x400
jne 0x140046b80
mov eax, esi
jmp 0x140046bd2
test r15d, r15d
jne 0x140046b3c
test ebp, ebp
jne 0x140046baf
test edi, edi
je 0x140046b50
neg edi
sbb edi, edi
and edi, 4
jmp 0x140046b41
mov edi, 2
jmp 0x140046b41
lea edi, [rdi*4]
jmp 0x140046bcb
mov edi, 2
jmp 0x140046bcb
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.140029170
int3