Audio/video stream recording forums (http://stream-recorder.com/forum/index.php)
-   Video stream recording (http://stream-recorder.com/forum/forumdisplay.php?f=4)
-   -  

how to decrypt and decode png files to real file (.ass)

(http://stream-recorder.com/forum/showthread.php?t=16727)

Liluy 07-09-2015 12:09 PM

Re: how to decrypt and decode png files to real file (.ass)


 
Quote:

Originally Posted by blurg (Post 78082)
je le vois moi (1ier dans la liste)

Oui, c'est bon j'ai trouvé, merci pour ton aide.

IzayoiSk 07-09-2015 01:10 PM

Re: how to decrypt and decode png files to real file (.ass)


 
Apparently my post went unnoticed ^^

Hello ! I'm new here ! Someone can explain from A to Z ? How can I use THIS ?

If I have understood correctly, it's to recover the subtitles video from ADN ?

THANKS !

Fr : Apparemment mon post est passé inaperçu ^^

je voudrais juste savoir si c'est bel et bien une méthode pour avoir les .ass des vidéo de chez ADN ? Si oui pourrait-on m'expliquer la marche a suivre ?
Merci ! :)

baka.shinji 07-10-2015 05:49 AM

Re: how to decrypt and decode png files to real file (.ass)


 
One last thing. How to decompil the mulutibu please ?

Paradox 07-10-2015 09:07 AM

Re: how to decrypt and decode png files to real file (.ass)


 
Hello !

How to get the *correct* constants format, please ?

In the swf file, the constants are an array of numbers, but how to convert them to the hex form ? I tried many converters, changed 0x to \x, but it doesn't work. :(

Thanks for your help !

blurg 07-10-2015 09:19 AM

Re: how to decrypt and decode png files to real file (.ass)


 
Quote:

Originally Posted by Paradox (Post 78107)
Hello !

How to get the *correct* constants format, please ?

In the swf file, the constants are an array of numbers, but how to convert them to the hex form ? I tried many converters, changed 0x to \x, but it doesn't work. :(

Thanks for your help !

Code:

import os,sys,urllib,time,binascii
# -*- coding: utf-8 -*-

testfile = urllib.URLopener()
testfile.retrieve("url mulutibu_v4_3.swf", "mulutibu_v4_3.swf")
time.sleep(5)
cmd1='.\\video\\ffdec -export binaryData \\com\\longtailvideo\\plugins\\mulutibu6\\binaryData\\ mulutibu_v4_3.swf'
os.system(cmd1)
time.sleep(10)
data=open('.\\com\\longtailvideo\\plugins\\mulutibu6\\binaryData\\31.bin','r').read()
data1=binascii.a2b_hex(data.replace('0x', '').strip())
final=open('constanteskeys.txt','w')
final.write(data1)

try this with python script and JPEXS Free Flash Decompiler

edit = replace url of mulutibu by the correct url

Paradox 07-10-2015 10:24 AM

Re: how to decrypt and decode png files to real file (.ass)


 
Thanks a lot ! ;)

Paradox 07-11-2015 06:12 PM

Re: how to decrypt and decode png files to real file (.ass)


 
I re-wrote blurg's python script and changed a few K-S-V's php script (thanks to them), to get automatically the constants and the start variable.

Code:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os, urllib, datetime, time, re

dirName = os.path.dirname(os.path.abspath(__file__))
mulutibuFile = "mulutibu_v4_3.swf"

command = "ffdec -export script \"%s\" %s" % (dirName, mulutibuFile)
os.system(command)

time.sleep(10)

with open(dirName + "\\com\\longtailvideo\\plugins\\mulutibu6\\Mulutibu.as", "r") as startFile:
        start = re.findall("d1\([0-9]{2}\)", startFile.read())

        command = "ffdec -export binaryData \"%s\" %s" % (dirName, mulutibuFile)
        os.system(command)

        time.sleep(10)

        with open(dirName + "\\31.bin", "r") as fo:
                binary = fo.read()

                phpFile        = '''<?php
        if ( $argc < 2 )
                die( "Usage: php adn.php <encrypted_subtitles>" );

        // Read encrypted subtitles
        $file = file_get_contents( $argv[1] );
        $file = base64_decode( $file );

        // Get decryption key from aes constants
        $constants = "{CONSTANTS}";
        $start    = {START};
        $key      = substr( $constants, $start, 32 );
        $salt      = substr( $file, 8, 8 );
        $key      = $key . $salt;
        $hash1    = md5( $key, true );
        $hash2    = md5( $hash1 . $key, true );
        $iv        = md5( $hash2 . $key, true );
        $key      = $hash1 . $hash2;
        // Decrypt subtitles
        $td = mcrypt_module_open( "rijndael-128", "", "cbc", "" );
        mcrypt_generic_init( $td, $key, $iv );

        $decrypted = mdecrypt_generic( $td, $file );
        $decrypted = substr( $decrypted, 32 );
        mcrypt_generic_deinit( $td );
        mcrypt_module_close( $td );

        // Detect and remove PKCS#7 padding
        $padded = true;
        $len    = strlen( $decrypted );
        $pad    = ord( $decrypted[$len - 1] );

        for ( $i = 1; $i <= $pad; $i++ )
                $padded &= ( $pad == ord( substr( $decrypted, -$i, 1 ) ) ) ? true : false;
        if ( $padded )
                $decrypted = substr( $decrypted, 0, $len - $pad );

        // Save decrypted subtitles
        $file = pathinfo( $argv[1], PATHINFO_FILENAME ) . ".ass";
        file_put_contents( $file, $decrypted );
?>'''
                phpFile = re.sub("\{CONSTANTS\}", binary.replace("0x", "\\x").strip(), phpFile)
                phpFile = re.sub("\{START\}", re.findall(r"\d+", start[0])[1], phpFile)

                with open("adn.php", "w") as out:
                        out.write(phpFile)

Assuming you will save the script as adn.py, put :
Code:


adn.py

in your console and it will generate an adn.php file, then put:
Code:


php adn.php "picture_file"

P.S : You will need to get the picture file using fiddler.
P.S2 : When you finish, delete : 31.bin, mulutibu6.as and mulutibu_v4_3.swf files. Delete also com and mx folders.
P.S3 : Be sure to have the path of the JPEXS Free Flash Decompiler folder in your environment path variable, e.g : C:\Programe Files\FFDec

Hope it helps !

EDIT : You MUST download the mulutibu file with fiddler or from your browser to get the valid file and rename it to mulutibu_v4_3.swf, then put it in the same folder as adn.py and run the script !

baka.shinji 07-12-2015 08:29 AM

Re: how to decrypt and decode png files to real file (.ass)


 
@ Paradox : I tried your method but I get this message:

C:\adn.py
Traceback (most recent call last):
File "C:\adn.py", line 21, in <module>
with open(dirName + "\\com\\longtailvideo\\plugins\\mulutibu6\\Mulutib u.as",
"r") as startFile:
IOError: [Errno 2] No such file or directory: 'C:\\com\\longtailvideo\\plugin
s\\mulutibu6\\Mulutibu.as'

blurg 07-12-2015 09:30 AM

Re: how to decrypt and decode png files to real file (.ass)


 
don't try anymore
they have change 1 more time the methode of decryptage

plz don't indicate url or anything because they change every time

Paradox 07-12-2015 04:43 PM

Re: how to decrypt and decode png files to real file (.ass)


 
Quote:

Originally Posted by baka.shinji (Post 78163)
@ Paradox : I tried your method but I get this message:

C:\adn.py
Traceback (most recent call last):
File "C:\adn.py", line 21, in <module>
with open(dirName + "\\com\\longtailvideo\\plugins\\mulutibu6\\Mulutib u.as",
"r") as startFile:
IOError: [Errno 2] No such file or directory: 'C:\\com\\longtailvideo\\plugin
s\\mulutibu6\\Mulutibu.as'

If you have this error, delete all generated files and run adn.py again.

Quote:

Originally Posted by blurg (Post 78166)
don't try anymore
they have change 1 more time the methode of decryptage

plz don't indicate url or anything because they change every time

Hum... Now, if the mulutibu file is downloaded with a script(python, php, whatever) we get a non-valid file. I edited my previous post.

The script has been revised BTW.


All times are GMT -6. The time now is 08:14 PM.