Function at 0x4040a7
Capabilities:
Check if file exists
Copy file
Delete file
Get file attributes

Disassembly:
push 0x54
mov eax, 0x40c1bf
call fcn.0040b2b9
mov edi, ecx
mov dword [ebp - 0x48], edi
call sub.mfc90u.dll_AfxGetModuleState
mov eax, dword [eax + 4]
mov dword [ebp - 0x58], eax
xor ecx, ecx
mov eax, edi
mov dword [ebp - 0x40], ecx
mov dword [ebp - 0x54], ecx
call fcn.004054ec
mov ebx, eax
cmp dword [edi + 0xc], ecx
je 0x4042e4
cmp ebx, ecx
je 0x4042e4
mov eax, edi
call fcn.004056dd
cmp eax, 2
jne 0x4042e4
mov eax, edi
call fcn.00405517
mov dword [ebp - 0x50], eax
mov eax, edi
call fcn.004056d5
mov dword [ebp - 0x5c], eax
lea esi, [ebx + 0xd8c]
push esi
lea eax, [ebp - 0x3c]
push eax
call fcn.00401a9c
and dword [ebp - 4], 0
test esi, esi
je 0x404132
push 0x40e650
push esi
call sub.MSVCR90.dll_strcmp
pop ecx
pop ecx
test eax, eax
je 0x404161
lea eax, [ebx + 4]
test eax, eax
jne 0x40413d
test esi, esi
jmp 0x40414c
test esi, esi
je 0x40414e
push esi
push eax
call sub.MSVCR90.dll_strcmp
pop ecx
pop ecx
test eax, eax
je 0x404161
cmp byte [ebp - 0x18], 0
jne 0x40415c
lea esi, [ebp - 0x3c]
call fcn.00401af5
mov edi, dword [ebp - 0x20]
jmp 0x404176
add edi, 0xed0
cmp word [edi], 0
jne 0x404176
mov eax, dword [ebp - 0x50]
mov edi, dword [eax + 0x228]
call fcn.00409ffc
xor esi, esi
mov dword [ebp - 0x50], eax
cmp eax, esi
je 0x40419f
push esi
call fcn.00409fc0
pop ecx
test eax, eax
jne 0x40419f
push 5
mov dword [ebp - 0x40], esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x40427a
mov dword [ebp - 0x4c], esi
mov eax, dword [ebp - 0x48]
lea edx, [ebp - 0x4c]
mov byte [ebp - 4], 1
mov eax, dword [eax + 0xc]
mov ecx, dword [eax]
push edx
push dword [ebx + 0xe98]
push eax
call dword [ecx + 0x6c]
test eax, eax
jne 0x404264
cmp dword [ebp - 0x4c], esi
je 0x404264
push edi
lea ecx, [ebp - 0x44]
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_class]
push 0x5c
lea ecx, [ebp - 0x44]
mov byte [ebp - 4], 2
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::ReverseFind]
push eax
lea eax, [ebp - 0x60]
push eax
lea ecx, [ebp - 0x44]
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::Left]
push eax
lea ecx, [ebp - 0x44]
mov byte [ebp - 4], 3
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::operator_1]
lea ecx, [ebp - 0x60]
mov byte [ebp - 4], 2
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_clas]
push dword [ebp - 0x44]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x40422c
push dword [ebp - 0x44]
mov ecx, dword [ebp - 0x48]
call fcn.004058c8
test eax, eax
je 0x40425b
mov eax, dword [ebp - 0x4c]
mov ecx, dword [eax]
push 1
push 0x40e2d8
push dword [ebx + 0x988]
push eax
call dword [ecx + 0x68]
test eax, eax
jne 0x40425b
push edi
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
push esi
push edi
push dword [ebp - 0x5c]
call dword [sym.imp.KERNEL32.dll_CopyFileW]
mov dword [ebp - 0x40], eax
lea ecx, [ebp - 0x44]
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_clas]
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x4c]
cmp eax, esi
je 0x404275
mov ecx, dword [eax]
push eax
call dword [ecx + 8]
cmp dword [ebp - 0x40], esi
jne 0x40428d
mov eax, dword [ebp - 0x58]
call fcn.00402aee
test eax, eax
jne 0x40428d
mov dword [ebp - 0x54], 1
cmp dword [ebp - 0x50], esi
je 0x40429a
push 1
call fcn.00409fc0
pop ecx
cmp dword [ebp - 0x40], esi
je 0x4042a3
push 6
jmp 0x4042aa
cmp dword [ebp - 0x54], esi
jne 0x4042c4
push 7
mov eax, dword [ebp - 0x48]
pop ecx
call fcn.004056d9
cmp dword [ebp - 0x40], esi
je 0x4042c4
cmp dword [ebp + 8], esi
je 0x4042c4
mov ecx, eax
call fcn.004056e1
or dword [ebp - 4], 0xffffffff
cmp dword [ebp - 0x20], esi
je 0x4042d6
push dword [ebp - 0x20]
call sub.mfc90u.dll_delete__
pop ecx
lea ecx, [ebp - 0x3c]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
mov eax, dword [ebp - 0x40]
jmp 0x4042e6
xor eax, eax
call fcn.0040b33c
ret 4