Function at 0x4078f8
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x468
push 0x104
lea eax, [ebp - 0x20c]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0x5c
lea ecx, [ebp - 0x20c]
push ecx
call fcn.00409890
add esp, 8
mov dword [ebp - 0x108], eax
cmp dword [ebp - 0x108], 0
je 0x4079a4
mov edx, dword [ebp - 0x108]
add edx, 1
push edx
lea eax, [ebp - 0x104]
push eax
call fcn.004096d0
add esp, 8
push str.Simulate.CD
mov ecx, dword [ebp - 0x108]
add ecx, 1
push ecx
call fcn.004096d0
add esp, 8
lea edx, [ebp - 0x34c]
push edx
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
mov dword [ebp - 0x354], eax
cmp dword [ebp - 0x354], 0xffffffff
je 0x407999
mov byte [ebp + 0xc], 1
mov ecx, dword [ebp - 0x354]
push ecx
call dword [sym.imp.KERNEL32.dll_FindClose]
mov edx, dword [ebp - 0x108]
mov byte [edx], 0
jmp 0x4079ba
lea eax, [ebp - 0x20c]
push eax
lea ecx, [ebp - 0x104]
push ecx
call fcn.004096d0
add esp, 8
push 0x2e
lea edx, [ebp - 0x104]
push edx
call fcn.00409890
add esp, 8
mov dword [ebp - 0x108], eax
cmp dword [ebp - 0x108], 0
je 0x4079e3
mov eax, dword [ebp - 0x108]
mov byte [eax], 0
mov ecx, dword [ebp + 0xc]
and ecx, 0xff
test ecx, ecx
je 0x407a02
lea edx, [ebp - 0x20c]
push edx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
push 0
lea eax, [ebp - 0x20c]
push eax
call fcn.004097d0
add esp, 8
sub eax, 1
mov dword [ebp - 0x108], eax
mov ecx, dword [ebp - 0x108]
movsx edx, byte [ecx]
cmp edx, 0x5c
je 0x407a3e
push 0x412568
lea eax, [ebp - 0x20c]
push eax
call fcn.004096e0
add esp, 8
mov dword [ebp - 0x350], 0
jmp 0x407a59
mov ecx, dword [ebp - 0x350]
add ecx, 1
mov dword [ebp - 0x350], ecx
cmp dword [ebp - 0x350], 0x3e8
jge 0x407bd5
mov byte [ebp - 0x45c], 0
xor edx, edx
mov dl, byte [0x41535d]
test edx, edx
je 0x407a88
mov dword [ebp - 0x468], str..EXE
jmp 0x407a92
mov dword [ebp - 0x468], 0x41559c
mov eax, dword [ebp - 0x468]
push eax
mov ecx, dword [ebp - 0x350]
push ecx
lea edx, [ebp - 0x104]
push edx
lea eax, [ebp - 0x20c]
push eax
push str._s_s.TMP_d_s
lea ecx, [ebp - 0x458]
push ecx
call fcn.004098b7
add esp, 0x18
mov edx, dword [ebp + 0x10]
and edx, 0xff
test edx, edx
je 0x407ae9
lea eax, [ebp - 0x458]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.004096d0
add esp, 8
mov al, 1
jmp 0x407bd7
lea edx, [ebp - 0x34c]
push edx
lea eax, [ebp - 0x458]
push eax
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
mov dword [ebp - 0x354], eax
cmp dword [ebp - 0x354], 0xffffffff
je 0x407b20
mov byte [ebp - 0x45c], 1
mov ecx, dword [ebp - 0x354]
push ecx
call dword [sym.imp.KERNEL32.dll_FindClose]
push 0
push 2
push 2
push 0
push 0
push 0x40000000
lea edx, [ebp - 0x458]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x460], eax
cmp dword [ebp - 0x460], 0xffffffff
jne 0x407bb1
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x464], eax
cmp dword [ebp - 0x464], 0xb7
je 0x407b6c
cmp dword [ebp - 0x464], 0x20
jne 0x407b71
jmp 0x407a4a
cmp dword [ebp - 0x464], 5
jne 0x407b8e
mov eax, dword [ebp - 0x45c]
and eax, 0xff
test eax, eax
je 0x407b8e
jmp 0x407a4a
mov ecx, dword [ebp + 0xc]
and ecx, 0xff
test ecx, ecx
jne 0x407baf
mov dl, byte [ebp + 0x10]
push edx
push 1
mov eax, dword [ebp + 8]
push eax
call fcn.004078f8
add esp, 0xc
jmp 0x407bd7
jmp 0x407bd5
mov ecx, dword [ebp - 0x460]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea edx, [ebp - 0x458]
push edx
mov eax, dword [ebp + 8]
push eax
call fcn.004096d0
add esp, 8
mov al, 1
jmp 0x407bd7
xor al, al
mov esp, ebp
pop ebp
ret