Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 22
  1. #11
    elshabory
    elshabory is offline
    New member
    Join Date
    2011 Mar
    Posts
    7
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    2
    Thanked in
    1 Post
    Rep Power
    0
    i think that freezing a value is more simple
    i think that all we need is put our code in a timer
    set its interval
    is this ok ???

  2. #12
    boredtc
    boredtc is offline
    New member
    Join Date
    2011 Jul
    Posts
    4
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts
    Rep Power
    0

    Pointer reading in Delphi

    Hey all,

    Before the major website update, ive asked how to read the value of an specific, multi level pointer.
    for example;

    Address 03D7C4C4 with offset 3B8 ---> 03D7C87C

    And so on...

    So I want to read the address that's pointed by the previous pointer using the offset.

    MrSmith posted an perfect code snippet, but after the update, the post was vanished.

    Thanks in advance!

  3. #13
    MrSmith
    MrSmith is offline
    Member-in-training
    Join Date
    2010 Aug
    Posts
    85
    Thanks Thanks Given 
    9
    Thanks Thanks Received 
    7
    Thanked in
    4 Posts
    Rep Power
    0
    It works something like this

    Code:
    Procedure readpointer;
    var
    BytesRead : Cardinal;
    myVar : Cardinal;
    EndVar : Integer // example, it could be anything byte, cardinal etc..
    myHandle, PID : Integer;
    begin
    myHandle := FindWindow("classname here", "windowtitle here") // if you only know window title, use nil for classname
    PID := GetWindowThreadProcessId(myHandle, PID);
    myHandle := OpenProcess (PROCESS_ALL_ACCESS, False, PID);
    If PID <> 0 Then
    begin
    ReadProcessMemory(myHandle, Ptr(pointer address here), @myVar, SizeOf(myVar), BytesRead);
    ReadProcessMemory(myHandle, Ptr(myVar + offset), @myVar, SizeOf(myVar), BytesRead);
    ReadProcessMemory(myHandle, Ptr(myVar + offset2), @myVar, SizeOf(myVar), BytesRead); // it can continue as far as the pointer goes.
    ReadProcessMemory(myHandle, Ptr(myVar), @EndVar, SizeOf(EndVar), BytesRead);
    Result := EndVar
    end
    else
    ShowMessage ('There was some error');
    end;
    Ever Danced With The Devil By The Pale Moonlight ?

  4. #14
    insure3d
    insure3d is offline
    Guest
    Join Date
    2011 Jul
    Posts
    1
    Thanks Thanks Given 
    13
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts
    Rep Power
    0
    i am very newbie delphi ;x

  5. #15
    MrSmith
    MrSmith is offline
    Member-in-training
    Join Date
    2010 Aug
    Posts
    85
    Thanks Thanks Given 
    9
    Thanks Thanks Received 
    7
    Thanked in
    4 Posts
    Rep Power
    0
    It's advised to read a few tutorials on coding with delphi
    Ever Danced With The Devil By The Pale Moonlight ?

  6. #16
    boredtc
    boredtc is offline
    New member
    Join Date
    2011 Jul
    Posts
    4
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts
    Rep Power
    0
    Thanx MrSmith.
    It was just the snippet i was searching for.

    However, I got an few errors;

    -There is no overloaded version of 'GetWindowThreadProcessId' that can be called with these arguments.

    -Declaration expected, but end of file found (witch I don't understand, since there is nothing after "end;"

    -Undeclared identifier: 'Result'

    ----edit----

    I fixed the end of file error

    ----edit----



    Maybe you can clear some code up, with explanation offcourse since i'm still learning

    Thanx in advance!

    ---------- Post added at 02:36 PM ---------- Previous post was at 11:10 AM ----------

    I've managed to get rid of the errors, but the code's result seem to return a zero
    every time, no matter what game is loaded.
    Is there something i'm missing?
    Last edited by boredtc; 2011-08-06 at 12:17 PM.

  7. #17
    MrSmith
    MrSmith is offline
    Member-in-training
    Join Date
    2010 Aug
    Posts
    85
    Thanks Thanks Given 
    9
    Thanks Thanks Received 
    7
    Thanked in
    4 Posts
    Rep Power
    0
    You need the pointers/addresses of the value's you wish to read, if you copy and paste your code i can take a look for you
    Ever Danced With The Devil By The Pale Moonlight ?

  8. #18
    boredtc
    boredtc is offline
    New member
    Join Date
    2011 Jul
    Posts
    4
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts
    Rep Power
    0
    Hey, thanks for the fast reply.
    I know the right pointer + offsets, but whatever i do, it gives me the big 0 as result.
    As i was forced to make an new account, i'm not yet able to post code snippets, but after the 3rd post i should be :P

    Thanks

    ---------- Post added at 03:34 PM ---------- Previous post was at 03:32 PM ----------


    Code:
    var
    Form1: TForm1;
    BytesRead : Cardinal;
    myVar : Cardinal;
    EndVar : Cardinal; //it could be anything byte, cardinal etc..
    myHandle : Integer;
    PID : integer;
    Result : Integer;
    implementation
    
    {$R *.dfm}
    
    procedure TForm1.Button1Click(Sender: TObject);
    begin
    myHandle := FindWindow(nil, 'Game name window');
    if myHandle = 0 then
    begin
    MessageDlg ('The game is not loaded in memory, try again...', mtwarning,[mbOK],0);
    end;
    
    PID := GetWindowThreadProcessId(myHandle, @PID);
    myHandle := OpenProcess (PROCESS_ALL_ACCESS, False, PID);
    ReadProcessMemory(myHandle, Ptr($3D7C4C4), @myVar, SizeOf(myVar), BytesRead);
    ReadProcessMemory(myHandle, Ptr(myVar + $3B8), @myVar, SizeOf(myVar), BytesRead);
    ReadProcessMemory(myHandle, Ptr(myVar + $120), @myVar, SizeOf(myVar), BytesRead);
    ReadProcessMemory(myHandle, Ptr(myVar + $7C), @myVar, SizeOf(myVar), BytesRead);
    ReadProcessMemory(myHandle, Ptr(myVar + $14), @myVar, SizeOf(myVar), BytesRead);
    ReadProcessMemory(myHandle, Ptr(myVar + $268), @myVar, SizeOf(myVar), BytesRead);
    ReadProcessMemory(myHandle, Ptr(myVar), @EndVar, SizeOf(EndVar), BytesRead);
    Result := EndVar;
    showMessage (IntToStr(result));
    
    end;
    
    end.

  9. #19
    MrSmith
    MrSmith is offline
    Member-in-training
    Join Date
    2010 Aug
    Posts
    85
    Thanks Thanks Given 
    9
    Thanks Thanks Received 
    7
    Thanked in
    4 Posts
    Rep Power
    0
    Ok here you haven't defined the correct window to search memory for, you need to change 'Game name window' to the title of your game This should resolve your problem.

    Also what kind of value are you reading ? hp ? level ? exp etc.. ?
    Ever Danced With The Devil By The Pale Moonlight ?

  10. #20
    Kn0xx
    Kn0xx is offline
    New member
    Join Date
    2012 Jul
    Posts
    6
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts
    Rep Power
    0
    Hmm, and in this case, how can we make a multilevel pointer retrieving cardinal.

    In this case Aion works at this base.

    Process. aion.bin
    BaseOffset: Game.dll
    with offsets it will result in
    Game.dll+OFFSET, that will work with the rest of the offsets in game, including multilevel offsets.
    Game.dll+OFFSET+OFFSET1+OFFSET2...

    And the same logic has for retriving HexToString...

    And guidenance ?

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •