| View previous topic :: View next topic |
| Author |
Message |
Blackvz Newbie cheater
Reputation: 0
Joined: 08 Jul 2012 Posts: 19
|
Posted: Sun Jun 23, 2013 10:13 am Post subject: [C++]Writing OpCode to Memory |
|
|
So all I want to know is how I can write opcode to a specific memory address.
So I have a adress ... e.g. : 0x323F with the instruction : jmp 0555938
and my Aim is to NOP it with C++.
Before that i already connected to the Process of the game.
Hope someone can help  |
|
| Back to top |
|
 |
Innovation Grandmaster Cheater
Reputation: 12
Joined: 14 Aug 2008 Posts: 617
|
Posted: Sun Jun 23, 2013 10:37 am Post subject: |
|
|
In an injected DLL, you need only dereference the address after making sure the memory is writable.
In a separate process, you can use OpenProcess and WriteProcessMemory (again, after making sure the memory is writable).
Last edited by Innovation on Sun Jun 23, 2013 10:55 am; edited 1 time in total |
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25823 Location: The netherlands
|
Posted: Sun Jun 23, 2013 10:48 am Post subject: |
|
|
don't forget VirtualQuery(Ex) in both cases _________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
Blackvz Newbie cheater
Reputation: 0
Joined: 08 Jul 2012 Posts: 19
|
Posted: Sun Jun 23, 2013 1:52 pm Post subject: |
|
|
Sorry guys , I need a little more help because its just new to me :/
Sorry sorry :s
I know how to write a Value to memory...
It's like that one :
int newammo = 999;
WriteProcessMemory(hproc,(LPVOID)erg3,&newammo,
sizeof(newammo),0);
but how should i write asm to it ?
Maybe __asm {} ? But which type is it etc...Please give me a short example :S |
|
| Back to top |
|
 |
berkay2578 How do I cheat?
Reputation: 0
Joined: 24 Dec 2012 Posts: 3 Location: Turkey
|
Posted: Tue Jun 25, 2013 2:00 am Post subject: |
|
|
BYTE NOPBytes[5] = "\x90\x90\x90\x90\x90";
DWORD NOPAddr = 0x00001234;
WriteProcessMemory( hProcessHandle, (LPVOID)NOPAddr, &NOPBytes, 5, NULL );
//Just use bytes instead of asm |
|
| Back to top |
|
 |
Blackvz Newbie cheater
Reputation: 0
Joined: 08 Jul 2012 Posts: 19
|
Posted: Tue Jun 25, 2013 3:06 pm Post subject: |
|
|
Thanks Bro !
Works perfectly !! Thankssss
but how it works e.g. with JMP 05523389
Is there any way to convert it ? |
|
| Back to top |
|
 |
logical_operator How do I cheat?
Reputation: 1
Joined: 17 Jun 2013 Posts: 5
|
Posted: Wed Jun 26, 2013 4:16 am Post subject: |
|
|
| Code: | #define CALC_REL32(from, to) (reinterpret_cast<DWORD>(to) - reinterpret_cast<DWORD>(from) - 5)
...
const LPVOID dest = reinterpret_cast<LPVOID>(0x00400100);
BYTE hook_jmp[] = [ 0xE9, 0x00, 0x00, 0x00, 0x00 ]; // 0xE9 = far jump opcode, rel32 follows
*reinterpret_cast<DWORD*>(hook_jmp + 1) = CALC_REL32(dest, hook);
if (!WriteProcessMemory(hProcess, dest, reinterpret_cast<LPCVOID>(hook_jmp), sizeof(hook_jmp), NULL))
{
// print error
} |
|
|
| Back to top |
|
 |
Blackvz Newbie cheater
Reputation: 0
Joined: 08 Jul 2012 Posts: 19
|
Posted: Wed Jun 26, 2013 12:46 pm Post subject: |
|
|
Everythink works , I found out with a simple try!
Thanks to all , who helped.
Not the first time , really good support here  |
|
| Back to top |
|
 |
|