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

Disassembly:
push ebp
push edi
xor edi, edi
push esi
push ebx
mov ebx, eax
sub esp, 0x3c
mov eax, dword [0x458020]
mov dword [esp + 0x2c], eax
xor eax, eax
mov dword [esp + 0x1c], edx
lea esi, [esp + 0x20]
mov dword [esp + 0x18], ecx
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 8
mov dword [esp + 4], 1
mov dword [esp], esi
call sub.msvcrt.dll_fread
cmp eax, 7
ja 0x406620
test edi, edi
jne 0x4066c4
mov dword [esp + 8], 0
mov di, 1
mov dword [esp + 4], 0xc
mov dword [esp], ebx
call sub.msvcrt.dll_fseek
jmp 0x4065d2
movzx ebp, byte [esp + 0x24]
movzx eax, byte [esp + 0x25]
mov edx, dword [esp + 0x18]
shl ebp, 0x18
shl eax, 0x10
or ebp, eax
movzx eax, byte [esp + 0x27]
or ebp, eax
movzx eax, byte [esp + 0x26]
shl eax, 8
or ebp, eax
mov dword [edx], ebp
mov edx, dword [esp + 0x1c]
mov dword [esp + 8], 4
mov dword [esp], esi
mov dword [esp + 4], edx
call sub.msvcrt.dll_memcmp
test eax, eax
je 0x4066f0
test ebp, 1
je 0x40667a
mov eax, dword [esp + 0x18]
add ebp, 1
mov dword [eax], ebp
mov dword [esp + 8], 1
mov dword [esp + 4], ebp
mov dword [esp], ebx
call sub.msvcrt.dll_fseek
test eax, eax
je 0x4065d2
mov edx, ebp
mov eax, ebx
call fcn.00405b00
test eax, eax
jne 0x4065d2
mov esi, esi
lea edi, [edi]
mov edx, dword [esp + 0x2c]
xor edx, dword [0x458020]
jne 0x4066f7
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x26
mov dword [esp + 4], 1
mov dword [esp], str.Warning:_Unexpected_EOF_in_AIFF_chunk_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
xor eax, eax
jmp 0x4066b0
mov eax, 1
jmp 0x4066b0
call fcn.00442960
lea esi, [esi]
push ebp
mov ebp, esp
push edi
push esi
lea ecx, [ebp - 0x38]
push ebx
sub esp, 0xbc
mov edx, dword [0x458020]
mov dword [ebp - 0x1c], edx
xor edx, edx
mov eax, dword [ebp + 0xc]
mov edx, str.COMM
mov edi, dword [ebp + 8]
mov dword [ebp - 0x54], eax
mov eax, dword [ebp + 0x10]
movzx eax, byte [eax + 0xb]
mov byte [ebp - 0x4a], al
mov eax, edi
call fcn.004065b0
test eax, eax
je 0x4069f3
mov edx, dword [ebp - 0x38]
cmp edx, 0x11
jbe 0x4069b0
lea eax, [edx + 0x1e]
and eax, 0xfffffff0
call fcn.00443b10
sub esp, eax
lea ebx, [esp + 0x27]
mov dword [esp + 0xc], edi
and ebx, 0xfffffff0
mov dword [esp + 8], edx
mov dword [esp + 4], 1
mov dword [esp], ebx
call sub.msvcrt.dll_fread
mov ecx, dword [ebp - 0x38]
cmp eax, ecx
mov dword [ebp - 0x50], ecx
jb 0x406ad0
movzx eax, byte [ebx]
mov esi, 0x7f
movzx ecx, byte [ebx + 2]
movzx edx, byte [ebx + 1]
mov byte [ebp - 0x88], al
movzx eax, byte [ebx + 3]
mov byte [ebp - 0x98], cl
movzx ecx, byte [ebx + 5]
mov byte [ebp - 0x71], dl
movzx edx, byte [ebx + 4]
mov byte [ebp - 0x72], al
movzx eax, byte [ebx + 6]
mov byte [ebp - 0x74], cl
movzx ecx, byte [ebx + 0xb]
mov byte [ebp - 0x73], dl
movzx edx, byte [ebx + 7]
mov byte [ebp - 0x70], al
movzx eax, byte [ebx + 8]
mov byte [ebp - 0x68], cl
movzx ecx, byte [ebx + 0xc]
mov byte [ebp - 0x56], dl
movzx edx, byte [ebx + 9]
and esi, eax
mov byte [ebp - 0x75], cl
movzx ecx, byte [ebx + 0xd]
shl esi, 8
or esi, edx
movzx edx, byte [ebx + 0xa]
cmp esi, 0x7fff
mov byte [ebp - 0x55], cl
je 0x406ab4
movzx eax, byte [ebp - 0x55]
shl edx, 0x18
movzx ecx, byte [ebp - 0x75]
or edx, eax
movzx eax, byte [ebp - 0x68]
shl ecx, 8
shl eax, 0x10
or edx, eax
mov eax, 0x20
or edx, ecx
mov dword [ebp - 0x44], eax
mov dword [ebp - 0xa0], edx
movss xmm0, dword [ebp - 0xa0]
movlps qword [ebp - 0x40], xmm0
fild qword [ebp - 0x40]
movzx eax, byte [ebx + 0xe]
fild dword [ebp - 0x44]
fxch st(1)
movzx edx, byte [ebx + 0xf]
fscale
fstp st(1)
shl eax, 0x18
shl edx, 0x10
or eax, edx
movzx edx, byte [ebx + 0x11]
or eax, edx
movzx edx, byte [ebx + 0x10]
fnstcw word [ebp - 0x46]
shl edx, 8
or eax, edx
mov dword [ebp - 0x44], eax
lea eax, [esi - 0x403e]
fild dword [ebp - 0x44]
mov dword [ebp - 0x44], eax
faddp st(1)
movzx eax, word [ebp - 0x46]
fild dword [ebp - 0x44]
fxch st(1)
mov ah, 0xc
mov word [ebp - 0x48], ax
fscale
fstp st(1)
fldcw word [ebp - 0x48]
fistp dword [ebp - 0x44]
fldcw word [ebp - 0x46]
mov esi, dword [ebp - 0x44]
cmp byte [ebp - 0x4a], 0x43
jne 0x4068cf
cmp dword [ebp - 0x50], 0x15
jbe 0x406b30
lea edx, [ebx + 0x12]
mov dword [esp + 8], 4
mov dword [esp], edx
mov dword [esp + 4], str.NONE
mov dword [ebp - 0x9c], edx
call sub.msvcrt.dll_memcmp
mov edx, dword [ebp - 0x9c]
test eax, eax
jne 0x406a20
mov word [ebp - 0x4a], 1
lea ecx, [ebp - 0x38]
mov edx, str.SSND
mov eax, edi
call fcn.004065b0
test eax, eax
je 0x406b00
cmp dword [ebp - 0x38], 7
jbe 0x406a85
lea eax, [ebp - 0x28]
mov dword [esp + 0xc], edi
mov dword [esp + 8], 8
mov dword [esp + 4], 1
mov dword [esp], eax
call sub.msvcrt.dll_fread
cmp eax, 7
jbe 0x406ca2
movzx edx, byte [ebp - 0x28]
movzx eax, byte [ebp - 0x24]
movzx ecx, byte [ebp - 0x27]
mov byte [ebp - 0x68], dl
movzx edx, byte [ebp - 0x26]
shl eax, 0x18
mov byte [ebp - 0x55], cl
movzx ecx, byte [ebp - 0x25]
mov byte [ebp - 0x75], dl
movzx edx, byte [ebp - 0x23]
mov byte [ebp - 0x76], cl
shl edx, 0x10
or eax, edx
movzx edx, byte [ebp - 0x21]
or eax, edx
movzx edx, byte [ebp - 0x22]
shl edx, 8
or eax, edx
jne 0x40697c
movzx ebx, byte [ebp - 0x70]
movzx eax, byte [ebp - 0x56]
shl ebx, 8
or ebx, eax
cmp bx, 8
je 0x406b60
cmp bx, 0x10
je 0x406b60
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x57
xor esi, esi
mov dword [esp + 4], 1
mov dword [esp], str.Warning:_OggEnc_does_not_support_this_type_of_AIFF_AIFC_file_n_Must_be_8_or_16_bit_PCM._n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
jmp 0x4069da
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x2f
xor esi, esi
mov dword [esp + 4], 1
mov dword [esp], str.Warning:_Truncated_common_chunk_in_AIFF_header_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov edx, dword [ebp - 0x1c]
xor edx, dword [0x458020]
mov eax, esi
jne 0x406d5f
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x2c
xor esi, esi
mov dword [esp + 4], 1
mov dword [esp], str.Warning:_No_common_chunk_found_in_AIFF_file_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
jmp 0x4069da
mov dword [esp + 8], 4
mov dword [esp + 4], str.sowt
mov dword [esp], edx
call sub.msvcrt.dll_memcmp
mov word [ebp - 0x4a], 0
test eax, eax
je 0x4068d5
movzx eax, byte [ebx + 0x15]
xor esi, esi
mov dword [esp + 0x14], eax
movzx eax, byte [ebx + 0x14]
mov dword [esp + 0x10], eax
movzx eax, byte [ebx + 0x13]
mov dword [esp + 0xc], eax
movzx eax, byte [ebx + 0x12]
mov dword [esp + 4], str.Warning:_Cant_handle_compressed_AIFF_C___c_c_c_c__n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
jmp 0x4069da
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x2d
xor esi, esi
mov dword [esp + 4], 1
mov dword [esp], str.Warning:_Corrupted_SSND_chunk_in_AIFF_header_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
jmp 0x4069da
test dl, dl
js 0x406cd1
cmp al, 1
sbb esi, esi
add esi, 0x80000000
jmp 0x406890
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x2f
xor esi, esi
mov dword [esp + 4], 1
mov dword [esp], str.Warning:_Unexpected_EOF_in_reading_AIFF_header_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
jmp 0x4069da
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x2a
xor esi, esi
mov dword [esp + 4], 1
mov dword [esp], str.Warning:_No_SSND_chunk_found_in_AIFF_file_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
jmp 0x4069da
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x22
xor esi, esi
mov dword [esp + 4], 1
mov dword [esp], str.Warning:_AIFF_C_header_truncated._n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
jmp 0x4069da
movzx eax, byte [ebp - 0x88]
movzx edx, byte [ebp - 0x98]
shl eax, 8
mov word [ebp - 0xa2], ax
movzx eax, byte [ebp - 0x71]
shl edx, 0x18
or word [ebp - 0xa2], ax
movzx eax, byte [ebp - 0x72]
shl eax, 0x10
or edx, eax
movzx eax, byte [ebp - 0x74]
or edx, eax
movzx eax, byte [ebp - 0x73]
shl eax, 8
or edx, eax
mov eax, dword [ebp - 0x54]
mov ecx, edx
mov dword [ebp - 0x70], edx
sar ecx, 0x1f
mov edx, dword [ebp - 0x70]
mov dword [ebp - 0x6c], ecx
mov dword [eax + 0x18], esi
mov ecx, dword [ebp - 0x6c]
movsx esi, word [ebp - 0xa2]
mov dword [eax], 0x405670
mov dword [eax + 8], edx
mov dword [eax + 0xc], ecx
mov dword [eax + 0x14], esi
mov dword [esp], 0x28
call sub.msvcrt.dll_malloc
movzx edx, word [ebp - 0xa2]
mov ecx, dword [ebp - 0x6c]
mov dword [ebp - 0x50], eax
cmp word [ebp - 0xa2], 3
mov dword [eax + 0x18], edi
mov dword [eax + 0x10], 0
mov word [eax], dx
mov edx, dword [ebp - 0x70]
mov dword [eax + 0x14], 0
mov word [eax + 2], bx
mov dword [eax + 0xc], ecx
mov dword [eax + 8], edx
movzx edx, word [ebp - 0x4a]
mov word [eax + 0x1c], dx
jg 0x406cdb
mov eax, dword [ebp - 0x50]
lea ebx, [esi*4]
mov ecx, dword [ebp - 0x54]
mov dword [ecx + 4], eax
mov dword [esp], ebx
call sub.msvcrt.dll_malloc
mov edx, dword [ebp - 0x50]
mov dword [edx + 0x20], eax
lea ecx, [esi + esi*2 - 3]
mov dword [esp + 8], ebx
lea ecx, [ecx*8 + 0x44f800]
mov dword [esp], eax
mov dword [esp + 4], ecx
call sub.msvcrt.dll_memcpy
movzx ebx, byte [ebp - 0x68]
mov dword [esp], edi
mov esi, 1
movzx eax, byte [ebp - 0x55]
mov dword [esp + 8], 1
shl ebx, 0x18
shl eax, 0x10
or ebx, eax
movzx eax, byte [ebp - 0x76]
or ebx, eax
movzx eax, byte [ebp - 0x75]
shl eax, 8
or ebx, eax
mov dword [esp + 4], ebx
call sub.msvcrt.dll_fseek
test eax, eax
je 0x4069da
mov edx, ebx
mov eax, edi
call fcn.00405b00
jmp 0x4069da
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x2c
xor esi, esi
mov dword [esp + 4], 1
mov dword [esp], str.Warning:_Unexpected_EOF_reading_AIFF_header_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
jmp 0x4069da
mov esi, 0x7fffffff
jmp 0x406890
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0xa8
mov dword [esp + 4], 1
mov dword [esp], str.WARNING:_AIFF__C__files_with_greater_than_three_channels_use_nspeaker_locations_incompatable_with_Vorbis_suppound_definitions._nNot_performaing_channel_location_mapping._n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov eax, dword [ebp - 0x50]
mov ecx, dword [ebp - 0x54]
movzx edx, word [eax]
mov dword [ecx + 4], eax
movsx esi, dx
mov dword [ebp - 0x9c], edx
lea ebx, [esi*4]
mov dword [esp], ebx
call sub.msvcrt.dll_malloc
mov edx, dword [ebp - 0x9c]
mov ecx, dword [ebp - 0x50]
cmp dx, 6
mov dword [ecx + 0x20], eax
jle 0x406c39
xor edx, edx
test esi, esi
jle 0x406c54
mov esi, esi
lea edi, [edi]
mov dword [eax + edx*4], edx
add edx, 1
cmp edx, esi
jne 0x406d50
jmp 0x406c54
call fcn.00442960
lea esi, [esi]
lea edi, [edi]