Function at 0x405457
Capabilities:
Check if file exists
Delete file
Get file attributes
Read file on windows
Write file on windows

Disassembly:
mov eax, 0x407d80
call sub.MSVCRT.dll__EH_prolog
mov eax, 0x1500
call fcn.00407200
push ebx
push esi
push edi
mov esi, ecx
and dword [ebp - 0x18], 0
lea ecx, [ebp - 0x14]
mov dword [ebp - 4], 2
mov byte [ebp - 0xd], 1
call sub.MFC42.DLL_CString::CString_2
lea eax, [ebp - 0x184]
mov byte [ebp - 4], 3
push eax
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
cmp eax, 0xffffffff
je 0x4054dd
mov ecx, dword [ebp - 0x180]
push eax
mov dword [ebp - 0x38], ecx
mov ecx, dword [ebp - 0x17c]
mov dword [ebp - 0x34], ecx
mov ecx, dword [ebp - 0x178]
mov dword [ebp - 0x30], ecx
mov ecx, dword [ebp - 0x174]
mov dword [ebp - 0x2c], ecx
mov ecx, dword [ebp - 0x170]
mov dword [ebp - 0x40], ecx
mov ecx, dword [ebp - 0x16c]
mov dword [ebp - 0x3c], ecx
call dword [sym.imp.KERNEL32.dll_FindClose]
push dword [0x40a03c]
call dword [sym.imp.MSVCRT.dll_malloc]
mov ebx, dword [sym.imp.MSVCRT.dll_fopen]
mov dword [esp], 0x40aa3c
push dword [ebp + 0xc]
mov dword [esi + 0x16c], eax
call ebx
mov edi, eax
pop ecx
test edi, edi
pop ecx
mov dword [ebp - 0x20], edi
je 0x405721
push 0x40aa38
push dword [ebp + 8]
call ebx
pop ecx
mov dword [ebp - 0x1c], eax
test eax, eax
pop ecx
je 0x405721
push 0
push dword [0x40a03c]
push edi
call dword [sym.imp.MSVCRT.dll_fseek]
mov ebx, dword [sym.imp.MSVCRT.dll_fread]
push edi
lea eax, [esi + 0x60]
push 1
push 4
push eax
call ebx
add esp, 0x1c
test eax, eax
je 0x405721
push edi
push 1
lea eax, [ebp - 0x44]
push 4
push eax
call ebx
add esp, 0x10
test eax, eax
je 0x405721
push edi
push dword [0x40a03c]
push 1
push dword [esi + 0x16c]
call ebx
add esp, 0x10
test eax, eax
je 0x4055ed
cmp byte [ebp - 0xd], 0
je 0x4055b1
mov ecx, dword [0x40a030]
lea edi, [ecx + 9]
cmp edi, dword [0x40a03c]
jge 0x4055aa
mov ecx, dword [esi + 0x16c]
add ecx, edi
add edi, 0x1a
mov dl, byte [ecx]
not dl
mov byte [ecx], dl
jmp 0x40558f
and byte [ebp - 0xd], 0
mov edi, dword [ebp - 0x20]
mov edx, dword [ebp - 0x18]
mov ecx, dword [esi + 0x60]
add edx, eax
cmp edx, ecx
jle 0x4055c2
sub ecx, dword [ebp - 0x18]
mov eax, ecx
push dword [ebp - 0x1c]
push eax
push 1
push dword [esi + 0x16c]
call dword [sym.imp.MSVCRT.dll_fwrite]
push edi
add dword [ebp - 0x18], eax
push dword [0x40a03c]
push 1
push dword [esi + 0x16c]
call ebx
add esp, 0x20
jmp 0x40557c
push dword [ebp - 0x1c]
call dword [sym.imp.MSVCRT.dll_fclose]
and dword [ebp - 0x18], 0
pop ecx
push 0
push ecx
mov edi, 0x40b0f0
mov ecx, esp
mov dword [ebp - 0x24], esp
push edi
call sub.MFC42.DLL_CString::CString_1
call fcn.0040162d
pop ecx
mov ecx, esp
mov dword [ebp - 0x24], esp
push edi
call sub.MFC42.DLL_CString::CString_1
mov ecx, esi
call fcn.0040164d
push edi
lea ecx, [ebp - 0x14]
call fcn.004070f8
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x24]
push str.cmd.exe__c_del__F__Q__
push eax
call sub.MFC42.DLL_operator_2
push 0x40a050
push eax
lea eax, [ebp - 0x28]
mov byte [ebp - 4], 4
push eax
call sub.MFC42.DLL_operator_1
push dword [eax]
lea eax, [ebp - 0x150c]
push eax
call sub.MSVCRT.dll_strcpy
pop ecx
pop ecx
lea ecx, [ebp - 0x28]
call sub.MFC42.DLL_CString::CString
lea ecx, [ebp - 0x24]
mov byte [ebp - 4], 3
call sub.MFC42.DLL_CString::CString
xor eax, eax
lea ecx, [ebp - 0x150c]
push eax
push eax
push eax
push ecx
push eax
mov ecx, esi
call fcn.004053c5
test eax, eax
je 0x405697
push edi
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x405733
push 0x40aa38
push edi
call dword [sym.imp.MSVCRT.dll_fopen]
pop ecx
mov dword [ebp - 0x1c], eax
test eax, eax
pop ecx
je 0x405733
mov eax, dword [esi + 0x60]
mov ecx, dword [0x40a03c]
push 0
lea eax, [eax + ecx + 8]
push eax
push dword [ebp - 0x20]
call dword [sym.imp.MSVCRT.dll_fseek]
push dword [ebp - 0x20]
push 4
push 1
push dword [esi + 0x16c]
call ebx
add esp, 0x1c
push dword [ebp - 0x1c]
test eax, eax
je 0x405714
push eax
push 1
push dword [esi + 0x16c]
call dword [sym.imp.MSVCRT.dll_fwrite]
push dword [ebp - 0x20]
add dword [ebp - 0x18], eax
push 4
push 1
push dword [esi + 0x16c]
call ebx
add esp, 0x20
jmp 0x4056e7
call dword [sym.imp.MSVCRT.dll_fclose]
cmp dword [ebp - 0x18], 0
pop ecx
jne 0x405733
push dword [esi + 0x16c]
call dword [sym.imp.MSVCRT.dll_free]
pop ecx
jmp 0x4057fd
push dword [ebp - 0x20]
call dword [sym.imp.MSVCRT.dll_fclose]
push dword [esi + 0x16c]
call dword [sym.imp.MSVCRT.dll_free]
pop ecx
pop ecx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x405795
push ecx
lea eax, [ebp + 0xc]
mov ecx, esp
mov dword [ebp - 0x20], esp
push eax
call fcn.0040711c
push ecx
lea eax, [ebp + 8]
mov ecx, esp
mov dword [ebp - 0x1c], esp
push eax
mov byte [ebp - 4], 5
call fcn.0040711c
mov ecx, esi
mov byte [ebp - 4], 3
call fcn.00402532
xor ebx, ebx
push 1
push ebx
push 1
push ebx
push edi
mov ecx, esi
call fcn.004053c5
jmp 0x405797
xor ebx, ebx
push dword [ebp + 8]
call dword [sym.imp.MSVCRT.dll__unlink]
pop ecx
push ebx
push 0x80
push 3
push ebx
push 3
push 0xc0000000
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
lea eax, [ebp - 0x40]
push eax
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x38]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp + 0x10]
lea eax, [ebp - 0x150c]
push eax
call sub.MSVCRT.dll_strcpy
pop ecx
lea eax, [ebp - 0x150c]
pop ecx
push 1
push ebx
push 1
push eax
push dword [ebp + 0xc]
mov ecx, esi
call fcn.004053c5
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 2
call sub.MFC42.DLL_CString::CString
lea ecx, [ebp + 8]
mov byte [ebp - 4], 1
call sub.MFC42.DLL_CString::CString
and byte [ebp - 4], 0
lea ecx, [ebp + 0xc]
call sub.MFC42.DLL_CString::CString
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp + 0x10]
call sub.MFC42.DLL_CString::CString
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
leave
ret 0xc