Function at 0x665e08
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffd14
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0x2ec], ebx
mov dword [ebp - 0x2e8], ebx
mov dword [ebp - 0x2e0], ebx
mov dword [ebp - 0x2e4], ebx
mov dword [ebp - 0x2dc], ebx
mov dword [ebp - 0x2d8], ebx
mov dword [ebp - 4], ebx
mov dword [ebp - 8], ebx
mov dword [ebp - 0xc], ebx
mov dword [ebp - 0x28c], ecx
mov dword [ebp - 0x288], edx
mov dword [ebp - 0x284], eax
mov eax, dword [ebp - 0x288]
test eax, eax
je 0x665e63
xor edx, edx
mov dword [eax], edx
lea eax, [ebp - 0x280]
mov edx, dword [sym.imp.rtl120.bpl___xp_19Sysutils_TSearchRec]
call sub.rtl120.bpl__System__InitializeRecord_qqrpvt1
xor eax, eax
push ebp
push 0x666314
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 0x284]
xor edx, edx
mov dword [eax], edx
mov dword [eax + 4], edx
mov eax, dword [ebp - 0x288]
xor edx, edx
call sub.rtl120.bpl__System__UStrAsg_qqrr20System_UnicodeStringx20System_UnicodeString
mov eax, dword [ebp - 0x28c]
mov eax, dword [eax]
mov edx, dword [eax]
call dword [edx + 0x44]
mov dl, 1
mov eax, dword [sym.imp.rtl120.bpl__Registry_TRegistry_]
call sub.rtl120.bpl__Registry_TRegistry__bctr_qqrv
mov dword [ebp - 0x290], eax
xor eax, eax
push ebp
push 0x6662d1
push dword fs:[eax]
mov dword fs:[eax], esp
mov edx, 0x80000002
mov eax, dword [ebp - 0x290]
call sub.rtl120.bpl__Registry_TRegistry_SetRootKey_qqrp6HKEY__
xor ecx, ecx
mov edx, 0x666330
mov eax, dword [ebp - 0x290]
call sub.rtl120.bpl__Registry_TRegistry_OpenKey_qqrx20System_UnicodeStringo
test al, al
je 0x666058
lea ecx, [ebp - 8]
mov edx, 0x666398
mov eax, dword [ebp - 0x290]
call sub.rtl120.bpl__Registry_TRegistry_ReadString_qqrx20System_UnicodeString
lea eax, [ebp - 0xc]
mov edx, 0x104
call sub.rtl120.bpl__System__UStrSetLength_qqrr20System_UnicodeStringi
push 0x104
mov eax, dword [ebp - 0xc]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
call sub.kernel32.dll_ExpandEnvironmentStringsW
mov eax, dword [ebp - 0xc]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
mov edx, eax
lea eax, [ebp - 0xc]
call sub.rtl120.bpl__System__UStrFromPWChar_qqrr20System_UnicodeStringpb
mov eax, dword [ebp - 0x288]
mov edx, dword [ebp - 0xc]
call sub.rtl120.bpl__System__UStrAsg_qqrr20System_UnicodeStringx20System_UnicodeString
mov eax, dword [ebp - 0x288]
mov eax, dword [eax]
call sub.rtl120.bpl__Sysutils_FileExists_qqrx20System_UnicodeString
test al, al
je 0x665fda
lea eax, [ebp - 0x2c4]
push eax
push 0
mov eax, dword [ebp - 0x288]
mov eax, dword [eax]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
call sub.kernel32.dll_GetFileAttributesExW
lea eax, [ebp - 0x2a0]
push eax
lea eax, [ebp - 0x2b0]
push eax
call sub.kernel32.dll_FileTimeToLocalFileTime
lea eax, [ebp - 0x2d4]
push eax
lea eax, [ebp - 0x2a0]
push eax
call sub.kernel32.dll_FileTimeToSystemTime
xor eax, eax
push ebp
push 0x665fce
push dword fs:[eax]
mov dword fs:[eax], esp
lea eax, [ebp - 0x2d4]
call sub.rtl120.bpl__Sysutils_SystemTimeToDateTime_qqrrx11_SYSTEMTIME
mov eax, dword [ebp - 0x284]
fstp qword [eax]
wait
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x665ff4
mov eax, dword [ebp - 0x284]
xor edx, edx
mov dword [eax], edx
mov dword [eax + 4], edx
mov eax, dword [ebp - 0x288]
xor edx, edx
call sub.rtl120.bpl__System__UStrAsg_qqrr20System_UnicodeStringx20System_UnicodeString
lea ecx, [ebp - 8]
mov edx, 0x6663b8
mov eax, dword [ebp - 0x290]
call sub.rtl120.bpl__Registry_TRegistry_ReadString_qqrx20System_UnicodeString
lea eax, [ebp - 0xc]
mov edx, 0x104
call sub.rtl120.bpl__System__UStrSetLength_qqrr20System_UnicodeStringi
push 0x104
mov eax, dword [ebp - 0xc]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
call sub.kernel32.dll_ExpandEnvironmentStringsW
mov eax, dword [ebp - 0xc]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
mov edx, eax
lea eax, [ebp - 0xc]
call sub.rtl120.bpl__System__UStrFromPWChar_qqrr20System_UnicodeStringpb
lea edx, [ebp - 4]
mov eax, dword [ebp - 0xc]
call sub.rtl120.bpl__Sysutils_IncludeTrailingPathDelimiter_qqrx20System_UnicodeString
mov eax, dword [ebp - 0x290]
call sub.rtl120.bpl__Registry_TRegistry_CloseKey_qqrv
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__Sysutils_DirectoryExists_qqrx20System_UnicodeString
test al, al
je 0x6662b8
lea eax, [ebp - 0x2d8]
mov ecx, 0x6663dc
mov edx, dword [ebp - 4]
call sub.rtl120.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
mov eax, dword [ebp - 0x2d8]
lea ecx, [ebp - 0x280]
mov edx, 0x1ff
call sub.rtl120.bpl__Sysutils_FindFirst_qqrx20System_UnicodeStringir19Sysutils_TSearchRec
test eax, eax
jne 0x666188
mov eax, dword [ebp - 0x26c]
mov edx, 0x6663f4
call sub.rtl120.bpl__System__UStrEqual_qqrv
je 0x666175
mov eax, dword [ebp - 0x26c]
mov edx, 0x666404
call sub.rtl120.bpl__System__UStrEqual_qqrv
je 0x666175
cmp dword [ebp - 0x270], 0x10
je 0x666175
xor edi, edi
mov eax, dword [ebp - 0x28c]
mov eax, dword [eax]
mov edx, dword [eax]
call dword [edx + 0x14]
mov esi, eax
dec esi
test esi, esi
jl 0x666125
inc esi
xor ebx, ebx
mov edi, ebx
push 0
push 0
lea ecx, [ebp - 0x2dc]
mov eax, dword [ebp - 0x28c]
mov eax, dword [eax]
mov edx, ebx
call sub.rtl120.bpl__Classes_TStrings_GetValueFromIndex_qqri
mov eax, dword [ebp - 0x2dc]
call sub.rtl120.bpl__Sysutils_StrToInt64Def_qqrx20System_UnicodeStringxj
cmp edx, dword [ebp - 0x258]
jne 0x66611f
cmp eax, dword [ebp - 0x25c]
jb 0x666125
inc ebx
dec esi
jne 0x6660eb
push dword [ebp - 4]
push dword [ebp - 0x26c]
push 0x666418
push dword [ebp - 0x258]
push dword [ebp - 0x25c]
lea eax, [ebp - 0x2e4]
call sub.rtl120.bpl__Sysutils_IntToStr_qqrj
push dword [ebp - 0x2e4]
lea eax, [ebp - 0x2e0]
mov edx, 4
call sub.rtl120.bpl__System__UStrCatN_qqrv
mov ecx, dword [ebp - 0x2e0]
mov eax, dword [ebp - 0x28c]
mov eax, dword [eax]
mov edx, edi
mov ebx, dword [eax]
call dword [ebx + 0x60]
lea eax, [ebp - 0x280]
call sub.rtl120.bpl__Sysutils_FindNext_qqrr19Sysutils_TSearchRec
test eax, eax
je 0x666099
lea eax, [ebp - 0x280]
call sub.rtl120.bpl__Sysutils_FindClose_qqrr19Sysutils_TSearchRec
mov eax, dword [ebp - 0x28c]
mov eax, dword [eax]
mov edx, dword [eax]
call dword [edx + 0x14]
test eax, eax
jle 0x666273
lea eax, [ebp - 0x2c4]
push eax
push 0
lea ecx, [ebp - 0x2e8]
mov eax, dword [ebp - 0x28c]
mov eax, dword [eax]
xor edx, edx
call sub.rtl120.bpl__Classes_TStrings_GetName_qqri
mov eax, dword [ebp - 0x2e8]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
call sub.kernel32.dll_GetFileAttributesExW
lea eax, [ebp - 0x2a0]
push eax
lea eax, [ebp - 0x2c0]
push eax
call sub.kernel32.dll_FileTimeToLocalFileTime
lea eax, [ebp - 0x2d4]
push eax
lea eax, [ebp - 0x2a0]
push eax
call sub.kernel32.dll_FileTimeToSystemTime
mov eax, dword [ebp - 0x284]
mov edx, dword [eax]
mov dword [ebp - 0x298], edx
mov edx, dword [eax + 4]
mov dword [ebp - 0x294], edx
xor eax, eax
push ebp
push 0x66623e
push dword fs:[eax]
mov dword fs:[eax], esp
lea eax, [ebp - 0x2d4]
call sub.rtl120.bpl__Sysutils_SystemTimeToDateTime_qqrrx11_SYSTEMTIME
fstp qword [ebp - 0x298]
wait
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x666248
mov eax, dword [ebp - 0x284]
fld qword [eax]
fcomp qword [ebp - 0x298]
wait
fnstsw ax
sahf
jae 0x666273
mov eax, dword [ebp - 0x284]
mov edx, dword [ebp - 0x298]
mov dword [eax], edx
mov edx, dword [ebp - 0x294]
mov dword [eax + 4], edx
mov eax, dword [ebp - 0x28c]
mov eax, dword [eax]
mov edx, dword [eax]
call dword [edx + 0x14]
mov esi, eax
dec esi
test esi, esi
jl 0x6662b8
inc esi
xor ebx, ebx
lea ecx, [ebp - 0x2ec]
mov eax, dword [ebp - 0x28c]
mov eax, dword [eax]
mov edx, ebx
call sub.rtl120.bpl__Classes_TStrings_GetName_qqri
mov ecx, dword [ebp - 0x2ec]
mov eax, dword [ebp - 0x28c]
mov eax, dword [eax]
mov edx, ebx
mov edi, dword [eax]
call dword [edi + 0x20]
inc ebx
dec esi
jne 0x66628a
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x6662d8
mov eax, dword [ebp - 0x290]
call sub.rtl120.bpl__System_TObject_Free_qqrv
ret