Function at 0x402054
Capabilities:
Copy file
Get common file path

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffedc
xor eax, eax
mov dword [ebp - 0x114], eax
mov dword [ebp - 0x118], eax
mov dword [ebp - 0x110], eax
mov dword [ebp - 4], eax
xor eax, eax
push ebp
push 0x40229e
push dword fs:[eax]
mov dword fs:[eax], esp
call sub.kernel32.dll_GetACP
cmp eax, 0x3b6
jne 0x402278
call fcn.00401c94
test al, al
je 0x402278
mov byte [0x420040], 0
push 0x4022ac
call sub.kernel32.dll_LoadLibraryA
mov dword [0x42004c], eax
cmp dword [0x42004c], 0
jne 0x40217b
push 0x104
lea eax, [ebp - 0x109]
push eax
call sub.kernel32.dll_GetSystemDirectoryA
lea eax, [ebp - 4]
lea edx, [ebp - 0x109]
mov ecx, 0x105
call sub.Vcl50.bpl__System__LStrFromArray_qqrr17System_AnsiStringpci
mov eax, dword [ebp - 4]
call sub.Vcl50.bpl__System__LStrLen_qqrv
mov edx, dword [ebp - 4]
cmp byte [edx + eax - 1], 0x5c
je 0x402105
lea eax, [ebp - 4]
mov edx, 0x4022c4
call sub.Vcl50.bpl__System__LStrCat_qqrv
lea eax, [ebp - 0x110]
mov ecx, 0x4022d0
mov edx, dword [ebp - 4]
call sub.Vcl50.bpl__System__LStrCat3_qqrv
mov eax, dword [ebp - 0x110]
call sub.Vcl50.bpl__Sysutils_FileExists_qqrx17System_AnsiString
test al, al
jne 0x40216c
push 0
lea eax, [ebp - 0x114]
mov ecx, 0x4022d0
mov edx, dword [ebp - 4]
call sub.Vcl50.bpl__System__LStrCat3_qqrv
mov eax, dword [ebp - 0x114]
call sub.Vcl50.bpl__System__LStrToPChar_qqrv
push eax
lea eax, [ebp - 0x118]
mov ecx, 0x4022e8
mov edx, dword [ebp - 4]
call sub.Vcl50.bpl__System__LStrCat3_qqrv
mov eax, dword [ebp - 0x118]
call sub.Vcl50.bpl__System__LStrToPChar_qqrv
push eax
call sub.kernel32.dll_CopyFileA
push 0x4022ac
call sub.kernel32.dll_LoadLibraryA
mov dword [0x42004c], eax
push 0x4022f8
mov eax, dword [0x42004c]
push eax
call sub.kernel32.dll_GetProcAddress
mov dword [0x420054], eax
push 0x40230c
mov eax, dword [0x42004c]
push eax
call sub.kernel32.dll_GetProcAddress
mov dword [0x420058], eax
cmp dword [0x420054], 0
je 0x4021b7
cmp dword [0x420058], 0
jne 0x4021cd
mov ecx, 0x402328
mov dl, 1
mov eax, dword [sym.imp.Vcl50.bpl__Sysutils_Exception_]
call sub.Vcl50.bpl__Sysutils_Exception__bctr_qqrx17System_AnsiString
call sub.Vcl50.bpl__System__RaiseExcept_qqrv
push 0x402374
call sub.kernel32.dll_LoadLibraryA
mov dword [0x420048], eax
push 0x4022f8
mov eax, dword [0x420048]
push eax
call sub.kernel32.dll_GetProcAddress
mov dword [0x420050], eax
lea ecx, [ebp - 0x124]
mov edx, 0x401eec
mov eax, dword [0x420050]
call fcn.00401b88
mov eax, dword [ebp - 0x124]
mov dword [0x42005c], eax
mov eax, dword [ebp - 0x120]
mov dword [0x420060], eax
mov eax, dword [ebp - 0x11c]
mov dword [0x420064], eax
push 0x40230c
mov eax, dword [0x420048]
push eax
call sub.kernel32.dll_GetProcAddress
mov dword [0x420050], eax
lea ecx, [ebp - 0x124]
mov edx, 0x401d98
mov eax, dword [0x420050]
call fcn.00401b88
mov eax, dword [ebp - 0x124]
mov dword [0x420068], eax
mov eax, dword [ebp - 0x120]
mov dword [0x42006c], eax
mov eax, dword [ebp - 0x11c]
mov dword [0x420070], eax
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4022a5
lea eax, [ebp - 0x118]
mov edx, 3
call sub.Vcl50.bpl__System__LStrArrayClr_qqrv
lea eax, [ebp - 4]
call sub.Vcl50.bpl__System__LStrClr_qqrr17System_AnsiString
ret