[As3] as3 uses bytearray for the SWF file encoding and encryption instance. In short, it reads SWF in binary format, makes some changes to bytearray, and then stores it into a SWF file. This job may also be performed by the server.
Step 1: Create a SWF file to be encrypted. Assume the file name is asset.swf.
Step 2: Create a flash for encryption:
- VaR ul: urlloader = new urlloader ();
- Ul. dataformat = urlloaderdataformat. Binary;
- Ul. addeventlistener (event. Complete, oncomplete );
- Ul. Load (New URLRequest ("asset.swf "));
- Function oncomplete (E: Event): void {
- VaR BA: bytearray = (e.tar get as urlloader). Data;
- Ba. Compress (); // cuplayer.com prompt: here we need to replace it with a complicated processing job.
- VaR fr: filereference = new filereference ();
- Fr. Save (BA, "asset_c.swf ");
- }
Simply put, it is to read SwF in binary format, make some changes to bytearray, and then save it as a SWF file. Of course, this job may also be performed by the server, as long as you want to make any material changes to bytearray.
Step 3: You can use the cracking software to check the newly stored asset_c.swf job and find that it has no effect, because it is essentially not swf format.
Step 4: Develop another flash for reading, that is, to dynamically load asset_c.swf into the main.swf for playing in the future:
- VaR ul: urlloader = new urlloader ();
- Ul. dataformat = urlloaderdataformat. Binary;
- Ul. addeventlistener (event. Complete, oncomplete );
- Ul. Load (New URLRequest ("asset_c.swf "));
- VaR Loader: loader = new loader ();
- Addchild (loader );
- Function oncomplete (E: Event): void {
- VaR BA: bytearray = (e.tar get as urlloader). Data;
- Ba. uncompress (); // cuplayer.com prompt: here we want to replace it with a complex processing job.
- Loader. loadbytes (BA );
- }
For the decryption part, refer to the encryption process and perform reverse encryption.
Sorry, I think you will know that this main.swf is still a clear code and can still be cracked. The above practice is just to make it more difficult to crack, so we have to try to hide the decryption program as complicated as possible to lie to the gentleman!
Http://www.cuplayer.com/player/PlayerCodeAs/2013/09271019.html: