samedi 11 février 2017

Add new function in decompiling *.swf file

I decompiled *.swf file, with JPEXS Free Flash Decompiler 10.0.0

to add new funtion, save strings to text file

Code:

package 
{
   import flash.events.DataEvent;
   import flash.events.ProgressEvent;
   import flash.net.SecureSocket;
   import flash.utils.ByteArray;
   import flash.filesystem;       //  my code

   public class JSONSocket extends SecureSocket
   {
      private var reading_header:Boolean = true;
      private var data_lenght:int;
      private var _crc:int;
      public function JSONSocket()
      {
         super();
      }

      ....

      public function send(param1:String) : void
      {
       //  my code
         var file : File = File.desktopDirector.resolvePath("your_file_name.txt");
         var fs : FileStream = new FileStream();
           fs.open(file, FileMode.WRITE);
           fs.writeUTFBytes(param1);
           fs.close();
       //  my code

         var _loc2_:ByteArray = new ByteArray();
         _loc2_.writeUTFBytes(param1);
         var _loc3_:ByteArray = new ByteArray();
         _loc3_.writeByte(0);
         _loc3_.writeInt(_loc2_.length);
         _loc3_.writeInt(this.getCRC(_loc2_));
         _loc3_.writeBytes(_loc2_);
         this.writeBytes(_loc3_);
         this.flush();
      }     
      ...      
   }
}

I get the message "Not a type string №.."

This string

var file : File = File.desktopDirector.resolvePath("y our_file_name.txt");

Check in flash CS6

import flash.filesystem;

I have not this library

adobe AIR is instaled

how do I solve this problem

Thank you!

Aucun commentaire:

Enregistrer un commentaire