Function at 0x401c40
Capabilities:
Write file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x4c
mov eax, dword [esp + 0x6c]
mov esi, dword [esp + 0x60]
mov ebx, dword [esp + 0x64]
sub eax, 3
cmp eax, 5
ja 0x401c66
cmp dword [esp + 0x68], 1
je 0x401df8
mov dword [esp + 4], str.RIFF
mov dword [esp], esi
call sub.msvcrt.dll_fprintf
mov edx, esi
mov ebp, eax
mov eax, 0x7fffffff
call fcn.00401b80
not ebp
shr ebp, 0x1f
mov dword [esp + 4], str.WAVEfmt
mov dword [esp], esi
and ebp, eax
call sub.msvcrt.dll_fprintf
mov edx, esi
not eax
shr eax, 0x1f
and ebp, eax
mov eax, 0x10
call fcn.00401b80
xor edx, edx
mov dword [esp + 0x2c], 0
and ebp, eax
mov eax, 1
lea edi, [esp + 0x3e]
mov dword [esp + 0xc], esi
mov dword [esp + 8], 1
mov dword [esp + 4], 2
mov dword [esp], edi
mov byte [esp + 0x3f], dl
mov byte [esp + 0x3e], al
call sub.msvcrt.dll_fwrite
movzx ecx, byte [esp + 0x6c]
mov dword [esp + 0xc], esi
mov dword [esp + 8], 1
mov dword [esp + 4], 2
mov dword [esp], edi
mov byte [esp + 0x3e], cl
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x6c]
sar eax, 8
mov byte [esp + 0x3f], al
call sub.msvcrt.dll_fwrite
mov edx, esi
mov dword [esp + 0x24], eax
mov eax, ebx
call fcn.00401b80
mov edx, dword [esp + 0x6c]
lea ecx, [edx + edx]
mov edx, esi
imul ebx, ecx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x28], ecx
mov eax, ebx
call fcn.00401b80
mov ecx, dword [esp + 0x28]
mov dword [esp + 0xc], esi
mov dword [esp + 8], 1
mov dword [esp + 4], 2
mov byte [esp + 0x3e], cl
sar ecx, 8
mov dword [esp], edi
mov ebx, eax
mov byte [esp + 0x3f], cl
call sub.msvcrt.dll_fwrite
mov dword [esp + 0xc], esi
mov dword [esp + 8], 1
mov dword [esp + 4], 2
mov dword [esp], edi
mov byte [esp + 0x3e], 0x10
mov dword [esp + 0x28], eax
mov byte [esp + 0x3f], 0
call sub.msvcrt.dll_fwrite
and ebx, dword [esp + 0x1c]
and ebx, dword [esp + 0x20]
and ebx, dword [esp + 0x24]
and ebx, dword [esp + 0x28]
and ebx, eax
mov eax, dword [esp + 0x2c]
and ebx, ebp
test eax, eax
jne 0x401e60
mov dword [esp + 4], str.data
mov dword [esp], esi
call sub.msvcrt.dll_fprintf
mov edx, esi
mov edi, eax
mov eax, 0x7fffffff
call fcn.00401b80
not edi
shr edi, 0x1f
and edi, ebx
mov edx, eax
mov eax, 0x10
test edi, edx
je 0x401f22
nop
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 4], str.RIFF
mov dword [esp], esi
call sub.msvcrt.dll_fprintf
mov edx, esi
mov ebp, eax
mov eax, 0x7fffffff
call fcn.00401b80
not ebp
shr ebp, 0x1f
mov dword [esp + 4], str.WAVEfmt
mov dword [esp], esi
and ebp, eax
call sub.msvcrt.dll_fprintf
mov edx, esi
not eax
shr eax, 0x1f
and ebp, eax
mov eax, 0x28
call fcn.00401b80
mov edx, 0xffffffff
mov dword [esp + 0x2c], 1
and ebp, eax
mov eax, 0xfffffffe
jmp 0x401cbf
mov dword [esp], edi
mov dword [esp + 0xc], esi
mov dword [esp + 8], 1
mov dword [esp + 4], 2
mov byte [esp + 0x3e], 0x16
mov byte [esp + 0x3f], 0
call sub.msvcrt.dll_fwrite
mov dword [esp], edi
mov dword [esp + 0xc], esi
mov dword [esp + 8], 1
mov dword [esp + 4], 2
mov byte [esp + 0x3e], 0x10
mov ebp, eax
mov byte [esp + 0x3f], 0
call sub.msvcrt.dll_fwrite
mov edi, dword [esp + 0x6c]
mov edx, esi
mov dword [esp + 0x1c], eax
mov eax, dword [edi*4 + 0x42319c]
call fcn.00401b80
mov dword [esp + 0xc], esi
mov dword [esp + 8], 1
mov dword [esp + 4], 0x10
mov dword [esp], 0x423173
mov edi, eax
call sub.msvcrt.dll_fwrite
mov dword [esp + 4], str.data
mov dword [esp], esi
and edi, eax
and edi, ebx
and edi, ebp
and edi, dword [esp + 0x1c]
call sub.msvcrt.dll_fprintf
mov edx, esi
not eax
shr eax, 0x1f
and edi, eax
mov eax, 0x7fffffff
call fcn.00401b80
mov edx, eax
mov eax, 0x28
test edi, edx
jne 0x401df0
mov eax, 0xffffffff
jmp 0x401df0