| View previous topic :: View next topic |
| Author |
Message |
AwayTheWInd Master Cheater
Reputation: 0
Joined: 11 Sep 2007 Posts: 450
|
Posted: Wed Apr 16, 2008 7:10 pm Post subject: how do i... |
|
|
| how do i use C++ to scan for values? like.. i want to scan for the value 27 or 26. i think i have an idea, but it would include a huge database of stuff...
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Wed Apr 16, 2008 8:52 pm Post subject: |
|
|
| ReadProcessMemory
|
|
| Back to top |
|
 |
Heartless I post too much
Reputation: 0
Joined: 03 Dec 2006 Posts: 2436
|
Posted: Thu Apr 17, 2008 7:02 am Post subject: |
|
|
| Code: | BOOL WINAPI ReadProcessMemory(
__in HANDLE hProcess,
__in LPCVOID lpBaseAddress,
__out LPVOID lpBuffer,
__in SIZE_T nSize,
__out SIZE_T* lpNumberOfBytesRead
); |
| Code: | HANDLE WINAPI OpenProcess(
__in DWORD dwDesiredAccess,
__in BOOL bInheritHandle,
__in DWORD dwProcessId
); |
_________________
What dosen't kill you, usually does the second time. |
|
| Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Thu Apr 17, 2008 7:33 am Post subject: |
|
|
| Horny AZN boy, what about GetWindowThreadProcessId() and CloseHandle() ?
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Thu Apr 17, 2008 7:40 am Post subject: |
|
|
If you are injecting a DLL you can dump a location of memory into an array using memcpy then loop the array and compare each byte using memcmp.
Don't hold me to this code, I just made it in Notepad, don't have access to Visual Studio to make a dll to test it, but this should be something similar to what you want:
| Code: | BYTE* ScanMemory( BYTE* btBaseAddr, DWORD dwSize, BYTE btScanByte )
{
//
BYTE* btAddressFound = NULL;
// Create Array For Memory Dump
char* szMemDump = new char[dwSize+1];
// Copy Memory Into Dump
memcpy( szMemDump, btBaseAddr, dwSize );
// Loop And To Find Byte
for( int x=0; x<dwSize; x++ )
{
if( memcmp( (BYTE*)&szMemDump[x], btScanByte, 1 ) == 0 )
{
btAddressFound = btBaseAddress+x;
break;
}
}
// Delete Memory Dump
delete[] szMemDump;
// Return Result
return btBaseAddr;
} |
_________________
- Retired. |
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 472
Joined: 09 May 2003 Posts: 25870 Location: The netherlands
|
Posted: Thu Apr 17, 2008 8:24 am Post subject: |
|
|
Toy don't even have to copy the memory first when using a dll. You can just read the memory directly
_________________
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 |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Thu Apr 17, 2008 2:39 pm Post subject: |
|
|
| Dark Byte wrote: | | Toy don't even have to copy the memory first when using a dll. You can just read the memory directly |
Yeah but if the value changes during the scan he's screwed. Easier to dump it that second and have it scan through the dump in case the memory changes during the loop. Bigger loops can take a second or two which could lead to missing the value all together.
_________________
- Retired. |
|
| Back to top |
|
 |
|