java.lang.Object
com.pnfsoftware.jeb.core.units.code.asm.analyzer.MemoryRanges

@Ser public class MemoryRanges extends Object
A collection of byte-addressable memory ranges. The final addressable byte (e.g., @ 0xFFFFFFFF in a 32-bit address space) cannot be part of any range.

This class is not thread-safe.

  • Constructor Details

    • MemoryRanges

      public MemoryRanges(int spaceBits)
    • MemoryRanges

      public MemoryRanges()
    • MemoryRanges

      public MemoryRanges(IVirtualMemory mem)
  • Method Details

    • add

      public void add(long begin0, long end0)
    • remove

      public void remove(long begin0, long end0)
    • clear

      public void clear()
    • min

      public Long min()
    • max

      public Long max()
    • count

      public int count()
    • asList

      public List<Couple<Long,Long>> asList()
      Convert the MemoryRanges to a List of ranges (stored as Couple.
      Returns:
      the list of MemoryRanges
    • contains

      public boolean contains(long address)
      Indicate if an address is defined in this MemoryRanges
      Parameters:
      address - address to test
      Returns:
      true if MemoryRanges contains this address
    • intersects

      public boolean intersects(long addressStart, long addressEnd)
      Indicate if an element from range [addressStart:addressEnd[ is defined in this MemoryRanges.
      Parameters:
      addressStart - start address (inclusive)
      addressEnd - end address (exclusive)
      Returns:
      true if MemoryRanges contains at least one address from the given range
    • getLocalBegin

      public Long getLocalBegin(long address0)
    • getLocalEnd

      public Long getLocalEnd(long address0)
    • getNextRange

      public Couple<Long,Long> getNextRange(long address0)
    • getPreviousRange

      public Couple<Long,Long> getPreviousRange(long address0)
    • getLocalRange

      public Couple<Long,Long> getLocalRange(long address0)
    • spanSize

      public long spanSize()
    • aggregatedRangesSize

      public long aggregatedRangesSize()
    • toString

      public String toString()
      Overrides:
      toString in class Object