View previous topic :: View next topic |
Author |
Message |
A_jj74 Cheater
Reputation: 0
Joined: 14 Nov 2009 Posts: 41
|
Posted: Sun Nov 15, 2009 6:42 am Post subject: C++ Reading an adress |
|
|
Well as the Title says, how would I go on about reading an address?
|
|
Back to top |
|
 |
Jani Grandmaster Cheater
Reputation: 2
Joined: 29 Dec 2006 Posts: 804
|
Posted: Sun Nov 15, 2009 6:55 am Post subject: |
|
|
Code: | int *ptr = 0x400000;
int value = *ptr; |
|
|
Back to top |
|
 |
A_jj74 Cheater
Reputation: 0
Joined: 14 Nov 2009 Posts: 41
|
Posted: Sun Nov 15, 2009 7:00 am Post subject: |
|
|
Thanks for the Reply, is it really that simple? Don't you have to get the Process or something like that?
|
|
Back to top |
|
 |
Jani Grandmaster Cheater
Reputation: 2
Joined: 29 Dec 2006 Posts: 804
|
Posted: Sun Nov 15, 2009 9:55 am Post subject: |
|
|
Yeah, pointers are easy. You just point and read the value at the address.
|
|
Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Sun Nov 15, 2009 10:17 am Post subject: |
|
|
ReadProcessMemory
|
|
Back to top |
|
 |
A_jj74 Cheater
Reputation: 0
Joined: 14 Nov 2009 Posts: 41
|
Posted: Sun Nov 15, 2009 10:19 am Post subject: |
|
|
Ok thanks.
|
|
Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Sun Nov 15, 2009 10:40 am Post subject: |
|
|
C/C++ has a direct access to the memory
that's why you don't have to use readprocessmemory
unless you want to read other process's memory
|
|
Back to top |
|
 |
bulhufas How do I cheat?
Reputation: 0
Joined: 06 Nov 2009 Posts: 9
|
Posted: Sun Nov 15, 2009 5:14 pm Post subject: |
|
|
ReadProcessMemory to read other process' memory.
Jany's code to read your process' memory.
You can also inject a DLL to use Jany's code in any process.
|
|
Back to top |
|
 |
A_jj74 Cheater
Reputation: 0
Joined: 14 Nov 2009 Posts: 41
|
Posted: Mon Nov 16, 2009 1:56 am Post subject: |
|
|
_DoR wrote: | C/C++ has a direct access to the memory
that's why you don't have to use readprocessmemory
unless you want to read other process's memory |
Yes, I want to read another Process's memory , thank you that cleared some things up.
bulhufas wrote: | ReadProcessMemory to read other process' memory.
Jany's code to read your process' memory.
You can also inject a DLL to use Jany's code in any process. |
I'm not good at DLL's so I wont attempt DLL injection, thanks for your reply.
|
|
Back to top |
|
 |
bulhufas How do I cheat?
Reputation: 0
Joined: 06 Nov 2009 Posts: 9
|
Posted: Mon Nov 16, 2009 9:55 am Post subject: |
|
|
ReadProcessMemory and WriteProcessMemory are hooked by game security systems, so if you're asking because of game cheats, you should use DLL Injection.
|
|
Back to top |
|
 |
iPromise Grandmaster Cheater
Reputation: -1
Joined: 27 Jun 2009 Posts: 529 Location: Canada
|
Posted: Wed Nov 18, 2009 8:54 pm Post subject: Solution |
|
|
First you want to do a VirtualProtect hookhop because it locally hooked on most anti-hacking systems.
Like so:
Code: |
DWORD VirtualAddress = (DWORD)GetProcAddress(GetModuleHandleA("kernel32.dll"), "VirtualProtect") + 5;
BOOL WINAPI VirtualProtectX(LPVOID lpAddress, SIZE_T dwSize, DWORD flNewProtect, PDWORD lpflOldProtect)
{
_asm {
mov edi,edi
push ebp
mov esp, ebp
jmp [VirtualAddress]
}
}
|
Now do this:
Code: |
DWORD Protection;
VirtualProtectX((LPVOID) 0xAddress, 4, PAGE_EXECUTE_READWRITE, &Protection);
// if your editing a 4 byte address
*(DWORD*) 0xAddress = 100;
|
Thats it, it works like that. Dont listen to anybody that tells you to just derefence the address then typecast it, it wont work. You need to give read/write protection to the address.
|
|
Back to top |
|
 |
A_jj74 Cheater
Reputation: 0
Joined: 14 Nov 2009 Posts: 41
|
Posted: Thu Nov 19, 2009 1:12 am Post subject: |
|
|
Thanks a lot everyone, I really appreciate it!
|
|
Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Thu Nov 19, 2009 1:59 pm Post subject: Re: Solution |
|
|
iPromise wrote: | First you want to do a VirtualProtect hookhop because it locally hooked on most anti-hacking systems.
Like so:
Code: |
DWORD VirtualAddress = (DWORD)GetProcAddress(GetModuleHandleA("kernel32.dll"), "VirtualProtect") + 5;
BOOL WINAPI VirtualProtectX(LPVOID lpAddress, SIZE_T dwSize, DWORD flNewProtect, PDWORD lpflOldProtect)
{
_asm {
mov edi,edi
push ebp
mov esp, ebp
jmp [VirtualAddress]
}
}
|
Now do this:
Code: |
DWORD Protection;
VirtualProtectX((LPVOID) 0xAddress, 4, PAGE_EXECUTE_READWRITE, &Protection);
// if your editing a 4 byte address
*(DWORD*) 0xAddress = 100;
|
Thats it, it works like that. Dont listen to anybody that tells you to just derefence the address then typecast it, it wont work. You need to give read/write protection to the address. |
Why would he want to read from an address which is unreadable in normal circumstances ? It's not really likely to store a variable, is it ? You make no sense
|
|
Back to top |
|
 |
iPromise Grandmaster Cheater
Reputation: -1
Joined: 27 Jun 2009 Posts: 529 Location: Canada
|
Posted: Thu Nov 19, 2009 6:50 pm Post subject: |
|
|
Your confused, what i'm doing is for example, if I want to edit the address 0x00400000, and lets stay its a 16-bit address, and I wanted its value to be one.
Code: |
DWORD Protect;
VirtualProtectX((LPVOID) 0x00400000, 4, PAGE_EXECUTE_READWRITE, &Protect);
// To protect the address in order for us to edit it now..
*(WORD*) 0x00400000 = 1;
// What i'm doing is dereferencing the address with the * and typecasting it to a WORD (which is 16-bits) then making it equal to the value 1. This works 100% when I tried it. |
|
|
Back to top |
|
 |
A_jj74 Cheater
Reputation: 0
Joined: 14 Nov 2009 Posts: 41
|
Posted: Fri Nov 20, 2009 1:03 pm Post subject: |
|
|
iPromise wrote: | Your confused, what i'm doing is for example, if I want to edit the address 0x00400000, and lets stay its a 16-bit address, and I wanted its value to be one.
Code: |
DWORD Protect;
VirtualProtectX((LPVOID) 0x00400000, 4, PAGE_EXECUTE_READWRITE, &Protect);
// To protect the address in order for us to edit it now..
*(WORD*) 0x00400000 = 1;
// What i'm doing is dereferencing the address with the * and typecasting it to a WORD (which is 16-bits) then making it equal to the value 1. This works 100% when I tried it. |
|
Well I don't need to write to an Address, I just need to read from it .
(As the Title of the Thread/Topic says)
Anyways thank you for your Post.
I'll need this some time .
|
|
Back to top |
|
 |
|