public ulong VAToOffset(SectionTableEntry section, ulong va) { ulong image_base = reader.NTHeaders.OptionalHeader.ImageBase; uint rva = Convert.ToUInt32(va - image_base); return RVAToOffset(section,rva); }
public uint OffsetToRVA(SectionTableEntry section, ulong offset) { uint rva = Convert.ToUInt32((offset + section.VirtualAddress) - section.PointerToRawData); return rva; }
public ulong RVAToOffset(SectionTableEntry section, uint rva) { ulong offset = (rva - section.VirtualAddress) + section.PointerToRawData; return offset; }
public ulong OffsetToVA(SectionTableEntry section, ulong offset) { ulong image_base = reader.NTHeaders.OptionalHeader.ImageBase; uint rva = Convert.ToUInt32((offset + section.VirtualAddress) - section.PointerToRawData); return image_base + rva; }
private string[] ShowSectionTable_Characteristics(SectionTableEntry section) { List<string> results = new List<string>(); SectionCharacteristicsType chars = section.GetCharacteristics(); long enum_value = Convert.ToInt64(chars); EnumAnnotations<SectionCharacteristicsType> enum_annotations = new EnumAnnotations<SectionCharacteristicsType>(); foreach (EnumAnnotation<SectionCharacteristicsType> annotation in enum_annotations) { long value = Convert.ToInt64(annotation.Value); if (value == 0) continue; bool selected = ((enum_value & value) == value); if (!selected) continue; string line = String.Format("{0} {1}", Utils.IntToHex(value, 8), annotation.HeaderName); results.Add(line); } int max_len = 0; foreach (var line in results) { if (line.Length > max_len) max_len = line.Length; } return results.ToArray(); }
public ulong OffsetToVA(SectionTableEntry section, long offset) { if (_nt_headers == null) LoadNTHeaders(); ulong image_base = _nt_headers.OptionalHeader.ImageBase; uint rva = Convert.ToUInt32((offset + section.VirtualAddress) - section.PointerToRawData); return image_base + rva; }
public long VAToOffset(SectionTableEntry section, ulong va) { if (_nt_headers == null) LoadNTHeaders(); ulong image_base = _nt_headers.OptionalHeader.ImageBase; uint rva = Convert.ToUInt32(va - image_base); return RVAToOffset(section,rva); }