Function at 0x4054c5
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x424b5c
mov eax, dword fs:[0]
push eax
sub esp, 0x250
mov eax, dword [0x4334c0]
xor eax, esp
mov dword [esp + 0x248], eax
push ebx
push esi
push edi
mov eax, dword [0x4334c0]
xor eax, esp
push eax
lea eax, [esp + 0x260]
mov dword fs:[0], eax
mov ebx, ecx
mov dword [esp + 0x14], ebx
mov edi, dword [ebp + 8]
test edi, edi
je 0x405737
mov eax, dword [edi + 0x14]
test eax, eax
je 0x405521
mov al, byte [eax]
jmp 0x405524
mov al, byte [edi + 0x18]
test al, al
je 0x405737
mov ecx, edi
call fcn.004081f9
xor edx, edx
mov esi, eax
push 7
pop ecx
xor eax, eax
mov dword [esp + 0x2c], edx
mov dword [esp + 0x30], edx
mov dword [esp + 0x30], ecx
mov dword [esp + 0x2c], edx
mov word [esp + 0x1c], ax
mov dword [esp + 0x268], edx
mov dword [esp + 0x44], edx
mov dword [esp + 0x48], edx
mov dword [esp + 0x48], ecx
mov dword [esp + 0x44], edx
mov word [esp + 0x34], ax
mov byte [esp + 0x268], 1
push esi
call dword [sym.imp.SHLWAPI.dll_PathIsFileSpecW]
add ebx, 0xbc
test eax, eax
je 0x4055b8
push ebx
xor eax, eax
push eax
push eax
push 0x8023
push eax
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
push ebx
call fcn.00401d41
pop ecx
push eax
push ebx
lea ecx, [esp + 0x24]
call fcn.00401cc8
push esi
call fcn.00401d41
pop ecx
push eax
push esi
lea ecx, [esp + 0x3c]
jmp 0x4055f6
push esi
push 0x104
push ebx
call fcn.0040c809
add esp, 0xc
push ebx
call dword [sym.imp.SHLWAPI.dll_PathFindFileNameW]
mov esi, eax
push esi
call fcn.00401d41
pop ecx
push eax
push esi
lea ecx, [esp + 0x3c]
call fcn.00401cc8
push ebx
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
push ebx
call fcn.00401d41
pop ecx
push eax
push ebx
lea ecx, [esp + 0x24]
call fcn.00401cc8
test dword [edi + 0x10], 0x20000
je 0x405664
cmp dword [esp + 0x48], 8
lea ecx, [esp + 0x34]
push ebx
cmovae ecx, dword [esp + 0x38]
lea eax, [esp + 0x20]
cmp dword [esp + 0x34], 8
push 0
cmovae eax, dword [esp + 0x24]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
test eax, eax
je 0x405664
push 0x104
lea eax, [esp + 0x50]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
test eax, eax
je 0x405664
mov esi, dword [edi + 0x14]
test esi, esi
je 0x405664
lea eax, [esp + 0x4c]
push eax
call fcn.00401d41
pop ecx
push eax
lea eax, [esp + 0x50]
push eax
lea ecx, [esi + 4]
call fcn.00401cc8
mov ecx, edi
call fcn.004081f9
mov esi, eax
push esi
mov dword [esp + 0x14], esi
call fcn.0040c3c4
pop ecx
test eax, eax
je 0x4056d4
xor eax, eax
test dword [edi + 0x10], 0x10000
push eax
push 0x80
je 0x405691
push 2
jmp 0x405693
push 4
push eax
push eax
push 0x40000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x4056d4
lea eax, [esp + 0x18]
push eax
push ebx
push 0x104
push 0
push dword [esp + 0x20]
push 0
call dword [sym.imp.KERNEL32.dll_SearchPathW]
test eax, eax
je 0x4056cd
push ebx
mov ecx, edi
call fcn.00408212
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test dword [edi + 0xc], 0x40000000
je 0x405700
mov esi, dword [esp + 0x14]
mov ecx, esi
push edi
call fcn.004051f6
test dword [edi + 0x10], 0x100000
je 0x405700
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
mov ecx, esi
call fcn.0040515b
mov eax, dword [edi + 0x14]
xor ebx, ebx
test eax, eax
je 0x40570d
mov byte [eax], bl
jmp 0x405710
mov byte [edi + 0x18], bl
mov byte [esp + 0x268], bl
lea ecx, [esp + 0x34]
push ebx
push 1
call fcn.00401bf8
or dword [esp + 0x268], 0xffffffff
lea ecx, [esp + 0x1c]
push ebx
push 1
call fcn.00401bf8
mov ecx, dword [esp + 0x260]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x248]
xor ecx, esp
call fcn.0040b1e5
mov esp, ebp
pop ebp
ret 4