Esempio n. 1
0
        private void ReadLocalPool(DataBuffer data)
        {
            data.Position = LocalPoolOffset;
            int length      = SysAtrPoolOffset - LocalPoolOffset;
            int tableOffset = LocalPoolOffset + data.ReadInt32();

            int[] offsets = ReadIntTable(data, LocalPoolOffset);
            Sections.Add(new Section("Local Pool", LocalPoolOffset, offsets.Length, length));

            LocalPool = new VmObject[offsets.Length][];
            for (int i = 0; i < offsets.Length; i++)
            {
                data.Position = tableOffset + offsets[i];
                int offset = data.ReadInt32();
                int count  = data.ReadInt32();
                data.Position += offset - 8;
                var entries = new VmObject[count];

                for (int j = 0; j < count; j++)
                {
                    entries[j] = new VmObject(data, Is64Bit);
                }

                LocalPool[i] = entries;
            }
        }
Esempio n. 2
0
        private static void PrintStaticVars(Script script, StringBuilder sb)
        {
            sb.AppendLine("Static Variables:");
            var table = new Table("Idx", "Name", "Type", "Len", "Value", "F8");

            for (int i = 0; i < script.StaticVars.Length; i++)
            {
                VmObject item = script.StaticVars[i];
                table.AddRow(i.ToString(), item.Name, item.Type.ToString(), item.Length.ToString(), item.Value.ToString(), item.Field8.ToString());
            }

            sb.AppendLine(table.Print());
        }
Esempio n. 3
0
        private void ReadStaticVars(DataBuffer data)
        {
            data.Position = StaticVarsOffset;
            int offset = data.ReadInt32();
            int count  = data.ReadInt32();
            int length = LocalPoolOffset - StaticVarsOffset;

            data.Position = StaticVarsOffset + offset;

            Sections.Add(new Section("Static Vars", StaticVarsOffset, count, length));

            StaticVars = new VmObject[count];
            for (int i = 0; i < StaticVars.Length; i++)
            {
                StaticVars[i] = new VmObject(data, Is64Bit);
            }
        }