Decodificando filmes do programa "3w player"

Este artigo irá ensinar como tirar a criptografia dos filmes que são codificados especialmente para o player "3w player". Muito fácil de fazer, apenas siga os passos.

[ Hits: 17.214 ]

Por: Perfil removido em 30/07/2007


Criando o novo arquivo



Para criar o novo arquivo você terá que executar um script que irei ensinar como fazer.

Abra um editor de texto e cole o código da seguinte forma no terminal:

# kate noW3player.pl

# Turn of output buffer
$|++;

# The key for XOR decryption
my $key = 'UIERYQWORTWEHLKDNKDBISGLZNCBZCVNBADFIEYLJ' . chr(0);

print "Reading from \"$ARGV[0]\":\n";
$insize = -s $ARGV[0];
# Open the bogus AVI file
open(IN, $ARGV[0]) or die $!;
binmode IN;

# Read Header to check
read(IN, $buffer, 4);
if ($buffer ne 'RIFF') {
    print "  ERROR: \"$ARGV[0]\" is not an AVI\n";
    close IN;
    exit(1);
}
# Get Length of the unencrypted movie
read(IN, $buffer, 4);
$offset = unpack 'L', $buffer;
print "  End of the unencrypted movie is at byte offset $offset\n";

# Jump to the read offset
seek(IN, $offset, 0);

# The next 4 or 8 Bytes seem to be either an unsinged long
# or an unsigned quad. This is another offset to jump
# over some filler bytes. Right now I can't really tell if
# it's 4 or 8 bytes, because I only have 1 file to test with.
# I assume it's a quad.

# low word
read(IN, $buffer, 4);
$offlo = unpack 'L', $buffer;
# high word
read(IN, $buffer, 4);
$offhi = unpack 'L', $buffer;
# Calculate offset
$offset = $offhi * 4294967296 + $offlo;

print "  Offset after the unencrypted movie is $offset\n";
seek(IN, $offset, 0);

# Then there seem to be another 100 filler bytes
# with value 0xff. Jump over those too, to get
# to the offset where the real movie starts.
printf "  Adding extra filler bytes, final offset is %s\n", $offset+100;
seek(IN, 100, 1);

# Update the size
$insize -= $offset+100;

# Open a file for writing the decrypted data to
print "Decrypting to \"$ARGV[1]\":\n";
open(OUT, ">$ARGV[1]");
binmode OUT;
truncate OUT, 0;

$bytes = 0;
$klen = length($key);
# Read key length bytes, decrypt them and
# write them to the output file untill you reach
# the end of the file
while ( read(IN, $buffer, $klen) ) {
    $buffer ^= $key;
    print OUT $buffer;
    $bytes += $klen;
    # print the status
    printf "\r  %d written (% .1f %%)", $bytes, ($bytes / $insize * 100);
}
# Close both files
close OUT;
close IN;
print "\n\nDONE!\n";

Agora execute o script no terminal da seguinte forma:

perl noW3player.pl NomeFilmeCriptografado.avi NomeFilmeDescripto.avi

Exemplo:

$ perl noW3player.pl TheSimpsonsCrip.avi TheSimpsonsDecri.avi

Irá aparecer:
Reading from "TheSimpsonsCrip.avi":
  End of the unencrypted movie is at byte offset 175364
  Offset after the unencrypted movie is 175616
  Adding extra filler bytes, final offset is 175716
Decrypting to "TheSimpsonsDecri.avi":

Após executado isso você terá o novo filme, podendo assistir no mplayer, Kaffeine ou seu player predileto.

Referências:
Página anterior    

Páginas do artigo
   1. O filme e a mensagem do software
   2. Criando o novo arquivo
Outros artigos deste autor

Varnish: Uma camada de velocidade

OcoMon 2.0RC6 no OpenSUSE 11.2 com PHP5 + MySQL5 + Apache2 com correção de acentuação

Capturando seu desktop com uma aplicação feita em kylix

USB-ZIP - Emulando Zip Drive em Pendrive

Dá para usar BackTrack como desktop! Sabia?

Leitura recomendada

Trabalhando com arquivos no Perl

Script Perl para consultas em base LDAP e/ou Active Directory

URL amigável com Perl

Configurando OTRS com PSGI/Plack e executando com Starman

Um pouco de PERL

  
Comentários
[1] Comentário enviado por daredevil em 30/07/2007 - 11:21h

Se eu tivesse visto isso antes não teria apagado os últimos que baixei.
Muito boa a dica.

[2] Comentário enviado por elgio em 30/07/2007 - 14:39h

Desculpe, mas isto não estaria mais para uma dica?

[3] Comentário enviado por fabio em 30/07/2007 - 16:59h

Olá Elgio,

Artigo mesmo! É que muitos se acostumaram a enviar dicas "gigantes" pro site, mas esse texto se enquadra perfeitamente como artigo. São 2 fatores que nos levam a classificar 1 artigo:

1. Tamanho do texto;
2. Redundância do assunto.

Como este trata de um assunto inédito, nada mais justo que ser artigo para ficar em maior destaque.

Um abraço,
Fábio

[4] Comentário enviado por removido em 30/07/2007 - 18:17h

Obrigado Fábio.
Pensei em enquadrar inicialmente como dica, mas estava muito longo o texto. Pensei em colocar mais informações, mas percebi que o objetivo já havia sido alcançado.
Por fim, um artigo simples e útil para pessoas que baixam filmes.

Uma dica: Antes de executar o script, renomeie o nome do filme caso ele contenha espaços ou caracteres especiais, isso pode evitar dores de cabeça.


Contribuir com comentário