How to use Pointer + Offset in C#?
Question in title ^_^
_PuRe.LucK* (06-15-2013)
Last edited by _PuRe.LucK*; 06-15-2013 at 09:20 AM.
_PuRe.LucK* (06-15-2013)
Add new Write Function:
And new WriteFloat & ReadFloat functions:Code:private void Write(int Address, float Value) { byte[] Buffer = BitConverter.GetBytes(Value); IntPtr Zero = IntPtr.Zero; WriteProcessMemory(pHandel, (IntPtr)Address, Buffer, (UInt32)Buffer.Length, out Zero); }
Code:public void WriteFloat(int Address, float Value) { Write(Address, Value); }Code:public float ReadFloat(int Address, int Length = 4) { return (float)BitConverter.ToDouble(Read(Address, Length), 0); }
Lovroman (06-15-2013)
_PuRe.LucK* (06-15-2013)
Yoo, I know D
---------- Post added at 09:43 AM ---------- Previous post was at 09:38 AM ----------
And can i do it like this:
private void Write(int Address, float Value)
{
byte[] Buffer = BitConverter.GetBytes(Value);
IntPtr Zero = IntPtr.Zero;
WriteProcessMemory(pHandel, (IntPtr)Address, Buffer, (UInt32)Buffer.Length, out Zero);
}
and for integer
private void Write2(int Address, int Value)
{
byte[] Buffer = BitConverter.GetBytes(Value);
IntPtr Zero = IntPtr.Zero;
WriteProcessMemory(pHandel, (IntPtr)Address, Buffer, (UInt32)Buffer.Length, out Zero);
}
_PuRe.LucK* (06-15-2013)