public void Read(BinaryReader reader) { magic = reader.ReadInt16(); lMajor = reader.ReadByte(); lMinor = reader.ReadByte(); codeSize = reader.ReadUInt32(); initDataSize = reader.ReadUInt32(); uninitDataSize = reader.ReadUInt32(); entryRVA = new RVA(reader.ReadUInt32()); codeBase = new RVA(reader.ReadUInt32()); dataBase = new RVA(reader.ReadUInt32()); }
public long RVAToVA(RVA rva) { string sectName = RVAToSectionName(rva); long res = 0; if (sectName != null) { Section s = (Section)Sections [sectName]; res = rva + (s.PointerToRawData - s.VirtualAddress); } return(res); }
public void Read (BinaryReader reader) { magic = reader.ReadInt16 (); lMajor = reader.ReadByte (); lMinor = reader.ReadByte (); codeSize = reader.ReadUInt32 (); initDataSize = reader.ReadUInt32 (); uninitDataSize = reader.ReadUInt32 (); entryRVA = new RVA (reader.ReadUInt32 ()); codeBase = new RVA (reader.ReadUInt32 ()); dataBase = new RVA (reader.ReadUInt32 ()); }
public void Read(BinaryReader reader) { phAddr_virtSize = reader.ReadUInt32(); virtAddr = new RVA(reader.ReadUInt32()); rawSize = reader.ReadUInt32(); rawDataPtr = new RVA(reader.ReadUInt32()); relocPtr = new RVA(reader.ReadUInt32()); lineNumPtr = new RVA(reader.ReadUInt32()); relocNum = reader.ReadInt16(); linenumNum = reader.ReadInt16(); flags = (SectionCharacteristics)reader.ReadUInt32(); }
public void Read (BinaryReader reader) { phAddr_virtSize = reader.ReadUInt32 (); virtAddr = new RVA (reader.ReadUInt32 ()); rawSize = reader.ReadUInt32 (); rawDataPtr = new RVA (reader.ReadUInt32 ()); relocPtr = new RVA (reader.ReadUInt32 ()); lineNumPtr = new RVA (reader.ReadUInt32 ()); relocNum = reader.ReadInt16 (); linenumNum = reader.ReadInt16 (); flags = (SectionCharacteristics) reader.ReadUInt32 (); }
/// <summary> /// Returns name of the section for the given RVA. /// </summary> /// <param name="rva"></param> /// <returns></returns> public string RVAToSectionName(RVA rva) { string res = null; foreach (Section s in Sections.Values) { RVA sva = s.VirtualAddress; if (rva >= sva && rva < sva + s.SizeOfRawData) { res = s.Name; break; } } return(res); }
public void Read (BinaryReader reader) { virtAddr = new RVA (reader.ReadUInt32 ()); size = reader.ReadUInt32 (); }
public long RVAToVA(RVA rva) { string sectName = RVAToSectionName(rva); long res = 0; if (sectName != null) { Section s = (Section) Sections [sectName]; res = rva + (s.PointerToRawData - s.VirtualAddress); } return res; }
/// <summary> /// Returns name of the section for the given RVA. /// </summary> /// <param name="rva"></param> /// <returns></returns> public string RVAToSectionName(RVA rva) { string res = null; foreach (Section s in Sections.Values) { RVA sva = s.VirtualAddress; if (rva >= sva && rva < sva + s.SizeOfRawData) { res = s.Name; break; } } return res; }
static RVA() { Null = new RVA(0); }
public void Read(BinaryReader reader) { virtAddr = new RVA(reader.ReadUInt32()); size = reader.ReadUInt32(); }