Function at 0x402740
Capabilities:
Delete file
Write file on windows

Disassembly:
sub esp, 0x138
push ebx
mov ebx, ecx
push ebp
push esi
mov eax, dword [ebx + 0x138]
push edi
mov edi, dword [sym.imp.MSVCRT.dll_sprintf]
push eax
lea ecx, [esp + 0xe8]
push str._s.temp
push ecx
call edi
mov eax, dword [ebx + 0x13c]
mov esi, dword [sym.imp.MSVCRT.dll_fopen]
push 0x408068
push eax
call esi
mov ebp, eax
add esp, 0x14
test ebp, ebp
jne 0x40278d
mov edx, dword [ebx + 0x13c]
jmp 0x4027ac
mov eax, dword [ebx + 0x138]
push 0x408068
push eax
call esi
add esp, 8
mov dword [esp + 0x10], eax
test eax, eax
jne 0x4027d7
mov edx, dword [ebx + 0x138]
push edx
lea eax, [esp + 0x20]
push 0x4081c8
push eax
call edi
add esp, 0xc
lea ecx, [esp + 0x1c]
push 0
push 0
push ecx
call sub.MFC42.DLL_AfxMessageBox
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x138
ret
lea edx, [esp + 0xe4]
push 0x4081c4
push edx
call esi
add esp, 8
mov dword [esp + 0x14], eax
test eax, eax
jne 0x402823
lea eax, [esp + 0xe4]
lea ecx, [esp + 0x1c]
push eax
push 0x4081c8
push ecx
call edi
add esp, 0xc
lea edx, [esp + 0x1c]
push 0
push 0
push edx
call sub.MFC42.DLL_AfxMessageBox
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x138
ret
lea eax, [ebx + 0x134]
push 0x4081ac
push eax
call sub.MFC42.DLL_CString::Format
add esp, 8
mov ecx, ebx
push 0
call sub.MFC42.DLL_CWnd::UpdateData
mov ecx, 0x19
xor eax, eax
lea edi, [esp + 0x1c]
rep stosd dword es:[edi], eax
mov edi, dword [esp + 0x10]
test byte [edi + 0xc], 0x10
jne 0x4029e0
lea eax, [esp + 0x1c]
push eax
push 0x4080ac
push edi
call dword [sym.imp.MSVCRT.dll_fscanf]
mov al, byte [edi + 0xc]
add esp, 0xc
test al, 0x10
jne 0x4029e0
lea ecx, [esp + 0x1c]
push str..wav
push ecx
call dword [sym.imp.MSVCRT.dll_strstr]
add esp, 8
test eax, eax
jne 0x402a6a
mov ecx, 0x19
lea edi, [esp + 0x80]
push eax
push eax
rep stosd dword es:[edi], eax
push ebp
mov dword [esp + 0x24], eax
call dword [sym.imp.MSVCRT.dll_fseek]
mov al, byte [ebp + 0xc]
add esp, 0xc
test al, 0x10
jne 0x402918
lea edx, [esp + 0x80]
push edx
push 0x4080ac
push ebp
call dword [sym.imp.MSVCRT.dll_fscanf]
mov al, byte [ebp + 0xc]
add esp, 0xc
test al, 0x10
jne 0x402918
lea esi, [esp + 0x80]
lea eax, [esp + 0x1c]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x402907
test cl, cl
je 0x402903
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x402907
add eax, 2
add esi, 2
test cl, cl
jne 0x4028e3
xor eax, eax
jmp 0x40290c
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x4028ba
mov dword [esp + 0x18], 1
mov ecx, dword [esp + 0x10]
lea eax, [esp + 0x1c]
push eax
push 0x4080ac
push ecx
call dword [sym.imp.MSVCRT.dll_fscanf]
mov eax, dword [esp + 0x24]
add esp, 0xc
test eax, eax
je 0x4029d0
mov esi, dword [sym.imp.MSVCRT.dll_strstr]
lea edx, [esp + 0x1c]
push str..wav
push edx
call esi
add esp, 8
test eax, eax
je 0x4029d0
lea eax, [esp + 0x80]
push 0x4081a8
push eax
call esi
add esp, 8
test eax, eax
jne 0x4029d0
mov ecx, dword [esp + 0x14]
lea edi, [esp + 0x80]
push ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov esi, dword [sym.imp.MSVCRT.dll_fwrite]
push 1
not ecx
dec ecx
lea edx, [esp + 0x88]
push ecx
push edx
call esi
lea eax, [esp + 0x2c]
lea ecx, [esp + 0x90]
push eax
push str._t_s_n
push ecx
call dword [sym.imp.MSVCRT.dll_sprintf]
lea edi, [esp + 0x9c]
or ecx, 0xffffffff
xor eax, eax
mov edx, dword [esp + 0x30]
repne scasb al, byte es:[edi]
not ecx
push edx
dec ecx
push 1
lea eax, [esp + 0xa4]
push ecx
push eax
call esi
add esp, 0x2c
mov ecx, dword [esp + 0x10]
mov edi, ecx
test byte [ecx + 0xc], 0x10
je 0x40285b
mov eax, dword [esp + 0x14]
mov esi, dword [sym.imp.MSVCRT.dll_fclose]
push eax
call esi
push edi
call esi
push ebp
call esi
mov ecx, dword [ebx + 0x138]
lea edx, [esp + 0x28]
push ecx
push str._s.bak
push edx
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0x18
lea eax, [esp + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov edx, dword [ebx + 0x138]
lea ecx, [esp + 0x1c]
push ecx
push edx
call sub.MFC42.DLL_CFile::Rename
mov eax, dword [ebx + 0x138]
lea ecx, [esp + 0xe4]
push eax
push ecx
call sub.MFC42.DLL_CFile::Rename
lea eax, [ebx + 0x134]
push 0x40818c
push eax
call sub.MFC42.DLL_CString::Format
add esp, 8
mov ecx, ebx
push 0
call sub.MFC42.DLL_CWnd::UpdateData
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x138
ret
push 0
push 0
push 0x408160
call sub.MFC42.DLL_AfxMessageBox
mov edx, dword [esp + 0x14]
mov esi, dword [sym.imp.MSVCRT.dll_fclose]
push edx
call esi
push edi
call esi
push ebp
call esi
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x138
ret