Guest User

player.swf chopped

a guest
Jul 21st, 2013
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         public function encryptPassword(arg1:String, arg2:String, arg3:String, arg4:uint=0, arg5:int=4096):void
  2.         {
  3.             var password:String;
  4.             var salt:String;
  5.             var challenge:String;
  6.             var hashType:uint=0;
  7.             var iterations:int=4096;
  8.             var onComplete_PBKDF2:Function;
  9.             var keyLen:int;
  10.             var pbkdf2:sirius.crypto.s3mp.PBKDF2;
  11.  
  12.             var loc1:*;
  13.             onComplete_PBKDF2 = null;
  14.             pbkdf2 = null;
  15.             password = arg1;
  16.             salt = arg2;
  17.             challenge = arg3;
  18.             hashType = arg4;
  19.             iterations = arg5;
  20.             onComplete_PBKDF2 = function (arg1:flash.events.Event):void
  21.             {
  22.                 pbkdf2.removeEventListener(flash.events.Event.COMPLETE, onComplete_PBKDF2);
  23.                 var loc1:*=sirius.crypto.Crypto.hashValue(hwid + ethernetMac + challenge);
  24.                 var loc2:*=challenge + loc1;
  25.                 passwordKey = com.hurlant.util.Hex.fromArray(pbkdf2.getResult());
  26.                 encryptedPassword = encryptRC4(loc2, passwordKey);
  27.                 dispatchEvent(new sirius.crypto.events.CryptoEvent(password, passwordKey, encryptedPassword));
  28.                 return;
  29.             }
  30.             var loc2:*=hashType;
  31.             switch (loc2)
  32.             {
  33.                 case 0:
  34.                 {
  35.                     password = sirius.crypto.Crypto.md5Hash(password);
  36.                     break;
  37.                 }
  38.                 case 1:
  39.                 {
  40.                     password = sirius.crypto.Crypto.md5Hash(password, true);
  41.                     break;
  42.                 }
  43.                 case 2:
  44.                 default:
  45.                 {
  46.                     password = DEFAULT_HASH;
  47.                     break;
  48.                 }
  49.             }
  50.             keyLen = 16;
  51.             pbkdf2 = new sirius.crypto.s3mp.PBKDF2(new com.hurlant.crypto.hash.SHA256(), com.hurlant.util.Hex.toArray(password), com.hurlant.util.Hex.toArray(salt), keyLen);
  52.             pbkdf2.addEventListener(flash.events.Event.COMPLETE, onComplete_PBKDF2);
  53.             pbkdf2.calculate(iterations);
  54.             return;
  55.         }
  56.  
  57.         protected static const hwid:String="00000000";
  58.         protected static const ethernetMac:String="0000CAFEBABE";
  59.         protected static const AES_KEY:String="263223a3a6c0a0050936623771ee35c7db1794b2a6ad8c9321963c427b0b999c";
  60.         protected static const DEFAULT_HASH:String="D0DB1CA3B300831A301AF9144FC6986A";
  61.         public var passwordKey:String;
  62.         public var encryptedPassword:String;
  63.  
  64.  
  65.  
  66. //      package s3mp
  67. //        class PBKDF2
  68. package sirius.crypto.s3mp
  69. {
  70.     import com.hurlant.crypto.hash.*;
  71.     import flash.events.*;
  72.     import flash.utils.*;
  73.     import sirius.utils.*;
  74.    
  75.     public class PBKDF2 extends flash.events.EventDispatcher
  76.     {
  77.         public function PBKDF2(arg1:com.hurlant.crypto.hash.IHash, arg2:flash.utils.ByteArray, arg3:flash.utils.ByteArray, arg4:uint)
  78.         {
  79.             var loc1:*=0;
  80.             super();
  81.             this._hashSize = arg1.getHashSize();
  82.             this._hmac = new com.hurlant.crypto.hash.HMAC(arg1, this._hashSize * 8);
  83.             this._password = arg2;
  84.             this._salt = arg3;
  85.             this._currentIteration = 0;
  86.             this._l = arg4 / this._hashSize;
  87.             if (arg4 % this._hashSize != 0)
  88.             {
  89.                 var loc2:*;
  90.                 var loc3:*=((loc2 = this)._l + 1);
  91.                 loc2._l = loc3;
  92.             }
  93.             this._r = arg4 - (this._l - 1) * this._hashSize;
  94.             this.processThreader = new sirius.utils.ProcessThreader();
  95.             return;
  96.         }
  97.  
  98.         public function calculate(arg1:uint):void
  99.         {
  100.             var loc1:*=null;
  101.             this.iterations = arg1;
  102.             if (this._currentIteration == 0 && this.iterations > 0)
  103.             {
  104.                 this._f = new Array();
  105.                 this._oldU = new Array();
  106.                 this.blockCounter = 0;
  107.                 while (this.blockCounter < this._l)
  108.                 {
  109.                     loc1 = new flash.utils.ByteArray();
  110.                     loc1.writeBytes(this._salt);
  111.                     loc1.writeUnsignedInt(this.blockCounter + 1);
  112.                     this._f[this.blockCounter] = this._hmac.compute(this._password, loc1);
  113.                     this._oldU[this.blockCounter] = new flash.utils.ByteArray();
  114.                     (this._oldU[this.blockCounter] as flash.utils.ByteArray).writeBytes(this._f[this.blockCounter]);
  115.                     var loc2:*;
  116.                     var loc3:*=((loc2 = this).blockCounter + 1);
  117.                     loc2.blockCounter = loc3;
  118.                 }
  119.                 loc3 = ((loc2 = this)._currentIteration + 1);
  120.                 loc2._currentIteration = loc3;
  121.                 loc3 = ((loc2 = this).iterations - 1);
  122.                 loc2.iterations = loc3;
  123.             }
  124.             this.processThreader.start(this.application_enterFrameHandler, this);
  125.             return;
  126.         }
  127.  
  128.         protected function application_enterFrameHandler(arg1:flash.events.Event):void
  129.         {
  130.             var loc2:*=0;
  131.             var loc1:*=this.iterations - ITERATIONS_PER_FRAME > 0 ? ITERATIONS_PER_FRAME : this.iterations;
  132.             if (loc1 > 0)
  133.             {
  134.                 loc2 = 0;
  135.                 while (loc2 < loc1)
  136.                 {
  137.                     this.u = new Array();
  138.                     this.blockCounter = 0;
  139.                     while (this.blockCounter < this._l)
  140.                     {
  141.                         this.u[this.blockCounter] = this._hmac.compute(this._password, this._oldU[this.blockCounter]);
  142.                         this.byteCounter = this._hashSize;
  143.                         do
  144.                         {
  145.                             var loc3:*;
  146.                             var loc4:*=((loc3 = this).byteCounter - 1);
  147.                             loc3.byteCounter = loc4;
  148.                             this._f[this.blockCounter][this.byteCounter] = this._f[this.blockCounter][this.byteCounter] ^ this.u[this.blockCounter][this.byteCounter];
  149.                         }
  150.                         while (this.byteCounter > 0);
  151.                         loc4 = ((loc3 = this).blockCounter + 1);
  152.                         loc3.blockCounter = loc4;
  153.                     }
  154.                     loc4 = ((loc3 = this)._currentIteration + 1);
  155.                     loc3._currentIteration = loc4;
  156.                     this._oldU = this.u;
  157.                     loc4 = ((loc3 = this).iterations - 1);
  158.                     loc3.iterations = loc4;
  159.                     if (this.iterations != 0)
  160.                     {
  161.                     };
  162.                     ++loc2;
  163.                 }
  164.             }
  165.             if (this.iterations == 0)
  166.             {
  167.                 this.processThreader.stop();
  168.                 dispatchEvent(new flash.events.Event(flash.events.Event.COMPLETE));
  169.             }
  170.             return;
  171.         }
  172.  
  173.         public function getResult():flash.utils.ByteArray
  174.         {
  175.             var loc1:*=0;
  176.             var loc2:*=new flash.utils.ByteArray();
  177.             if (this._l > 0)
  178.             {
  179.                 loc1 = 0;
  180.                 while (loc1 < (this._l - 1))
  181.                 {
  182.                     loc2.writeBytes(this._f[loc1]);
  183.                     ++loc1;
  184.                 }
  185.                 loc2.writeBytes(this._f[(this._l - 1)], 0, this._r);
  186.             }
  187.             return loc2;
  188.         }
  189.  
  190.        
  191.         {
  192.             ITERATIONS_PER_FRAME = 35;
  193.         }
  194.  
  195.         internal var _hashSize:uint;
  196.  
  197.         internal var _hmac:com.hurlant.crypto.hash.HMAC;
  198.  
  199.         internal var _l:uint;
  200.  
  201.         internal var _r:uint;
  202.  
  203.         internal var _password:flash.utils.ByteArray;
  204.  
  205.         internal var _salt:flash.utils.ByteArray;
  206.  
  207.         internal var _oldU:Array;
  208.  
  209.         internal var _f:Array;
  210.  
  211.         internal var _currentIteration:uint;
  212.  
  213.         protected var iterations:uint;
  214.  
  215.         protected var blockCounter:uint;
  216.  
  217.         protected var byteCounter:uint;
  218.  
  219.         protected var u:Array;
  220.  
  221.         protected var processThreader:sirius.utils.ProcessThreader;
  222.  
  223.         protected static var ITERATIONS_PER_FRAME:int=35;
  224.     }
  225. }
  226.  
  227.  
  228. //      class Crypto
  229. package sirius.crypto
  230. {
  231.     import com.adobe.crypto.*;
  232.     import com.hurlant.crypto.*;
  233.     import com.hurlant.crypto.hash.*;
  234.     import com.hurlant.crypto.symmetric.*;
  235.     import com.hurlant.util.*;
  236.     import flash.events.*;
  237.     import flash.utils.*;
  238.     import sirius.crypto.events.*;
  239.     import sirius.crypto.s3mp.*;
  240.     import sirius.utils.string.*;
  241.    
  242.     public class Crypto extends flash.events.EventDispatcher
  243.     {
  244.         public function Crypto()
  245.         {
  246.             super();
  247.             return;
  248.         }
  249.  
  250.         public function encryptPassword(arg1:String, arg2:String, arg3:String, arg4:uint=0, arg5:int=4096):void
  251.         {
  252.             var password:String;
  253.             var salt:String;
  254.             var challenge:String;
  255.             var hashType:uint=0;
  256.             var iterations:int=4096;
  257.             var onComplete_PBKDF2:Function;
  258.             var keyLen:int;
  259.             var pbkdf2:sirius.crypto.s3mp.PBKDF2;
  260.  
  261.             var loc1:*;
  262.             onComplete_PBKDF2 = null;
  263.             pbkdf2 = null;
  264.             password = arg1;
  265.             salt = arg2;
  266.             challenge = arg3;
  267.             hashType = arg4;
  268.             iterations = arg5;
  269.             onComplete_PBKDF2 = function (arg1:flash.events.Event):void
  270.             {
  271.                 pbkdf2.removeEventListener(flash.events.Event.COMPLETE, onComplete_PBKDF2);
  272.                 var loc1:*=sirius.crypto.Crypto.hashValue(hwid + ethernetMac + challenge);
  273.                 var loc2:*=challenge + loc1;
  274.                 passwordKey = com.hurlant.util.Hex.fromArray(pbkdf2.getResult());
  275.                 encryptedPassword = encryptRC4(loc2, passwordKey);
  276.                 dispatchEvent(new sirius.crypto.events.CryptoEvent(password, passwordKey, encryptedPassword));
  277.                 return;
  278.             }
  279.             var loc2:*=hashType;
  280.             switch (loc2)
  281.             {
  282.                 case 0:
  283.                 {
  284.                     password = sirius.crypto.Crypto.md5Hash(password);
  285.                     break;
  286.                 }
  287.                 case 1:
  288.                 {
  289.                     password = sirius.crypto.Crypto.md5Hash(password, true);
  290.                     break;
  291.                 }
  292.                 case 2:
  293.                 default:
  294.                 {
  295.                     password = DEFAULT_HASH;
  296.                     break;
  297.                 }
  298.             }
  299.             keyLen = 16;
  300.             pbkdf2 = new sirius.crypto.s3mp.PBKDF2(new com.hurlant.crypto.hash.SHA256(), com.hurlant.util.Hex.toArray(password), com.hurlant.util.Hex.toArray(salt), keyLen);
  301.             pbkdf2.addEventListener(flash.events.Event.COMPLETE, onComplete_PBKDF2);
  302.             pbkdf2.calculate(iterations);
  303.             return;
  304.         }
  305.  
  306.         public function decryptRC4(arg1:String, arg2:String):String
  307.         {
  308.             var text:String;
  309.             var key:String;
  310.             var dst:flash.utils.ByteArray;
  311.  
  312.             var loc1:*;
  313.             text = arg1;
  314.             key = arg2;
  315.             dst = new flash.utils.ByteArray();
  316.             dst.writeBytes(com.hurlant.util.Hex.toArray(text));
  317.             try
  318.             {
  319.                 this.buildKeyCipher(key).decrypt(dst);
  320.             }
  321.             catch (e:Error)
  322.             {
  323.                 return "";
  324.             }
  325.             return com.hurlant.util.Hex.fromArray(dst);
  326.         }
  327.  
  328.         public function encryptRC4(arg1:String, arg2:String):String
  329.         {
  330.             var text:String;
  331.             var key:String;
  332.             var dst:flash.utils.ByteArray;
  333.  
  334.             var loc1:*;
  335.             text = arg1;
  336.             key = arg2;
  337.             dst = new flash.utils.ByteArray();
  338.             dst.writeBytes(com.hurlant.util.Hex.toArray(text));
  339.             try
  340.             {
  341.                 this.buildKeyCipher(key).encrypt(dst);
  342.             }
  343.             catch (e:Error)
  344.             {
  345.                 return "";
  346.             }
  347.             return com.hurlant.util.Hex.fromArray(dst);
  348.         }
  349.  
  350.         protected function buildKeyCipher(arg1:String):com.hurlant.crypto.symmetric.CBCMode
  351.         {
  352.             var loc1:*=new flash.utils.ByteArray();
  353.             loc1[15] = 0;
  354.             var loc2:*=new com.hurlant.crypto.symmetric.CBCMode(new com.hurlant.crypto.symmetric.AESKey(com.hurlant.util.Hex.toArray(arg1)));
  355.             loc2.IV = loc1;
  356.             return loc2;
  357.         }
  358.  
  359.         public static function hashValue(arg1:String, arg2:int=16):String
  360.         {
  361.             var loc1:*=com.hurlant.util.Hex.toArray(arg1);
  362.             var loc2:*=new com.hurlant.crypto.hash.SHA256().hash(loc1);
  363.             return com.hurlant.util.Hex.fromArray(loc2).substr(0, arg2 * 2);
  364.         }
  365.  
  366.         public static function md5Hash(arg1:String, arg2:Boolean=false):String
  367.         {
  368.             arg1 = arg1 || "";
  369.             if (arg2)
  370.             {
  371.                 arg1 = arg1.toUpperCase();
  372.             }
  373.             return com.adobe.crypto.MD5.hash(sirius.utils.string.trim(arg1));
  374.         }
  375.  
  376.         public static function protect(arg1:String):String
  377.         {
  378.             var loc1:*=com.hurlant.util.Hex.toArray(com.hurlant.util.Hex.fromString(arg1));
  379.             buildCipher().encrypt(loc1);
  380.             return com.hurlant.util.Hex.fromArray(loc1);
  381.         }
  382.  
  383.         public static function unprotect(arg1:String):String
  384.         {
  385.             var loc1:*=com.hurlant.util.Hex.toArray(arg1);
  386.             buildCipher().decrypt(loc1);
  387.             return com.hurlant.util.Hex.toString(com.hurlant.util.Hex.fromArray(loc1));
  388.         }
  389.  
  390.         protected static function buildCipher():com.hurlant.crypto.symmetric.ICipher
  391.         {
  392.             var loc1:*=new com.hurlant.crypto.symmetric.PKCS5();
  393.             var loc2:*=com.hurlant.crypto.Crypto.getCipher("rc4-cbc", com.hurlant.util.Hex.toArray(AES_KEY), loc1);
  394.             loc1.setBlockSize(loc2.getBlockSize());
  395.             return loc2;
  396.         }
  397.  
  398.         protected static const hwid:String="00000000";
  399.  
  400.         protected static const ethernetMac:String="0000CAFEBABE";
  401.  
  402.         protected static const AES_KEY:String="263223a3a6c0a0050936623771ee35c7db1794b2a6ad8c9321963c427b0b999c";
  403.  
  404.         protected static const DEFAULT_HASH:String="D0DB1CA3B300831A301AF9144FC6986A";
  405.  
  406.         public var passwordKey:String;
  407.  
  408.         public var encryptedPassword:String;
  409.     }
  410. }
Advertisement
Add Comment
Please, Sign In to add comment