Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package
- {
- import flash.display.MovieClip;
- import flash.events.Event;
- import flash.events.KeyboardEvent;
- import flash.external.ExternalInterface;
- import flash.net.URLLoader;
- import flash.net.URLLoaderDataFormat;
- import flash.net.URLRequest;
- import flash.net.URLRequestMethod;
- import flash.net.URLVariables;
- import flash.text.StyleSheet;
- import flash.text.TextField;
- import flash.text.TextFormat;
- import flash.ui.ContextMenu;
- import flash.utils.ByteArray;
- public class ChallengeTry extends MovieClip
- {
- private static const DECRYPTION_KEY:String = "1477166CA63EE45929653607B4408BA4";
- private static const CHALLENGE_TOKEN:String = "CC1738C726ED147629653607B4408BA4";
- private static const DOWNLOAD_SUBMIT_URL:String = " /data/challenge/?action=encrypted";
- private var seed:uint = 0;
- private var top:uint = 0;
- public function ChallengeTry()
- {
- super();
- graphics.beginFill(16777215);
- graphics.drawRect(-100,-100,1000,1000);
- graphics.endFill();
- var myMenu:ContextMenu = new ContextMenu();
- myMenu.hideBuiltInItems();
- this.contextMenu = myMenu;
- try
- {
- this.downloadSubmit("this-is-id");
- return;
- }
- catch(error:*)
- {
- this.initializeSeed();
- this.drawLine("Error: " + this.seed);
- return;
- }
- }
- private function downloadSubmit(param1:String) : void
- {
- var loader:URLLoader = null;
- var param1:String = param1;
- loader = null;
- ;
- loader = null;
- var token:String = param1;
- loader = new URLLoader();
- loader.dataFormat = URLLoaderDataFormat.BINARY;
- loader.addEventListener(Event.COMPLETE,function(param1:Event):void
- {
- this.drawText(new String(this.decrypt(loader.data)));
- });
- var request:URLRequest = new URLRequest(DOWNLOAD_SUBMIT_URL);
- request.method = URLRequestMethod.POST;
- request.data = new URLVariables("challengeToken=" + CHALLENGE_TOKEN);
- try
- {
- loader.load(request);
- return;
- }
- catch(error:Error)
- {
- this.drawText("Unable to show submit");
- return;
- }
- }
- private function initializeSeed() : void
- {
- this.seed = uint(uint(0));
- var _loc1_:int = 0;
- while(_loc1_ < DECRYPTION_KEY.length)
- {
- this.seed = uint(uint(this.seed * 106033 + int(DECRYPTION_KEY.charCodeAt(_loc1_))));
- _loc1_++;
- }
- }
- private function decrypt(param1:ByteArray) : ByteArray
- {
- var _loc5_:uint = 0;
- param1.position = 0;
- this.initializeSeed();
- var _loc2_:ByteArray = new ByteArray();
- var _loc3_:uint = param1.length;
- var _loc4_:int = 0;
- while(_loc4_ < _loc3_)
- {
- _loc5_ = param1.readUnsignedByte() ^ this.nextRandomUnsignedByte();
- _loc2_.writeByte(_loc5_);
- _loc4_++;
- }
- return _loc2_;
- }
- private function nextRandomUnsignedByte() : uint
- {
- return this.nextRandom() & 255;
- }
- private function nextRandom() : uint
- {
- this.seed = uint(uint(this.seed * 99371 + 97));
- return this.seed;
- }
- private function processScrollUp(param1:Event) : void
- {
- TextField(param1.target).scrollH++;
- }
- private function drawText(param1:String) : void
- {
- param1 = param1.split("\r\n").join("\n");
- ExternalInterface.call("console.log","2");
- var _loc2_:Object = new Object();
- _loc2_.fontWeight = "bold";
- _loc2_.color = "#008800";
- var _loc3_:Object = new Object();
- _loc3_.fontWeight = "bold";
- _loc3_.color = "#000088";
- var _loc4_:Object = new Object();
- _loc4_.fontWeight = "bold";
- _loc4_.color = "#880000";
- var _loc5_:Object = new Object();
- _loc5_.fontWeight = "bold";
- _loc5_.color = "#660066";
- var _loc6_:Object = new Object();
- _loc6_.fontWeight = "bold";
- _loc6_.color = "#006666";
- var _loc7_:Object = new Object();
- _loc7_.fontWeight = "bold";
- _loc7_.color = "#666600";
- var _loc8_:Object = new Object();
- _loc8_.fontWeight = "bold";
- _loc8_.color = "#000000";
- var _loc9_:Object = new Object();
- _loc9_.fontWeight = "bold";
- _loc9_.color = "#000088";
- var _loc10_:Object = new Object();
- _loc10_.fontWeight = "bold";
- _loc10_.color = "#660066";
- var _loc11_:Object = new Object();
- _loc11_.fontWeight = "bold";
- _loc11_.color = "#008800";
- var _loc12_:Object = new Object();
- _loc12_.fontWeight = "bold";
- _loc12_.color = "#660066";
- var _loc13_:Object = new Object();
- _loc13_.fontFamily = "Courier";
- _loc13_.fontSize = "10px";
- var _loc14_:StyleSheet = new StyleSheet();
- _loc14_.setStyle(".str",_loc2_);
- _loc14_.setStyle(".kwd",_loc3_);
- _loc14_.setStyle(".com",_loc4_);
- _loc14_.setStyle(".typ",_loc5_);
- _loc14_.setStyle(".lit",_loc6_);
- _loc14_.setStyle(".pun",_loc7_);
- _loc14_.setStyle(".pln",_loc8_);
- _loc14_.setStyle(".tag",_loc9_);
- _loc14_.setStyle(".atn",_loc10_);
- _loc14_.setStyle(".atv",_loc11_);
- _loc14_.setStyle(".dec",_loc12_);
- _loc14_.setStyle("body",_loc13_);
- var _loc15_:TextFormat = new TextFormat();
- _loc15_.font = "Courier";
- _loc15_.size = 10;
- var _loc16_:TextField = new TextField();
- _loc16_.mouseEnabled = false;
- _loc16_.doubleClickEnabled = false;
- _loc16_.tabEnabled = false;
- _loc16_.width = 490;
- _loc16_.height = 385;
- _loc16_.wordWrap = true;
- _loc16_.styleSheet = _loc14_;
- _loc16_.multiline = true;
- _loc16_.htmlText = param1;
- _loc16_.selectable = false;
- addChild(_loc16_);
- var _loc17_:ScrollBar = new ScrollBar(_loc16_);
- addChild(_loc17_);
- _loc16_.addEventListener(KeyboardEvent.KEY_DOWN,this.processScrollDown);
- }
- private function getBytes(param1:String) : ByteArray
- {
- var _loc2_:ByteArray = new ByteArray();
- _loc2_.writeUTF(param1);
- return _loc2_;
- }
- private function processScrollDown(param1:Event) : void
- {
- TextField(param1.target).scrollH++;
- }
- private function drawLine(param1:String) : void
- {
- this.top = uint(uint(this.top + 20));
- var _loc2_:TextField = new TextField();
- _loc2_.text = param1;
- _loc2_.y = this.top;
- _loc2_.selectable = false;
- addChild(_loc2_);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement