actually supply the ExecutableObjectModel with section data
This commit is contained in:
parent
b2e23c1b2b
commit
7ae8ab9b9b
@ -227,8 +227,29 @@ namespace UniversalEditor.DataFormats.Executable.ELF
|
||||
}
|
||||
br.Accessor.Position = pos;
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i < sections.Count; i++)
|
||||
{
|
||||
ExecutableSection sect = new ExecutableSection();
|
||||
sect.PhysicalAddress = sections[i].offset;
|
||||
sect.VirtualSize = sections[i].size;
|
||||
sect.DataRequest += sect_DataRequest;
|
||||
exe.Sections.Add(sect);
|
||||
}
|
||||
}
|
||||
|
||||
private void sect_DataRequest(object sender, DataRequestEventArgs e)
|
||||
{
|
||||
ExecutableSection sect = (sender as ExecutableSection);
|
||||
if (sect == null)
|
||||
return;
|
||||
|
||||
Accessor.Reader.Seek(sect.PhysicalAddress, SeekOrigin.Begin);
|
||||
e.Data = Accessor.Reader.ReadBytes(sect.VirtualSize);
|
||||
}
|
||||
|
||||
|
||||
protected override void SaveInternal(ObjectModel objectModel)
|
||||
{
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user