Interface INativeContext

All Known Subinterfaces:
INativeCodeUnit<InsnType>

@Ser public interface INativeContext
Native code context. The context is a super-interface of the INativeCodeUnit and allows the implementation of test disassemblers outside of the unit management facility.
  • Method Details

    • getCodeContainerType

      int getCodeContainerType()
      Retrieve the code container type.
      Returns:
      0=unknown, 1=ELF, 2=PE
    • getSubsystemType

      SubsystemType getSubsystemType()
      Retrieve the executable subsystem type.
      Returns:
      subsystem type, or null if unknown
    • getDetectedCompiler

      ICompiler getDetectedCompiler()
      Retrieve the compiler detected for this native unit.
      Returns:
      detected compiler descriptor
    • trackNativeItem

      void trackNativeItem(INativeType type, IEventListener listener)
      Register a listener for updates to a native type or item.
      Parameters:
      type - native type to track
      listener - event listener
    • getProcessor

      IProcessor<?> getProcessor()
      Retrieve the machine code parser (pseudo-processor).
      Returns:
      processor instance
    • getMemory

      IVirtualMemory getMemory()
      Retrieve the virtual memory model.
      Returns:
      virtual memory model
    • getTypeManager

      ITypeManager getTypeManager()
      Retrieve the native type manager.
      Returns:
      type manager
    • getVirtualImageBase

      long getVirtualImageBase()
      Retrieve the virtual image base. This virtual address is the reference for every memory access.
      Returns:
      the virtual image base
    • getImageSize

      long getImageSize()
      Retrieve the size of the image
      Returns:
      image size in bytes
    • getRoutines

      List<INativeMethodItem> getRoutines()
      Retrieve all known routines.
      Returns:
      routine list
    • getRoutine

      INativeMethodItem getRoutine(long address)
      Retrieve the routine starting at an address.
      Parameters:
      address - routine start address
      Returns:
      routine, or null
    • getRoutineOver

      INativeMethodItem getRoutineOver(long address)
      Retrieve the routine containing an address.
      Parameters:
      address - address to test
      Returns:
      containing routine, or null
    • getRoutineByName

      INativeMethodItem getRoutineByName(String name)
      Retrieve a routine by name.
      Parameters:
      name - routine name
      Returns:
      matching routine, or null
    • getFields

      List<INativeFieldItem> getFields()
      Retrieve all known fields.
      Returns:
      field list
    • getField

      INativeFieldItem getField(long address)
      Retrieve the field starting at an address.
      Parameters:
      address - field start address
      Returns:
      field, or null
    • getNativeItemAt

      INativeContinuousItem getNativeItemAt(long address)
      Retrieve the native continuous memory item (a variable, an instruction) starting at the provided address.
      Parameters:
      address - item start address
      Returns:
      native item, or null
    • getNativeItemOver

      INativeContinuousItem getNativeItemOver(long address)
      Retrieve the native continuous memory item (a variable, an instruction) spanning over the provided address.
      Parameters:
      address - address to test
      Returns:
      native item, or null
    • createMethodReference

      INativeMethodItem createMethodReference(String name, IPrototypeItem prototype, INativeMethodDataItem methodData)
      Create a method reference backed by native method data.
      Parameters:
      name - method name
      prototype - method prototype
      methodData - method data
      Returns:
      method reference
    • getDynamicBranchResolution

      IBranchResolution getDynamicBranchResolution(long address)
      Retrieve the recorded dynamic branch resolution at an address.
      Parameters:
      address - branch instruction address
      Returns:
      branch resolution, or null
    • recordDynamicBranchTarget

      boolean recordDynamicBranchTarget(long instructionAddress, boolean resolved, IBranchTarget target)
      Record a dynamic branch target.
      Parameters:
      instructionAddress - branch instruction address
      resolved - true if the target was resolved
      target - resolved target, or null
      Returns:
      true if the target was recorded
    • requestRoutineReanalysis

      void requestRoutineReanalysis(INativeMethodItem routine)
      Request reanalysis of a routine.
      Parameters:
      routine - routine to reanalyze