Function at 0x4778dc
Capabilities:
Copy file

Disassembly:
push ebp
mov ebp, esp
push ecx
mov ecx, 0x13
push 0
push 0
dec ecx
jne 0x4778e5
xchg dword [ebp - 4], ecx
push ebx
push esi
push edi
mov dword [ebp - 8], ecx
mov dword [ebp - 4], edx
mov ebx, eax
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__System__UStrAddRef_qqrpv
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrAddRef_qqrpv
xor eax, eax
push ebp
push 0x4780f9
push dword fs:[eax]
mov dword fs:[eax], esp
lea eax, [ebp - 0x14]
mov ecx, dword [ebp - 4]
mov edx, 0x47811c
call sub.rtl120.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
mov eax, dword [ebp - 0x14]
mov edx, 0x478150
call fcn.004037ec
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__Sysutils_FileExists_qqrx20System_UnicodeString
test al, al
jne 0x477994
push 0
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
mov esi, eax
push esi
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
mov ebx, eax
push ebx
call sub.kernel32.dll_CopyFileW
test eax, eax
je 0x477973
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__Sysutils_DeleteFile_qqrx20System_UnicodeString
mov byte [ebp - 9], 1
jmp 0x4780ce
mov byte [ebp - 9], 0
cmp byte [ebp + 8], 0
je 0x4780ce
push esi
mov eax, ebx
mov ecx, 2
pop edx
call fcn.00444f20
jmp 0x4780ce
lea edx, [ebp - 0x18]
xor eax, eax
call sub.rtl120.bpl__System_ParamStr_qqri
mov edx, dword [ebp - 0x18]
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__Sysutils_CompareText_qqrx20System_UnicodeStringt1
test eax, eax
jne 0x477a95
lea eax, [ebp - 0x1c]
mov ecx, 0x47817c
mov edx, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__Sysutils_RenameFile_qqrx20System_UnicodeStringt1
test al, al
je 0x477a5d
mov edx, 0x478150
mov eax, 0x478194
call fcn.004037ec
push 0
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
mov edi, eax
push edi
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
mov esi, eax
push esi
call sub.kernel32.dll_CopyFileW
test eax, eax
je 0x477a24
mov edx, 0x478150
mov eax, 0x4781dc
call fcn.004037ec
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__Sysutils_DeleteFile_qqrx20System_UnicodeString
mov byte [ebp - 9], 1
jmp 0x4780ce
mov edx, 0x478150
mov eax, 0x4781dc
call fcn.004037ec
mov edx, 0x478150
mov eax, 0x478234
call fcn.004037ec
mov byte [ebx + 4], 1
push edi
mov eax, esi
mov ecx, 2
pop edx
call fcn.00444f20
mov byte [ebp - 9], 1
jmp 0x4780ce
mov edx, 0x478150
mov eax, 0x478288
call fcn.004037ec
mov byte [ebx + 4], 1
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
mov ecx, 2
pop edx
call fcn.00444f20
mov byte [ebp - 9], 1
jmp 0x4780ce
mov byte [ebp - 0xa], 0
mov eax, dword [ebx + 0x64]
mov edx, dword [eax]
call dword [edx + 0x14]
dec eax
test eax, eax
jl 0x477b58
inc eax
mov dword [ebp - 0x10], eax
xor esi, esi
lea ecx, [ebp - 0x20]
mov eax, dword [ebx + 0x64]
mov edx, esi
mov edi, dword [eax]
call dword [edi + 0xc]
mov eax, dword [ebp - 0x20]
push eax
lea edx, [ebp - 0x24]
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__Sysutils_ExtractFileName_qqrx20System_UnicodeString
mov edx, dword [ebp - 0x24]
pop eax
call sub.rtl120.bpl__Sysutils_CompareText_qqrx20System_UnicodeStringt1
test eax, eax
jne 0x477b4e
lea ecx, [ebp - 0x2c]
mov eax, dword [ebx + 0x64]
mov edx, esi
mov ebx, dword [eax]
call dword [ebx + 0xc]
mov ecx, dword [ebp - 0x2c]
lea eax, [ebp - 0x28]
mov edx, 0x4782b8
call sub.rtl120.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
mov eax, dword [ebp - 0x28]
mov edx, 0x478150
call fcn.004037ec
lea eax, [ebp - 0x30]
mov ecx, dword [ebp - 8]
mov edx, 0x4782ec
call sub.rtl120.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
mov eax, dword [ebp - 0x30]
mov edx, 0x478150
call fcn.004037ec
lea edx, [ebp - 0x38]
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__Sysutils_ExtractFileName_qqrx20System_UnicodeString
mov ecx, dword [ebp - 0x38]
lea eax, [ebp - 0x34]
mov edx, 0x478320
call sub.rtl120.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
mov eax, dword [ebp - 0x34]
mov edx, 0x478150
call fcn.004037ec
mov byte [ebp - 0xa], 1
jmp 0x477b58
inc esi
dec dword [ebp - 0x10]
jne 0x477ab0
cmp byte [ebp - 0xa], 0
je 0x477db5
lea edx, [ebp - 0x3c]
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__Sysutils_ExtractFileName_qqrx20System_UnicodeString
mov eax, dword [ebp - 0x3c]
call fcn.00444db8
test al, al
je 0x477db5
cmp byte [ebp + 8], 0
je 0x477dac
mov edx, 0x478150
mov eax, 0x478354
call fcn.004037ec
lea eax, [ebp - 0x40]
mov ecx, 0x47838c
mov edx, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
mov eax, dword [ebp - 0x40]
call sub.rtl120.bpl__Sysutils_FileExists_qqrx20System_UnicodeString
test al, al
je 0x477bd9
mov edx, 0x478150
mov eax, 0x478354
call fcn.004037ec
lea eax, [ebp - 0x44]
mov ecx, 0x47838c
mov edx, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
mov eax, dword [ebp - 0x44]
call sub.rtl120.bpl__Sysutils_DeleteFile_qqrx20System_UnicodeString
lea eax, [ebp - 0x48]
mov ecx, 0x47838c
mov edx, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
mov edx, dword [ebp - 0x48]
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__Sysutils_RenameFile_qqrx20System_UnicodeStringt1
test al, al
je 0x477d7d
mov edx, 0x478150
mov eax, 0x4783a4
call fcn.004037ec
lea eax, [ebp - 0x4c]
mov ecx, 0x47838c
mov edx, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
mov eax, dword [ebp - 0x4c]
call sub.rtl120.bpl__Sysutils_DeleteFile_qqrx20System_UnicodeString
test al, al
jne 0x477c97
xor eax, eax
push ebp
push 0x477c8d
push dword fs:[eax]
mov dword fs:[eax], esp
push 0x4783d8
push dword [ebp - 8]
push 0x47838c
lea eax, [ebp - 0x50]
mov edx, 3
call sub.rtl120.bpl__System__UStrCatN_qqrv
mov eax, dword [ebp - 0x50]
mov edx, 0x478150
call fcn.004037ec
lea eax, [ebp - 0x54]
mov ecx, 0x47838c
mov edx, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
mov eax, dword [ebp - 0x54]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
mov edx, 0x4783f8
mov ecx, 1
call fcn.00444f20
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x477c97
push 0
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
call sub.kernel32.dll_CopyFileW
cmp eax, 1
sbb eax, eax
inc eax
mov byte [ebp - 9], al
cmp byte [ebp - 9], 0
jne 0x477cf2
cmp byte [ebp + 8], 0
je 0x477cf2
mov edx, 0x478150
mov eax, 0x478408
call fcn.004037ec
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
mov ecx, 2
pop edx
call fcn.00444f20
jmp 0x477d01
mov edx, 0x478150
mov eax, 0x478434
call fcn.004037ec
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
mov ebx, eax
mov edx, ebx
lea eax, [ebp - 0x58]
call sub.rtl120.bpl__System__UStrFromPWChar_qqrr20System_UnicodeStringpb
mov eax, dword [ebp - 0x58]
call sub.rtl120.bpl__Sysutils_DeleteFile_qqrx20System_UnicodeString
test al, al
jne 0x4780ce
xor eax, eax
push ebp
push 0x477d6e
push dword fs:[eax]
mov dword fs:[eax], esp
lea eax, [ebp - 0x5c]
mov ecx, dword [ebp - 4]
mov edx, 0x478464
call sub.rtl120.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
mov eax, dword [ebp - 0x5c]
mov edx, 0x478150
call fcn.004037ec
mov eax, ebx
mov edx, 0x4783f8
mov ecx, 1
call fcn.00444f20
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x4780ce
mov byte [ebp - 9], 0
cmp byte [ebp + 8], 0
je 0x4780ce
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
mov ecx, 2
pop edx
call fcn.00444f20
jmp 0x4780ce
mov byte [ebp - 9], 0
jmp 0x4780ce
lea eax, [ebp - 0x60]
mov ecx, 0x47838c
mov edx, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
mov eax, dword [ebp - 0x60]
call sub.rtl120.bpl__Sysutils_FileExists_qqrx20System_UnicodeString
test al, al
je 0x477e5f
lea eax, [ebp - 0x64]
mov ecx, 0x47838c
mov edx, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
mov eax, dword [ebp - 0x64]
call sub.rtl120.bpl__Sysutils_DeleteFile_qqrx20System_UnicodeString
test al, al
je 0x477e1f
push 0x478490
push dword [ebp - 8]
push 0x47838c
push 0x4784c0
lea eax, [ebp - 0x68]
mov edx, 4
call sub.rtl120.bpl__System__UStrCatN_qqrv
mov eax, dword [ebp - 0x68]
mov edx, 0x478150
call fcn.004037ec
jmp 0x477e5f
push 0x478490
push dword [ebp - 8]
push 0x47838c
push 0x4784e0
call sub.kernel32.dll_GetLastError_1
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x70]
call sub.rtl120.bpl__Sysutils_IntToStr_qqrj
push dword [ebp - 0x70]
lea eax, [ebp - 0x6c]
mov edx, 5
call sub.rtl120.bpl__System__UStrCatN_qqrv
mov eax, dword [ebp - 0x6c]
mov edx, 0x478150
call fcn.004037ec
lea eax, [ebp - 0x74]
mov ecx, 0x47838c
mov edx, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
mov edx, dword [ebp - 0x74]
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__Sysutils_RenameFile_qqrx20System_UnicodeStringt1
test al, al
je 0x47806e
mov edx, 0x478150
mov eax, 0x478508
call fcn.004037ec
lea eax, [ebp - 0x78]
mov ecx, 0x47838c
mov edx, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
mov eax, dword [ebp - 0x78]
call sub.rtl120.bpl__Sysutils_DeleteFile_qqrx20System_UnicodeString
test al, al
jne 0x477f42
push 0x47854c
push dword [ebp - 8]
push 0x47838c
push 0x4784e0
call sub.kernel32.dll_GetLastError_1
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x80]
call sub.rtl120.bpl__Sysutils_IntToStr_qqrj
push dword [ebp - 0x80]
lea eax, [ebp - 0x7c]
mov edx, 5
call sub.rtl120.bpl__System__UStrCatN_qqrv
mov eax, dword [ebp - 0x7c]
mov edx, 0x478150
call fcn.004037ec
xor eax, eax
push ebp
push 0x477f36
push dword fs:[eax]
mov dword fs:[eax], esp
lea eax, [ebp - 0x84]
mov ecx, 0x47838c
mov edx, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
mov eax, dword [ebp - 0x84]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
mov edx, 0x4783f8
mov ecx, 1
call fcn.00444f20
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x477f74
push 0x47854c
push dword [ebp - 8]
push 0x47838c
push 0x4784c0
lea eax, [ebp - 0x88]
mov edx, 4
call sub.rtl120.bpl__System__UStrCatN_qqrv
mov eax, dword [ebp - 0x88]
mov edx, 0x478150
call fcn.004037ec
push 0
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
call sub.kernel32.dll_CopyFileW
cmp eax, 1
sbb eax, eax
inc eax
mov byte [ebp - 9], al
cmp byte [ebp - 9], 0
je 0x477fad
mov edx, 0x478150
mov eax, 0x47859c
call fcn.004037ec
jmp 0x477fe7
call sub.kernel32.dll_GetLastError_1
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x90]
call sub.rtl120.bpl__Sysutils_IntToStr_qqrj
mov ecx, dword [ebp - 0x90]
lea eax, [ebp - 0x8c]
mov edx, 0x4785f4
call sub.rtl120.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
mov eax, dword [ebp - 0x8c]
mov edx, 0x478150
call fcn.004037ec
cmp byte [ebp - 9], 0
jne 0x47800f
cmp byte [ebp + 8], 0
je 0x47800f
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
mov ecx, 2
pop edx
call fcn.00444f20
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
mov ebx, eax
mov edx, ebx
lea eax, [ebp - 0x94]
call sub.rtl120.bpl__System__UStrFromPWChar_qqrr20System_UnicodeStringpb
mov eax, dword [ebp - 0x94]
call sub.rtl120.bpl__Sysutils_DeleteFile_qqrx20System_UnicodeString
test al, al
jne 0x4780ce
xor eax, eax
push ebp
push 0x478062
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, ebx
mov edx, 0x4783f8
mov ecx, 1
call fcn.00444f20
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x4780ce
call sub.kernel32.dll_GetLastError_1
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x9c]
call sub.rtl120.bpl__Sysutils_IntToStr_qqrj
mov ecx, dword [ebp - 0x9c]
lea eax, [ebp - 0x98]
mov edx, 0x478654
call sub.rtl120.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
mov eax, dword [ebp - 0x98]
mov edx, 0x478150
call fcn.004037ec
mov byte [ebp - 9], 0
cmp byte [ebp + 8], 0
je 0x4780ce
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
mov ecx, 2
pop edx
call fcn.00444f20
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x478100
lea eax, [ebp - 0x9c]
mov edx, 0x23
call sub.rtl120.bpl__System__UStrArrayClr_qqrpvi
lea eax, [ebp - 8]
mov edx, 2
call sub.rtl120.bpl__System__UStrArrayClr_qqrpvi
ret