Function at 0x18003856c
Capabilities:
Read file on windows

Disassembly:
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
mov eax, 0x1180
call fcn.180051560
sub rsp, rax
mov qword [rsp + 0xc0], 0xfffffffffffffffe
mov qword [rsp + 0x11d0], rbx
mov rax, qword [0x180071060]
xor rax, rsp
mov qword [rsp + 0x1170], rax
mov r12, rdx
mov rbx, rcx
xor r13d, r13d
mov dword [rsp + 0x50], r13d
lea r15, [0x180075150]
cmp dword [0x180073e44], r13d
je 0x1800385d9
mov dword [0x180073e44], r13d
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
cmp r12, r13
jne 0x18003860a
mov esi, 0xf
mov qword [rbx + 0x20], rsi
mov qword [rbx + 0x18], r13
mov byte [rbx + 8], r13b
lea r8d, [rsi - 8]
lea rdx, [0x18005efe0]
mov rcx, rbx
call fcn.180006c70
mov rax, rbx
jmp 0x180038c32
mov ebp, 7
mov qword [rsp + 0x110], rbp
mov qword [rsp + 0x108], r13
mov word [rsp + 0xf8], r13w
xor eax, eax
or rcx, 0xffffffffffffffff
mov rdi, r12
repne scasw ax, word [rdi]
not rcx
lea r8, [rcx - 1]
mov rdx, r12
lea rcx, [rsp + 0xf0]
call fcn.180006f50
nop
lea rsi, [rsp + 0xf8]
mov rcx, qword [rsp + 0xf8]
mov rdx, qword [rsp + 0x110]
lea r14d, [rbp + 1]
cmp rdx, r14
cmovae rsi, rcx
cmp rsi, r13
je 0x1800386a8
lea rax, [rsp + 0xf8]
cmp rdx, r14
cmovae rax, rcx
cmp rax, rsi
ja 0x1800386a8
lea rax, [rsp + 0xf8]
cmp rdx, r14
cmovae rax, rcx
mov rdi, qword [rsp + 0x108]
lea rax, [rax + rdi*2]
cmp rsi, rax
jbe 0x1800386c5
call fcn.18003ce6c
mov rdx, qword [rsp + 0x110]
mov rdi, qword [rsp + 0x108]
mov rcx, qword [rsp + 0xf8]
lea rax, [rsp + 0xf0]
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x48], rsi
movaps xmm0, xmmword [rsp + 0x40]
movdqa xmmword [rsp + 0x60], xmm0
lea rax, [rsp + 0xf8]
cmp rdx, r14
cmovae rax, rcx
lea rsi, [rax + rdi*2]
cmp rsi, r13
je 0x180038726
lea rax, [rsp + 0xf8]
cmp rdx, r14
cmovae rax, rcx
cmp rax, rsi
ja 0x180038726
lea rax, [rsp + 0xf8]
cmp rdx, r14
cmovae rax, rcx
lea rax, [rax + rdi*2]
cmp rsi, rax
jbe 0x180038743
call fcn.18003ce6c
mov rdx, qword [rsp + 0x110]
mov rdi, qword [rsp + 0x108]
mov rcx, qword [rsp + 0xf8]
lea rax, [rsp + 0xf0]
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x48], rsi
movaps xmm0, xmmword [rsp + 0x40]
movdqa xmmword [rsp + 0xd0], xmm0
lea rsi, [rsp + 0xf8]
cmp rdx, r14
cmovae rsi, rcx
cmp rsi, r13
je 0x1800387a3
lea rax, [rsp + 0xf8]
cmp rdx, r14
cmovae rax, rcx
cmp rax, rsi
ja 0x1800387a3
lea rax, [rsp + 0xf8]
cmp rdx, r14
cmovae rax, rcx
lea rax, [rax + rdi*2]
cmp rsi, rax
jbe 0x1800387a8
call fcn.18003ce6c
lea rax, [rsp + 0xf0]
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x48], rsi
movaps xmm0, xmmword [rsp + 0x40]
movdqa xmmword [rsp + 0x40], xmm0
lea rax, [fcn.18003d278]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x60]
lea r8, [rsp + 0xd0]
lea rdx, [rsp + 0x40]
lea rcx, [rsp + 0xe0]
call fcn.18000f570
mov edx, dword [0x180075d74]
lea rdi, [0x180075b70]
test dl, 1
jne 0x18003886e
or edx, 1
mov dword [0x180075d74], edx
mov rcx, r14
call fcn.18003cfc0
cmp rax, r13
je 0x18003881d
mov qword [rax], rdi
jmp 0x180038820
mov rax, r13
mov qword [0x180075b70], rax
mov rcx, rdi
call fcn.18003a3e4
mov qword [0x180075ba0], rax
mov byte [rax + 0x69], 1
mov rax, qword [0x180075ba0]
mov qword [rax + 8], rax
mov rax, qword [0x180075ba0]
mov qword [rax], rax
mov rax, qword [0x180075ba0]
mov qword [rax + 0x10], rax
mov qword [0x180075ba8], r13
lea rcx, [0x180058aa0]
call fcn.18003d400
nop
mov dword [rsp + 0x98], r13d
xor edx, edx
lea r8d, [rdx + 0x20]
lea rcx, [rsp + 0x9c]
call fcn.18003e200
lea r8, [rsp + 0x98]
xor edx, edx
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_GetFileAttributesExW]
cmp eax, r13d
jne 0x1800388e4
mov esi, 0xf
mov qword [rbx + 0x20], rsi
mov qword [rbx + 0x18], r13
mov byte [rbx + 8], r13b
mov r8, rbp
lea rdx, [0x18005efe0]
mov rcx, rbx
call fcn.180006c70
nop
cmp qword [rsp + 0x110], r14
jb 0x1800388dc
mov rcx, qword [rsp + 0xf8]
call fcn.18003cec4
mov rax, rbx
jmp 0x180038c32
mov qword [rsp + 0x60], r15
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
nop
lea r8, [rsp + 0xf0]
lea rdx, [rsp + 0x40]
mov rcx, rdi
call fcn.180038ed4
mov r12, qword [0x180075ba0]
mov rdi, qword [rsp + 0x40]
cmp rdi, r13
je 0x180038922
cmp rdi, qword [0x180075b70]
je 0x180038927
call fcn.18003ce6c
mov rsi, qword [rsp + 0x48]
cmp rsi, r12
je 0x1800389d6
cmp rdi, r13
jne 0x180038944
call fcn.18003ce6c
mov r11, r13
jmp 0x180038947
mov r11, qword [rdi]
cmp rsi, qword [r11 + 0x30]
jne 0x180038952
call fcn.18003ce6c
mov rax, qword [rsi + 0x40]
cmp rax, qword [rsp + 0xac]
jne 0x1800389d6
cmp rdi, r13
jne 0x18003896f
call fcn.18003ce6c
mov rdx, r13
jmp 0x180038972
mov rdx, qword [rdi]
cmp rsi, qword [rdx + 0x30]
jne 0x18003897d
call fcn.18003ce6c
lea rdx, [rsi + 0x48]
mov esi, 0xf
mov qword [rbx + 0x20], rsi
mov qword [rbx + 0x18], r13
mov byte [rbx + 8], r13b
xor eax, eax
or rcx, 0xffffffffffffffff
mov rdi, rdx
repne scasb al, byte [rdi]
not rcx
lea r8, [rcx - 1]
mov rcx, rbx
call fcn.180006c70
nop
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
nop
cmp qword [rsp + 0x110], r14
jb 0x1800389ce
mov rcx, qword [rsp + 0xf8]
call fcn.18003cec4
mov rax, rbx
jmp 0x180038c32
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea rcx, [rsp + 0xf8]
cmp qword [rsp + 0x110], r14
cmovae rcx, qword [rsp + 0xf8]
mov qword [rsp + 0x30], r13
mov dword [rsp + 0x28], r13d
mov r8d, 3
mov dword [rsp + 0x20], r8d
xor r9d, r9d
mov edx, 0x80000000
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rdi, rax
mov qword [rsp + 0x60], rax
cmp rax, r13
je 0x180038bdf
cmp rax, 0xffffffffffffffff
je 0x180038bdf
mov byte [rsp + 0x170], r13b
xor edx, edx
mov r8d, 0xfff
lea rcx, [rsp + 0x171]
call fcn.18003e200
mov qword [rsp + 0x20], r13
lea r9, [rsp + 0x50]
mov esi, 0x1000
mov r8d, esi
lea rdx, [rsp + 0x170]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov r8d, esi
lea rdx, [rsp + 0x170]
lea rcx, [rsp + 0x70]
call fcn.1800372dc
nop
mov r9d, 0xc
mov r8, r14
lea rdx, [rsp + 0x118]
mov rcx, rax
call fcn.180037024
nop
cmp qword [rsp + 0x90], 0x10
jb 0x180038abb
mov rcx, qword [rsp + 0x78]
call fcn.18003cec4
mov esi, 0xf
mov qword [rsp + 0x90], rsi
mov qword [rsp + 0x88], r13
mov byte [rsp + 0x78], r13b
mov qword [rsp + 0x40], r15
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
nop
xor edx, edx
lea r8d, [rsi + 0x15]
lea rcx, [rsp + 0x144]
call fcn.18003e200
mov r11, qword [rsp + 0xac]
mov qword [rsp + 0x140], r11
lea rdx, [rsp + 0x120]
cmp qword [rsp + 0x138], 0x10
cmovae rdx, qword [rsp + 0x120]
lea r8d, [rsi + 0x11]
lea rcx, [rsp + 0x148]
call qword [sym.imp.KERNEL32.dll_lstrcpynA]
lea rdx, [rsp + 0xf0]
lea rcx, [0x180075b70]
call fcn.180038c60
mov rcx, rax
lea rdx, [rsp + 0x140]
lea r8d, [rsi + 0x19]
call fcn.18003c980
nop
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov qword [rbx + 0x20], rsi
mov qword [rbx + 0x18], r13
mov byte [rbx + 8], r13b
or r9, 0xffffffffffffffff
xor r8d, r8d
lea rdx, [rsp + 0x118]
mov rcx, rbx
call fcn.180005ff0
nop
cmp qword [rsp + 0x138], 0x10
jb 0x180038ba1
mov rcx, qword [rsp + 0x120]
call fcn.18003cec4
mov qword [rsp + 0x138], rsi
mov qword [rsp + 0x130], r13
mov byte [rsp + 0x120], r13b
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop
cmp qword [rsp + 0x110], r14
jb 0x180038bda
mov rcx, qword [rsp + 0xf8]
call fcn.18003cec4
mov rax, rbx
jmp 0x180038c32
mov esi, 0xf
mov qword [rbx + 0x20], rsi
mov qword [rbx + 0x18], r13
mov byte [rbx + 8], r13b
mov r8, rbp
lea rdx, [0x18005efe0]
mov rcx, rbx
call fcn.180006c70
nop
cmp rdi, 0xffffffffffffffff
je 0x180038c18
cmp rdi, r13
je 0x180038c18
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop
cmp qword [rsp + 0x110], r14
jb 0x180038c2f
mov rcx, qword [rsp + 0xf8]
call fcn.18003cec4
mov rax, rbx
mov rcx, qword [rsp + 0x1170]
xor rcx, rsp
call fcn.18003c6c0
mov rbx, qword [rsp + 0x11d0]
add rsp, 0x1180
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret