Function at 0x40581c
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0
push 0
push ebx
push esi
push edi
xor eax, eax
push ebp
push 0x405aae
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp + 8]
mov eax, dword [eax - 4]
cmp word [eax], 0x25
jne 0x40590d
mov eax, dword [ebp + 8]
add eax, 0xfffffffc
mov ecx, 1
mov edx, 1
call sub.rtl170.bpl__System__UStrDelete_qqrr20System_UnicodeStringii
mov eax, dword [ebp + 8]
mov edx, dword [eax - 4]
mov ecx, 1
mov eax, 0x405acc
call sub.rtl170.bpl__System_Pos_qqrx20System_UnicodeStringt1i
mov edx, dword [ebp + 8]
mov dword [edx - 0x218], eax
mov eax, dword [ebp + 8]
add eax, 0xfffffde4
push eax
mov eax, dword [ebp + 8]
mov ecx, dword [eax - 0x218]
dec ecx
mov eax, dword [ebp + 8]
mov eax, dword [eax - 4]
mov edx, 1
call sub.rtl170.bpl__System__UStrCopy_qqrx20System_UnicodeStringii
mov eax, dword [ebp + 8]
mov ecx, dword [eax - 0x218]
mov eax, dword [ebp + 8]
add eax, 0xfffffffc
mov edx, 1
call sub.rtl170.bpl__System__UStrDelete_qqrr20System_UnicodeStringii
mov eax, dword [ebp + 8]
add eax, 0xfffffdf4
xor ecx, ecx
mov edx, 0x103
call sub.rtl170.bpl__System__FillChar_qqrpvic
push 0x104
mov eax, dword [ebp + 8]
add eax, 0xfffffdf4
push eax
mov eax, dword [ebp + 8]
mov eax, dword [eax - 0x21c]
call sub.rtl170.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
call sub.kernel32.dll_GetEnvironmentVariableW
lea edx, [ebp - 4]
mov eax, dword [ebp + 8]
add eax, 0xfffffdf4
call sub.rtl170.bpl__System_Sysutils_StrPas_qqrpxb
mov edx, dword [ebp - 4]
mov eax, dword [ebp + 8]
mov ecx, dword [eax - 4]
mov eax, dword [ebp + 8]
add eax, 0xfffffffc
call sub.rtl170.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
mov eax, dword [ebp + 8]
mov edx, dword [eax - 4]
mov eax, 0x405adc
call sub.rtl170.bpl__System_Sysutils_LastDelimiter_qqrx20System_UnicodeStringt1
mov edx, dword [ebp + 8]
mov dword [edx - 0x218], eax
mov eax, dword [ebp + 8]
cmp dword [eax - 0x218], 0
jne 0x405979
mov eax, dword [ebp + 8]
xor edx, edx
mov dword [eax - 0x220], edx
push 1
mov eax, dword [ebp + 8]
add eax, 0xfffffdec
push eax
mov eax, dword [ebp + 8]
add eax, 0xfffffdf0
push eax
mov eax, dword [ebp + 8]
mov eax, dword [eax - 0x220]
push eax
mov eax, dword [0x40f068]
call sub.rtl170.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
call sub.shell32.dll_ExtractIconExW
mov eax, dword [ebp + 8]
mov ebx, dword [eax - 0x214]
jmp 0x405a93
mov eax, dword [ebp + 8]
add eax, 0xfffffde4
push eax
mov eax, dword [ebp + 8]
mov edx, dword [eax - 0x218]
inc edx
mov eax, dword [ebp + 8]
mov eax, dword [eax - 4]
mov ecx, 0x7fffffff
call sub.rtl170.bpl__System__UStrCopy_qqrx20System_UnicodeStringii
mov eax, dword [ebp + 8]
mov edx, dword [eax - 0x218]
mov eax, dword [ebp + 8]
add eax, 0xfffffffc
mov ecx, 0x7fffffff
call sub.rtl170.bpl__System__UStrDelete_qqrr20System_UnicodeStringii
xor eax, eax
push ebp
push 0x4059ef
push dword fs:[eax]
mov dword fs:[eax], esp
lea edx, [ebp - 8]
mov eax, dword [ebp + 8]
mov eax, dword [eax - 0x21c]
call sub.rtl170.bpl__System_Sysutils_Trim_qqrx20System_UnicodeString
mov eax, dword [ebp - 8]
call sub.rtl170.bpl__System_Sysutils_StrToInt_qqrx20System_UnicodeString
mov edx, dword [ebp + 8]
mov dword [edx - 0x220], eax
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x405a04
mov eax, dword [ebp + 8]
mov eax, dword [eax - 4]
cmp word [eax], 0x22
jne 0x405a5b
mov eax, dword [ebp + 8]
add eax, 0xfffffffc
mov ecx, 1
mov edx, 1
call sub.rtl170.bpl__System__UStrDelete_qqrr20System_UnicodeStringii
mov eax, dword [ebp + 8]
mov eax, dword [eax - 4]
call sub.rtl170.bpl__System__UStrLen_qqrx20System_UnicodeString
mov edx, dword [ebp + 8]
mov edx, dword [edx - 4]
cmp word [edx + eax*2 - 2], 0x22
jne 0x405a5b
mov eax, dword [ebp + 8]
mov eax, dword [eax - 4]
call sub.rtl170.bpl__System__UStrLen_qqrx20System_UnicodeString
mov edx, eax
mov eax, dword [ebp + 8]
add eax, 0xfffffffc
mov ecx, 1
call sub.rtl170.bpl__System__UStrDelete_qqrr20System_UnicodeStringii
push 1
mov eax, dword [ebp + 8]
add eax, 0xfffffdec
push eax
mov eax, dword [ebp + 8]
add eax, 0xfffffdf0
push eax
mov eax, dword [ebp + 8]
mov eax, dword [eax - 0x220]
push eax
mov eax, dword [ebp + 8]
mov eax, dword [eax - 4]
call sub.rtl170.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
call sub.shell32.dll_ExtractIconExW
mov eax, dword [ebp + 8]
mov ebx, dword [eax - 0x214]
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x405ab5
lea eax, [ebp - 8]
mov edx, 2
call sub.rtl170.bpl__System__UStrArrayClr_qqrpvi
ret