Function at 0x516cf0
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x1c
mov edi, dword [ebp + 0x14]
mov eax, dword [ebp + 0x10]
mov esi, dword [ebp + 8]
neg eax
mov dword [ebp - 0x1c], eax
test esi, esi
je 0x516f04
cmp edi, 8
ja 0x516fca
mov eax, dword [ebp + 0x10]
dec eax
mov dword [ebp - 0x28], eax
mov al, 1
lea ecx, [edi - 2]
mov dword [ebp - 0x20], ecx
cmp ecx, 6
mov dword [ebp - 0x10], eax
jbe 0x516f62
mov edx, 0x2000
xor ebx, ebx
xor eax, eax
inc eax
mov dword [ebp - 0x14], edx
mov cl, byte [0x759310]
mov byte [ebp - 0x24], cl
mov dword [ebp - 0x18], eax
push eax
push edx
push dword [ebp + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ecx, dword [ebp - 0x14]
mov edi, eax
test bl, bl
je 0x516d78
mov eax, ecx
and eax, 0x1000
je 0x516d78
cmp byte [ebp - 0x24], 0
je 0x516d78
test edi, edi
je 0x517010
test edi, edi
je 0x516ee6
mov eax, dword [ebp + 0xc]
lock add dword [0x759314], eax
test dword [ebp - 0x28], edi
je 0x516edc
push 0x8000
push 0
push edi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
test eax, eax
je 0x516fc7
mov eax, dword [ebp + 0xc]
lock sub dword [0x759314], eax
mov ecx, dword [ebp - 0x20]
add edi, dword [ebp - 0x28]
and edi, dword [ebp - 0x1c]
mov esi, edi
test byte [ebp - 0x10], 1
mov eax, 0
mov edi, dword [ebp + 0x14]
jne 0x516d27
mov eax, dword [ebp + 0x10]
add eax, 0xffff0000
mov dword [ebp - 0x24], eax
add eax, dword [ebp + 0xc]
mov dword [ebp - 0x14], eax
jb 0x516fd0
cmp ecx, 6
jbe 0x516f7a
mov esi, 0x2000
mov dword [ebp - 0x10], 0
xor eax, eax
inc eax
mov dword [ebp - 0x1c], eax
mov ebx, esi
shr ebx, 0xc
and bl, byte [0x759310]
push eax
push esi
push dword [ebp - 0x14]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
sete al
and al, byte [ebp - 0x10]
and al, bl
cmp al, 1
je 0x51728b
test edi, edi
je 0x516f2d
mov eax, dword [ebp - 0x14]
lock add dword [0x759314], eax
mov eax, edi
and eax, dword [ebp - 0x28]
mov esi, dword [ebp + 0x10]
cmove esi, eax
sub esi, eax
mov eax, dword [ebp - 0x24]
sub eax, esi
or eax, esi
je 0x516f21
push 0x8000
push 0
push edi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
test eax, eax
je 0x516fcd
mov eax, dword [ebp - 0x14]
lock sub dword [0x759314], eax
cmp dword [ebp + 0x14], 2
mov eax, dword [ebp - 0x20]
jae 0x516f95
mov ecx, 0x2000
xor ebx, ebx
xor eax, eax
inc eax
mov dword [ebp - 0x10], ecx
add esi, edi
mov dl, byte [0x759310]
mov byte [ebp - 0x1c], dl
mov dword [ebp - 0x18], eax
push eax
push ecx
push dword [ebp + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ecx, dword [ebp - 0x10]
mov edi, eax
test bl, bl
je 0x516ece
mov eax, ecx
and eax, 0x1000
je 0x516ece
cmp byte [ebp - 0x1c], 0
je 0x516ece
test edi, edi
je 0x5174df
test edi, edi
je 0x516f13
mov eax, dword [ebp + 0xc]
lock add dword [0x759314], eax
mov eax, edi
add esp, 0x1c
pop esi
pop edi
pop ebx
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
xchg dword [0x759304], eax
xor edi, edi
test esi, esi
mov ecx, dword [ebp - 0x20]
jne 0x516db6
jmp 0x516fd6
call fcn.004c1e10
mov esi, eax
and esi, dword [ebp - 0x1c]
jmp 0x516d0f
call dword [sym.imp.KERNEL32.dll_GetLastError]
xchg dword [0x759304], eax
xor edi, edi
test edi, edi
mov ecx, dword [ebp - 0x20]
jne 0x516edc
jmp 0x516de7
call dword [sym.imp.KERNEL32.dll_GetLastError]
xchg dword [0x759304], eax
call fcn.00657850
sub esp, 8
push dword [ebp + 0x14]
push dword [ebp - 0x14]
push 0
call fcn.00657590
add esp, 0x14
mov edi, eax
test eax, eax
jne 0x516e36
xor edi, edi
jmp 0x516edc
mov edx, 0x3000
jmp dword [ecx*4 + 0x6df11c]
mov eax, 4
mov bl, 1
jmp 0x516d3d
mov esi, 0x3000
jmp dword [ecx*4 + 0x6df138]
mov eax, 4
mov cl, 1
mov dword [ebp - 0x10], ecx
jmp 0x516dff
cmp eax, 6
ja case.default.0x516f9f
mov ecx, 0x3000
jmp dword [eax*4 + 0x6df154]
mov eax, 4
mov bl, 1
jmp 0x516e91
mov eax, 0x40
jmp 0x516f73
mov eax, 0x40
jmp 0x516f8b
mov eax, 0x40
jmp 0x516fab
int3
int3
int3
int3
int3
call fcn.00657850
sub esp, 8
push dword [ebp + 0x14]
push dword [ebp + 0xc]
push 0
call fcn.00657590
add esp, 0x14
mov edi, eax
test eax, eax
jne 0x516d80
jmp 0x516f5b
mov eax, 0x20
jmp 0x516f73
mov bl, 1
mov eax, edi
jmp 0x516d3d
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x51702c
cmp eax, 0x27b
jne 0x516ee6
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push dword [ebp - 0x18]
push dword [ebp - 0x14]
push dword [ebp + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
jne 0x516d80
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x51706a
cmp eax, 0x27b
jne 0x516ee6
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push dword [ebp - 0x18]
push dword [ebp - 0x14]
push dword [ebp + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
jne 0x516d80
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x5170a8
cmp eax, 0x27b
jne 0x516ee6
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push dword [ebp - 0x18]
push dword [ebp - 0x14]
push dword [ebp + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
jne 0x516d80
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x5170e6
cmp eax, 0x27b
jne 0x516ee6
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push dword [ebp - 0x18]
push dword [ebp - 0x14]
push dword [ebp + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
jne 0x516d80
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x517124
cmp eax, 0x27b
jne 0x516ee6
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push dword [ebp - 0x18]
push dword [ebp - 0x14]
push dword [ebp + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
jne 0x516d80
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x517162
cmp eax, 0x27b
jne 0x516ee6
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push dword [ebp - 0x18]
push dword [ebp - 0x14]
push dword [ebp + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
jne 0x516d80
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x5171a0
cmp eax, 0x27b
jne 0x516ee6
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push dword [ebp - 0x18]
push dword [ebp - 0x14]
push dword [ebp + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
jne 0x516d80
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x5171de
cmp eax, 0x27b
jne 0x516ee6
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push dword [ebp - 0x18]
push dword [ebp - 0x14]
push dword [ebp + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
jne 0x516d80
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x51721c
cmp eax, 0x27b
jne 0x516ee6
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push dword [ebp - 0x18]
push dword [ebp - 0x14]
push dword [ebp + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
jne 0x516d80
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x51725a
cmp eax, 0x27b
jne 0x516ee6
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x516ee6
mov eax, dword [ebp + 0x14]
jmp 0x516f8b
mov eax, 0x20
jmp 0x516f8b
mov eax, dword [ebp + 0x14]
jmp 0x516fab
mov eax, 0x20
jmp 0x516fab
mov dword [ebp - 0x10], esi
mov ebx, dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x5172ad
cmp eax, 0x27b
jne 0x516f2d
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push ebx
push dword [ebp - 0x10]
push dword [ebp - 0x14]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
jne 0x516e36
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x5172ea
cmp eax, 0x27b
jne 0x516f2d
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push ebx
push dword [ebp - 0x10]
push dword [ebp - 0x14]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
jne 0x516e36
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x517327
cmp eax, 0x27b
jne 0x516f2d
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push ebx
push dword [ebp - 0x10]
push dword [ebp - 0x14]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
jne 0x516e36
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x517364
cmp eax, 0x27b
jne 0x516f2d
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push ebx
push dword [ebp - 0x10]
push dword [ebp - 0x14]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
jne 0x516e36
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x5173a1
cmp eax, 0x27b
jne 0x516f2d
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push ebx
push dword [ebp - 0x10]
push dword [ebp - 0x14]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
jne 0x516e36
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x5173de
cmp eax, 0x27b
jne 0x516f2d
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push ebx
push dword [ebp - 0x10]
push dword [ebp - 0x14]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
jne 0x516e36
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x51741b
cmp eax, 0x27b
jne 0x516f2d
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push ebx
push dword [ebp - 0x10]
push dword [ebp - 0x14]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
jne 0x516e36
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x517458
cmp eax, 0x27b
jne 0x516f2d
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push ebx
push dword [ebp - 0x10]
push dword [ebp - 0x14]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
jne 0x516e36
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x517495
cmp eax, 0x27b
jne 0x516f2d
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push ebx
push dword [ebp - 0x10]
push dword [ebp - 0x14]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
jne 0x516e36
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x5174d2
cmp eax, 0x27b
jne 0x516f2d
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x516f2d
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x5174fb
cmp eax, 0x27b
jne 0x516f13
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push dword [ebp - 0x18]
push dword [ebp - 0x10]
push dword [ebp + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
jne 0x516ed2
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x517539
cmp eax, 0x27b
jne 0x516f13
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push dword [ebp - 0x18]
push dword [ebp - 0x10]
push dword [ebp + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
jne 0x516ed2
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x517577
cmp eax, 0x27b
jne 0x516f13
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push dword [ebp - 0x18]
push dword [ebp - 0x10]
push dword [ebp + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
jne 0x516ed2
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x5175b5
cmp eax, 0x27b
jne 0x516f13
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push dword [ebp - 0x18]
push dword [ebp - 0x10]
push dword [ebp + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
jne 0x516ed2
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x5175f3
cmp eax, 0x27b
jne 0x516f13
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push dword [ebp - 0x18]
push dword [ebp - 0x10]
push dword [ebp + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
jne 0x516ed2
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x517631
cmp eax, 0x27b
jne 0x516f13
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push dword [ebp - 0x18]
push dword [ebp - 0x10]
push dword [ebp + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
jne 0x516ed2
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x51766f
cmp eax, 0x27b
jne 0x516f13
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push dword [ebp - 0x18]
push dword [ebp - 0x10]
push dword [ebp + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
jne 0x516ed2
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x5176ad
cmp eax, 0x27b
jne 0x516f13
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push dword [ebp - 0x18]
push dword [ebp - 0x10]
push dword [ebp + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
jne 0x516ed2
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x5176eb
cmp eax, 0x27b
jne 0x516f13
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push dword [ebp - 0x18]
push dword [ebp - 0x10]
push dword [ebp + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test eax, eax
jne 0x516ed2
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [eax - 0x5ae]
cmp ecx, 2
jb 0x517729
cmp eax, 0x27b
jne 0x516f13
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x516f13