Function at 0x40d210
Capabilities:
Check if file exists
Get common file path

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x4826d7
mov eax, dword fs:[0]
push eax
sub esp, 0x29c
mov eax, dword [0x4aa0cc]
xor eax, esp
mov dword [esp + 0x294], eax
push esi
push edi
mov eax, dword [0x4aa0cc]
xor eax, esp
push eax
lea eax, [esp + 0x2a8]
mov dword fs:[0], eax
mov edi, edx
push ecx
lea ecx, [esp + 0x78]
call fcn.004058b0
lea ecx, [esp + 0x74]
mov dword [esp + 0x2b0], 0
xor esi, esi
call fcn.00403490
test al, al
jne 0x40d59c
lea ecx, [esp + 0x58]
call fcn.00403380
lea ecx, [esp + 0x40]
mov byte [esp + 0x2b0], 1
call fcn.00403380
lea ecx, [esp + 0x40]
mov byte [esp + 0x2b0], 2
call fcn.00403490
mov esi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test al, al
je 0x40d2d6
lea eax, [esp + 0x74]
push eax
lea ecx, [esp + 0x44]
call fcn.004033d0
lea ecx, [esp + 0x40]
call fcn.00403470
push eax
call esi
test eax, eax
jne 0x40d2d6
push eax
lea ecx, [esp + 0x44]
call fcn.00403820
lea ecx, [esp + 0x40]
call fcn.00403490
test al, al
je 0x40d3c5
test edi, edi
jne 0x40d3c5
xor eax, eax
push 0x20a
push eax
mov word [esp + 0x94], ax
lea eax, [esp + 0x96]
push eax
call sub.MSVCR120.dll_memset
add esp, 0xc
lea eax, [esp + 0x8c]
push 0x104
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [esp + 0x8c]
push eax
lea ecx, [esp + 0x5c]
call fcn.00403450
push 1
push ecx
lea eax, [esp + 0x78]
mov dword [esp + 0x78], 0x5c
push eax
lea ecx, [esp + 0x64]
call fcn.0040d6e0
cmp eax, 0xffffffff
je 0x40d376
inc eax
lea ecx, [esp + 0x58]
push eax
push edi
lea eax, [esp + 0x18]
push eax
call fcn.0040d680
push eax
lea ecx, [esp + 0x5c]
call fcn.0040d5d0
lea ecx, [esp + 0x10]
call fcn.004033b0
lea ecx, [esp + 0x58]
call fcn.00403490
test al, al
jne 0x40d3c5
lea eax, [esp + 0x74]
push eax
lea edx, [esp + 0x5c]
lea ecx, [esp + 0x14]
call fcn.0040d770
add esp, 4
lea ecx, [esp + 0x40]
push eax
call fcn.0040d5d0
lea ecx, [esp + 0x10]
call fcn.004033b0
lea ecx, [esp + 0x40]
call fcn.00403470
push eax
call esi
test eax, eax
jne 0x40d3c5
push eax
lea ecx, [esp + 0x44]
call fcn.00403820
lea ecx, [esp + 0x40]
call fcn.00403490
test al, al
je 0x40d486
push 0
lea ecx, [esp + 0x5c]
call fcn.00403820
push 0x104
lea eax, [esp + 0x90]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
test eax, eax
je 0x40d409
lea eax, [esp + 0x8c]
push eax
lea ecx, [esp + 0x5c]
call fcn.00403450
lea ecx, [esp + 0x58]
call fcn.00403490
test al, al
jne 0x40d486
push 0x493b4c
lea eax, [esp + 0x5c]
push eax
lea eax, [esp + 0x30]
push eax
call fcn.00408470
lea ecx, [esp + 0x80]
mov byte [esp + 0x2bc], 3
push ecx
mov edx, eax
lea ecx, [esp + 0x20]
call fcn.0040d810
add esp, 0x10
lea ecx, [esp + 0x40]
push eax
call fcn.0040d5d0
lea ecx, [esp + 0x10]
call fcn.004033b0
lea ecx, [esp + 0x28]
mov byte [esp + 0x2b0], 2
call fcn.004033b0
lea ecx, [esp + 0x40]
call fcn.00403470
push eax
call esi
test eax, eax
jne 0x40d486
push eax
lea ecx, [esp + 0x44]
call fcn.00403820
lea ecx, [esp + 0x40]
call fcn.00403490
test al, al
je 0x40d547
push 0
lea ecx, [esp + 0x5c]
call fcn.00403820
push 0x104
lea eax, [esp + 0x90]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
test eax, eax
je 0x40d4ca
lea eax, [esp + 0x8c]
push eax
lea ecx, [esp + 0x5c]
call fcn.00403450
lea ecx, [esp + 0x58]
call fcn.00403490
test al, al
jne 0x40d547
push 0x493b4c
lea eax, [esp + 0x5c]
push eax
lea eax, [esp + 0x18]
push eax
call fcn.00408470
lea ecx, [esp + 0x80]
mov byte [esp + 0x2bc], 4
push ecx
mov edx, eax
lea ecx, [esp + 0x38]
call fcn.0040d810
add esp, 0x10
lea ecx, [esp + 0x40]
push eax
call fcn.0040d5d0
lea ecx, [esp + 0x28]
call fcn.004033b0
lea ecx, [esp + 0x10]
mov byte [esp + 0x2b0], 2
call fcn.004033b0
lea ecx, [esp + 0x40]
call fcn.00403470
push eax
call esi
test eax, eax
jne 0x40d547
push eax
lea ecx, [esp + 0x44]
call fcn.00403820
lea ecx, [esp + 0x40]
call fcn.00403490
mov edi, dword [sym.imp.KERNEL32.dll_LoadLibraryW]
test al, al
jne 0x40d57c
lea ecx, [esp + 0x40]
call fcn.00403470
push eax
call esi
test eax, eax
je 0x40d57c
lea ecx, [esp + 0x40]
call fcn.00403470
push eax
call edi
mov esi, eax
test esi, esi
jne 0x40d58a
lea ecx, [esp + 0x74]
call fcn.00403470
push eax
call edi
mov esi, eax
lea ecx, [esp + 0x40]
call fcn.004033b0
lea ecx, [esp + 0x58]
call fcn.004033b0
lea ecx, [esp + 0x74]
call fcn.004033b0
mov eax, esi
mov ecx, dword [esp + 0x2a8]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [esp + 0x294]
xor ecx, esp
call fcn.0047db8e
mov esp, ebp
pop ebp
ret