Function at 0x402860
Capabilities:
Check if file exists
Get file attributes

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x40fa81
push eax
mov eax, dword [esp + 0x10]
mov dword fs:[0], esp
sub esp, 0x158
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x402ae9
test al, 0x10
je 0x402ae9
mov eax, dword [esp + 0x16c]
push ebx
push ebp
push esi
mov esi, dword [esp + 0x17c]
push edi
test eax, eax
je 0x4028c4
test esi, esi
je 0x4028c4
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
test eax, eax
mov dword [esp + 0x24], 2
jne 0x4028cc
mov dword [esp + 0x24], 1
mov edi, dword [esp + 0x184]
push 0
push edi
mov byte [esp + 0x1b], 1
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
sete bl
xor ebp, ebp
test bl, bl
mov dword [esp + 0x1c], ebp
jne 0x402abb
jmp 0x4028fa
mov ebp, dword [esp + 0x1c]
cmp ebp, dword [esp + 0x24]
jge 0x402ad6
mov ecx, dword [esp + 0x178]
push ecx
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CString::CString_2
push esi
lea ecx, [esp + 0x24]
mov dword [esp + 0x174], 0
call sub.MFC42.DLL_CString::CString_2
mov edx, dword [esp + 0x20]
mov byte [esp + 0x170], 1
mov eax, dword [edx - 8]
test eax, eax
je 0x402942
cmp ebp, 1
jne 0x402950
push 0x415a14
lea ecx, [esp + 0x24]
call fcn.0040eef8
lea eax, [esp + 0x18]
push eax
call fcn.00402700
add esp, 4
lea ecx, [esp + 0x20]
push ecx
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CString::operator
mov eax, dword [esp + 0x18]
lea edx, [esp + 0x28]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
mov ebp, eax
cmp ebp, 0xffffffff
je 0x402a85
mov ebx, dword [esp + 0x188]
test ebx, ebx
je 0x402996
call fcn.00402690
cmp byte [esp + 0x54], 0x2e
je 0x402a50
mov ecx, dword [esp + 0x178]
push ecx
lea ecx, [esp + 0x18]
call sub.MFC42.DLL_CString::CString_2
push 0x415a10
lea ecx, [esp + 0x18]
mov byte [esp + 0x174], 2
call fcn.0040eeec
lea edx, [esp + 0x54]
lea ecx, [esp + 0x14]
push edx
call fcn.0040eeec
test byte [esp + 0x28], 0x10
je 0x402a2c
mov eax, dword [esp + 0x17c]
test eax, eax
je 0x402a3f
mov ecx, dword [esp + 0x1c]
mov eax, 1
cmp ecx, eax
je 0x4029fb
cmp dword [esp + 0x24], eax
jne 0x402a3f
push ebx
push edi
push esi
push eax
mov eax, dword [esp + 0x24]
push eax
call fcn.00402860
add esp, 0x14
test al, al
je 0x402a3f
test esi, esi
je 0x402a1f
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
test eax, eax
jne 0x402a3f
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryA]
jmp 0x402a37
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
cmp eax, 1
sete byte [esp + 0x13]
lea ecx, [esp + 0x14]
mov byte [esp + 0x170], 1
call sub.MFC42.DLL_CString::CString
push 0
push edi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
sete bl
test bl, bl
jne 0x402a7e
mov al, byte [esp + 0x13]
test al, al
je 0x402a7e
lea eax, [esp + 0x28]
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_FindNextFileA]
test eax, eax
jne 0x402986
push ebp
call dword [sym.imp.KERNEL32.dll_FindClose]
lea ecx, [esp + 0x20]
mov byte [esp + 0x170], 0
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x18]
mov dword [esp + 0x170], 0xffffffff
call sub.MFC42.DLL_CString::CString
mov ecx, dword [esp + 0x1c]
inc ecx
test bl, bl
mov dword [esp + 0x1c], ecx
je 0x4028f6
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x158]
mov dword fs:[0], ecx
add esp, 0x164
ret
test bl, bl
jne 0x402abb
mov al, byte [esp + 0x13]
test al, al
je 0x402abb
mov eax, 1
jmp 0x402abd
mov ecx, dword [esp + 0x158]
xor al, al
mov dword fs:[0], ecx
add esp, 0x164
ret