|
|
Comments and Discussions
|
|
 |

|
I want to get the yaw, pitch and roll aswell it's position in the 3D-World of a character in a game. How would you go about finding them out and changing them?
|
|
|
|
|

|
I didnt know if you had ever worked out the string variables for the memory scanner. I tried the scanner, but I am confused as to what it is accomplishing. is it finding every instance of a certain int in the memory location that is being scanned. and if it is, what its the second scan for, is it for finding the same value after the values of other variables have most likely changed?
|
|
|
|
|

|
Thanks Sojaner for your excellent sample
I have made several tries to make function to search for a specific string and return the addresses but failed and tried several codes from the net, please bro help me with this i still using CheatEngine to get my addresses.
thanks in forward,
|
|
|
|

|
Hi Sojaner.
First of all, very nice tutorial ! I'm definitely going to work with it and hopefully it can help me reaching my goal.
I was wondering though, is it long to scan the memory of a program ? My objective would be to find some addresses of stored variables from a Flash game, to make statistics out of it. For example, by knowing the game is a multiplayers soccer game (in 2D but that's not important to know I guess), and that I want to make stats such as time possession, score, goals, assists etc.
I just want to know if it is even possible in your opinion,
thanks in advance !
Greetings,
haxballfan
|
|
|
|

|
Thanck
modified on Friday, June 17, 2011 10:51 AM
|
|
|
|

|
The way he has gone step by step, without jumping directly to the topic is good. The diagrams also help a great deal in making the logic clear. The way he has approached and explained the whole concept has made things look much simpler. All in all, a good article
|
|
|
|

|
how to scan a float value ??
ex: 2.52
|
|
|
|

|
When i use ReadPrcoessMemory to scan the RAM,it dons't work,lasterror=0X0000012B :(.
PS: OS->win7 64bit
|
|
|
|

|
Hello Sojaner!
I'm using your scanner in C#project for many purposes
I just wrote a nice trainer game for Settlers 4. it's workflow is the following:
- Reads resource informations
- Create a map and places resources in correct place
- Can select a resource and edit it through a simple UI
- I use a simple timer for "Freeze" option which means, that amount resources can be frozen (for eg. if a settler takes a stone for construction from a 7-stone storage slot, it remains 7 after pickup)
Resource read/write goes well, the only problem is gettin the list of resources.
The memory block where these informations are stored can be overflown, in this case, the program continues listing anywhere. So I have to scan wide area of memory (usually 0x07000000-0x30000000)
This takes much time even if scanning block's size is 20480. But this is the smaller problem, the greater problem is that I don't receive all the values. I tried other memory searchers, and I always get back more result than with this scanner. I think the problem is, that Settler's memory consist lots of block with RW permission of size from 0x4000 to 0x8000, separated with a 0x1000 sized block signed as "reserved". Maybe the reader can't read in such environment. The distance of identifiers I search is 128 bytes if they are in the same block (for eg. after loading a game).
I just want to know whether I can fix it with using another parameters in opening process, freezing memory before scan or etc.
Please tell me if you can advise anything.
Thanks in advance:
Cpt Balu
Hungary
|
|
|
|

|
that's really useful for me!thanks!!
|
|
|
|

|
Your Memory Scanner , is work in Games On-line ? Grand Chase and Gunbound , Scan work's ?
|
|
|
|

|
I have spent 10 days looking for example source codes online that would show how to list strings contained in process's memory, but failed to do so...
Please, if someone knows how to do it, it would help me alot.. Thank you..
|
|
|
|

|
you know, you dont need to search the whole memory space of the program in memory. the values that you are looking for, say the health, etc.. are going to be stored in the .data section, which is only a small part of all the memory space the program is using. all you need to do is read the PE headers to get the virtual address of the .data section, then search that. A PE file starts with:
_IMAGE_DOS_HEADER(not important), followed by the _IMAGE_NT_HEADERS, then the Section Table(thats what you want) which is an array of Section Headers, there is one Section Header for each section (.text,.data,idata,etc). find the one for the .data section and it contains the virtual address. As defined in winnt.h:
typedef struct _IMAGE_SECTION_HEADER {
BYTE Name[IMAGE_SIZEOF_SHORT_NAME];
union {
DWORD PhysicalAddress;
DWORD VirtualSize;
} Misc;
DWORD VirtualAddress;
DWORD SizeOfRawData;
DWORD PointerToRawData;
DWORD PointerToRelocations;
DWORD PointerToLinenumbers;
WORD NumberOfRelocations;
WORD NumberOfLinenumbers;
DWORD Characteristics;
} IMAGE_SECTION_HEADER, *PIMAGE_SECTION_HEADER;
|
|
|
|

|
i need recovry file source
|
|
|
|

|
Hello Sojaner!
I'm building a GPS program for my university project.
For that task, I have to write two applications - the GPS software and the GPS emulator, which will throw "GPS String" to my software at some constant rate.
I was looking for a good way to pass variable from one application to another, and the best solution to do that working on fast rates is to create a buffer in which my emulator will write data and the gps software will read from ten times a second.
In order to make it happen, I need to create 2 "double" variables X and Y to store coordinates, and to pass their addresses to the second application.
Because I pass the adresses only once, I can use file.
The problem is to get my variables physical addresses and once passed, to set pointer to them on the other side.
I write using C#.
...hope to get some help from You, since You know thing or two about memory managing!
Thank You for Your time!..
Pavel.
|
|
|
|

|
First of all, thanks a lot for this nice source code.
I read your code and all seems to logical to me. But I don't know how to search for string in a game, like "Charactername" and such things.
Can you give me a hint?
|
|
|
|
|

|
Hi, I'm trying to use your article to build my own memory scanner / hex editor / game cheat thing etc. I already have such a tool but I wanted a challenge.
However I have run into a problem and after checking your code it appears your program would suffer from the same problem, although you don't even check for an error.
The problem is this: large areas of a processes memory are protected. ReadProcessMemory will fail when trying to read from such a place.
I will show an example of various desired and undesired results, and what both your code and my code do.
Here is my relevant VB code for reference, which I think improves on yours a bit, although the calling function has to do more checks on the returned data (ie IsNot Nothing, or != null):
Public Function ReadMemory(ByVal start As UInteger, ByVal length As UInteger) As Byte()
Dim read As UInteger = 0
Dim buffer(length - 1) As Byte
WinAPI.ReadProcessMemory(_handle, start, buffer, length, read)
If read = 0 Then
Return Nothing
End If
If read <> length Then
Array.Resize(Of Byte)(buffer, read)
End If
Return buffer
End Function
Let's say we have a chunk of memory that looks like this starting at 0x00000000, where the Xs are protected:
01 23 45 67 89 AB CD EF XX XX XX XX XX 01 23 45 67 89 AB CD EF
We ReadProcessMemory the first three, everything is OK:
Your function: 01 23 45
Mine: 01 23 45
We read 10 bytes, and the last two get cut off. This is ok because we still get all the data we can access:
Your function: 01 23 45 67 89 AB CD EF 00 00
Mine: 01 23 45 67 89 AB CD EF
Now we read bytes at 0x8 for 5 bytes...
Your function: 00 00 00 00 00
Mine: null
Still acceptable behavior. Now this is where it gets ugly.
Let's read 10 bytes from the same place:
Your function: 00 00 00 00 00 00 00 00 00 00
Mine: null
Where we would really like to convey the actual contents of XX XX XX XX XX 01 23 45 67 89 somehow...
To summarize, if the starting address is protected, the ENTIRE read fails, even if later parts of the specified address range are unprotected!
A visual demonstration... the pictured control does one ReadProcessMemory operation on the entire pictured block of memory... here is a result with an entirely non-protected block:
http://x.mzzt.net/0039.jpg
Now if we scroll up one line, we have the top line as a protected block. The whole read operation is blank:
http://x.mzzt.net/0040.jpg
Now my problem is, how do I determine where a protected area ends? If I have a condition like 40.jpg, I can't tell unless I read every single protected byte one at a time until I find the first unprotected one... and that is SLOW.
I know there must be a Windows API function to get the addresses of these protected areas, because the program I use for memory scanning can show me those ranges in a list.
So my question is... what is it? I've been looking through the API docs and I can't see anything relevant.
I figure it's my lack of expertise in this area that's responsible... the term "memory pages" keeps popping in my head but I don't remember enough about OS-level memory management to know if this is what I'm running into. Not that I saw any API functions relating to pages either.
I'm also curious if it's possible to do this a lazy way... like, can I count on a certain boundary for these areas (ie I'd only need to check once every 0xXXXX bytes instead of checking every protected byte to find the end of the protected area).
PS: I think you should consider splitting your article into two articles, one on basics of memory and another on your actual program. This way those of us who were expecting just an article on the program don't have to go past a bunch of stuff we already know... you can have it in a separate article for those of us who don't know. Also you should expand more on the actual program and how it operates... right now most of your article about that is just theory and not how you actually implemented it.
BTW I assume when you are referring to *-bit OSs you mean the maximum number of bits used to access memory, and thus the limit on how much memory the OS supports. Nowadays that's what the *-bit means in modern OSs, but when you are talking about the *-bit of microprocessors there are a few different metrics that can be used... it's all very confusing but I will just say there has never been an 8-bit OS as far as memory usage. 8 bits is only enough to fit 256 bytes, you can't do ANYTHING in that. And I know for a fact DOS was 16-bit, with the exception of extenders like DOS4GW and Windows 386 Enhanced mode which enabled some 32-bit functionality in supported programs.
|
|
|
|

|
I seem to have problems with this code, as in 9 out of 10 trys I cant finde a specific value in a process memory. My debugger is finding the value without any problems, and I just cant find the problem with my (and your sample) code.
The value I try to find is 0x50, 0x00, 0x14, 0x00; => 1310800.
Why is your memory scanner only showing the address sometimes, and not all the time?
|
|
|
|

|
check this one. its free
http://bnf-soft.com
look for link to memory scanner there
|
|
|
|

|
I like this article very much. Good job!
|
|
|
|

|
:I have learned a lot from your article
|
|
|
|

|
Just: WOW...
Thank you man.... Thats one of the best Tuts i've ever read!... For sure you get an Excelent (5) from me =)
|
|
|
|

|
I use it to try scan game memory,and i have some problem.
1.many game(MapleStory) is not show process id
2.many game(MapleStory) detect your program.
How to write/read these game's memory ?
PS:Sorry, My english is poor.
|
|
|
|

|
i'm able to compile the source, and run it.
selecting process is successful.
selecting data type, and entering value as well.
but after i start scanning...
the progress bar will run until 99% and fails with a closehandle error.
i'm currently using vista.
i've traced thru the code and arrive at the location where it passes the information into the winapi for openprocess, but it return a 0 pid.
pls advise.
|
|
|
|

|
I have try to use this function in my software, but when i use the ReadProcessMemory i have returned a Error 299, How i can fix that?
The error 299 is: "Only part of a ReadProcessMemory or WriteProcessMemory request was completed. "
The part of my code is:
int StartAdress = Convert.ToInt32( textBox2.Text, 16 );
int EndAdress = Convert.ToInt32( textBox3.Text, 16 );
System.IntPtr ptrBytesRead;
int SF = Convert.ToInt32( textBox1.Text );
int BytesRead = 4;
while( ( ++StartAdress <= EndAdress ) && ( BytesRead == 4 ) )
{
ProcessMemoryReaderAPI.ReadProcessMemory(SelectedProcessHandle, (IntPtr)StartAdress, BufferInt32, 4, out ptrBytesRead ));
BytesRead = ptrBytesRead.ToInt32( );
if( BytesRead == 4 )
{
int mBuffer32 = BitConverter.ToInt32( BufferInt32, 0 );
if (mBuffer32 == SF)
{
listBox2.Items.Add(Convert.ToString(mBuffer32, 16));
}
}
StartAdress++;
}
|
|
|
|

|
Thanks, I like this article very much, this can really apply to many aspects of a program - SMC (Self Modifying Code) this will really come in handy.
|
|
|
|

|
I liked you work. I do a lot of pattern finding in my work.
I have a somewhat different approach.
Suppose you needed to find a number , as you did, in a byte array recieved over a UDP socket.
Call it _framebuff.
You need to find a pattern: synch which is a byte array of {250,243,64,40}.
1. look for the first item, 250
use Array.IndexOf to find it
loop through _framebuff.
2. Next walk through the _framebuff again using the indexes from 1.
look to see if the value 3 away from the index is the last item, 40
The idea is look for the bounds to be what you want before checking more.
3. If the bounds match, look at the other internal value.
I pull those and check the vales like you do but only by byte values.
The pulling is done by walking the bounds matched indexes and using the
Buffer.BlockCopy function to get the byte array at the index.
Then the two array are compared.
ie:public int Findframes(byte[] _frame_buff)
{
int pg1 = 0;
int pstp = 0;
int check = 0;
byte[] synch=new byte[4]{ 64, 40, 107, 254 };
ArrayList _possiblesubframes=new ArrayList(30);
while (pg1 != -1)
{
pg1 = Array.IndexOf(_frame_buff, _synch[0], pstp);
int pg2 = Array.IndexOf(_frame_buff, _synch[3], pg1 + 1, 4);
if (pg2 == pg1 + 3)
{
byte[] tempcomp = new Byte[4];
Buffer.BlockCopy(_frame_buff, pg1, tempcomp, 0, 4);
if (CompareByteArrays(tempcomp, _synch) == true)
{
_possiblesubframes.Add(pg1);
}
}
pstp = pg1 + 1;
}
|
|
|
|
|

|
I used to be a fan as well, but the HORRIBLE development support, a very clumsy and closed development environment coupled with horrible marketing support... well need I say more.
Many people say the Mac was superior, but I disagree. When the Mac was the monopoly, Windows beat them because DOS was ultimately superior at solving the majority of business and personal problems. Couple that with Microsoft's ability to create GREAT Office applications, and it spelled doom for that monopoly. Ditto for Netscape & Java's monopolys, each fell for lack of developer support and great tools.
Finally, it was a good article... THANKS!
|
|
|
|

|
Looks good. Now all the noobs will flock to your article hoping it's a generic game hack.
ROFLOLMFAO
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
Search a process' memory to find specified 16, 32 or 64 bit data values.
| Type | Article |
| Licence | CPOL |
| First Posted | 23 Sep 2006 |
| Views | 157,415 |
| Downloads | 7,460 |
| Bookmarked | 143 times |
|
|