Function at 0x4c2d6c
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
mov ecx, 6
push 0
push 0
dec ecx
jne 0x4c2d74
push ebx
push esi
push edi
mov dword [ebp - 0x10], edx
mov dword [ebp - 0xc], eax
xor eax, eax
push ebp
push 0x4c30d9
push dword fs:[eax]
mov dword fs:[eax], esp
mov byte [ebp - 0x15], 0
mov eax, dword [ebp - 0xc]
cmp dword [eax + 0xc], 0
je 0x4c2dcd
lea ecx, [ebp - 8]
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + 0xc]
mov edx, 0x4c30f4
call fcn.004c2cc8
mov dl, 1
mov eax, dword [ebp - 8]
call sub.rtl170.bpl__System_Sysutils_FileExists_qqrx20System_UnicodeStringo
test al, al
je 0x4c30a0
mov byte [ebp - 0x15], 1
jmp 0x4c30a0
push 0
push 0
push 0x4c3110
call sub.kernel32.dll_GetEnvironmentVariableW
mov ebx, eax
test ebx, ebx
jle 0x4c2e36
mov edx, ebx
dec edx
lea eax, [ebp - 8]
call sub.rtl170.bpl__System__UStrSetLength_qqrr20System_UnicodeStringi
mov eax, dword [ebp - 8]
call sub.rtl170.bpl__System__UStrLen_qqrx20System_UnicodeString
inc eax
push eax
mov eax, dword [ebp - 8]
call sub.rtl170.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
push 0x4c3110
call sub.kernel32.dll_GetEnvironmentVariableW
lea ecx, [ebp - 0x1c]
mov edx, 0x4c30f4
mov eax, dword [ebp - 8]
call fcn.004c2cc8
mov edx, dword [ebp - 0x1c]
lea eax, [ebp - 8]
call sub.rtl170.bpl__System__UStrLAsg_qqrr20System_UnicodeStringx20System_UnicodeString
mov dl, 1
mov eax, dword [ebp - 8]
call sub.rtl170.bpl__System_Sysutils_FileExists_qqrx20System_UnicodeStringo
test al, al
je 0x4c2e36
mov byte [ebp - 0x15], 1
cmp byte [ebp - 0x15], 0
jne 0x4c2fce
call fcn.004488c0
test al, al
jne 0x4c2e4e
call fcn.00444378
push 0x2001f
xor ecx, ecx
mov dl, 1
mov eax, dword [sym.imp.rtl170.bpl__System_Win_Registry_TRegIniFile_]
call sub.rtl170.bpl__System_Win_Registry_TRegIniFile__bctr_qqrx20System_UnicodeStringui
mov dword [ebp - 0x14], eax
xor eax, eax
push ebp
push 0x4c2fb5
push dword fs:[eax]
mov dword fs:[eax], esp
mov edx, 0x80000002
mov eax, dword [ebp - 0x14]
call sub.rtl170.bpl__System_Win_Registry_TRegistry_SetRootKey_qqrp6HKEY__
mov eax, dword [ebp - 0xc]
cmp dword [eax + 8], 0
jne 0x4c2eec
mov eax, dword [0x5e3b44]
mov eax, dword [eax]
call sub.rtl170.bpl__System__DynArrayLength_qqrpxv
test eax, eax
jle 0x4c2eec
mov eax, dword [0x5e379c]
cmp dword [eax], 0
jl 0x4c2eec
push 0
lea eax, [ebp - 0x20]
push eax
mov eax, dword [0x5e379c]
mov eax, dword [eax]
lea eax, [eax + eax*2]
mov edx, dword [0x5e3b44]
mov edx, dword [edx]
mov ecx, dword [edx + eax*4]
lea eax, [ebp - 0x24]
mov edx, 0x4c3130
call sub.rtl170.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
mov edx, dword [ebp - 0x24]
mov ecx, 0x4c3160
mov eax, dword [ebp - 0x14]
call sub.rtl170.bpl__System_Win_Registry_TRegIniFile_ReadString_qqrx20System_UnicodeStringt1t1
mov eax, dword [ebp - 0x20]
lea ecx, [ebp - 8]
mov edx, 0x4c30f4
call fcn.004c2cc8
jmp 0x4c2f62
mov eax, dword [0x5e3b44]
mov eax, dword [eax]
call sub.rtl170.bpl__System__DynArrayLength_qqrpxv
mov edi, eax
dec edi
test edi, edi
jl 0x4c2f62
inc edi
xor ebx, ebx
lea esi, [ebx + ebx*2]
mov eax, dword [0x5e3b44]
mov eax, dword [eax]
mov eax, dword [eax + esi*4 + 4]
mov edx, dword [ebp - 0xc]
mov edx, dword [edx + 8]
call sub.rtl170.bpl__System_Sysutils_AnsiCompareText_qqrx20System_UnicodeStringt1
test eax, eax
jne 0x4c2f5e
push 0
lea eax, [ebp - 0x28]
push eax
mov eax, dword [0x5e3b44]
mov eax, dword [eax]
mov ecx, dword [eax + esi*4]
lea eax, [ebp - 0x2c]
mov edx, 0x4c3130
call sub.rtl170.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
mov edx, dword [ebp - 0x2c]
mov ecx, 0x4c3160
mov eax, dword [ebp - 0x14]
call sub.rtl170.bpl__System_Win_Registry_TRegIniFile_ReadString_qqrx20System_UnicodeStringt1t1
mov eax, dword [ebp - 0x28]
lea ecx, [ebp - 8]
mov edx, 0x4c30f4
call fcn.004c2cc8
jmp 0x4c2f62
inc ebx
dec edi
jne 0x4c2f02
mov eax, dword [ebp - 8]
mov edx, 0x4c30f4
call sub.rtl170.bpl__System__UStrEqual_qqrv
je 0x4c2f77
cmp dword [ebp - 8], 0
jne 0x4c2f9f
push 0
lea eax, [ebp - 0x30]
push eax
mov ecx, 0x4c3160
mov edx, 0x4c3130
mov eax, dword [ebp - 0x14]
call sub.rtl170.bpl__System_Win_Registry_TRegIniFile_ReadString_qqrx20System_UnicodeStringt1t1
mov eax, dword [ebp - 0x30]
lea ecx, [ebp - 8]
mov edx, 0x4c30f4
call fcn.004c2cc8
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4c2fbc
mov eax, dword [ebp - 0x14]
call sub.rtl170.bpl__System_TObject_Free_qqrv
ret
cmp byte [ebp - 0x15], 0
jne 0x4c30a0
mov eax, dword [ebp - 0xc]
cmp dword [eax + 8], 0
jne 0x4c2ff3
lea eax, [ebp - 4]
mov edx, dword [0x5e4598]
mov edx, dword [edx]
call sub.rtl170.bpl__System__UStrLAsg_qqrr20System_UnicodeStringx20System_UnicodeString
jmp 0x4c3040
mov eax, dword [0x5e3b44]
mov eax, dword [eax]
call sub.rtl170.bpl__System__DynArrayLength_qqrpxv
mov edi, eax
dec edi
test edi, edi
jl 0x4c3040
inc edi
xor ebx, ebx
lea esi, [ebx + ebx*2]
mov eax, dword [0x5e3b44]
mov eax, dword [eax]
mov eax, dword [eax + esi*4 + 4]
mov edx, dword [ebp - 0xc]
mov edx, dword [edx + 8]
call sub.rtl170.bpl__System_Sysutils_AnsiCompareText_qqrx20System_UnicodeStringt1
test eax, eax
jne 0x4c303c
lea eax, [ebp - 4]
mov edx, dword [0x5e3b44]
mov edx, dword [edx]
mov edx, dword [edx + esi*4 + 8]
call sub.rtl170.bpl__System__UStrLAsg_qqrr20System_UnicodeStringx20System_UnicodeString
jmp 0x4c3040
inc ebx
dec edi
jne 0x4c3009
cmp dword [ebp - 4], 0
je 0x4c30a0
push dword [ebp - 4]
push 0x4c3180
push 0x4c30f4
lea eax, [ebp - 8]
mov edx, 3
call sub.rtl170.bpl__System__UStrCatN_qqrv
mov dl, 1
mov eax, dword [ebp - 8]
call sub.rtl170.bpl__System_Sysutils_FileExists_qqrx20System_UnicodeStringo
test al, al
je 0x4c3074
mov byte [ebp - 0x15], 1
jmp 0x4c30a0
push dword [ebp - 4]
push 0x4c31ac
push 0x4c30f4
lea eax, [ebp - 8]
mov edx, 3
call sub.rtl170.bpl__System__UStrCatN_qqrv
mov dl, 1
mov eax, dword [ebp - 8]
call sub.rtl170.bpl__System_Sysutils_FileExists_qqrx20System_UnicodeStringo
test al, al
je 0x4c30a0
mov byte [ebp - 0x15], 1
cmp byte [ebp - 0x15], 0
je 0x4c30b1
mov eax, dword [ebp - 0x10]
mov edx, dword [ebp - 8]
call sub.rtl170.bpl__System__UStrAsg_qqrr20System_UnicodeStringx20System_UnicodeString
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4c30e0
lea eax, [ebp - 0x30]
mov edx, 6
call sub.rtl170.bpl__System__UStrArrayClr_qqrpvi
lea eax, [ebp - 8]
mov edx, 2
call sub.rtl170.bpl__System__UStrArrayClr_qqrpvi
ret