public CEEntryNode CreateCEEntryNode()
        {
            CEEntryNode n = new CEEntryNode();

            this.Children[0].AddChild(n);
            return(n);
        }
Exemple #2
0
        public override void OnPopulate()
        {
            Type t = null; //switch by name

            if (_name == "Events")
            {
                t = typeof(CEEntryNode);
            }
            else if (_name == "Strings")
            {
                t = typeof(CEStringNode);
            }
            else
            {
                return;
            }

            if (t == typeof(CEEntryNode)) //is this CEEntryNode?
            {
                for (int i = 0; i < Header->_numEntries; i++)
                {
                    VoidPtr     entry = (VoidPtr)Header + Header->entryOffsets[i];
                    CEEntryNode node  = new CEEntryNode
                    {
                        NextAddress = (VoidPtr)Header + Header->entryOffsets[i + 1]
                    };
                    node.Initialize(this, new DataSource(entry, node.NextAddress - entry));
                }
            }
            else //this is CEStringNode
            {
                bint *offset = &Header->entryOffsets[Header->_numEntries];
                for (; offset < (VoidPtr)Header + Header->entryOffsets[0]; offset++)
                {
                    if (*offset != 0x0)
                    {
                        CEStringNode node = new CEStringNode();
                        node.Initialize(this, new DataSource((VoidPtr)Header + *offset, 0x0));
                    }
                }
            }
        }
 public CEEntryNode CreateCEEntryNode()
 {
     CEEntryNode n = new CEEntryNode();
     this.Children[0].AddChild(n);
     return n;
 }
        public override void OnPopulate()
        {
            Type t = null;//switch by name
            if (_name == "Events")
                t = typeof(CEEntryNode);
            else if (_name == "Strings")
                t = typeof(CEStringNode);
            else
                return;

            if (t == typeof(CEEntryNode))//is this CEEntryNode?
                for (int i = 0; i < Header->_numEntries; i++)
                {
                    VoidPtr entry = (VoidPtr)Header + Header->entryOffsets[i];
                    CEEntryNode node = new CEEntryNode();
                    node.NextAddress = (VoidPtr)Header + Header->entryOffsets[i + 1];
                    node.Initialize(this, new DataSource(entry, node.NextAddress - entry));
                }
            else//this is CEStringNode
            {
                bint* offset = &Header->entryOffsets[Header->_numEntries];
                for (; (VoidPtr)offset < (VoidPtr)Header + Header->entryOffsets[0]; offset++)
                {
                    if (*offset != 0x0)
                    {
                        CEStringNode node = new CEStringNode();
                        node.Initialize(this, new DataSource((VoidPtr)Header + *offset, 0x0));
                    }
                }
            }
        }