need help with writeprocessmemory and readprocessmemory

Started by
8 comments, last by 31337noob 20 years ago
i sortof know how to use readprocessmemory() example ReadProcessMemory(process,(LPCVOID)baseaddress,(LPVOID)buffer,256,NULL); and you increament the baseaddress by 256 because i am reading 256 at a time. but how do you search the memory for values and strings? and then how do i write over that value with my own value. please help me. thanks in advanced.
Advertisement
any one know how to do this???????????????
The datatype of the data at any memory location is not stored. You''d just have to know.

You can write to the memory using WriteProcessMemory()

Thanks Salsa!Colin Jeanne | Invader''s Realm
"I forgot I had the Scroll Lock key until a few weeks ago when some asshole program used it. It even used it right" - Conner McCloud
yea i know that much......

does any one else have an idea on how to do this.

searching strings and integers in the memory.

please help.

thanks
There''s simply no way of telling whether a chunk of memory used by an unknown program contains a string, an integer or something else.
You could debug/disassemble the program, see how it manipulates the data and deduce what it is... but that''s painful...
If you want to search for strings, you could for example look for sequences of at least 4 alphanumerical characters.
what are you wanting to do?
i want to make a memory hacking program so you can find values and strings for games or apps and then change the value or string.
quote:Original post by 31337noob
i want to make a memory hacking program so you can find values and strings for games or apps and then change the value or string.


I see... are you thinking of hacking my games?
What most (all?) memory hackers liek that do is examine the memory and take a copy of it. Then, the user says "I want to find a variable that contains the number 16" - which represents current cash or something. You search through the memory (4 bytes at a time since most integer variables will be 32-bit integers), and look for the value "16". You''ll probably find loads of occurances. Then, you tell the user to change the number in game (buy buying or selling something). They buy something and the number changes to 10. They tell the hacking program that the number changed to 10, and the hacking program goes through its list of memory locations that were at 16 and sees what ones now say 10.
You repeat this process a few times until you only have one or two memory locations. Then you try changing the memory at that location and see if your money changes in game.
If you don''t get any results, you could try searching for 16-bit numbers (skipping 2 bytes every loop), and then try 8-bit numbers.

Strings are the same, they''re just runs of characters instead of 4-byte numbers.
I made a program like that, but kind of lost interest after I finished a more orless working version.
The code is kind of messy, disorganized, not very optimized and not very well-commented, but it might help you get a general idea of how it could be done.
Executable can be found here, and the source here.

[My Website and Image Gallery (WIP)][Greatest Tetris clone evar!][Return your stolen MP3s]

This topic is closed to new replies.

Advertisement