Function at 0x4aff40
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffdd4
push ebx
push esi
push edi
xor eax, eax
mov dword [ebp - 0x22c], eax
mov dword [ebp - 0x228], eax
mov dword [ebp - 0x224], eax
mov dword [ebp - 0x220], eax
mov dword [ebp - 4], eax
mov dword [ebp - 8], eax
xor eax, eax
push ebp
push 0x4b0199
push dword fs:[eax]
mov dword fs:[eax], esp
mov byte [ebp - 9], 0
mov dl, 1
mov eax, dword [sym.imp.rtl120.bpl__Classes_TStringList_]
call sub.rtl120.bpl__Classes_TStringList__bctr_qqrv
mov dword [ebp - 0x10], eax
push 0x104
lea eax, [ebp - 0x21a]
push eax
call sub.kernel32.dll_GetSystemDirectoryW
lea eax, [ebp - 0x220]
lea edx, [ebp - 0x21a]
mov ecx, 0x105
call sub.rtl120.bpl__System__UStrFromWArray_qqrr20System_UnicodeStringpbi
mov edx, dword [ebp - 0x220]
lea eax, [ebp - 4]
mov ecx, 0x4b01b8
call sub.rtl120.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
xor eax, eax
push ebp
push 0x4b0167
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__Sysutils_FileExists_qqrx20System_UnicodeString
test al, al
je 0x4b0151
xor eax, eax
push ebp
push 0x4b0143
push dword fs:[eax]
mov dword fs:[eax], esp
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax]
call dword [ecx + 0x68]
mov eax, dword [ebp - 0x10]
mov edx, dword [eax]
call dword [edx + 0x14]
mov esi, eax
dec esi
test esi, esi
jl 0x4b00f2
inc esi
xor ebx, ebx
lea ecx, [ebp - 8]
mov edx, ebx
mov eax, dword [ebp - 0x10]
mov edi, dword [eax]
call dword [edi + 0xc]
lea edx, [ebp - 0x224]
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__Sysutils_Trim_qqrx20System_UnicodeString
mov edx, dword [ebp - 0x224]
lea eax, [ebp - 8]
call sub.rtl120.bpl__System__UStrLAsg_qqrr20System_UnicodeStringx20System_UnicodeString
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
call sub.rtl120.bpl__Sysutils_StrLower_qqrpb
mov edx, eax
lea eax, [ebp - 8]
call sub.rtl120.bpl__System__UStrFromPWChar_qqrr20System_UnicodeStringpb
mov edx, dword [ebp - 8]
mov eax, 0x4b01ec
call sub.rtl120.bpl__System_Pos_qqrx20System_UnicodeStringt1
test eax, eax
jg 0x4b0098
mov edx, dword [ebp - 8]
mov eax, 0x4b020c
call sub.rtl120.bpl__System_Pos_qqrx20System_UnicodeStringt1
test eax, eax
jg 0x4b0098
mov edx, dword [ebp - 8]
mov eax, 0x4b022c
call sub.rtl120.bpl__System_Pos_qqrx20System_UnicodeStringt1
test eax, eax
jg 0x4b0098
mov edx, dword [ebp - 8]
mov eax, 0x4b0264
call sub.rtl120.bpl__System_Pos_qqrx20System_UnicodeStringt1
test eax, eax
jle 0x4b00ea
lea ecx, [ebp - 0x228]
mov edx, ebx
mov eax, dword [ebp - 0x10]
mov edi, dword [eax]
call dword [edi + 0xc]
mov edx, dword [ebp - 0x228]
mov eax, 0x4b028c
call sub.rtl120.bpl__System_Pos_qqrx20System_UnicodeStringt1
dec eax
je 0x4b00ea
lea ecx, [ebp - 0x22c]
mov edx, ebx
mov eax, dword [ebp - 0x10]
mov edi, dword [eax]
call dword [edi + 0xc]
mov edx, dword [ebp - 0x22c]
mov eax, 0x4b028c
call sub.rtl120.bpl__System_Pos_qqrx20System_UnicodeStringt1
dec eax
je 0x4b00ea
xor ecx, ecx
mov edx, ebx
mov eax, dword [ebp - 0x10]
mov edi, dword [eax]
call dword [edi + 0x20]
inc ebx
dec esi
jne 0x4b0014
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__Sysutils_FileGetAttr_qqrx20System_UnicodeString
mov ebx, eax
test bl, 1
jne 0x4b0106
test bl, 2
je 0x4b0116
mov edx, ebx
and edx, 0xfffffffe
and edx, 0xfffffffd
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__Sysutils_FileSetAttr_qqrx20System_UnicodeStringi
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax]
call dword [ecx + 0x7c]
test bl, 1
jne 0x4b012b
test bl, 2
je 0x4b0135
mov edx, ebx
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__Sysutils_FileSetAttr_qqrx20System_UnicodeStringi
mov byte [ebp - 9], 1
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x4b0151
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4b016e
mov eax, dword [ebp - 0x10]
call sub.rtl120.bpl__System_TObject_Free_qqrv
ret