ptaylor Wrote:There is a separate swf file (sec.swf) that gets pulled down in the video viewing process that seems to include code looking for the "~", and lots of code that does all sorts of calculations. It may just be something to throw us off the scent though...
Yeah, I think they put the encryption logic in sec.swf so they can change it often independent of the player.swf code itself.
It looks like you need to call e.g. S.dec("a9d2af515205989ce1d8bd20fa36db2c29a307b089a3351401012878b8b399d9~39474f6e3096ab2e5252d39741bd99994a4f0750bac32ef01c2c79a4845a5d37") with the <pid> element and get back tkZDMTeYiZvqZTmTv1Bc3CmNMJnNjhEF.
I wrote an mtasc app that loads sec.swf and decrypts a pid. I don't have an easy way to get the input pid in via the command line yet though.
Compile the AS2 using mtasc, run it using adl from the AIR 1.5 SDK.
DecryptPid.as, compile via:
mtasc -version 9 -swf DecryptPid.swf -main -header 20:20:1 DecryptPid.as
Code:
class DecryptPid {
var pid:String;
function DecryptPid() {
}
function decrypt(pid:String) {
this.pid = pid;
var loader:MovieClipLoader = new MovieClipLoader();
loader.addListener(this);
var sec:MovieClip = _root.createEmptyMovieClip("sec", 10)
sec._lockroot = true;
loader.loadClip("http://www.hulu.com/sec.swf", sec);
}
function onLoadInit(sec:MovieClip) {
var s:String = sec.dec(this.pid);
trace(this.pid + " = " + s)
}
static function main(mc) {
(new DecryptPid()).decrypt("a9d2af515205989ce1d8bd20fa36db2c29a307b089a3351401012878b8b399d9~39474f6e3096ab2e5252d39741bd99994a4f0750bac32ef01c2c79a4845a5d37");
}
}
To run this, use adl from AIR SDK with this DecryptPid.xml
Code:
<?xml version='1.0' encoding='utf-8'?>
<application xmlns="http://ns.adobe.com/air/application/1.5">
<id>com.rectalogic.DecryptPid</id>
<filename>DecryptPid</filename>
<initialWindow>
<content>DecryptPid.swf</content>
<visible>false</visible>
</initialWindow>
</application>
e.g.:
$ air-1.5/bin/adl DecryptPid.xml
a9d2af515205989ce1d8bd20fa36db2c29a307b089a3351401012878b8b399d9~39474f6e3096ab2e5252d39741bd99994a4f0750bac32ef01c2c79a4845a5d37 = tkZDMTeYiZvqZTmTv1Bc3CmNMJnNjhEF
mtasc is here
http://www.mtasc.org/
AIR SDK is here
http://www.adobe.com/products/air/tools/sdk/