Class CodeObjectUnitUtil

java.lang.Object
com.pnfsoftware.jeb.core.units.codeobject.CodeObjectUnitUtil

public class CodeObjectUnitUtil extends Object
Utility routines for ICodeObjectUnit.
  • Method Details

    • findSymbolByName

      public static ISymbolInformation findSymbolByName(ICodeObjectUnit unit, String name)
      Get first symbol with given name
      Parameters:
      unit - code object unit
      name - symbol name
      Returns:
      first symbol with given name, null if none
    • findAllSymbolsByName

      public static List<ISymbolInformation> findAllSymbolsByName(ICodeObjectUnit unit, String name)
      Get all symbols with given name
      Parameters:
      unit - code object unit
      name - symbol name
      Returns:
      symbols with given name, empty list if none
    • findAllSymbolsByRelativeAddress

      public static List<ISymbolInformation> findAllSymbolsByRelativeAddress(ICodeObjectUnit unit, long rva)
      Get all symbols for given relative virtual address.
      Parameters:
      unit - code object unit
      rva - relative virtual address
      Returns:
      symbols for given relative virtual address, empty list if none
    • hasSymbolsAtRelativeAddress

      public static boolean hasSymbolsAtRelativeAddress(ICodeObjectUnit unit, long rva)
      Determine whether symbols exist at the provided relative virtual address.
      Parameters:
      unit - code object unit
      rva - relative virtual address
      Returns:
      true if at least one symbol exists at the address
    • findExportedSymbolByName

      public static ISymbolInformation findExportedSymbolByName(ICodeObjectUnit unit, String name)
      Find an exported symbol by name.
      Parameters:
      unit - code object unit
      name - symbol name
      Returns:
      exported symbol, or null if none
    • findImportedSymbolByName

      public static ISymbolInformation findImportedSymbolByName(ICodeObjectUnit unit, String name)
      Find an imported symbol by name.
      Parameters:
      unit - code object unit
      name - symbol name
      Returns:
      imported symbol, or null if none
    • findSectionByName

      public static ISegmentInformation findSectionByName(ICodeObjectUnit unit, String name)
      Find a section by name.
      Parameters:
      unit - code object unit
      name - section name
      Returns:
      section information, or null if none
    • findSegmentByName

      public static ISegmentInformation findSegmentByName(ICodeObjectUnit unit, String name)
      Find a segment by name.
      Parameters:
      unit - code object unit
      name - segment name
      Returns:
      segment information, or null if none
    • findSectionByRelativeAddress

      public static ISegmentInformation findSectionByRelativeAddress(ICodeObjectUnit unit, long rva)
      Find section covering the given relative virtual address.
      Parameters:
      unit - code object unit
      rva - relative virtual address
      Returns:
      section information, or null if none
    • findSegmentByRelativeAddress

      public static ISegmentInformation findSegmentByRelativeAddress(ICodeObjectUnit unit, long rva)
      Get segments covering the given relative virtual address.
      Parameters:
      unit - code object unit
      rva - relative virtual address
      Returns:
      segment information, or null if none
    • getUniqueNativeCodeUnitChild

      public static INativeCodeUnit<?> getUniqueNativeCodeUnitChild(ICodeObjectUnit unit)
      Get unique native code child if it exists, null otherwise.
      Parameters:
      unit - code object unit
      Returns:
      the unique native code unit child, or null if none or ambiguous