PtrReader
Provides methods to read data from an unmanaged memory pointer.
Konstruktoren
public PtrReader(IntPtr ptr)
ptrReader = PtrReader(ptr)
Initializes a new instance of the PtrReader class with the specified pointer.
- ptr
- The unmanaged memory pointer to read from.
Eigenschaften
public IntPtr Ptr { get; set; }
value = ptrReader.Ptr
ptrReader.Ptr = value
Gets or sets the unmanaged memory pointer.
Methoden
public byte GetByte()
result = ptrReader.GetByte()
Reads a byte from the current pointer and advances the pointer by the size of a byte.
Rückgabe: The byte read from the pointer.
public int GetInt()
result = ptrReader.GetInt()
Reads a 32-bit integer from the current pointer and advances the pointer by the size of an integer.
Rückgabe: The 32-bit integer read from the pointer.
public IntPtr GetIntPtr()
result = ptrReader.GetIntPtr()
Reads an IntPtr from the current pointer and advances the pointer by the size of an IntPtr.
Rückgabe: The IntPtr read from the pointer.
public long GetLong()
result = ptrReader.GetLong()
Reads a 64-bit integer from the current pointer and advances the pointer by the size of a long.
Rückgabe: The 64-bit integer read from the pointer.
public short GetShort()
result = ptrReader.GetShort()
Reads a 16-bit integer from the current pointer and advances the pointer by the size of a short.
Rückgabe: The 16-bit integer read from the pointer.
public string GetString()
result = ptrReader.GetString()
Reads a null-terminated ANSI string from the current pointer and advances the pointer by the size of an IntPtr.
Rückgabe: The ANSI string read from the pointer. If the string is null, an empty string is returned.
public string GetString(int length)
result = ptrReader.GetString(length)
Reads an ANSI string of the specified length from the current pointer and advances the pointer by the specified length.
- length
- The length of the string to read.
Rückgabe: The ANSI string read from the pointer. If the string is null, an empty string is returned.