Function at 0x4c4f08
Capabilities:
Copy file

Disassembly:
push ebp
mov ebp, esp
push ecx
mov ecx, 4
push 0
push 0
dec ecx
jne 0x4c4f11
push ecx
xchg dword [ebp - 4], ecx
push ebx
push esi
mov byte [ebp - 9], cl
mov dword [ebp - 4], edx
mov ebx, eax
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__System__UStrAddRef_qqrpv
xor eax, eax
push ebp
push 0x4c5123
push dword fs:[eax]
mov dword fs:[eax], esp
cmp byte [ebp - 9], 0
je 0x4c4f6a
lea edx, [ebp - 0x10]
mov eax, dword [ebx + 8]
call sub.rtl120.bpl__Sysutils_ExtractFilePath_qqrx20System_UnicodeString
lea eax, [ebp - 0x10]
mov edx, 0x4c513c
call sub.rtl120.bpl__System__UStrCat_qqrr20System_UnicodeStringx20System_UnicodeString
mov eax, dword [ebp - 0x10]
call sub.rtl120.bpl__Sysutils_FileExists_qqrx20System_UnicodeString
test al, al
je 0x4c50fb
mov eax, dword [ebx + 0x14]
cmp eax, dword [ebx + 0x18]
jl 0x4c505f
push dword [ebx + 0xc]
push 0x4c5164
lea edx, [ebp - 0x14]
movzx eax, byte [ebx + 0x1c]
call sub.rtl120.bpl__Sysutils_IntToStr_qqri
push dword [ebp - 0x14]
lea eax, [ebp - 8]
mov edx, 3
call sub.rtl120.bpl__System__UStrCatN_qqrv
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__Sysutils_FileExists_qqrx20System_UnicodeString
test al, al
je 0x4c4fae
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__Sysutils_DeleteFile_qqrx20System_UnicodeString
movzx esi, byte [ebx + 0x1c]
dec esi
cmp esi, 1
jl 0x4c5019
push dword [ebx + 0xc]
push 0x4c5164
lea edx, [ebp - 0x18]
mov eax, esi
call sub.rtl120.bpl__Sysutils_IntToStr_qqri
push dword [ebp - 0x18]
lea eax, [ebp - 8]
mov edx, 3
call sub.rtl120.bpl__System__UStrCatN_qqrv
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__Sysutils_FileExists_qqrx20System_UnicodeString
test al, al
je 0x4c5014
push dword [ebx + 0xc]
push 0x4c5164
lea edx, [ebp - 0x20]
lea eax, [esi + 1]
call sub.rtl120.bpl__Sysutils_IntToStr_qqri
push dword [ebp - 0x20]
lea eax, [ebp - 0x1c]
mov edx, 3
call sub.rtl120.bpl__System__UStrCatN_qqrv
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__Sysutils_RenameFile_qqrx20System_UnicodeStringt1
dec esi
test esi, esi
jne 0x4c4fb8
push 0
lea eax, [ebp - 0x24]
mov ecx, 0x4c517c
mov edx, dword [ebx + 0xc]
call sub.rtl120.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
mov eax, dword [ebp - 0x24]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
mov eax, dword [ebx + 0xc]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
call sub.kernel32.dll_CopyFileW
push 0
push 0
mov eax, dword [ebx + 0x10]
call sub.rtl120.bpl__Classes_TStream_SetSize64_qqrxj
push 0
push 0
mov eax, dword [ebx + 0x10]
call sub.rtl120.bpl__Classes_TStream_SetPosition_qqrxj
xor eax, eax
mov dword [ebx + 0x14], eax
cmp dword [ebx + 0x14], 0
jne 0x4c5082
mov word [ebp - 0xc], 0xfeff
lea edx, [ebp - 0xc]
mov ecx, 2
mov eax, dword [ebx + 0x10]
call sub.rtl120.bpl__Classes_TStream_WriteBuffer_qqrpxvi
mov dword [ebx + 0x14], 2
cmp byte [ebx + 0x1d], 0
je 0x4c50b1
call sub.rtl120.bpl__Sysutils_Now_qqrv
add esp, 0xfffffff8
fstp qword [esp]
wait
lea edx, [ebp - 0x28]
mov eax, 0x4c5194
call sub.rtl120.bpl__Sysutils_FormatDateTime_qqrx20System_UnicodeString16System_TDateTime
mov eax, dword [ebp - 0x28]
lea edx, [ebp - 4]
mov ecx, 1
call sub.rtl120.bpl__System__UStrInsert_qqrx20System_UnicodeStringr20System_UnicodeStringi
lea eax, [ebp - 4]
mov edx, 0x4c51d4
call sub.rtl120.bpl__System__UStrCat_qqrr20System_UnicodeStringx20System_UnicodeString
lea eax, [ebp - 4]
call sub.rtl120.bpl__System__EnsureUnicodeString_qqrr20System_UnicodeString
call sub.rtl120.bpl__System__UStrLen_qqrx20System_UnicodeString
add eax, eax
push eax
lea eax, [ebp - 4]
call sub.rtl120.bpl__System__EnsureUnicodeString_qqrr20System_UnicodeString
lea eax, [ebp - 4]
call sub.rtl120.bpl__System__UniqueStringU_qqrr20System_UnicodeString
mov edx, eax
mov eax, dword [ebx + 0x10]
pop ecx
mov esi, dword [eax]
call dword [esi + 0x10]
lea eax, [ebp - 4]
call sub.rtl120.bpl__System__EnsureUnicodeString_qqrr20System_UnicodeString
call sub.rtl120.bpl__System__UStrLen_qqrx20System_UnicodeString
add eax, eax
add dword [ebx + 0x14], eax
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4c512a
lea eax, [ebp - 0x28]
mov edx, 7
call sub.rtl120.bpl__System__UStrArrayClr_qqrpvi
lea eax, [ebp - 8]
mov edx, 2
call sub.rtl120.bpl__System__UStrArrayClr_qqrpvi
ret