Class ModuleMap

Hierarchy

  • ModuleMap

Constructors

  • Creates a new module map optimized for determining which module a given memory address belongs to, if any. Takes a snapshot of the currently loaded modules when created, which may be refreshed by calling update().

    The filter argument is optional and allows you to pass a function used for filtering the list of modules. This is useful if you e.g. only care about modules owned by the application itself, and allows you to quickly check if an address belongs to one of its modules. The filter function is given the module's details and must return true for each module that should be kept in the map. It is called for each loaded module every time the map is updated.

    Parameters

    • Optional filter: ModuleMapFilter

      Filter function to decide which modules are kept in the map.

    Returns ModuleMap

Methods

  • Looks up a module by address. Returns null if not found.

    Parameters

    Returns null | Module

  • Just like find(), but only returns the name field, which means less overhead when you don’t need the other details. Returns null if not found.

    Parameters

    Returns null | string

  • Just like find(), but only returns the path field, which means less overhead when you don’t need the other details. Returns null if not found.

    Parameters

    Returns null | string

  • Just like get(), but only returns the name field, which means less overhead when you don’t need the other details. Throws an exception if not found.

    Parameters

    Returns string

  • Just like get(), but only returns the path field, which means less overhead when you don’t need the other details. Throws an exception if not found.

    Parameters

    Returns string

  • Determines if address belongs to any of the contained modules.

    Parameters

    Returns boolean

  • Updates the map.

    You should call this after a module has been loaded or unloaded to avoid operating on stale data.

    Returns void

  • Gets the modules currently in the map. The returned array is a deep copy and will not mutate after a call to update().

    Returns Module[]

Generated using TypeDoc