Autre Code incompréhensible

Inscrit
13 Avril 2016
Messages
72
Reactions
0
#1
Bonjour tout le monde, je suis confronté à un problème assez bizarre mdr :)

Dans le code ActionScript du RDM, à la fonction sendTicket(), il y a une déclaration de varialbe qui prend pour valeur la definition du paramètre entré:
Java:
var _loc1_:String = _a_-_---._a_--_--(-1820302810);
Je vais donc à la classe _a_-_--- et à la fonction _a_--_--.
Voici le code de _a_-_---:
Java:
package 
{
   import flash.display.Sprite;
   import flash.utils.ByteArray;
   import flash.utils.Endian;


   public class _a_-_--- extends Sprite
   {
      {
         var _loc1_:* = true;
         var _loc2_:* = false;
      }

      public function _a_-_---() {
         var _loc1_:* = false;
         var _loc2_:* = true;
         super();
      }

      private static var _a_--_-:Class = _a_-_-__;

      private static var _a_--_:Class = _a_-_;

      private static var _a_-__:Class = _a_---;

      private static var _a_-____:Array = new Array();

      private static var _a_----:Array = new Array();

      private static var _a_-___-:Boolean = false;

      private static var _a_--:int;

      private static function _a_-_--() : void {
         var _loc7_:* = false;
         var _loc8_:* = true;
         var _loc1_:ByteArray = new _a_--_-() as ByteArray;
         var _loc2_:ByteArray = new _a_--_() as ByteArray;
         var _loc3_:ByteArray = new _a_-__() as ByteArray;
         _loc3_.endian=Endian.LITTLE_ENDIAN;
         _a_--=_loc3_.readInt();
         var _loc4_:int = _loc2_.readByte();
         var _loc5_:* = 0;
         while(_loc5_<_loc4_)
         {
            _a_-__-_(_loc2_);
            _loc5_++;
         }
         _loc4_=_loc1_.readInt();
         var _loc6_:* = 0;
         while(_loc6_<_loc4_)
         {
            _a_--__(_loc1_,_a_----[_loc6_%_a_----.length]);
            _loc6_++;
         }
         _a_-___-=true;
      }

      private static function _a_--__(param1:ByteArray, param2:ByteArray) : void {
         var _loc6_:* = false;
         var _loc7_:* = true;
         var _loc3_:int = param1.readInt();
         var _loc4_:ByteArray = new ByteArray();
         param1.readBytes(_loc4_,0,_loc3_);
         var _loc5_:_a_-_-_ = new _a_-_-_(param2);
         _loc5_._a_---_(_loc4_);
         _loc4_.position=0;
         _a_-____.push(_loc4_.readUTFBytes(_loc4_.length));
      }

      private static function _a_-__-_(param1:ByteArray) : void {
         var _loc3_:* = false;
         var _loc4_:* = true;
         var _loc2_:ByteArray = new ByteArray();
         param1.readBytes(_loc2_,0,16);
         _loc2_.position=0;
         _a_----.push(_loc2_);
      }

      public static function _a_--_--(param1:int) : String {
         var _loc2_:* = false;
         var _loc3_:* = true;
         if(!_a_-___-)
         {
            _a_-_--();
         }
         return _a_-____[param1^_a_--];
      }


   }

}
Ce que je trouve bizarre c'est la fonction _a_-_--() qui est appelée dans la fonction _a_--_--().
En effet,
Java:
private static function _a_-_--() : void {
         var _loc7_:* = false;
         var _loc8_:* = true;
         var _loc1_:ByteArray = new _a_--_-() as ByteArray;
         var _loc2_:ByteArray = new _a_--_() as ByteArray;
         var _loc3_:ByteArray = new _a_-__() as ByteArray;
         _loc3_.endian=Endian.LITTLE_ENDIAN;
         _a_--=_loc3_.readInt();
         var _loc4_:int = _loc2_.readByte();
         var _loc5_:* = 0;
         while(_loc5_<_loc4_)
         {
            _a_-__-_(_loc2_);
            _loc5_++;
         }
         _loc4_=_loc1_.readInt();
         var _loc6_:* = 0;
         while(_loc6_<_loc4_)
         {
            _a_--__(_loc1_,_a_----[_loc6_%_a_----.length]);
            _loc6_++;
         }
         _a_-___-=true;
      }
_loc4_ prend la valeur _loc2_.readByte(), mais, _loc2_ vient juste d'être déclarée et elle est vide.

J'ai donc converti le tout en C# et j'ai donc:
Pour _a_-_---:
Code:
 public class First // _a_-_---
    {
        private static List<string> first = new List<string>(); // _a_-____
        private static List<BinaryReader> second = new List<BinaryReader>(); // _a_----
        private static bool third = false; // _a_-___-
        private static int fourth = 0; // _a_--

        private static void firstFunc() // _a_-_--
        {
            var loc1 = new BinaryReader(new MemoryStream());
            var loc2 = new BinaryReader(new MemoryStream());
            var loc3 = new BinaryReader(new MemoryStream());
            fourth = loc3.ReadInt32();
            int loc4 = loc2.ReadByte();
            var loc5 = 0;
            while (loc5 < loc4)
            {
                thirdFunc(loc2);
                loc5++;
            }
            loc4 = loc1.ReadInt32();
            var loc6 = 0;
            while (loc6 < loc4)
            {
                secondFunc(loc1, second[loc6 % second.Count]);
                loc6++;
            }
            third = true;
        }

        private static void secondFunc(BinaryReader param1, BinaryReader param2) // _a_--__
        {
            int loc3 = param1.ReadInt32();
            byte[] array = null;
            param1.Read(array, 0, loc3);
            var loc5 = new Second(param2);
            loc5.sixthFunc(array);
            var reader = new BinaryReader(new MemoryStream(array));
            first.Add(Encoding.UTF8.GetString(reader.ReadBytes(array.Length)));
        }

        private static void thirdFunc(BinaryReader param1) // _a_-__-_
        {
            byte[] loc2 = null;
            param1.Read(loc2, 0, 16);
            second.Add(new BinaryReader(new MemoryStream(loc2)));
        }

        public static string fourthFunc(int param1) // _a_--_--
        {
            if (!third)
            {
                firstFunc();
            }
            return first[param1 ^ fourth];
        }

    }
Et pour _a_-_-_:
Code:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RDM_DependenciesConverted
{
    public class Second
    {
        private int first = 0; // _a_-___
        private int second = 0;// _a_---__
        private List<byte> third = new List<byte>();// _a_-_-_-
        private const uint fourth = 256; // _a_-__--

        public Second(BinaryReader param1)
        {
            var loc2 = false;
            var loc3 = true;
            secondFunc(param1);
        }

        private uint firstFunc() // _a_--___
        {
            return fourth;
        }

        public void secondFunc(BinaryReader param1) // _a_-
        {
            var loc5 = false;
            var loc6 = true;
            var loc2 = 0;
            var loc3 = 0;
            var loc4 = 0;
            loc2 = 0;
            while (loc2 < 256)
            {
                this.third[loc2] = (byte)loc2;
                loc2++;
            }
            loc3 = 0;
            loc2 = 0;
            while (loc2 < 256)
            {
                var array = ((MemoryStream)param1.BaseStream).ToArray() ;
                loc3 = loc3 + this.third[loc2] + array[loc2 % array.Length] & 255;
                loc4 = third[loc2];
                third[loc2] = third[loc3];
                third[loc3] = (byte)loc4;
            }
            first = 0;
            second = 0;
        }

        private uint thirdFunc() // _a_-__-
        {
            var loc1 = 0;
            first = first + 1 & 255;
            second = second + third[first] & 255;
            loc1 = third[first];
            third[first] = third[second];
            third[second] = (byte)loc1;
            return third[loc1 + third[first] & 255];
        }

        public uint fourthFunc() // _a_--_-_
        {
            return 1;
        }

        public void fifthFunc(byte[] param1) // _a_-_--_
        {
            uint loc2 = 0;
            while (loc2 < param1.Length)
            {
                param1[loc2++] = (byte)(param1[loc2++] ^ thirdFunc());
            }
        }

        public void sixthFunc(byte[] param1) // _a_---_
        {
            fifthFunc(param1);
        }

        public void seventhFunc() // _a_-_-
        {

        }

    }
}
Mais bon j'ai une erreur, normal quoi.
Le pire c'est que dans le fichier AS, il n'y a que _a_-_---._a_--_-- !

Si quelqu'un pourrait m'éclairer...
Cordialement,Trytax.
 

Lakh92

Membre Actif
Inscrit
24 Decembre 2009
Messages
118
Reactions
0
#2
Prenons la classe suivante par exemple :

Code:
package
{
   import mx.core.ByteArrayAsset;
   
   public class §_a_---§ extends ByteArrayAsset
   {
       
     
      public function §_a_---§()
      {
         super();
      }
   }
}
Elle hérite de ByteArrayAsset (cf http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/core/ByteArrayAsset.html). Sur la documentation, on peut lire :

Code:
ByteArrayAsset is a subclass of the flash.utils.ByteArray class which represents an arbitrary sequence of byte data that you embed in a Flex application.

The byte data that you are embedding can be in any kind of file, and the entire file is always embedded.
....
The compiler autogenerates a subclass of the ByteArrayAsset class and sets your variable to be a reference to this autogenerated class. You can then use this class reference to create instances of the ByteArrayAsset using the new operator, and you can extract information from the byte array using methods of the ByteArray class:
L'idée est que la classe a été générée par le compilateur et est liée à un asset. À l'instantiation
Code:
var _loc1_:ByteArray = new _a_--_-() as ByteArray;
, le runtime s'occupe de récupérer l'asset et de créer un ByteArray de cet asset. Donc non, _loc1_ n'est pas vide à cet instant, il contient l'asset au complet qui est lié.
Avec FFDec, si tu vas dans BinaryData, tu trouves ceci :



Ces assets ont le même nom que les classe que tu utilises, et sont les données liées aux classes que tu utilises. En instantiant un new _a_---(), le contenu du BinaryData du même nom dans le SWF est inséré dans le ByteArray crée.

J'espère que c'est compréhensible. Pour rappel, c'est le même système qui est utilisé pour inclure les clés de cryptage du jeu.
 

Lakh92

Membre Actif
Inscrit
24 Decembre 2009
Messages
118
Reactions
0
#4
La classe _a_--- est un ByteArray qui contient l'asset du même nom, défini dans un tag DefineBinaryData, pour être exact.
 
Haut Bas