Function at 0x408e7c
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
push ecx
mov ecx, 0x4b
push 0
push 0
dec ecx
jne 0x408e85
xchg dword [ebp - 4], ecx
push ebx
push esi
push edi
mov ebx, ecx
mov esi, edx
mov edi, eax
xor eax, eax
push ebp
push 0x4092ef
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, ebx
xor edx, edx
call sub.rtl120.bpl__System__UStrAsg_qqrr20System_UnicodeStringx20System_UnicodeString
mov word [ebp - 0x20a], 0
push 0
push esi
lea eax, [ebp - 0x20a]
push eax
push edi
call sub.shell32.dll_SHGetSpecialFolderPathW
test eax, eax
je 0x408ede
mov eax, ebx
lea edx, [ebp - 0x20a]
mov ecx, 0x105
call sub.rtl120.bpl__System__UStrFromWArray_qqrr20System_UnicodeStringpbi
mov eax, dword [ebx]
call sub.rtl120.bpl__System__UStrLen_qqrx20System_UnicodeString
cmp eax, 2
jg case.0x408f01.27
add esi, 0xffffffe6
cmp esi, 0x11
ja case.0x408f01.27
movzx esi, byte [esi + 0x408f08]
jmp dword [esi*4 + 0x408f1a]
lea edx, [ebp - 0x210]
mov eax, 0x40930c
call sub.rtl120.bpl__Sysutils_GetEnvironmentVariable_qqrx20System_UnicodeString
mov eax, dword [ebp - 0x210]
mov edx, ebx
call sub.rtl120.bpl__Sysutils_Trim_qqrx20System_UnicodeString
cmp dword [ebx], 0
jne case.0x408f01.27
push 0x409324
call sub.kernel32.dll_GetModuleHandleW_1
lea edx, [ebp - 0x214]
call sub.rtl120.bpl__Sysutils_GetModuleName_qqrui
mov eax, dword [ebp - 0x214]
mov edx, ebx
call sub.rtl120.bpl__Sysutils_ExtractFileDrive_qqrx20System_UnicodeString
mov eax, dword [sym.imp.rtl120.bpl__Sysutils_Win32MajorVersion]
cmp dword [eax], 5
jle 0x408fb1
push dword [ebx]
push 0x40934c
lea eax, [ebp - 0x218]
call fcn.00408df4
push dword [ebp - 0x218]
mov eax, ebx
mov edx, 3
call sub.rtl120.bpl__System__UStrCatN_qqrv
jmp case.0x408f01.27
push dword [ebx]
push 0x409368
lea eax, [ebp - 0x21c]
call fcn.00408df4
push dword [ebp - 0x21c]
mov eax, ebx
mov edx, 3
call sub.rtl120.bpl__System__UStrCatN_qqrv
jmp case.0x408f01.27
call fcn.00408d28
test al, al
je 0x409002
lea edx, [ebp - 0x220]
mov eax, 0x4093a8
call sub.rtl120.bpl__Sysutils_GetEnvironmentVariable_qqrx20System_UnicodeString
mov eax, dword [ebp - 0x220]
mov edx, ebx
call sub.rtl120.bpl__Sysutils_Trim_qqrx20System_UnicodeString
jmp 0x40901f
lea edx, [ebp - 0x224]
mov eax, 0x4093d8
call sub.rtl120.bpl__Sysutils_GetEnvironmentVariable_qqrx20System_UnicodeString
mov eax, dword [ebp - 0x224]
mov edx, ebx
call sub.rtl120.bpl__Sysutils_Trim_qqrx20System_UnicodeString
cmp dword [ebx], 0
jne case.0x408f01.27
push 0x409324
call sub.kernel32.dll_GetModuleHandleW_1
lea edx, [ebp - 0x228]
call sub.rtl120.bpl__Sysutils_GetModuleName_qqrui
mov eax, dword [ebp - 0x228]
mov edx, ebx
call sub.rtl120.bpl__Sysutils_ExtractFileDrive_qqrx20System_UnicodeString
call fcn.00408d28
test al, al
je 0x409064
mov eax, ebx
mov edx, 0x409400
call sub.rtl120.bpl__System__UStrCat_qqrr20System_UnicodeStringx20System_UnicodeString
jmp case.0x408f01.27
mov eax, ebx
mov edx, 0x409438
call sub.rtl120.bpl__System__UStrCat_qqrr20System_UnicodeStringx20System_UnicodeString
jmp case.0x408f01.27
call fcn.00408d28
test al, al
je 0x40909d
lea edx, [ebp - 0x22c]
mov eax, 0x409464
call sub.rtl120.bpl__Sysutils_GetEnvironmentVariable_qqrx20System_UnicodeString
mov eax, dword [ebp - 0x22c]
mov edx, ebx
call sub.rtl120.bpl__Sysutils_Trim_qqrx20System_UnicodeString
jmp 0x4090ba
lea edx, [ebp - 0x230]
mov eax, 0x4094a0
call sub.rtl120.bpl__Sysutils_GetEnvironmentVariable_qqrx20System_UnicodeString
mov eax, dword [ebp - 0x230]
mov edx, ebx
call sub.rtl120.bpl__Sysutils_Trim_qqrx20System_UnicodeString
cmp dword [ebx], 0
jne case.0x408f01.27
push 0x409324
call sub.kernel32.dll_GetModuleHandleW_1
lea edx, [ebp - 0x234]
call sub.rtl120.bpl__Sysutils_GetModuleName_qqrui
mov eax, dword [ebp - 0x234]
mov edx, ebx
call sub.rtl120.bpl__Sysutils_ExtractFileDrive_qqrx20System_UnicodeString
call fcn.00408d28
test al, al
je 0x4090ff
mov eax, ebx
mov edx, 0x4094d4
call sub.rtl120.bpl__System__UStrCat_qqrr20System_UnicodeStringx20System_UnicodeString
jmp case.0x408f01.27
mov eax, ebx
mov edx, 0x409524
call sub.rtl120.bpl__System__UStrCat_qqrr20System_UnicodeStringx20System_UnicodeString
jmp case.0x408f01.27
lea edx, [ebp - 0x238]
mov eax, 0x409568
call sub.rtl120.bpl__Sysutils_GetEnvironmentVariable_qqrx20System_UnicodeString
mov eax, dword [ebp - 0x238]
mov edx, ebx
call sub.rtl120.bpl__Sysutils_Trim_qqrx20System_UnicodeString
cmp dword [ebx], 0
jne case.0x408f01.27
push 0x409324
call sub.kernel32.dll_GetModuleHandleW_1
lea edx, [ebp - 0x23c]
call sub.rtl120.bpl__Sysutils_GetModuleName_qqrui
mov eax, dword [ebp - 0x23c]
mov edx, ebx
call sub.rtl120.bpl__Sysutils_ExtractFileDrive_qqrx20System_UnicodeString
mov eax, dword [sym.imp.rtl120.bpl__Sysutils_Win32MajorVersion]
cmp dword [eax], 5
jle 0x409190
push dword [ebx]
push 0x40934c
lea eax, [ebp - 0x240]
call fcn.00408df4
push dword [ebp - 0x240]
push 0x409584
mov eax, ebx
mov edx, 4
call sub.rtl120.bpl__System__UStrCatN_qqrv
jmp case.0x408f01.27
push dword [ebx]
push 0x409368
lea eax, [ebp - 0x244]
call fcn.00408df4
push dword [ebp - 0x244]
push 0x4095b4
mov eax, ebx
mov edx, 4
call sub.rtl120.bpl__System__UStrCatN_qqrv
jmp case.0x408f01.27
lea edx, [ebp - 0x248]
mov eax, 0x4095e4
call sub.rtl120.bpl__Sysutils_GetEnvironmentVariable_qqrx20System_UnicodeString
mov eax, dword [ebp - 0x248]
mov edx, ebx
call sub.rtl120.bpl__Sysutils_Trim_qqrx20System_UnicodeString
cmp dword [ebx], 0
jne case.0x408f01.27
push 0x409324
call sub.kernel32.dll_GetModuleHandleW_1
lea edx, [ebp - 0x24c]
call sub.rtl120.bpl__Sysutils_GetModuleName_qqrui
mov eax, dword [ebp - 0x24c]
mov edx, ebx
call sub.rtl120.bpl__Sysutils_ExtractFileDrive_qqrx20System_UnicodeString
mov eax, dword [sym.imp.rtl120.bpl__Sysutils_Win32MajorVersion]
cmp dword [eax], 5
jle 0x40923e
push dword [ebx]
push 0x40934c
lea eax, [ebp - 0x250]
call fcn.00408df4
push dword [ebp - 0x250]
push 0x40960c
mov eax, ebx
mov edx, 4
call sub.rtl120.bpl__System__UStrCatN_qqrv
jmp case.0x408f01.27
push dword [ebx]
push 0x409368
lea eax, [ebp - 0x254]
call fcn.00408df4
push dword [ebp - 0x254]
push 0x409638
mov eax, ebx
mov edx, 4
call sub.rtl120.bpl__System__UStrCatN_qqrv
jmp case.0x408f01.27
lea edx, [ebp - 0x258]
mov eax, 0x409688
call sub.rtl120.bpl__Sysutils_GetEnvironmentVariable_qqrx20System_UnicodeString
mov eax, dword [ebp - 0x258]
mov edx, ebx
call sub.rtl120.bpl__Sysutils_Trim_qqrx20System_UnicodeString
cmp dword [ebx], 0
jne case.0x408f01.27
push 0x409324
call sub.kernel32.dll_GetModuleHandleW_1
lea edx, [ebp - 0x25c]
call sub.rtl120.bpl__Sysutils_GetModuleName_qqrui
mov eax, dword [ebp - 0x25c]
mov edx, ebx
call sub.rtl120.bpl__Sysutils_ExtractFileDrive_qqrx20System_UnicodeString
mov eax, dword [sym.imp.rtl120.bpl__Sysutils_Win32MajorVersion]
cmp dword [eax], 5
jle 0x4092c5
mov eax, ebx
mov edx, 0x4096ac
call sub.rtl120.bpl__System__UStrCat_qqrr20System_UnicodeStringx20System_UnicodeString
jmp case.0x408f01.27
mov eax, ebx
mov edx, 0x4096d4
call sub.rtl120.bpl__System__UStrCat_qqrr20System_UnicodeStringx20System_UnicodeString
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4092f6
lea eax, [ebp - 0x25c]
mov edx, 0x14
call sub.rtl120.bpl__System__UStrArrayClr_qqrpvi
ret