vmv Cheater
Reputation: 0
Joined: 29 Jun 2013 Posts: 32
|
Posted: Sat Nov 16, 2013 6:57 am Post subject: C# timers |
|
|
Hello,
I have a piece of code that is not refreshing the value based on a timer tick:
| Code: | public static void Start()
{
OpenProcess(); Allocate(out vMemory, 0x1024);
byte[] byt = { 0xC7,0x83,0x22,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x8B,0x74,0x24,0x40,
0x48,0x8B,0x6C,0x24,0x48,0x48,0x8B,0x5C,0x24,0x50,0x48,0x83,0xC4,0x58,0xC3 };
for (int i = 6; i < 10; ++i) { byt[i] = (byte)(gsSpd & 0xFF); gsSpd = gsSpd >> 8; }
write(vMemory + 8, byt, 30);
write(vMemory, BitConverter.GetBytes((vMemory + 8)), 8);
write(gameBase, new byte[] { 0xFF, 0x24, 0x25 }, 3);
write(gameBase + 3, BitConverter.GetBytes((vMemory)), 4);
}
public static void Timer(object source, ElapsedEventArgs e)
{
aTimer.Enabled = true;
int[] wepOffsets = { 0x70, 0x10, 0x20, 0x368, 0x36c };
byte[] readMemory = PointerRead((IntPtr)wepBase, 4, wepOffsets, out bytesToRead);
int final = BitConverter.ToInt32(readMemory, 0);
MessageBox.Show("value : " + final); /////// here timer is working fine, the message is shown every second
if (final == 4)
{
byte[] sw = { 0xC7,0x83,0x22,0x05,0x00,0x00,0x00,0x00,0x00,0x00 };
for ( int i = 6; i < 10; ++i )
{
sw[i] = (byte)(swSpd & 0xFF);
swSpd = swSpd >> 8;
}
write ( vMemory + 8, sw, 10 ); ///// not working, it is writing first the correct value then instantly writes 0 value.
}
} |
Tested the message box and is ticking every second with the popup message showing the value of "final"...so far so good.
The write function it's just writing the correct value at first hit then instantly changes to 0 value...
Any idea what i'm doing wrong...thank you,
|
|