Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ;
- import sys.io.File;
- import haxe.io.Bytes;
- import haxe.crypto.Md5;
- class Main
- {
- private static inline var KEY:String = "rootmeifyoucan";
- private static inline var FILE:String = "1_RootMe_EmbeddedSWF.bin";
- private static inline var NEW_FILE:String = "2_RootMe_EmbeddedSWF.bin";
- private static inline var CODE:String = "dbbcd6ee441aa6d2889e6e3cae6adebe";
- private static inline var FIND:String = "xxxxxxxxxxxx";
- public static function main()
- {
- var bytes = File.getBytes(FILE);
- File.saveBytes(NEW_FILE, XOR(bytes, KEY));
- Hex.fromArray(MD5.hash(Hex.toArray(Hex.fromString(this._e4G79.split("").reverse().join("")))))
- hex_from_array(Md5.make(hex_to_array(hex_from_string("codea12chiffrestopsecreto"))));
- ==
- CODE
- }
- static private hex_from_array(bytes:Bytes, param)
- static private function XOR(bytes:Bytes, key:String) : Bytes
- {
- var new_bytes = bytes;
- var j = 0;
- for(i in 0...bytes.length)
- {
- new_bytes.set(i, (new_bytes.get(i) ^ key.charCodeAt(j)));
- j ++;
- if(j >= key.length) j = 0;
- }
- return new_bytes;
- }
- /* AS3 to haxe
- public static function toArray(param1:String) : ByteArray
- {
- param1 = param1.replace(/\s|:/gm,"");
- var _loc2_:ByteArray = new ByteArray();
- if(param1.length & 1 == 1)
- {
- param1 = "0" + param1;
- }
- var _loc3_:uint = 0;
- while(_loc3_ < param1.length)
- {
- _loc2_[_loc3_ / 2] = parseInt(param1.substr(_loc3_,2),16);
- _loc3_ = _loc3_ + 2;
- }
- return _loc2_;
- }
- public static function fromArray(param1:ByteArray, param2:Boolean = false) : String
- {
- var _loc3_:* = "";
- var _loc4_:uint = 0;
- while(_loc4_ < param1.length)
- {
- _loc3_ = _loc3_ + ("0" + param1[_loc4_].toString(16)).substr(-2,2);
- if(param2)
- {
- if(_loc4_ < param1.length - 1)
- {
- _loc3_ = _loc3_ + ":";
- }
- }
- _loc4_++;
- }
- return _loc3_;
- }
- */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement