Function at 0x407700
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4751e8
mov eax, dword fs:[0]
push eax
sub esp, 0x298
mov eax, dword [0x498114]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, dword [ebp + 8]
mov ebx, dword [ebp + 0xc]
mov esi, dword [edi]
mov dword [ebp - 4], 0
cmp dword [esi - 0xc], 0
je 0x407942
mov eax, dword [ebx]
cmp dword [eax - 0xc], 0
je 0x407942
push 0x208
lea eax, [ebp - 0x218]
push 0
push eax
call fcn.00416b00
add esp, 0xc
push esi
call dword [sym.imp.SHLWAPI.dll_PathIsRelativeW]
test eax, eax
lea eax, [ebp - 0x218]
je 0x4077b1
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov esi, dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea eax, [ebp - 0x218]
push eax
call esi
lea eax, [ebp - 0x218]
push eax
call esi
push dword [edi]
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
jmp 0x4077eb
mov esi, dword [edi]
lea ecx, [ebp - 0x218]
mov edx, 0x104
sub esi, eax
lea eax, [edx + 0x7ffffefa]
test eax, eax
je 0x4077de
movzx eax, word [esi + ecx]
test ax, ax
je 0x4077de
mov word [ecx], ax
add ecx, 2
sub edx, 1
jne 0x4077c0
test edx, edx
lea eax, [ecx - 2]
cmovne eax, ecx
xor ecx, ecx
mov word [eax], cx
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x407942
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov dword [ebp - 0x2a4], eax
test eax, eax
je 0x407942
mov edi, dword [ebx]
lea eax, [ebp - 0x298]
mov dword [ebp - 0x29c], eax
test edi, edi
jne 0x40783a
xor eax, eax
mov dword [ebp - 0x29c], eax
jmp 0x40790a
mov ecx, edi
lea edx, [ecx + 2]
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x407840
sub ecx, edx
lea eax, [ebp - 0x298]
sar ecx, 1
push 0x80
push eax
lea eax, [ebp - 0x29c]
lea ebx, [ecx + 1]
lea esi, [ebx*4]
mov dword [ebp - 0x2a0], ebx
push esi
push eax
call fcn.00407620
add esp, 0x10
push 0
push 0
push esi
push dword [ebp - 0x29c]
mov esi, dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
push ebx
push edi
push 0
push 3
call esi
xor ebx, ebx
test eax, eax
sete bl
test eax, eax
jne 0x4078fc
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x4078fc
mov ebx, dword [ebp - 0x2a0]
push 0
push 0
push 0
push 0
push ebx
push edi
push 0
push 3
call esi
mov esi, eax
lea eax, [ebp - 0x298]
push 0x80
push eax
lea eax, [ebp - 0x29c]
push esi
push eax
call fcn.00407620
add esp, 0x10
push 0
push 0
push esi
push dword [ebp - 0x29c]
push ebx
push edi
push 0
push 3
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov ebx, eax
neg ebx
sbb ebx, ebx
inc ebx
test ebx, ebx
jne 0x407986
mov eax, dword [ebp - 0x29c]
push eax
push dword [ebp - 0x2a4]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
lea ecx, [ebp - 0x298]
mov eax, dword [ebp - 0x29c]
cmp eax, ecx
je 0x407932
push eax
call fcn.0041f352
add esp, 4
test esi, esi
je 0x407942
push dword [ebp + 0x10]
call esi
mov edi, 1
jmp 0x407944
xor edi, edi
mov esi, dword [ebp + 0x10]
or eax, 0xffffffff
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x407966
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00414809
mov esp, ebp
pop ebp
ret 0xc
push 0x80
lea eax, [ebp - 0x298]
push eax
push dword [ebp - 0x29c]
call fcn.004076a0
add esp, 0xc
call fcn.004076e0
int3