Function at 0x50ee20
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
push ecx
mov ecx, 0x49
push 0
push 0
dec ecx
jne 0x50ee29
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 0x50f1eb
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 0x50ee82
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.0x50eea5.27
add esi, 0xffffffe6
cmp esi, 0x11
ja case.0x50eea5.27
movzx esi, byte [esi + 0x50eeac]
jmp dword [esi*4 + 0x50eebe]
call fcn.00510b20
test al, al
je 0x50eefe
lea edx, [ebp - 0x210]
mov eax, 0x50f208
call sub.rtl120.bpl__Sysutils_GetEnvironmentVariable_qqrx20System_UnicodeString
mov eax, dword [ebp - 0x210]
mov edx, ebx
call sub.rtl120.bpl__Sysutils_Trim_qqrx20System_UnicodeString
jmp 0x50ef1b
lea edx, [ebp - 0x214]
mov eax, 0x50f238
call sub.rtl120.bpl__Sysutils_GetEnvironmentVariable_qqrx20System_UnicodeString
mov eax, dword [ebp - 0x214]
mov edx, ebx
call sub.rtl120.bpl__Sysutils_Trim_qqrx20System_UnicodeString
cmp dword [ebx], 0
jne case.0x50eea5.27
push 0x50f254
call sub.kernel32.dll_GetModuleHandleW_1
lea edx, [ebp - 0x218]
call sub.rtl120.bpl__Sysutils_GetModuleName_qqrui
mov eax, dword [ebp - 0x218]
mov edx, ebx
call sub.rtl120.bpl__Sysutils_ExtractFileDrive_qqrx20System_UnicodeString
call fcn.00510b20
test al, al
je 0x50ef60
mov eax, ebx
mov edx, 0x50f27c
call sub.rtl120.bpl__System__UStrCat_qqrr20System_UnicodeStringx20System_UnicodeString
jmp case.0x50eea5.27
mov eax, ebx
mov edx, 0x50f2b4
call sub.rtl120.bpl__System__UStrCat_qqrr20System_UnicodeStringx20System_UnicodeString
jmp case.0x50eea5.27
call fcn.00510b20
test al, al
je 0x50ef99
lea edx, [ebp - 0x21c]
mov eax, 0x50f2e0
call sub.rtl120.bpl__Sysutils_GetEnvironmentVariable_qqrx20System_UnicodeString
mov eax, dword [ebp - 0x21c]
mov edx, ebx
call sub.rtl120.bpl__Sysutils_Trim_qqrx20System_UnicodeString
jmp 0x50efb6
lea edx, [ebp - 0x220]
mov eax, 0x50f31c
call sub.rtl120.bpl__Sysutils_GetEnvironmentVariable_qqrx20System_UnicodeString
mov eax, dword [ebp - 0x220]
mov edx, ebx
call sub.rtl120.bpl__Sysutils_Trim_qqrx20System_UnicodeString
cmp dword [ebx], 0
jne case.0x50eea5.27
push 0x50f254
call sub.kernel32.dll_GetModuleHandleW_1
lea edx, [ebp - 0x224]
call sub.rtl120.bpl__Sysutils_GetModuleName_qqrui
mov eax, dword [ebp - 0x224]
mov edx, ebx
call sub.rtl120.bpl__Sysutils_ExtractFileDrive_qqrx20System_UnicodeString
call fcn.00510b20
test al, al
je 0x50effb
mov eax, ebx
mov edx, 0x50f350
call sub.rtl120.bpl__System__UStrCat_qqrr20System_UnicodeStringx20System_UnicodeString
jmp case.0x50eea5.27
mov eax, ebx
mov edx, 0x50f3a0
call sub.rtl120.bpl__System__UStrCat_qqrr20System_UnicodeStringx20System_UnicodeString
jmp case.0x50eea5.27
lea edx, [ebp - 0x228]
mov eax, 0x50f3e4
call sub.rtl120.bpl__Sysutils_GetEnvironmentVariable_qqrx20System_UnicodeString
mov eax, dword [ebp - 0x228]
mov edx, ebx
call sub.rtl120.bpl__Sysutils_Trim_qqrx20System_UnicodeString
cmp dword [ebx], 0
jne case.0x50eea5.27
push 0x50f254
call sub.kernel32.dll_GetModuleHandleW_1
lea edx, [ebp - 0x22c]
call sub.rtl120.bpl__Sysutils_GetModuleName_qqrui
mov eax, dword [ebp - 0x22c]
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 0x50f08c
push dword [ebx]
push 0x50f400
lea eax, [ebp - 0x230]
call fcn.0050e81c
push dword [ebp - 0x230]
push 0x50f41c
mov eax, ebx
mov edx, 4
call sub.rtl120.bpl__System__UStrCatN_qqrv
jmp case.0x50eea5.27
push dword [ebx]
push 0x50f44c
lea eax, [ebp - 0x234]
call fcn.0050e81c
push dword [ebp - 0x234]
push 0x50f48c
mov eax, ebx
mov edx, 4
call sub.rtl120.bpl__System__UStrCatN_qqrv
jmp case.0x50eea5.27
lea edx, [ebp - 0x238]
mov eax, 0x50f4bc
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.0x50eea5.27
push 0x50f254
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 0x50f13a
push dword [ebx]
push 0x50f400
lea eax, [ebp - 0x240]
call fcn.0050e81c
push dword [ebp - 0x240]
push 0x50f4e4
mov eax, ebx
mov edx, 4
call sub.rtl120.bpl__System__UStrCatN_qqrv
jmp case.0x50eea5.27
push dword [ebx]
push 0x50f44c
lea eax, [ebp - 0x244]
call fcn.0050e81c
push dword [ebp - 0x244]
push 0x50f510
mov eax, ebx
mov edx, 4
call sub.rtl120.bpl__System__UStrCatN_qqrv
jmp case.0x50eea5.27
lea edx, [ebp - 0x248]
mov eax, 0x50f560
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.0x50eea5.27
push 0x50f254
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 0x50f1c1
mov eax, ebx
mov edx, 0x50f584
call sub.rtl120.bpl__System__UStrCat_qqrr20System_UnicodeStringx20System_UnicodeString
jmp case.0x50eea5.27
mov eax, ebx
mov edx, 0x50f5ac
call sub.rtl120.bpl__System__UStrCat_qqrr20System_UnicodeStringx20System_UnicodeString
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x50f1f2
lea eax, [ebp - 0x24c]
mov edx, 0x10
call sub.rtl120.bpl__System__UStrArrayClr_qqrpvi
ret