Function at 0x520170
Capabilities:
Check if file exists
Copy file
Set file attributes

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5c4698
mov eax, dword fs:[0]
push eax
sub esp, 0x1c
mov eax, dword [0x64a070]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, edx
mov ebx, ecx
cmp dword [ebx + 0x14], 8
jb 0x5201a9
mov eax, dword [ebx]
jmp 0x5201ab
mov eax, ebx
mov esi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
push eax
call esi
test eax, eax
jne 0x520213
mov eax, dword [0x656c44]
test eax, eax
je 0x5201e8
push str.Source_file_does_not_exist_in_CopyFileFromSourceToDestination
push 0x5f8398
push 0x5f8398
push str.FileUtils
push 0x61c4f4
push 0x32
call eax
add esp, 0x18
xor al, al
jmp 0x520471
mov ecx, dword [0x656c48]
test ecx, ecx
je 0x52020c
mov eax, dword [ecx]
push str.Source_file_does_not_exist_in_CopyFileFromSourceToDestination
push str.FileUtils
push 0x5f8398
push 0x32
push ecx
call dword [eax + 0x34]
add esp, 0x14
xor al, al
jmp 0x520471
cmp byte [ebp + 8], 0
je 0x52023e
cmp dword [edi + 0x14], 8
jb 0x520223
mov eax, dword [edi]
jmp 0x520225
mov eax, edi
push eax
call esi
test eax, eax
je 0x52023e
push 0
mov dl, 1
mov ecx, edi
call fcn.0051fea0
add esp, 4
test al, al
je 0x52020c
xor eax, eax
mov dword [ebp - 0x14], 7
push 0xffffffffffffffff
push eax
push edi
lea ecx, [ebp - 0x28]
mov dword [ebp - 0x18], 0
mov word [ebp - 0x28], ax
call fcn.00408f10
lea ecx, [ebp - 0x28]
mov dword [ebp - 4], 0
call fcn.0051dd00
push ecx
lea ecx, [ebp - 0x28]
call fcn.0051f200
add esp, 4
cmp dword [edi + 0x14], 8
jb 0x520283
mov ecx, dword [edi]
jmp 0x520285
mov ecx, edi
cmp dword [ebx + 0x14], 8
jb 0x52028f
mov eax, dword [ebx]
jmp 0x520291
mov eax, ebx
mov esi, dword [sym.imp.KERNEL32.dll_CopyFileW]
push 0
push ecx
push eax
call esi
test eax, eax
jne 0x520437
cmp byte [ebp + 0xc], al
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
je 0x520351
call eax
cmp eax, 5
jne 0x52034c
cmp dword [edi + 0x14], 8
jb 0x5202c8
mov ecx, dword [edi]
jmp 0x5202ca
mov ecx, edi
push ecx
call fcn.00520800
add esp, 4
test al, al
je 0x520395
mov eax, dword [0x656c44]
test eax, eax
je 0x520306
push str.Trying_to_copy_file_after_setting_permissions
push 0x5f8398
push 0x5f8398
push str.FileUtils
push 0x61c4f4
push 0x1e
call eax
add esp, 0x18
jmp 0x52032a
mov ecx, dword [0x656c48]
test ecx, ecx
je 0x52032a
mov eax, dword [ecx]
push str.Trying_to_copy_file_after_setting_permissions
push str.FileUtils
push 0x5f8398
push 0x1e
push ecx
call dword [eax + 0x34]
add esp, 0x14
cmp dword [edi + 0x14], 8
jb 0x520334
mov eax, dword [edi]
jmp 0x520336
mov eax, edi
cmp dword [ebx + 0x14], 8
jb 0x52033e
mov ebx, dword [ebx]
push 0
push eax
push ebx
call esi
test eax, eax
jne 0x520437
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [0x656c44], 0
je 0x5203fe
cmp dword [edi + 0x14], 8
jb 0x520366
mov edi, dword [edi]
call eax
push eax
push edi
push str.Failed_to_copy_file_at_the_destination:_s._LastError:__d
push 0x5f8398
push 0x5f8398
push str.FileUtils
push 0x61c4f4
push 0x32
call dword [0x656c44]
add esp, 0x20
xor bl, bl
jmp 0x52045a
cmp dword [0x656c44], 0
je 0x5203da
cmp dword [ebx + 0x14], 8
jb 0x5203a6
mov ebx, dword [ebx]
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
push eax
push ebx
push str.Failed_to_set_permissions_for_path__s._LastError:__d
push 0x5f8398
push 0x5f8398
push str.FileUtils
push 0x61c4f4
push 0x32
call dword [0x656c44]
add esp, 0x20
xor bl, bl
jmp 0x52045a
mov esi, dword [0x656c48]
test esi, esi
je 0x520433
cmp dword [ebx + 0x14], 8
jb 0x5203ec
mov ebx, dword [ebx]
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, dword [esi]
call eax
push eax
push ebx
push str.Failed_to_set_permissions_for_path__s._LastError:__d
jmp 0x52041b
mov esi, dword [0x656c48]
test esi, esi
je 0x520433
cmp dword [edi + 0x14], 8
jb 0x520410
mov edi, dword [edi]
mov esi, dword [esi]
call eax
push eax
push edi
push str.Failed_to_copy_file_at_the_destination:_s._LastError:__d
push str.FileUtils
push 0x5f8398
push 0x32
push dword [0x656c48]
call dword [esi + 0x34]
add esp, 0x1c
xor bl, bl
jmp 0x52045a
cmp byte [ebp + 0x10], 0
je 0x520444
mov ecx, edi
call fcn.004fccb0
cmp dword [edi + 0x14], 8
jb 0x52044c
mov edi, dword [edi]
push 0x80
push edi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov bl, 1
mov ecx, dword [ebp - 0x14]
cmp ecx, 8
jb 0x52046f
inc ecx
push ecx
push dword [ebp - 0x28]
lea ecx, [ebp - 0x28]
call fcn.00409510
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0057608a
mov esp, ebp
pop ebp
ret