IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage Perl Discussion :

problème code aide à programmer


Sujet :

Langage Perl

  1. #1
    Candidat au Club
    Profil pro
    Inscrit en
    Décembre 2007
    Messages
    5
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2007
    Messages : 5
    Points : 3
    Points
    3
    Par défaut problème code aide à programmer
    Bonjour, je ne sais pas programmer le perl, je suis sous linux et en téléchargant une video je me suis aperçu qu'elle était codée. J'ai trouvé sur un autre forum un code perl pour pouvoir la décoder et la lire!!!
    Sauf que lorque je lance mon code il me met de erreurs mais je ne sais pas ce que je dois faire. Voici le code

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    # 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";


    Voila! Pouvez vous me dire les élements que je dois remplacer s'il vous plait et par quoi? S'il faut juste mettre un nom de fichier, inventez en un svp juste pour que je comprenne merci d'avance
    A bientôt Gazut

  2. #2
    Candidat au Club
    Profil pro
    Inscrit en
    Décembre 2007
    Messages
    5
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2007
    Messages : 5
    Points : 3
    Points
    3
    Par défaut
    c'est bon j'ai trouvé c'était juste la commande que je rentré qui n'était pas bonne
    désolé pour le dérengement

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 11
    Dernier message: 14/02/2006, 00h26
  2. Réponses: 1
    Dernier message: 30/01/2006, 16h07
  3. PERL AIDE PROGRAMMATION
    Par kiza dans le forum Langage
    Réponses: 2
    Dernier message: 17/10/2005, 16h57
  4. Problème avec le programme executable
    Par GreyDragon dans le forum VB 6 et antérieur
    Réponses: 7
    Dernier message: 01/10/2005, 13h43
  5. Problème avec un programme éxécuter en console
    Par bzhrobby dans le forum Windows
    Réponses: 2
    Dernier message: 25/04/2005, 10h42

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo