All Superinterfaces:
IPriorityBasedHooks
All Known Implementing Classes:
AndroidEmulationHooksSkeleton

public interface IEStateHooks extends IPriorityBasedHooks
Memory hooks.
  • Method Details

    • onReadMemory

      default Integer onReadMemory(EState state, long address, byte[] buffer)
      Invoked before a memory-read operation.
      Parameters:
      state - the state
      address - memory address
      buffer - output buffer (contents may be written by the hook; make sure to return a non-null code if so)
      Returns:
      null to process with the read; else, a read operation return code (one of: EState.MEMREAD_OK, EState.MEMREAD_FAILED, EState.MEMREAD_BADDATA)
    • onReadMemoryPost

      default Integer onReadMemoryPost(EState state, long address, byte[] buffer, int retcode)
      Invoked after a memory-read operation.
      Parameters:
      state - the state
      address - memory address
      buffer - read bytes (may be modified by the hook)
      retcode - the return code provided by the read operation (one of: EState.MEMREAD_OK, EState.MEMREAD_FAILED, EState.MEMREAD_BADDATA)
      Returns:
      null or a a read operation return code override (one of: EState.MEMREAD_OK, EState.MEMREAD_FAILED, EState.MEMREAD_BADDATA)
    • onWriteMemory

      default Boolean onWriteMemory(EState state, long address, byte[] buffer)
      Invoked before a memory write.
      Parameters:
      state - the state
      address - memory address
      buffer - bytes to be written (may be modified by the hook)
      Returns:
      null to let the write operation proceed; else, a success code
    • onAllocMemory

      default Long onAllocMemory(EState state, long address, int size, int protection)
      Invoked before a memory-alloc operation.
      Parameters:
      state -
      address - requested address
      size - requested size (may be adjusted)
      protection -
      Returns:
      null to let the operation proceed; else, a memory address (the result of the allocation operation)
    • onAllocMemoryPost

      default Long onAllocMemoryPost(EState state, long address, int size, int protection)
      Invoked after a memory-alloc operation.
      Parameters:
      state -
      address - the allocated address
      size - the adjusted allocated size
      protection -
      Returns:
      null to let the operation proceed; else, a memory address (the result of the allocation operation)
    • onFreeMemory

      default Boolean onFreeMemory(EState state, long address, int size)
      Invoked before a memory-free operation.
      Parameters:
      state -
      address - the allocated address
      size - the amount of bytes to be freed
      Returns:
      null to let the operation proceed; else, a success indicator