Function at 0x406970
Capabilities:
Link many functions at runtime
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48c
mov eax, dword [0x42400c]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 8]
lea eax, [ebp - 0x468]
push esi
mov esi, dword [ebp + 0xc]
push edi
push 0x109
push 0
push eax
mov dword [ebp - 0x474], esi
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
mov byte [ebp - 0x208], 0x30
lea eax, [ebp - 0x207]
push 0xfe
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
mov byte [ebp - 0x108], 0x30
lea eax, [ebp - 0x107]
push 0xfe
push 0
push eax
call sub.VCRUNTIME140.dll_memset
lea edx, [ebp - 0x208]
mov dword [ebp - 0x47c], 0
add esp, 0xc
mov dword [ebp - 0x484], 0
mov dword [ebp - 0x470], 0
mov ecx, ebx
sub edx, ebx
nop word [eax + eax]
mov al, byte [ecx]
lea ecx, [ecx + 1]
mov byte [edx + ecx - 1], al
test al, al
jne 0x406a10
lea edx, [ebp - 0x108]
mov ecx, ebx
sub edx, ebx
mov al, byte [ecx]
lea ecx, [ecx + 1]
mov byte [edx + ecx - 1], al
test al, al
jne 0x406a27
lea ecx, [ebp - 0x108]
dec ecx
nop dword [eax + eax]
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x406a40
mov eax, dword [str..mp3]
mov dword [ecx], eax
mov al, byte [0x41e03c]
push str.lame_enc.dll
mov byte [ecx + 4], al
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov edi, eax
test edi, edi
jne 0x406a93
push str.Error_loading_lame_enc.DLL
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.004015c0
push str.Error_loading_lame_enc.DLL
push esi
call fcn.004016a0
add esp, 0x10
jmp 0x406fca
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.beInitStream
push edi
call esi
push str.beEncodeChunk
push edi
mov dword [0x472b38], eax
call esi
push str.beDeinitStream
push edi
mov dword [0x472b3c], eax
call esi
push str.beCloseStream
push edi
mov dword [0x472b40], eax
call esi
push str.beVersion
push edi
mov dword [0x472b44], eax
call esi
push str.beWriteVBRHeader
push edi
mov dword [0x472b48], eax
call esi
cmp dword [0x472b38], 0
mov ecx, eax
mov dword [0x472b4c], ecx
je 0x406faa
cmp dword [0x472b3c], 0
je 0x406faa
cmp dword [0x472b40], 0
je 0x406faa
cmp dword [0x472b44], 0
je 0x406faa
mov eax, dword [0x472b48]
test eax, eax
je 0x406faa
test ecx, ecx
je 0x406faa
lea ecx, [ebp - 0x468]
push ecx
call eax
add esp, 4
lea eax, [ebp - 0x460]
push eax
movzx eax, byte [ebp - 0x465]
push eax
movzx eax, byte [ebp - 0x466]
push eax
movzx eax, word [ebp - 0x462]
push eax
movzx eax, byte [ebp - 0x463]
push eax
movzx eax, byte [ebp - 0x464]
push eax
movzx eax, byte [ebp - 0x467]
push eax
movzx eax, byte [ebp - 0x468]
push eax
push str.lame_enc.dll_version__u._02u___u__u__u__nlame_enc_Engine__u._02u_nlame_enc_homepage_at__s_n_n
call fcn.004015e0
mov edi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
lea eax, [ebp - 0x208]
add esp, 0x24
push 0x41e14c
push eax
call edi
mov esi, eax
add esp, 8
mov dword [ebp - 0x478], esi
test esi, esi
jne 0x406bcd
push ebx
push str.Error_opening__s
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.004015c0
add esp, 0xc
jmp 0x406fca
lea eax, [ebp - 0x108]
push 0x41e164
push eax
call edi
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x406c23
lea eax, [ebp - 0x108]
push eax
push str.Error_creating_file__s
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.004015c0
add esp, 0xc
lea eax, [ebp - 0x108]
push eax
push str.Error_creating_file__s
push dword [ebp - 0x474]
call fcn.004016a0
add esp, 0xc
jmp 0x406fca
push 0x14b
lea eax, [ebp - 0x358]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
mov eax, dword [ebp + 0x10]
add esp, 0xc
mov dword [ebp - 0x340], eax
lea eax, [ebp - 0x470]
mov dword [ebp - 0x358], pe_nt_image_headers32
mov dword [ebp - 0x354], 1
push eax
lea eax, [ebp - 0x484]
mov dword [ebp - 0x350], 0x14b
push eax
lea eax, [ebp - 0x47c]
mov dword [ebp - 0x34c], 0x5622
push eax
lea eax, [ebp - 0x358]
mov dword [ebp - 0x348], 0
push eax
mov dword [ebp - 0x344], 3
mov dword [ebp - 0x338], 2
mov dword [ebp - 0x334], 1
mov dword [ebp - 0x330], 0
mov dword [ebp - 0x32c], 0
mov dword [ebp - 0x31c], 1
mov dword [ebp - 0x308], 1
call dword [0x472b38]
mov edi, eax
add esp, 0x10
test edi, edi
je 0x406d18
push edi
push str.Error_opening_encoding_stream___lu_
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.004015c0
add esp, 0xc
push edi
push str.Error_opening_encoding_stream___lu_
push dword [ebp - 0x474]
call fcn.004016a0
add esp, 0xc
jmp 0x406fca
push dword [ebp - 0x484]
call fcn.0041a2e7
mov edi, eax
xor ecx, ecx
mov eax, dword [ebp - 0x47c]
add esp, 4
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0041a2e7
add esp, 4
mov dword [ebp - 0x488], eax
mov dword [ebp - 0x46c], 0
mov dword [ebp - 0x474], 0
push 2
push 0
push esi
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
call esi
add esp, 0xc
push dword [ebp - 0x478]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_ftell]
add esp, 4
mov dword [ebp - 0x480], eax
push 0
push 0x2c
push dword [ebp - 0x478]
call esi
mov esi, dword [ebp - 0x488]
add esp, 0xc
push dword [ebp - 0x478]
push dword [ebp - 0x47c]
push 2
push esi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
add esp, 0x10
mov dword [ebp - 0x48c], eax
test eax, eax
je 0x406ea0
lea ecx, [ebp - 0x46c]
push ecx
push edi
push esi
push eax
push dword [ebp - 0x470]
call dword [0x472b3c]
mov esi, eax
add esp, 0x14
test esi, esi
jne 0x406f0f
push ebx
push dword [ebp - 0x46c]
push 1
push edi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
add esp, 0x10
cmp eax, dword [ebp - 0x46c]
jne 0x406ef4
mov eax, dword [ebp - 0x48c]
sub esp, 8
mov ecx, dword [ebp - 0x474]
lea ecx, [ecx + eax*2]
movd xmm0, ecx
mov eax, ecx
cvtdq2pd xmm0, xmm0
shr eax, 0x1f
mov dword [ebp - 0x474], ecx
addsd xmm0, qword [eax*8 + 0x41f830]
mov eax, dword [ebp - 0x480]
cvtpd2ps xmm1, xmm0
movd xmm0, eax
mulss xmm1, dword [0x41f798]
shr eax, 0x1f
cvtdq2pd xmm0, xmm0
addsd xmm0, qword [eax*8 + 0x41f830]
cvtpd2ps xmm0, xmm0
divss xmm1, xmm0
cvtps2pd xmm0, xmm1
movsd qword [esp], xmm0
push str.Done:__0.2f________r
call fcn.004015e0
mov esi, dword [ebp - 0x488]
add esp, 0xc
push dword [ebp - 0x478]
push dword [ebp - 0x47c]
push 2
push esi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
add esp, 0x10
mov dword [ebp - 0x48c], eax
test eax, eax
jne 0x406dc1
lea eax, [ebp - 0x46c]
push eax
push edi
push dword [ebp - 0x470]
call dword [0x472b40]
add esp, 0xc
mov dword [ebp - 0x480], eax
test eax, eax
je 0x406f3d
push dword [ebp - 0x470]
call dword [0x472b44]
add esp, 4
push dword [ebp - 0x480]
push str.beExitStream_failed___lu_
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.004015c0
add esp, 0xc
jmp 0x406fca
push str.Output_file_write_error
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.004015c0
jmp 0x406fc7
push dword [ebp - 0x470]
call dword [0x472b44]
add esp, 4
push esi
push str.beEncodeChunk___failed___lu_
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.004015c0
add esp, 0xc
jmp 0x406fca
mov eax, dword [ebp - 0x46c]
test eax, eax
je 0x406f5d
push ebx
push eax
push 1
push edi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
add esp, 0x10
cmp eax, dword [ebp - 0x46c]
jne 0x406ef4
push dword [ebp - 0x470]
call dword [0x472b44]
add esp, 4
push esi
call fcn.0041a2e2
add esp, 4
push edi
call fcn.0041a2e2
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 4
push dword [ebp - 0x478]
call esi
add esp, 4
push ebx
call esi
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0041a150
mov esp, ebp
pop ebp
ret 0x10
push str.Unable_to_get_LAME_interfaces
call fcn.004015e0
add esp, 4
push str.Unable_to_get_LAME_interfaces
push dword [ebp - 0x474]
call fcn.004016a0
add esp, 8
mov ecx, dword [ebp - 4]
or eax, 0xffffffff
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0041a150
mov esp, ebp
pop ebp
ret 0x10