Function at 0x519ff0
Capabilities:
Write file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x88c
mov ebx, dword [esp + 0x8a0]
fld qword [esp + 0x8ac]
mov edx, dword [ebx]
test edx, edx
je 0x51a3d0
mov edi, dword [ebx + 4]
test edi, edi
je 0x51a3ef
mov esi, dword [0xbe4648]
test esi, esi
jne 0x51a3e0
fnstcw word [esp + 0x6e]
fld qword [0x9edb60]
fmul st(1)
mov dword [esp + 0x4c], 0
movzx eax, word [esp + 0x6e]
mov dword [esp + 0x54], 0
mov ah, 0xc
mov word [esp + 0x6c], ax
fldcw word [esp + 0x6c]
fistp qword [esp + 0x60]
fldcw word [esp + 0x6e]
mov edi, dword [esp + 0x60]
imul eax, edi, 0xe10
mov dword [esp + 0x48], eax
fild qword [esp + 0x48]
fsubr st(1)
fld qword [0x9edb68]
fmul st(1)
fldcw word [esp + 0x6c]
fistp qword [esp + 0x48]
fldcw word [esp + 0x6e]
mov dword [esp + 0x4c], 0
mov ebp, dword [esp + 0x48]
imul eax, ebp, 0x3c
mov dword [esp + 0x48], eax
fild qword [esp + 0x48]
fsubp st(1)
fld st(0)
fldcw word [esp + 0x6c]
fistp qword [esp + 0x48]
fldcw word [esp + 0x6e]
mov eax, dword [esp + 0x48]
mov dword [esp + 0x50], eax
fild qword [esp + 0x50]
fsubp st(1)
fmul dword [0x9edb70]
fldcw word [esp + 0x6c]
fistp qword [esp + 0x50]
fldcw word [esp + 0x6e]
mov esi, dword [esp + 0x50]
cmp esi, 0x3e8
sbb eax, eax
and esi, eax
cmp edi, dword [0x9137d4]
je 0x51a404
fstp qword [esp + 0x30]
mov dword [esp], edx
call sub.msvcrt.dll_ftell
mov edx, dword [esp + 0x48]
mov dword [esp + 0x14], esi
mov dword [esp + 0xc], ebp
mov dword [esp + 8], edi
mov dword [esp + 0x10], edx
mov dword [esp + 4], str.timestamp:__02u:_02u:_02u:_03u__filepos:__09lx_n
mov dword [esp + 0x18], eax
mov eax, dword [ebx + 4]
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov ecx, dword [esp + 0x48]
mov dword [0x9137d4], edi
mov dword [0x9137d0], ebp
mov dword [0x9137c8], esi
mov dword [0x9137cc], ecx
fnstcw word [esp + 0x6e]
fld qword [esp + 0x30]
movzx eax, word [esp + 0x6e]
mov ah, 0xc
mov word [esp + 0x6c], ax
fst qword [0xbe4650]
mov esi, 0xbe4640
fmul dword [0x9edb38]
mov ecx, 5
mov ebp, 0x7ec
mov dword [0xbe4648], 1
mov byte [esp + 0x7b], 0
mov byte [esp + 0x7c], 0
mov byte [esp + 0x7d], 1
fldcw word [esp + 0x6c]
fistp qword [esp + 0x60]
fldcw word [esp + 0x6e]
mov byte [esp + 0x7e], 0xba
mov eax, dword [esp + 0x60]
mov byte [esp + 0x7f], 0x40
mov dword [esp + 0x80], 0
mov dword [esp + 0x84], 0
mov edx, eax
shr edx, 0x1d
and edx, 0xe
or edx, 0x21
mov byte [esp + 0x87b], dl
mov edx, eax
shr edx, 0x16
mov byte [esp + 0x87c], dl
mov edx, eax
shr edx, 0xe
or edx, 1
mov byte [esp + 0x87d], dl
mov edx, eax
add eax, eax
shr edx, 7
or eax, 1
mov byte [esp + 0x87e], dl
lea edx, [esp + 0x87b]
mov byte [esp + 0x87f], al
mov edi, edx
repe cmpsb byte [esi], byte es:[edi]
lea esi, [esp + 0x7b]
mov dword [esp + 0x2c], edx
mov byte [0xbe4644], al
mov byte [esp + 0x88], 0
setb cl
seta dl
sub dl, cl
mov ecx, dword [esp + 0x87b]
movsx edx, dl
cmp edx, 1
sbb edx, edx
mov dword [0xbe4640], ecx
mov ecx, dword [esp + 0x8a8]
not edx
and edx, 5
lea eax, [edx + ecx + 4]
sub ebp, eax
js 0x51a503
xor ecx, ecx
cmp ebp, 7
setge cl
sub ecx, 1
and ebp, ecx
lea eax, [ebp + eax]
mov ecx, eax
sar ecx, 8
test edx, edx
mov byte [esp + 0x89], 0
mov byte [esp + 0x8a], 0
mov byte [esp + 0x8b], 1
mov byte [esp + 0x8c], 0xbd
mov byte [esp + 0x8d], cl
mov byte [esp + 0x8e], al
mov byte [esp + 0x8f], pe_nt_image_headers32
je 0x51a431
mov ecx, ebp
mov eax, edx
add ecx, edx
lea edx, [esi + edx + 0x17]
lea edi, [edx + ebp]
mov byte [esp + 0x5f], cl
lea ecx, [edi + 1]
mov dword [esp + 0x48], ecx
lea ecx, [esp + 0x92]
mov byte [esp + 0x50], pe_nt_image_headers32
mov dword [esp + 0x28], ecx
movzx ecx, byte [esp + 0x50]
mov dword [esp + 8], eax
lea eax, [esp + 0x87b]
mov dword [esp + 0x44], edx
mov dword [esp + 4], eax
mov byte [esp + 0x90], cl
movzx ecx, byte [esp + 0x5f]
mov byte [esp + 0x91], cl
mov ecx, dword [esp + 0x28]
mov dword [esp], ecx
call sub.msvcrt.dll_memcpy
mov edx, dword [esp + 0x44]
mov dword [esp + 8], ebp
mov dword [esp + 4], 0
mov dword [esp], edx
call sub.msvcrt.dll_memset
mov eax, dword [ebx + 8]
or eax, 0x20
mov byte [edi], al
mov eax, dword [ebx]
mov dword [esp + 8], 1
mov dword [esp], esi
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x48]
sub eax, esi
mov dword [esp + 4], eax
call sub.msvcrt.dll_fwrite
cmp eax, 1
je 0x51a460
mov dword [esp], str.ERROR:_vobsub_write_failed
mov edi, 0x800
call sub.msvcrt.dll_perror
mov eax, 0x7fa
mov edx, 0xfffffffa
mov ecx, 7
mov byte [esp + 0x80], dl
lea edx, [esp + 0x81]
mov byte [esp + 0x7f], cl
mov dword [esp], edx
mov byte [esp + 0x7b], 0
mov byte [esp + 0x7c], 0
mov byte [esp + 0x7d], 1
mov byte [esp + 0x7e], 0xbe
mov dword [esp + 8], eax
mov dword [esp + 4], 0
call sub.msvcrt.dll_memset
mov eax, dword [ebx]
mov dword [esp + 8], 1
mov dword [esp + 4], edi
mov dword [esp], esi
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
cmp eax, 1
je 0x51a3d2
mov dword [esp], str.ERROR:_vobsub_padding_write_failed
call sub.msvcrt.dll_perror
jmp 0x51a3d2
fstp st(0)
add esp, 0x88c
pop ebx
pop esi
pop edi
pop ebp
ret
fcom qword [0xbe4650]
fnstsw ax
sahf
jne 0x51a02b
fnstcw word [esp + 0x6e]
movzx eax, word [esp + 0x6e]
mov ah, 0xc
mov word [esp + 0x6c], ax
jmp 0x51a14f
cmp ebp, dword [0x9137d0]
jne 0x51a0e8
mov eax, dword [esp + 0x48]
cmp eax, dword [0x9137cc]
jne 0x51a0e8
cmp esi, dword [0x9137c8]
jne 0x51a0e8
jmp 0x51a14f
lea ecx, [esp + 0x92]
mov edx, ebp
lea edi, [ecx + ebp]
lea eax, [edi + 1]
mov byte [esp + 0x5f], dl
mov edx, ecx
mov dword [esp + 0x48], eax
xor eax, eax
mov dword [esp + 0x28], ecx
mov byte [esp + 0x50], 0
jmp 0x51a2c9
mov eax, dword [ebx]
mov dword [esp + 8], 1
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x8a8]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x8a4]
mov dword [esp], eax
call sub.msvcrt.dll_fwrite
cmp eax, 1
jne 0x51a349
lea edi, [esp + 0x87b]
sub edi, dword [esp + 0x8a8]
sub edi, dword [esp + 0x48]
cmp edi, 5
jg 0x51a59e
cmp edi, 0
jle 0x51a570
mov dword [esp + 8], edi
mov dword [esp + 4], 0
mov dword [esp], esi
call sub.msvcrt.dll_memset
mov eax, dword [ebx]
mov dword [esp + 8], 1
mov dword [esp + 4], edi
mov dword [esp], esi
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
cmp eax, 1
je 0x51a3d2
mov dword [esp], str.ERROR:_vobsub_blank_padding_write_failed
call sub.msvcrt.dll_perror
add esp, 0x88c
pop ebx
pop esi
pop edi
pop ebp
ret
sub eax, edx
xor ebp, ebp
mov edx, eax
sar edx, 8
lea edi, [esp + 0x92]
mov byte [esp + 0x8e], al
lea eax, [esp + 0x93]
mov byte [esp + 0x8d], dl
mov edx, edi
mov dword [esp + 0x48], eax
xor eax, eax
mov byte [esp + 0x89], 0
mov byte [esp + 0x8a], 0
mov byte [esp + 0x8b], 1
mov byte [esp + 0x8c], 0xbd
mov byte [esp + 0x8f], pe_nt_image_headers32
mov dword [esp + 0x28], edi
mov byte [esp + 0x5f], 0
mov byte [esp + 0x50], 0
jmp 0x51a2c9
je 0x51a3d2
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov edx, dword [esp + 0x8a8]
mov dword [esp + 4], str._nERROR:_wrong_thing_happened..._n__I_wrote_a__i_data_bytes_spu_packet_and_thats_too_long_n
add eax, 0x40
mov dword [esp + 8], edx
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
jmp 0x51a3d2
lea eax, [edi - 6]
mov ecx, eax
shr ecx, 8
lea edx, [edi - 6]
jmp 0x51a369