Skip to content

VM write

Bennett Blodinger edited this page Mar 18, 2017 · 1 revision

Virtual Memory

Below are functions used to write data into a target process. Note that these functions can only succeed if the address that is being written at resides in a page that has writable protection set.

Writing Integral Types

  • vm.writeInt8(memoryAddress, value)
  • vm.writeUInt8(memoryAddress, value)
  • vm.writeInt16(memoryAddress, value)
  • vm.writeUInt16(memoryAddress, value)
  • vm.writeInt32(memoryAddress, value)
  • vm.writeUInt32(memoryAddress, value)
  • vm.writeInt64(memoryAddress, value)
  • vm.writeUInt64(memoryAddress, value)
  • vm.writePointer(memoryAddress, value)

Writes an integer or pointer value at memoryAddress. 'U' means Unsigned.

Raises bitslicer.VirtualMemoryError if unable to write the number of required bytes at memoryAddress.

Writing Fractional Types

  • vm.writeFloat(memoryAddress, value)
  • vm.writeDouble(memoryAddress, value)

Writes a float or double value to memoryAddress

Raises bitslicer.VirtualMemoryError if unable to write the number of required bytes at memoryAddress.

Writing String Types

  • vm.writeString8(memoryAddress, buffer)
  • vm.writeString16(memoryAddress, buffer)

Writes the contents of buffer (which can be a string or bytes object) plus a 8 or 16 bit NULL terminating byte at memoryAddress.

Raises bitslicer.VirtualMemoryError if unable to write the number of required bytes at memoryAddress or raises a BufferError if unable to parse the buffer.

Writing Bytes

  • vm.writeBytes(memoryAddress, buffer)

vm.writeBytes writes a contiguous buffer into memoryAddress.

vm.writeBytes raises bitslicer.VirtualMemoryError if unable to write buffer at memoryAddress or raises a BufferError if unable to parse the buffer.

Note: If you are reading and writing instructions, use debug.writeBytes instead.

Clone this wiki locally