using System;
using System.Text;
namespace Process.NET.Memory
{
public interface IMemory
{
///
/// Writes a set of bytes to memory.
///
/// The address where the bytes start in memory.
/// The slength of the byte chunk to read from the memory address.
///
/// The byte array section read from memory.
///
byte[] Read(IntPtr intPtr, int length);
///
/// Reads a string with a specified encoding from memory.
///
/// The address where the string is read.
/// The encoding used.
///
/// The number of maximum bytes to read. The string is automatically cropped at this end ('\0'
/// char).
///
/// The string.
string Read(IntPtr intPtr, Encoding encoding, int maxLength);
///
/// Reads the value of a specified type from memory.
///
/// The type of the value.
/// The address where the value is read.
/// A value.
T Read(IntPtr intPtr);
///
/// Reads an array of a specified type from memory.
///
/// The type of the values.
/// The address where the values is read.
/// The number of cells in the array.
/// An array.
T[] Read(IntPtr intPtr, int length);
///
/// Write an array of bytes in the remote process.
///
/// The address where the array is written.
/// The array of bytes to write.
int Write(IntPtr intPtr, byte[] bytesToWrite);
///
/// Writes a string with a specified encoding to memory.
///
/// The address where the string is written.
/// The text to write.
/// The encoding used.
void Write(IntPtr intPtr, string stringToWrite, Encoding encoding);
///
/// Writes an array of a specified type to memory,
///
/// The type of the values.
/// The address where the values is written.
/// The array to write.
void Write(IntPtr intPtr, T[] values);
///
/// Writes the values of a specified type to memory.
///
/// The type of the value.
/// The address where the value is written.
/// The value to write.
void Write(IntPtr intPtr, T value);
}
}