Results 1 to 10 of 15
Threaded View
-
27th Jul 2012, 06:13 AM #15Member
DLC
PHP Code:function decrypt_dlc($str_filename, $return_array)
{
if(!isset($str_filename) || !isset($return_array) || empty($str_filename) || empty($str_filename) || !file_exists($str_filename))
die("Pass correct parameter");
$return_array ? $links = array() : $links = '';
$key = 'xxxx';
$IV = 'xxxx';
$dlc_whole_content = file_get_contents($str_filename);
$dlc_content = substr($dlc_whole_content, 0, -88); //base64 encoded dlc content
$dlc_content = base64_decode($dlc_content); //dlc content
$dlc_key = substr($dlc_whole_content, -88); //dlc key
/*
* Send an HTTP-Request, remove <rc> and </rc> of response and decode it with base64
*/
$result = file_get_contents("http://service.jdownloader.org/dlcrypt/service.php?destType=load&srcType=dlc&data=$dlc_key");
$result = explode("<rc>", $result);
$result = explode("</rc>",$result[1]);
$result = $result[0];
$result = base64_decode($result);
if(empty($result))
die("Got wrong or no response from server!");
/*
* Decrypt the base64 decoded server response
* (128 Bit AES in CBC mode with your key and IV)
*/
$hdlDLCCrypt = mcrypt_module_open(MCRYPT_RIJNDAEL_128,'','cbc','');
@mcrypt_generic_init($hdlDLCCrypt,$key,$IV);
$dlckey = mdecrypt_generic($hdlDLCCrypt, $result);
/*
* Decrypt your content
* (128 Bit AES in CBC mode with your previously decrypted result as key and IV)
*/
$hdlDLCCrypt = mcrypt_module_open(MCRYPT_RIJNDAEL_128,'','cbc','');
@mcrypt_generic_init($hdlDLCCrypt,$dlckey,$dlckey);
$data = mdecrypt_generic($hdlDLCCrypt, $dlc_content);
$data = base64_decode($data);
/*
* Simple and dirty XML parsing
*/
$parser = xml_parser_create();
xml_parse_into_struct($parser, $data, $vals);
xml_parser_free($parser);
for($i = 0;; ++$i)
{
if($vals[$i]["tag"] == "DLC" && $vals[$i]["type"] == "close") // break at </dlc> (end of dlc content)
break;
if($vals[$i]["tag"] == "URL") // filter the links
{
/*
* <dlc>[...]<url>___LINKS___</url>[...]</dlc>
*/
$return_array
? $links[] = base64_decode($vals[$i]["value"]) // append link to array
: $links .= base64_decode($vals[$i]["value"])."\n"; // append link to string
}
}
return $links;
}
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Adding ip on vps container
By masterb56 in forum Server ManagementReplies: 1Last Post: 20th Sep 2011, 02:43 AM -
OpenVZ Container
By StabU2Dead in forum Webmaster DiscussionReplies: 2Last Post: 22nd May 2011, 10:07 AM -
Installing GD Graphics Library or Imagick Image Library
By RNBxBeatz in forum Webmaster DiscussionReplies: 0Last Post: 13th May 2011, 09:49 AM -
How to install GD Graphics Library or Imagick Image Library?
By Hillside in forum Technical Help Desk SupportReplies: 2Last Post: 12th Dec 2010, 09:54 AM -
MSDN Library
By BlaZe in forum General DiscussionReplies: 0Last Post: 26th Mar 2010, 06:28 AM
themaPoster - post to forums and...
Version 5.19 released. Open older version (or...