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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x482747
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.004058c0
lea ecx, [esp + 0x74]
mov dword [esp + 0x2b0], 0
xor esi, esi
call fcn.004034a0
test al, al
jne 0x40d5ac
lea ecx, [esp + 0x58]
call fcn.00403390
lea ecx, [esp + 0x40]
mov byte [esp + 0x2b0], 1
call fcn.00403390
lea ecx, [esp + 0x40]
mov byte [esp + 0x2b0], 2
call fcn.004034a0
mov esi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test al, al
je 0x40d2e6
lea eax, [esp + 0x74]
push eax
lea ecx, [esp + 0x44]
call fcn.004033e0
lea ecx, [esp + 0x40]
call fcn.00403480
push eax
call esi
test eax, eax
jne 0x40d2e6
push eax
lea ecx, [esp + 0x44]
call fcn.00403830
lea ecx, [esp + 0x40]
call fcn.004034a0
test al, al
je 0x40d3d5
test edi, edi
jne 0x40d3d5
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.00403460
push 1
push ecx
lea eax, [esp + 0x78]
mov dword [esp + 0x78], 0x5c
push eax
lea ecx, [esp + 0x64]
call fcn.0040d6f0
cmp eax, 0xffffffff
je 0x40d386
inc eax
lea ecx, [esp + 0x58]
push eax
push edi
lea eax, [esp + 0x18]
push eax
call fcn.0040d690
push eax
lea ecx, [esp + 0x5c]
call fcn.0040d5e0
lea ecx, [esp + 0x10]
call fcn.004033c0
lea ecx, [esp + 0x58]
call fcn.004034a0
test al, al
jne 0x40d3d5
lea eax, [esp + 0x74]
push eax
lea edx, [esp + 0x5c]
lea ecx, [esp + 0x14]
call fcn.0040d780
add esp, 4
lea ecx, [esp + 0x40]
push eax
call fcn.0040d5e0
lea ecx, [esp + 0x10]
call fcn.004033c0
lea ecx, [esp + 0x40]
call fcn.00403480
push eax
call esi
test eax, eax
jne 0x40d3d5
push eax
lea ecx, [esp + 0x44]
call fcn.00403830
lea ecx, [esp + 0x40]
call fcn.004034a0
test al, al
je 0x40d496
push 0
lea ecx, [esp + 0x5c]
call fcn.00403830
push 0x104
lea eax, [esp + 0x90]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
test eax, eax
je 0x40d419
lea eax, [esp + 0x8c]
push eax
lea ecx, [esp + 0x5c]
call fcn.00403460
lea ecx, [esp + 0x58]
call fcn.004034a0
test al, al
jne 0x40d496
push 0x493b4c
lea eax, [esp + 0x5c]
push eax
lea eax, [esp + 0x30]
push eax
call fcn.00408480
lea ecx, [esp + 0x80]
mov byte [esp + 0x2bc], 3
push ecx
mov edx, eax
lea ecx, [esp + 0x20]
call fcn.0040d820
add esp, 0x10
lea ecx, [esp + 0x40]
push eax
call fcn.0040d5e0
lea ecx, [esp + 0x10]
call fcn.004033c0
lea ecx, [esp + 0x28]
mov byte [esp + 0x2b0], 2
call fcn.004033c0
lea ecx, [esp + 0x40]
call fcn.00403480
push eax
call esi
test eax, eax
jne 0x40d496
push eax
lea ecx, [esp + 0x44]
call fcn.00403830
lea ecx, [esp + 0x40]
call fcn.004034a0
test al, al
je 0x40d557
push 0
lea ecx, [esp + 0x5c]
call fcn.00403830
push 0x104
lea eax, [esp + 0x90]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
test eax, eax
je 0x40d4da
lea eax, [esp + 0x8c]
push eax
lea ecx, [esp + 0x5c]
call fcn.00403460
lea ecx, [esp + 0x58]
call fcn.004034a0
test al, al
jne 0x40d557
push 0x493b4c
lea eax, [esp + 0x5c]
push eax
lea eax, [esp + 0x18]
push eax
call fcn.00408480
lea ecx, [esp + 0x80]
mov byte [esp + 0x2bc], 4
push ecx
mov edx, eax
lea ecx, [esp + 0x38]
call fcn.0040d820
add esp, 0x10
lea ecx, [esp + 0x40]
push eax
call fcn.0040d5e0
lea ecx, [esp + 0x28]
call fcn.004033c0
lea ecx, [esp + 0x10]
mov byte [esp + 0x2b0], 2
call fcn.004033c0
lea ecx, [esp + 0x40]
call fcn.00403480
push eax
call esi
test eax, eax
jne 0x40d557
push eax
lea ecx, [esp + 0x44]
call fcn.00403830
lea ecx, [esp + 0x40]
call fcn.004034a0
mov edi, dword [sym.imp.KERNEL32.dll_LoadLibraryW]
test al, al
jne 0x40d58c
lea ecx, [esp + 0x40]
call fcn.00403480
push eax
call esi
test eax, eax
je 0x40d58c
lea ecx, [esp + 0x40]
call fcn.00403480
push eax
call edi
mov esi, eax
test esi, esi
jne 0x40d59a
lea ecx, [esp + 0x74]
call fcn.00403480
push eax
call edi
mov esi, eax
lea ecx, [esp + 0x40]
call fcn.004033c0
lea ecx, [esp + 0x58]
call fcn.004033c0
lea ecx, [esp + 0x74]
call fcn.004033c0
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.0047dbfe
mov esp, ebp
pop ebp
ret