Epz Newbie cheater
Reputation: 0
Joined: 01 Jul 2012 Posts: 23
|
Posted: Sun Dec 01, 2013 7:52 pm Post subject: "Something.exe"+C97321 |
|
|
Well. I have weird problem that I'm wondering again.
I can use this easily to get always the correct value for everything I want to.
Code: | int AppMain = nProc.MainModule.BaseAddress.ToInt32(); |
If I read memory AppMain + Offset1 I get correct value, but why can't I write that value? WriteProcessMemory doesn't write there any changes, but CE is able to change the value.
Code: | [DllImport("kernel32.dll")]
public static extern int WriteProcessMemory(IntPtr hProcess, int lpBaseAddress, byte[] lpBuffer, int nSize, out int lpNumberOfBytesWritten);
[DllImport("kernel32.dll")]
public static extern IntPtr OpenProcess(int dwDesiredAccess, bool bInheritHandle, int dwProcessId);
[DllImport("kernel32.dll")]
public static extern int ReadProcessMemory(int hProcess, int lpBaseAddress, byte[] lpBuffer, int dwSize, out int lpNumberOfBytesRead); |
Code: | Process nProc = Process.GetProcessesByName("software")[0];
IntPtr nProcHandle = OpenProcess(DEBUGGER, false, nProc.Id);
int AppMain = nProc.MainModule.BaseAddress.ToInt32();
int bytesWritten = 0;
int bytesRead = 0;
byte[] Buff = new byte[1024];
int Offset1 = 0xC98F94;
int BaseAddr1 = AppMain + Offset1;
MessageBox.Show(BaseAddr1.ToString()); <- I get correct value always. Doesn't matter if I restart it.
ReadProcessMemory((int)nProcHandle, BaseAddr1, Buff, Buff.Length, out bytesRead);
byte[] Val1 = ASCIIEncoding.ASCII.GetBytes("400");
WriteProcessMemory(nProcHandle, AppMain + 0xB82F92, Val1, Val1.Length, out bytesWritten); <- I don't know why this doesn't change the value as well as ReadProcessMemory can read it. |
What's wrong?
|
|