Пример #1
0
        // Here we get each string value out of the string table
        // Then it gets added to the stack
        // Thanks to King for helping me with this function :)
        public IList <string> ReadStringTable()
        {
            StringBuilder  b         = new StringBuilder();
            IList <string> constants = new List <string>();

            byte Size = Bytecode[1];

            int SizeK = Bytecode[2];

            bool End = true;

            int val  = 0;
            int Base = 1; // Applied to the index

            for (int i = 0; i < Size; i++)
            {
                for (int idx = sizep + Base; idx < SizeK + sizep + 1; idx++)
                {
                    b.Append(HexLib.ToChar(Bytecode[idx]));
                    val = idx;
                }
                if (End)
                {
                    Base++;
                    End = false;
                }

                SizeK = Bytecode[val + 1] + 1;
                sizep = val++;

                constants.Add(b.ToString());
                b.Clear();
            }
            return(constants);
        }
Пример #2
0
        public IList <Roblox.IntegerConstant> ReadIntegerConstants()
        {
            IList <Roblox.IntegerConstant> Constants = new List <Roblox.IntegerConstant>();

            for (int i = sizep; i < Bytecode.Length; i++)
            {
                if (Roblox.Instruction.GetOpCode(Bytecode[i]) == Roblox.Instruction.OpCode.LoadNumber)
                {
                    Constants.Add(new Roblox.IntegerConstant(HexLib.ToInt(Bytecode[i + 1])));
                }
            }
            return(Constants);
        }
Пример #3
0
 static void Main(string[] args)
 {
     Decompiler a = new Decompiler(HexLib.ToByteArray("01 03 05 70 72 69 6E 74 05 48 65 6C 6C 6F 05 73 70 61 77 6E 02 02 00 00 00 06 C0 00 00 00 A4 00 01 00 00 00 00 40 6F 01 02 00 9F 00 02 01 82 00 01 00 03 03 01 04 00 00 00 40 03 02 00 00 06 01 01 00 00 00 01 00 02 00 00 01 07 A3 00 00 00 A4 00 01 00 00 00 00 40 D9 01 00 00 9F 00 02 02 9F 00 01 01 82 00 01 00 02 03 03 04 00 00 00 40 01 00 00 07 01 00 00 00 00 00 02 00"));
 }