protected override void OnPopulate() { RELGroupNode g; g = new RELGroupNode() { _name = "Sections" }; g.Parent = this; g = new RELGroupNode() { _name = "Imports" }; g.Parent = this; _sections = new RELSectionNode[_numSections]; for (int i = 0; i < _numSections; i++) { (_sections[i] = new RELSectionNode() { _name = "Section" + i }).Initialize(Children[0], &Header->SectionInfo[i], RELSection.Size); } for (int i = 0; i < Header->ImportListCount; i++) { new RELImportNode().Initialize(Children[1], &Header->Imports[i], RELImport.Size); } }
protected override bool OnInitialize() { _name = "Module" + ModuleID; _cmds = new List <RELLinkNode>(); RELLinkNode n; RELSectionNode memblock = null; uint offset = 0; RELImport *header = Header; RELLink * link = (RELLink *)((VoidPtr)Root.Header + (uint)header->_offset); while (link->Type != RELLinkType.End) { offset += link->_prevOffset; if (link->Type == RELLinkType.Section) { offset = 0; memblock = Root.Sections[link->_section]; } else { if (memblock != null) { memblock.RelocationBuffer[offset.RDown(0x4) / 0x4] = new RelCommand((int)Root._id, memblock.Index, offset, ModuleID, *link); } else { throw new Exception("Non-block oriented relocation command."); } } (n = new RELLinkNode() { _section = memblock }).Initialize(null, link++, RELImport.Size); _cmds.Add(n); } //Add the end node (n = new RELLinkNode() { _section = memblock }).Initialize(null, link++, RELImport.Size); _cmds.Add(n); return(false); }