Function at 0x40f650
Capabilities:
Check if file exists
Copy file
Create directory
Get file attributes
Set file attributes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x658
mov eax, dword [0x4f31b4]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
push esi
mov esi, ecx
mov dword [ebp - 0x350], edx
xor ebx, ebx
push edi
mov dword [ebp - 0x34c], ebx
cmp dword [esi + 0x10], 0x104
jae 0x40fa3e
cmp dword [edx + 0x10], 0x104
jae 0x40fa3e
push edx
lea ecx, [ebp - 0x38]
call fcn.00404e80
cmp dword [ebp - 0x24], 8
lea eax, [ebp - 0x38]
cmovae eax, dword [ebp - 0x38]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40f757
lea edx, [ebp - 0x38]
lea ecx, [ebp - 0x20]
call fcn.0040f410
lea ecx, [ebp - 0x38]
cmp ecx, eax
je 0x40f6cf
push 0xffffffffffffffff
push ebx
push eax
call fcn.00405380
lea ecx, [ebp - 0x20]
call fcn.00404d70
cmp dword [ebp - 0x28], ebx
je 0x40f79d
mov edx, esi
lea ecx, [ebp - 0x80]
call fcn.0040f410
mov edi, dword [ebp - 0x70]
test edi, edi
je 0x40fa19
mov edx, dword [ebp - 0x28]
cmp edx, edi
jb 0x40f729
cmp dword [ebp - 0x6c], 8
lea eax, [ebp - 0x80]
lea ecx, [ebp - 0x38]
cmovae eax, dword [ebp - 0x80]
cmp edi, edx
push edi
cmovbe edx, edi
cmp dword [ebp - 0x24], 8
push eax
cmovae ecx, dword [ebp - 0x38]
call fcn.004051d0
add esp, 8
test eax, eax
je 0x40fa19
push 3
push ecx
push esi
lea ecx, [ebp - 0x344]
call fcn.0041abb0
push esi
call fcn.0040fa60
add esp, 4
test al, al
jne 0x40f7ba
lea ecx, [ebp - 0x344]
xor bl, bl
call fcn.0041ad30
jmp 0x40fa1b
lea eax, [ebp - 0x98]
push eax
lea ecx, [ebp - 0x38]
call fcn.00412750
mov edx, eax
lea ecx, [ebp - 0x20]
call fcn.0040f410
lea ecx, [ebp - 0x38]
cmp ecx, eax
je 0x40f781
push 0xffffffffffffffff
push 0
push eax
call fcn.00405380
lea ecx, [ebp - 0x20]
call fcn.00404d70
lea ecx, [ebp - 0x98]
call fcn.00404d70
cmp dword [ebp - 0x28], ebx
jne 0x40f6e0
lea ecx, [ebp - 0x38]
xor bl, bl
call fcn.00404d70
mov al, bl
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00493b18
mov esp, ebp
pop ebp
ret
push esi
lea ecx, [ebp - 0x50]
call fcn.00404e80
mov ecx, esi
call fcn.0040fa80
push esi
lea ecx, [ebp - 0x68]
mov byte [ebp - 0x34c], al
mov byte [ebp - 0x345], 1
call fcn.00404e80
mov edi, dword [ebp - 0x350]
mov ecx, edi
call fcn.0040fa80
test al, al
je 0x40f820
lea eax, [ebp - 0x98]
mov ecx, esi
push eax
call fcn.00412750
lea ecx, [ebp - 0x68]
cmp ecx, eax
je 0x40f810
push 0xffffffffffffffff
push 0
push eax
call fcn.00405380
lea ecx, [ebp - 0x98]
call fcn.00404d70
nop dword [eax + eax]
cmp dword [ebp - 0x40], 0
je 0x40f9ea
push edi
lea ecx, [ebp - 0x20]
call fcn.00404e80
lea eax, [ebp - 0x50]
push eax
lea ecx, [ebp - 0x68]
call fcn.00412230
test al, al
je 0x40f85b
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x50]
push eax
lea ecx, [ebp - 0x68]
call fcn.00412510
test al, al
je 0x40fa0d
cmp byte [ebp - 0x34c], 0
je 0x40f8b0
cmp dword [ebp - 0xc], 8
lea eax, [ebp - 0x20]
cmovae eax, dword [ebp - 0x20]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40f886
shr eax, 4
and al, 1
jne 0x40f93d
cmp dword [ebp - 0xc], 8
lea eax, [ebp - 0x20]
push 0
cmovae eax, dword [ebp - 0x20]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x40f93d
test bl, 4
je 0x40f936
and ebx, 0xfffffffb
jmp 0x40f92b
lea ecx, [ebp - 0x50]
call fcn.00413000
test al, al
jne 0x40f91d
lea ecx, [ebp - 0x20]
call fcn.00413000
test al, al
jne 0x40f91d
cmp dword [ebp - 0x40], 0x104
jae 0x40f91d
cmp dword [ebp - 0x10], 0x104
jae 0x40f91d
cmp dword [ebp - 0xc], 8
lea esi, [ebp - 0x20]
push 0
cmovae esi, dword [ebp - 0x20]
lea eax, [ebp - 0x50]
cmp dword [ebp - 0x3c], 8
push esi
cmovae eax, dword [ebp - 0x50]
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
je 0x40f91d
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40f91d
test al, 1
je 0x40f919
and eax, 0xfffffffe
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov al, 1
jmp 0x40f91f
xor al, al
test al, al
jne 0x40f93d
test bl, 8
je 0x40f936
and ebx, 0xfffffff7
lea ecx, [ebp - 0x404]
call fcn.0041a040
mov byte [ebp - 0x345], 0
lea eax, [ebp - 0x98]
push eax
lea ecx, [ebp - 0x344]
call fcn.0041ad90
lea ecx, [ebp - 0x50]
cmp ecx, eax
je 0x40f960
push 0xffffffffffffffff
push 0
push eax
call fcn.00405380
lea ecx, [ebp - 0x98]
call fcn.00404d70
cmp dword [ebp - 0x40], 0
je 0x40f9d5
cmp byte [ebp - 0x344], 0
jne 0x40f9ab
test bl, 0x10
je 0x40f98d
lea ecx, [ebp - 0x404]
and ebx, 0xffffffef
call fcn.0041a040
push 0x250
lea eax, [ebp - 0x654]
push 0
push eax
call fcn.004991f0
mov eax, dword [ebp - 0x654]
add esp, 0xc
jmp 0x40f9ca
mov eax, dword [ebp - 0x340]
lea esi, [ebp - 0x340]
mov ecx, 0x94
lea edi, [ebp - 0x654]
rep movsd dword es:[edi], dword [esi]
mov edi, dword [ebp - 0x350]
shr eax, 4
and al, 1
mov dword [ebp - 0x34c], eax
lea ecx, [ebp - 0x20]
call fcn.00404d70
cmp byte [ebp - 0x345], 0
jne 0x40f820
mov bl, byte [ebp - 0x345]
lea ecx, [ebp - 0x68]
call fcn.00404d70
lea ecx, [ebp - 0x50]
call fcn.00404d70
lea ecx, [ebp - 0x344]
call fcn.0041ad30
jmp 0x40fa1b
lea ecx, [ebp - 0x20]
xor bl, bl
call fcn.00404d70
jmp 0x40f9f0
xor bl, bl
lea ecx, [ebp - 0x80]
call fcn.00404d70
lea ecx, [ebp - 0x38]
call fcn.00404d70
mov al, bl
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00493b18
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 8]
xor al, al
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00493b18
mov esp, ebp
pop ebp
ret