Board index » delphi » Direct Memory Access, Process IDs, etc.

Direct Memory Access, Process IDs, etc.

Hi Guys,

I wanted to code a program that reads out the memory of a game and
displays some information about it. I have every information i need
about how the data is stored, but i first need to get the data. My
program should run at the same time as the game, and put the game data
in a "array of byte". I just know the name of the program so what I
need to do is the following:

* Get the process ID by just knowing the name of the game
* Read out some of the memory (I want to specify start & end address),
and put it in a array.

I saw this feature at some programs and thought it couldn't be so
hard...is it possible in delphi?

        Ciao

                Joe

======================================================
johannes_ba...@gmx.TUDASWEG.de
To mail me, delete the underscore (_), and remove all Capslock-Letters.
======================================================

 

Re:Direct Memory Access, Process IDs, etc.


Quote
: johannes_ba...@gmx.TUDASWEG.de (Joe) wrote:
>is it possible in delphi?

Yes, of course.

Read about TlHlp32 (the unit) and ReadProcessMemory.

--
Stefan Hoffmeister    (http://www.econos.de/)
No private email, please, unless expressly invited.

Re:Direct Memory Access, Process IDs, etc.


Hi Stefan,

Quote
>Read about TlHlp32 (the unit) and ReadProcessMemory.

I searched through the delphi help but found nothing; it seems to be
an API...I have no (so special) books about Delphi, I'm afraid. Could
you tell me where I can find further information about TlHlp32 or
ReadProcessMemory?

        Bye

                Joe

======================================================
johannes_ba...@gmx.TUDASWEG.de
To mail me, delete the underscore (_), and remove all Capslock-Letters.
======================================================

Re:Direct Memory Access, Process IDs, etc.


Hi Stefan,

I found something in the Win32API-Reference...That's what I have till
now:

Var Application_Handle : THandle;
    C                  : Array[1..30] of Byte;
    T                  : Byte;
    Whereis_Data       : PString;    // ???
    Whereis_MemStart   : ^Longint;   // ???
    Whereis_HowMuch    : ^Longint;   // ???
    ReadAsMuch         : Integer;

  begin
    for t:=1 to 30 do c[t]:=0;   // clear the array to see if
something changed

Application_Handle:=openprocess(process_vm_read,true,getcurrentprocessid);
// just for testing use "getcurrendpic"
    Whereis_MemStart:=nil;
    Whereis_HowMuch:=nil;
    ReadAsMuch:=30;

readprocessmemory(Application_Handle,Whereis_MemStart,Whereis_Data,ReadAsMuch,Whereis_HowMuch);
  end;

But I don't know how to mess aroung with pointers :-(( Could you help
me please?

        Bye

                Joe

======================================================
johannes_ba...@gmx.TUDASWEG.de
To mail me, delete the underscore (_), and remove all Capslock-Letters.
======================================================

Re:Direct Memory Access, Process IDs, etc.


Quote
: johannes_ba...@gmx.TUDASWEG.de (Joe) wrote:
>But I don't know how to mess aroung with pointers :-(( Could you help
>me please?

No. If you don't know how to use pointers, you should not be fooling
with this low-level stuff.

Sorry, but you need to learn a couple of things first and I cannot
help you with these basics.

--
Stefan Hoffmeister    (http://www.econos.de/)
No private email, please, unless expressly invited.

Re:Direct Memory Access, Process IDs, etc.


Quote
: johannes_ba...@gmx.TUDASWEG.de (Joe) wrote:
>TlHlp32 or
>ReadProcessMemory?

ReadProcessMemory is a Win32 API call. Simply enter it and press F1.

TlHlp32.pas is a unit that you will find in Delphi\Source\Rtl\Win.
Look up the documentation for each of these functions.

Further information about this can probably be found at MSDN online
(http://msdn.microsoft.com/) or by simply entering the above terms as
a search term in DejaNews.

--
Stefan Hoffmeister    (http://www.econos.de/)
No private email, please, unless expressly invited.

Other Threads