Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IMemory

Manages the memory of a process

Hierarchy

  • IMemory

Implemented by

Index

Methods

allocateRegion

  • Allocate memory in the region.

    The memory that is allocate is not guaranteed to be the exact size that you request. The system may allocate more memory. Additionally, the readable, writeable, and executable flags are not guaranteed to be any particular values. Use changeRegion to adjust the flags to your needs.

    Parameters

    • size: number

      minimum byte length of the region to be allocated.

    Returns Promise<IMemoryRegion>

    the allocated memory region

changeRegion

  • changeRegion(address: number, size: number, readable: boolean, writeable: boolean, executable: boolean): Promise<IMemoryRegion>
  • Changes the memory access permissions of the specified memory

    Parameters

    • address: number

      start address of the memory to change

    • size: number

      byte length of the memory to change

    • readable: boolean
    • writeable: boolean
    • executable: boolean

    Returns Promise<IMemoryRegion>

    changed region

deallocateRegion

  • deallocateRegion(address: number, size: number): Promise<object>
  • Deallocates the specified memory

    Parameters

    • address: number

      start address of the memory to deallocate

    • size: number

      byte length of the memory to deallocate

    Returns Promise<object>

    success

getRegions

read

  • read(address: number, size: number): Promise<Buffer>
  • Read bytes from the process memory

    This call will fail if the region is not readable. You may need to change the region's access flags to readable using the changeRegion method.

    Parameters

    • address: number

      address to read from

    • size: number

      number of bytes to read

    Returns Promise<Buffer>

    read bytes

write

  • write(address: number, value: Buffer): Promise<number>
  • Write bytes to the process memory

    This call will fail if the region is not writeable. You may need to change the region's access flags to writeable using the changeRegion method.

    Parameters

    • address: number

      address to write to

    • value: Buffer

      bytes to be written

    Returns Promise<number>

    number of bytes written

Generated using TypeDoc