Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Help me in Delphi Trainer (Base Address+offset)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Ashkan
How do I cheat?
Reputation: 0

Joined: 30 Oct 2012
Posts: 0

PostPosted: Tue Oct 30, 2012 8:33 pm    Post subject: Help me in Delphi Trainer (Base Address+offset) Reply with quote

Hi Guys Im triying to make a injectable trainer in Delphi XE3,when I inject to the process i get acces violation,so i will show you what did i do, and i want if you can tell me whats the problem.

Scaning:

1.-Im scaning the value of mines which is "40":
Code:
http://s8.postimage.org/yh2c1wz5f/sshot_2.png



2.-So i change the ammount of mines and then I scan "20",and i choose the first adress:
Code:
http://s8.postimage.org/i7c5z0ohf/sshot_3.png



3.-I find the pointer:$D4,base address:"minesweeper.exe"+ $868B4
Code:
http://s8.postimage.org/3qowkfz03/sshot_4.png



4.-But here i think minesweeper.exe is my problem.
Code:
http://s8.postimage.org/4u90wejn7/sshot_7.png



Maybe my trainer source its wrong take a look and tell me whats the problem plz.
DLL:
Code:

library Project2;

{ Important note about DLL memory management: ShareMem must be the
  first unit in your library's USES clause AND your project's (select
  Project-View Source) USES clause if your DLL exports any procedures or
  functions that pass strings as parameters or function results. This
  applies to all strings passed to and from your DLL--even those that
  are nested in records and classes. ShareMem is the interface unit to
  the BORLNDMM.DLL shared memory manager, which must be deployed along
  with your DLL. To avoid using BORLNDMM.DLL, pass string information
  using PChar or ShortString parameters. }

uses
  System.SysUtils,
  windows,
  System.Classes,
  Unit1 in '..\NR\Unit1.pas' {Form2};

{$R *.res}
        var
AtProcessobymr:THandle;
hId:Cardinal;
procedure Trainer;
begin
Form2:=TForm2.Create(nil);
Form2.ShowModal;
end;
begin
AtProcessobymr:=OpenProcess(PROCESS_ALL_ACCESS,false,GetCurrentProcessID);
CreateRemoteThread(AtProcessobymr,nil,0,@Trainer,@Trainer,0,hID);
end.




FORM:
Code:
unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs,StdCtrls,ExtCtrls;

type
  TForm2 = class(TForm)
    Button1: TButton;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}


procedure TForm1.Button1Click(Sender: TObject);
begin

PDWORD( PDWORD($868B4)^ + $D4 )^ := 0;
end;
end.



when i inject the trainer i get this error,i think because when i made the trainer writes to $868B4 but it should write to minesweeper.exe+$868B4 ,so how can i get the addres of the process???
Code:
http://s7.postimage.org/ifhzsw4vd/sshot_5.png
Back to top
View user's profile Send private message
PR0GAM3
How do I cheat?
Reputation: 0

Joined: 15 Nov 2012
Posts: 3

PostPosted: Thu Nov 15, 2012 4:50 pm    Post subject: Reply with quote

I guess that is just two bytes.
try instead of PDWORD to PWORD

Code:

procedure TForm1.Button1Click(Sender: TObject);
begin
  PWORD( PDWORD($868B4)^ + $D4 )^ := 00;
end;
Back to top
View user's profile Send private message
jazzybecker
How do I cheat?
Reputation: 0

Joined: 22 Aug 2010
Posts: 4

PostPosted: Mon Dec 24, 2012 3:39 pm    Post subject: Reply with quote

try ReadProcessMemory
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Tue Dec 25, 2012 4:17 am    Post subject: Reply with quote

You need to add the base address of the process to your offset before you do anything to the address. Currently you are just trying to read/write to the offset itself, which is not the correct address.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites