Function at 0x140054520
Capabilities:
Check if file exists

Disassembly:
push rbp
push rsi
push rdi
push r12
push r14
sub rsp, 0x250
mov rax, qword [0x1401770a0]
xor rax, rsp
mov qword [rsp + 0x240], rax
xor r14d, r14d
lea rax, [rsp + 0x30]
mov esi, 0x104
mov qword [r8], r14
mov r9d, esi
lea rdx, [rsp + 0x30]
sub rcx, rax
mov r12, r8
nop
lea rax, [r9 + 0x7ffffefa]
test rax, rax
je 0x140054582
movzx eax, word [rcx + rdx]
test ax, ax
je 0x140054582
mov word [rdx], ax
add rdx, 2
sub r9, 1
jne 0x140054560
test r9, r9
lea rax, [rdx - 2]
mov rcx, rsi
cmovne rax, rdx
mov word [rax], r14w
lea rax, [rsp + 0x30]
nop dword [rax]
cmp word [rax], r14w
je 0x1400545b0
add rax, 2
sub rcx, 1
jne 0x1400545a0
mov rax, rsi
mov ebp, 0x7ffffffe
sub rax, rcx
test rcx, rcx
cmove rax, r14
je 0x140054611
mov rdx, rsi
lea rcx, [rsp + 0x30]
lea rcx, [rcx + rax*2]
sub rdx, rax
je 0x140054602
lea r9, [0x14014bf18]
mov eax, ebp
sub r9, rcx
test rax, rax
je 0x140054602
movzx r8d, word [r9 + rcx]
test r8w, r8w
je 0x140054602
mov word [rcx], r8w
dec rax
add rcx, 2
sub rdx, 1
jne 0x1400545e1
test rdx, rdx
lea rax, [rcx - 2]
cmovne rax, rcx
mov word [rax], r14w
mov qword [rsp + 0x280], rbx
lea r8, [rsp + 0x30]
xor edx, edx
mov qword [rsp + 0x288], r15
mov ecx, 0x1f0003
call qword [sym.imp.KERNEL32.dll_OpenSemaphoreW]
mov rdi, rax
test rax, rax
jne 0x140054664
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x1400548c6
mov rcx, qword [rsp + 0x278]
mov edx, 0xc9
call fcn.140054060
mov r14d, eax
jmp 0x1400548c6
xor edx, edx
mov dword [rsp + 0x28], r14d
mov rcx, rdi
mov r15d, r14d
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0xffffffff
jne 0x140054686
mov edx, 0x95
jmp 0x140054762
test eax, eax
je 0x14005469b
cmp eax, 0x102
je 0x14005469b
mov edx, 0x96
jmp 0x140054899
mov dword [rsp + 0x20], r14d
mov edx, 1
mov rcx, rdi
test eax, eax
jne 0x1400546f8
lea r8, [rsp + 0x20]
call qword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
test eax, eax
jne 0x1400546c5
mov edx, 0x9e
jmp 0x140054762
inc dword [rsp + 0x20]
xor r8d, r8d
mov rcx, rdi
lea edx, [r8 + 1]
call qword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
test eax, eax
jne 0x1400546ee
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x12a
je 0x140054788
mov edx, 0xa3
jmp 0x140054899
lea r8, [rsp + 0x24]
mov dword [rsp + 0x24], r14d
call qword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
test eax, eax
jne 0x140054713
mov edx, 0xad
jmp 0x140054762
cmp dword [rsp + 0x24], r14d
je 0x140054724
mov edx, 0xae
jmp 0x140054899
xor r8d, r8d
mov rcx, rdi
lea edx, [r8 + 1]
call qword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
test eax, eax
jne 0x140054894
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x12a
jne 0x140054894
xor edx, edx
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0xffffffff
jne 0x14005477a
mov edx, 0xb4
mov rcx, qword [rsp + 0x278]
call fcn.140054060
mov ebx, eax
test eax, eax
jns 0x14005478d
jmp 0x1400548ae
test eax, eax
je 0x140054788
mov edx, 0xb5
jmp 0x140054899
mov r15d, dword [rsp + 0x20]
mov rcx, rsi
lea rax, [rsp + 0x30]
cmp word [rax], r14w
je 0x1400547a5
add rax, 2
sub rcx, 1
jne 0x140054795
mov rax, rsi
sub rax, rcx
test rcx, rcx
cmove rax, r14
je 0x1400547fd
lea rdx, [rsp + 0x30]
lea rdx, [rdx + rax*2]
sub rsi, rax
je 0x1400547ee
lea rcx, [0x14014bf20]
sub rcx, rdx
nop dword [rax]
test rbp, rbp
je 0x1400547ee
movzx eax, word [rcx + rdx]
test ax, ax
je 0x1400547ee
mov word [rdx], ax
dec rbp
add rdx, 2
sub rsi, 1
jne 0x1400547d0
test rsi, rsi
lea rax, [rdx - 2]
cmovne rax, rdx
mov word [rax], r14w
lea r8, [rsp + 0x30]
xor edx, edx
mov ecx, 0x1f0003
call qword [sym.imp.KERNEL32.dll_OpenSemaphoreW]
mov rbx, rax
test rax, rax
jne 0x140054830
mov rcx, qword [rsp + 0x278]
mov edx, 0xd5
call fcn.140054060
mov esi, eax
jmp 0x1400548ce
lea rdx, [rsp + 0x28]
mov rcx, rbx
call fcn.140054390
mov esi, eax
test eax, eax
jns 0x14005486b
mov rcx, qword [rsp + 0x278]
mov r9d, eax
mov edx, 0xd7
call fcn.140054040
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x14005491f
jmp 0x1400548ce
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x140054932
movsxd rcx, dword [rsp + 0x28]
mov esi, r14d
shl rcx, 0x1f
movsxd rax, r15d
or rcx, rax
mov qword [r12], rcx
jmp 0x1400548ce
mov edx, 0xb1
mov rcx, qword [rsp + 0x278]
mov ebx, 0x8000ffff
mov r9d, ebx
call fcn.140054040
mov rcx, qword [rsp + 0x278]
mov r9d, ebx
mov edx, 0xcf
call fcn.140054040
mov r14d, ebx
mov esi, r14d
test rdi, rdi
je 0x1400548db
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x14005490c
mov r15, qword [rsp + 0x288]
mov eax, esi
mov rbx, qword [rsp + 0x280]
mov rcx, qword [rsp + 0x240]
xor rcx, rsp
call fcn.1400f8730
add rsp, 0x250
pop r14
pop r12
pop rdi
pop rsi
pop rbp
ret
mov rcx, qword [rsp + 0x278]
mov edx, 0x93e
call fcn.140054080
int3
mov rcx, qword [rsp + 0x278]
mov edx, 0x93e
call fcn.140054080
int3
mov rcx, qword [rsp + 0x278]
mov edx, 0x93e
call fcn.140054080
int3