Function at 0x405e10
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, eax
push edi
push esi
mov esi, 0x400
push ebx
mov ebx, edx
sub esp, 0x42c
mov eax, dword [0x458020]
mov dword [esp + 0x41c], eax
xor eax, eax
lea edi, [esp + 0x1c]
test edx, edx
jne 0x405b34
jmp 0x405b75
sub ebx, eax
je 0x405b75
cmp ebx, 0x400
mov eax, esi
mov dword [esp + 0xc], ebp
cmovbe eax, ebx
mov dword [esp + 4], 1
mov dword [esp], edi
mov dword [esp + 8], eax
call sub.msvcrt.dll_fread
test eax, eax
jne 0x405b30
mov edx, dword [esp + 0x41c]
xor edx, dword [0x458020]
jne 0x405b7c
add esp, 0x42c
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, 1
jmp 0x405b5b
call fcn.00442960
jmp 0x405b90
sub esp, 0x2c
mov eax, dword [0x458020]
mov dword [esp + 0x1c], eax
xor eax, eax
mov dword [esp + 0x24], ebx
xor ebx, ebx
cmp dword [esp + 0x34], 0xb
mov dword [esp + 0x28], esi
mov esi, dword [esp + 0x30]
jle 0x405bf1
mov dword [esp + 8], 4
mov dword [esp + 4], str.RIFF
mov dword [esp], esi
call sub.msvcrt.dll_memcmp
test eax, eax
jne 0x405bf1
add esi, 8
mov dword [esp + 8], 4
xor ebx, ebx
mov dword [esp + 4], str.WAVE
mov dword [esp], esi
call sub.msvcrt.dll_memcmp
test eax, eax
sete bl
mov edx, dword [esp + 0x1c]
xor edx, dword [0x458020]
mov eax, ebx
jne 0x405c0b
mov ebx, dword [esp + 0x24]
mov esi, dword [esp + 0x28]
add esp, 0x2c
ret
call fcn.00442960
sub esp, 0x2c
mov eax, dword [0x458020]
mov dword [esp + 0x1c], eax
xor eax, eax
mov dword [esp + 0x24], ebx
xor ebx, ebx
cmp dword [esp + 0x34], 0xb
mov dword [esp + 0x28], esi
mov esi, dword [esp + 0x30]
jle 0x405c84
mov dword [esp + 8], 4
mov dword [esp + 4], str.FORM
mov dword [esp], esi
call sub.msvcrt.dll_memcmp
test eax, eax
jne 0x405c84
lea eax, [esi + 8]
mov dword [esp + 8], 3
mov dword [esp + 4], 0x45190c
mov dword [esp], eax
call sub.msvcrt.dll_memcmp
test eax, eax
jne 0x405c84
movzx eax, byte [esi + 0xb]
cmp al, 0x46
setne bl
cmp al, 0x43
setne al
and ebx, eax
xor ebx, 1
movzx ebx, bl
mov edx, dword [esp + 0x1c]
xor edx, dword [0x458020]
mov eax, ebx
jne 0x405c9e
mov ebx, dword [esp + 0x24]
mov esi, dword [esp + 0x28]
add esp, 0x2c
ret
call fcn.00442960
lea esi, [esi]
lea edi, [edi]
push ebp
push edi
mov edi, ecx
push esi
mov esi, eax
push ebx
sub esp, 0x3c
mov eax, dword [0x458020]
mov dword [esp + 0x2c], eax
xor eax, eax
mov dword [esp + 0x1c], edx
lea ebx, [esp + 0x20]
jmp 0x405d68
mov edx, dword [esp + 0x1c]
mov dword [esp + 8], 4
mov dword [esp], ebx
mov dword [esp + 4], edx
call sub.msvcrt.dll_memcmp
test eax, eax
je 0x405dd0
movzx ebp, byte [esp + 0x27]
mov dword [esp + 8], 1
movzx eax, byte [esp + 0x26]
mov dword [esp], esi
shl ebp, 0x18
shl eax, 0x10
or ebp, eax
movzx eax, byte [esp + 0x24]
or ebp, eax
movzx eax, byte [esp + 0x25]
shl eax, 8
or ebp, eax
mov dword [edi], ebp
mov dword [esp + 4], ebp
call sub.msvcrt.dll_fseek
test eax, eax
je 0x405d41
mov edx, ebp
mov eax, esi
call fcn.00405b00
test eax, eax
je 0x405e00
mov eax, dword [edi]
mov dword [esp + 8], ebx
mov dword [esp + 4], str.Skipping_chunk_of_type___s___length__d_n
mov byte [esp + 0x24], 0
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov dword [esp + 0xc], esi
mov dword [esp + 8], 8
mov dword [esp + 4], 1
mov dword [esp], ebx
call sub.msvcrt.dll_fread
cmp eax, 7
ja 0x405cd3
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x2e
mov dword [esp + 4], 1
mov dword [esp], str.Warning:_Unexpected_EOF_in_reading_WAV_header_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
xor eax, eax
mov edx, dword [esp + 0x2c]
xor edx, dword [0x458020]
jne 0x405e04
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret
movzx eax, byte [esp + 0x27]
movzx edx, byte [esp + 0x26]
shl eax, 0x18
shl edx, 0x10
or eax, edx
movzx edx, byte [esp + 0x24]
or eax, edx
movzx edx, byte [esp + 0x25]
shl edx, 8
or eax, edx
mov dword [edi], eax
mov eax, 1
jmp 0x405db7
xor eax, eax
jmp 0x405db7
call fcn.00442960
lea esi, [esi]
sub esp, 0xbc
mov edx, str.fmt
mov dword [esp + 0xac], ebx
mov ebx, dword [esp + 0xc0]
lea ecx, [esp + 0x60]
mov dword [esp + 0xb0], esi
mov esi, dword [esp + 0xc4]
mov dword [esp + 0xb4], edi
mov edi, dword [0x458020]
mov dword [esp + 0x9c], edi
xor edi, edi
mov dword [esp + 0xb8], ebp
mov eax, ebx
mov dword [esp + 0x1c], esi
call 0x405cb0
test eax, eax
je 0x406170
mov eax, dword [esp + 0x60]
cmp eax, 0xf
jbe 0x406230
mov edx, eax
and edx, 0xfffffffd
cmp edx, 0x10
je 0x405eb3
cmp eax, 0x28
je 0x405ec5
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x56
mov dword [esp + 4], 1
mov dword [esp], str.Warning:_INVALID_format_chunk_in_wav_header._n_Trying_to_read_anyway__may_not_work_..._n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov eax, dword [esp + 0x60]
cmp eax, 0x28
jbe 0x405ec5
mov dword [esp + 0x60], 0x28
mov eax, 0x28
mov dword [esp + 8], eax
lea eax, [esp + 0x70]
mov dword [esp + 0xc], ebx
mov dword [esp + 4], 1
mov dword [esp], eax
call sub.msvcrt.dll_fread
mov edx, dword [esp + 0x60]
cmp eax, edx
jb 0x406290
movzx eax, byte [esp + 0x71]
movzx esi, byte [esp + 0x70]
movzx ecx, byte [esp + 0x72]
movzx edi, byte [esp + 0x7f]
shl eax, 8
movzx ebp, byte [esp + 0x7e]
or esi, eax
movzx eax, byte [esp + 0x73]
mov byte [esp + 0x57], cl
movzx ecx, byte [esp + 0x76]
cmp si, 0xfffe
mov byte [esp + 0x50], al
movzx eax, byte [esp + 0x77]
mov byte [esp + 0x5d], cl
movzx ecx, byte [esp + 0x74]
mov byte [esp + 0x40], al
movzx eax, byte [esp + 0x75]
mov byte [esp + 0x5f], cl
movzx ecx, byte [esp + 0x7c]
mov byte [esp + 0x5e], al
movzx eax, byte [esp + 0x7d]
mov byte [esp + 0x5c], cl
mov byte [esp + 0x30], al
je 0x4061b0
lea ecx, [esp + 0x60]
mov edx, str.data
mov eax, ebx
call 0x405cb0
test eax, eax
je 0x406170
mov edx, edi
and bp, 0xff
shl edx, 8
or edx, ebp
cmp si, 1
je 0x406260
cmp si, 3
jne 0x4062c0
mov edi, dword [esp + 0x1c]
mov dword [esp + 0x58], 0x20
mov eax, 4
mov dword [edi], 0x4054a0
movzx ecx, byte [esp + 0x50]
movzx ebp, byte [esp + 0x57]
shl ecx, 8
or ecx, ebp
movzx ebp, byte [esp + 0x5c]
movsx edi, cx
imul eax, edi
mov dword [esp + 0x50], eax
movzx eax, byte [esp + 0x30]
shl eax, 8
or eax, ebp
cwde
cmp eax, dword [esp + 0x50]
je 0x40600e
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x6f
mov dword [esp + 4], 1
mov dword [esp], str.Warning:_WAV_block_alignment_value_is_incorrect__ignoring._nThe_software_that_created_this_file_is_incorrect._n
mov dword [esp + 0x24], edx
add eax, 0x40
mov dword [esp + 0x20], ecx
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x24]
movsx eax, dx
cmp eax, dword [esp + 0x58]
jne 0x406140
mov eax, edx
and eax, 0xfffffff7
cmp ax, 0x10
je 0x406040
cmp dx, 8
je 0x406040
cmp dx, 0x20
jne 0x406140
cmp si, 3
jne 0x406140
movzx eax, byte [esp + 0x40]
movzx esi, byte [esp + 0x5d]
mov ebp, dword [esp + 0x1c]
shl eax, 0x18
shl esi, 0x10
or eax, esi
movzx esi, byte [esp + 0x5f]
mov dword [ebp + 0x14], edi
or eax, esi
movzx esi, byte [esp + 0x5e]
shl esi, 8
or eax, esi
mov dword [ebp + 0x18], eax
mov dword [esp], 0x28
mov dword [esp + 0x24], edx
mov dword [esp + 0x20], ecx
call sub.msvcrt.dll_malloc
mov edx, dword [esp + 0x24]
mov ecx, dword [esp + 0x20]
mov ebp, eax
mov dword [eax + 0x18], ebx
mov dword [eax + 0x10], 0
mov dword [eax + 0x14], 0
mov word [eax + 2], dx
mov edx, dword [esp + 0x50]
mov word [eax + 0x1c], 0
mov word [eax], cx
mov eax, dword [esp + 0x60]
shl edx, 2
cmp edx, eax
jae 0x406390
cmp eax, 0x7ffeffff
ja 0x406390
mov ebx, dword [esp + 0x1c]
cmp dword [ebx + 0x28], 1
je 0x4063ca
xor edx, edx
mov esi, dword [esp + 0x1c]
div dword [esp + 0x50]
xor edx, edx
mov dword [ebx + 0xc], edx
mov dword [ebx + 8], eax
mov esi, esi
lea edi, [edi]
lea ebx, [edi*4]
mov dword [ebp + 8], eax
mov dword [ebp + 0xc], edx
mov dword [esi + 4], ebp
mov dword [esp], ebx
mov dword [esp + 0x20], ecx
call sub.msvcrt.dll_malloc
mov ecx, dword [esp + 0x20]
mov dword [ebp + 0x20], eax
cmp cx, 8
jle 0x4064ab
xor edx, edx
test edi, edi
mov ecx, edi
jle 0x40612f
mov dword [eax + edx*4], edx
add edx, 1
cmp edx, ecx
jne 0x406125
mov eax, 1
jmp 0x406172
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x5c
mov dword [esp + 4], 1
mov dword [esp], str.ERROR:_Wav_file_is_unsupported_subformat__must_be_8_16__or_24_bit_PCM_nor_floating_point_PCM_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
nop
lea esi, [esi]
xor eax, eax
mov edi, dword [esp + 0x9c]
xor edi, dword [0x458020]
jne 0x40659e
mov ebx, dword [esp + 0xac]
mov esi, dword [esp + 0xb0]
mov edi, dword [esp + 0xb4]
mov ebp, dword [esp + 0xb8]
add esp, 0xbc
ret
cmp edx, 0x27
jbe 0x406361
movzx eax, byte [esp + 0x87]
movzx edx, byte [esp + 0x86]
shl eax, 0x18
shl edx, 0x10
or eax, edx
movzx edx, byte [esp + 0x84]
or eax, edx
movzx edx, byte [esp + 0x85]
shl edx, 8
or eax, edx
cmp eax, 0x3f
je 0x406210
ja 0x4062f0
cmp eax, 3
je 0x406210
nop
lea esi, [esi]
ja 0x40648f
cmp eax, 1
ja 0x406313
nop
movzx eax, byte [esp + 0x89]
movzx esi, byte [esp + 0x88]
shl eax, 8
or esi, eax
jmp 0x405f58
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x31
mov dword [esp + 4], 1
mov dword [esp], str.Warning:_Unrecognised_format_chunk_in_WAV_header_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
xor eax, eax
jmp 0x406172
lea eax, [edx + 7]
test dx, dx
mov edi, dword [esp + 0x1c]
cmovns eax, edx
sar ax, 3
cwde
mov dword [edi], 0x405670
lea ebp, [eax*8]
mov dword [esp + 0x58], ebp
jmp 0x405fa7
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x2e
mov dword [esp + 4], 1
mov dword [esp], str.Warning:_Unexpected_EOF_in_reading_WAV_header_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
xor eax, eax
jmp 0x406172
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x58
mov dword [esp + 4], 1
mov dword [esp], str.ERROR:_Wav_file_is_unsupported_type__must_be_standard_PCM_n_or_type_3_floating_point_PCM_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
xor eax, eax
jmp 0x406172
cmp eax, 0x603
je 0x406334
ja 0x406441
cmp eax, 0xff
je 0x406414
cmp eax, 0x13f
je 0x4063e7
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 4], str.WARNING:_Unknown_WAV_surround_channel_mask:__d_nblindly_mapping_speakers_using_default_SMPTE_ITU_ordering._n
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
jmp 0x406210
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x74
mov dword [esp + 4], 1
mov dword [esp], str.WARNING:_WAV_file_uses_side_surround_instead_of_rear_for_quadraphonic__nremapping_side_speakers_to_rear_in_encoding._n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
jmp 0x406210
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x36
mov dword [esp + 4], 1
mov dword [esp], str.ERROR:_Extended_WAV_format_header_invalid__too_small__n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
xor eax, eax
jmp 0x406172
mov esi, dword [esp + 0x1c]
cmp dword [esi + 0x28], 1
je 0x4063ca
mov dword [esp], ebx
call sub.msvcrt.dll__fileno
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__get_osfhandle]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetFileType]
and ah, 0x7f
sub esp, 4
cmp eax, 1
je 0x4064c9
movzx ecx, word [ebp]
movsx edi, cx
mov ebx, dword [esp + 0x1c]
xor eax, eax
xor edx, edx
mov dword [ebx + 8], 0
mov esi, ebx
mov dword [ebx + 0xc], 0
jmp 0x4060f0
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x6b
mov dword [esp + 4], 1
mov dword [esp], str.WARNING:_WAV_file_uses_rear_surround_instead_of_side_for_6.1__nremapping_rear_speakers_to_side_in_encoding._n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
jmp 0x406210
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x62
mov dword [esp + 4], 1
mov dword [esp], str.WARNING:_WAV_file_is_a_7.1_Widescreen_channel_mapping__nremapping_speakers_to_Vorbis_7.1_format._n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
jmp 0x406210
cmp eax, 0x63f
je 0x406210
cmp eax, 0x70f
je 0x406210
cmp eax, 0x60f
jne 0x406313
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x6b
mov dword [esp + 4], 1
mov dword [esp], str.WARNING:_WAV_file_uses_side_surround_instead_of_rear_for_5.1__nremapping_side_speakers_to_rear_in_encoding._n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
jmp 0x406210
cmp eax, 0x33
je 0x406210
cmp eax, 0x37
nop
lea esi, [esi]
jne 0x406313
jmp 0x406210
shl edi, 5
mov dword [esp + 8], ebx
lea edx, [edi + str.OpusHead]
mov dword [esp], eax
mov dword [esp + 4], edx
call sub.msvcrt.dll_memcpy
jmp 0x40612f
mov dword [esp], ebx
call sub.msvcrt.dll_ftell
mov dword [esp + 8], 2
mov dword [esp + 4], 0
mov dword [esp], ebx
mov dword [esp + 0x58], eax
call sub.msvcrt.dll_fseek
cmp eax, 0xffffffff
jne 0x406514
mov esi, dword [esp + 0x1c]
xor eax, eax
xor edx, edx
movzx ecx, word [ebp]
mov dword [esi + 8], 0
mov dword [esi + 0xc], 0
movsx edi, cx
jmp 0x4060f0
mov eax, dword [esp + 0x58]
mov dword [esp], ebx
mov edx, eax
mov dword [esp + 0x28], eax
sar edx, 0x1f
mov dword [esp + 0x2c], edx
call fcn.00444bd0
cmp dword [esp + 0x2c], edx
jg 0x4065a3
jl 0x40653b
cmp dword [esp + 0x58], eax
jae 0x4065a3
mov esi, eax
mov eax, dword [esp + 0x50]
mov edi, edx
sub esi, dword [esp + 0x28]
mov edx, eax
mov dword [esp + 8], eax
sbb edi, dword [esp + 0x2c]
sar edx, 0x1f
mov dword [esp], esi
mov dword [esp + 0xc], edx
mov dword [esp + 4], edi
call fcn.00443b40
mov esi, dword [esp + 0x1c]
mov dword [esi + 8], eax
mov eax, dword [esp + 0x58]
mov dword [esi + 0xc], edx
mov dword [esp], ebx
mov dword [esp + 8], 0
mov dword [esp + 4], eax
call sub.msvcrt.dll_fseek
mov ebx, dword [esp + 0x1c]
movzx ecx, word [ebp]
mov eax, dword [ebx + 8]
mov esi, ebx
mov edx, dword [ebx + 0xc]
movsx edi, cx
jmp 0x4060f0
call fcn.00442960
xor eax, eax
xor edx, edx
jmp 0x406564