Function at 0x2005c18
Capabilities:
Check if file exists
Copy file
Get common file path
Get file attributes
Set file attributes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x35c
and byte [ebp - 0x258], 0
push edi
and byte [ebp - 0x154], 0
push 0x40
pop ecx
xor eax, eax
lea edi, [ebp - 0x257]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
push 0x40
pop ecx
xor eax, eax
lea edi, [ebp - 0x153]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push 0xd
stosb byte es:[edi], al
pop ecx
xor eax, eax
lea edi, [ebp - 0x50]
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x258]
push eax
push 0x200235c
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.020058ee
test eax, eax
je 0x2005fca
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push esi
push 0x104
lea eax, [ebp - 0x154]
push eax
call ebx
lea edi, [ebp - 0x154]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x2005c96
mov esi, 0x200234c
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
lea eax, [ebp - 0x50]
movsd dword es:[edi], dword [esi]
push eax
lea eax, [ebp - 0x258]
push eax
movsw word es:[edi], word [esi]
call fcn.020055b6
lea eax, [ebp - 0x154]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x2005ce3
test al, 1
je 0x2005ce9
and eax, 0xfffffffe
push eax
lea eax, [ebp - 0x154]
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
test eax, eax
jne 0x2005ce9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0
lea eax, [ebp - 0x154]
push eax
lea eax, [ebp - 0x258]
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileA]
test eax, eax
mov dword [ebp - 0x1c], eax
je 0x2005fbf
push 0
push 0x2002310
push 0x80000002
lea eax, [ebp - 0xc]
push eax
call fcn.02004a86
test eax, eax
jne 0x2005e09
and byte [ebp - 0x35c], al
push 0x40
pop ecx
lea edi, [ebp - 0x35b]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push 0x20022e8
stosb byte es:[edi], al
push 0x20022dc
lea eax, [ebp - 0xc]
push eax
call fcn.02004c0c
push 0x20022cc
push 0x20022bc
lea eax, [ebp - 0xc]
push eax
call fcn.02004c0c
push 0x2002298
push 0x200228c
lea eax, [ebp - 0xc]
push eax
call fcn.02004c34
push 0x104
lea eax, [ebp - 0x154]
push eax
call ebx
lea eax, [ebp - 0x154]
push eax
push 0x200227c
lea eax, [ebp - 0xc]
push eax
call fcn.02004c0c
push 0x2001210
push 0x2002270
lea eax, [ebp - 0xc]
push eax
call fcn.02004c0c
mov esi, dword [ebp - 0x40]
shr esi, 0x10
push esi
push 0x2002260
lea eax, [ebp - 0xc]
push eax
call fcn.02004bf3
movzx edi, word [ebp - 0x40]
push edi
push 0x2002250
lea eax, [ebp - 0xc]
push eax
call fcn.02004bf3
push edi
push esi
lea eax, [ebp - 0x35c]
push 0x2002248
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea eax, [ebp - 0x35c]
push eax
push 0x2002238
lea eax, [ebp - 0xc]
push eax
call fcn.02004c0c
lea eax, [ebp - 0xc]
push eax
call fcn.02004a70
jmp 0x2005e0f
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor edi, edi
push edi
push 0x2002204
push 0x80000002
lea eax, [ebp - 0xc]
push eax
call fcn.02004a86
test eax, eax
jne 0x2005fbf
lea eax, [ebp + 0xc]
push eax
push edi
lea eax, [ebp + 8]
push eax
mov esi, 0x20021e8
push esi
lea eax, [ebp - 0xc]
push eax
mov dword [ebp + 8], edi
mov dword [ebp + 0xc], edi
call fcn.02004bb3
test eax, eax
jne 0x2005fb4
mov eax, dword [ebp + 0xc]
cmp eax, edi
jbe 0x2005fb4
cmp dword [ebp + 8], 7
jne 0x2005fb4
inc eax
push eax
call fcn.02006322
mov ebx, eax
cmp ebx, edi
pop ecx
mov dword [ebp - 0x10], ebx
je 0x2005ec5
mov ecx, dword [ebp + 0xc]
mov edx, ecx
xor eax, eax
shr ecx, 2
mov edi, ebx
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
lea eax, [ebp + 0xc]
push eax
push ebx
lea eax, [ebp + 8]
push eax
push esi
lea eax, [ebp - 0xc]
push eax
call fcn.02004bb3
test eax, eax
jne 0x2005eb8
mov eax, ebx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x2005eaa
sub eax, edx
mov dword [ebp - 0x14], eax
jne 0x2005ecb
push ebx
call fcn.02006278
and dword [ebp - 0x10], 0
pop ecx
jmp 0x2005ecb
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, dword [ebp - 0x10]
test esi, esi
je 0x2005fb4
mov eax, dword [ebp + 0xc]
inc eax
push eax
call fcn.02006322
mov edi, eax
test edi, edi
pop ecx
mov dword [ebp - 0x14], edi
je 0x2005fa5
mov ecx, dword [ebp + 0xc]
inc ecx
mov edx, ecx
shr ecx, 2
xor eax, eax
mov ebx, edi
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x2005f09
sub eax, edx
mov dword [ebp - 0x18], eax
je 0x2005f7a
push esi
call fcn.02006397
mov eax, esi
pop ecx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x2005f23
sub eax, edx
mov dword [ebp - 0x18], eax
je 0x2005f42
push 0x20021d8
push esi
call fcn.02006170
test eax, eax
pop ecx
pop ecx
jne 0x2005f64
mov edx, ebx
mov eax, esi
sub edx, esi
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x2005f48
mov eax, ebx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x2005f57
sub eax, edx
lea ebx, [ebx + eax + 1]
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x2005f69
sub eax, edx
lea esi, [esi + eax + 1]
test esi, esi
jne 0x2005f04
push dword [ebp + 0xc]
lea eax, [ebp - 0xc]
push dword [ebp - 0x14]
push 7
push 0x20021e8
push eax
call fcn.02004bd3
test eax, eax
je 0x2005f9a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [ebp - 0x14]
call fcn.02006278
pop ecx
jmp 0x2005fab
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [ebp - 0x10]
call fcn.02006278
pop ecx
lea eax, [ebp - 0xc]
push eax
call fcn.02004a70
jmp 0x2005fc5
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, dword [ebp - 0x1c]
pop esi
pop ebx
pop edi
leave
ret 8