/// <summary> /// Returns the segment that contains the specified address. /// </summary> public bool TryFindSegment(Address addr, out ImageSegment segment) { if (!Segments.TryGetLowerBound(addr, out segment)) { return(false); } if (segment.Address.ToLinear() == addr.ToLinear()) { return(true); } return(segment.IsInRange(addr)); }
/// <summary> /// Returns the segments that contains the specified linear address. /// </summary> public bool TryFindSegment(ulong linAddress, out ImageSegment segment) { if (!this.SegmentByLinAddress.TryGetLowerBound(linAddress, out segment)) { return(false); } if (segment.Address.ToLinear() == linAddress) { return(true); } return(segment.IsInRange(linAddress)); }
/// <summary> /// Returns the segment that contains the specified address. /// </summary> /// <param name="addr"></param> /// <returns></returns> public bool TryFindSegment(Address addr, out ImageSegment segment) { if (!segments.TryGetLowerBound(addr, out segment)) return false; if (segment.Address.ToLinear() == addr.ToLinear()) return true; return segment.IsInRange(addr); }
/// <summary> /// Grab a single instruction. /// </summary> /// <param name="segment"></param> /// <param name="a"></param> /// <returns></returns> private MachineInstruction Dasm(ImageSegment segment, int a) { var addr = segment.Address + a; if (!segment.IsInRange(addr) || !segment.MemoryArea.IsValidAddress(addr)) return null; var dasm = program.CreateDisassembler(addr); return dasm.FirstOrDefault(); }
private TreeNodeDesigner[] GetGlobalVariables(ImageMap imageMap, ImageSegment segment) { if (imageMap.Items.Values .Where(i => !(i is ImageMapBlock) && !(i.DataType is UnknownType)) .Any(i => segment.IsInRange(i.Address))) { return new TreeNodeDesigner[] { new GlobalVariablesNodeDesigner(segment) }; } else { return new TreeNodeDesigner[0]; } }