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 


Coding Delphi DLL Trainer

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
tanjiajun_34
Grandmaster Cheater
Reputation: 0

Joined: 16 Feb 2006
Posts: 786
Location: Singapore

PostPosted: Wed Jan 20, 2010 2:46 am    Post subject: Coding Delphi DLL Trainer Reply with quote

I only have idea about creating a exe.
Do we still use read or writeprocessmemory like exe?
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Wed Jan 20, 2010 5:20 am    Post subject: Reply with quote

no once your dll is in the target's memory space you have direct access to its memory
Back to top
View user's profile Send private message
tanjiajun_34
Grandmaster Cheater
Reputation: 0

Joined: 16 Feb 2006
Posts: 786
Location: Singapore

PostPosted: Wed Jan 20, 2010 5:58 am    Post subject: Reply with quote

How to code to make my dll read and write own memory then?
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Wed Jan 20, 2010 7:17 am    Post subject: Reply with quote

use the asm keyword to execute assembler code that edits the memory of the current process
that's one way
Back to top
View user's profile Send private message
tanjiajun_34
Grandmaster Cheater
Reputation: 0

Joined: 16 Feb 2006
Posts: 786
Location: Singapore

PostPosted: Wed Jan 20, 2010 8:48 pm    Post subject: Reply with quote

If you inject to dll to a gamguard game example sa or gb.
Then, will you be able to bypass the ring0 hooks thingy?

And also how to write to the pointed addresses using asm?
I tried a lot of methods........

Note:I used 00400000 as pointer address. 100 as offset. And the value I wanted it to change to is 1.

Method 1 (Got access violation error, no effect too)
Code:
mov eax, dword [$00400000]
mov byte ptr [eax+$100],$1


Method 2 (No error, no effect too....)
Code:
procedure TForm1.Button5Click(Sender: TObject);
var
back:dword;
begin
asm
mov eax, dword [$00400000]
mov     dword [back], eax
end;
back:=dword(back+$100);
asm
mov byte ptr [back],$1
end;
end;


Method 3 (Got access violation error, no effect too)
Code:
mov eax, dword [$00400000]
lea ebx, [eax+$100]
mov byte ptr [ebx],$1


Method 4 (Got access violation error, no effect)
Code:
mov eax, dword [$00400000]
mov ecx, $100
lea ebx, [eax+ecx]
mov byte ptr [ebx],$1


Method 5 (Got access violation, no effect)
Code:
mov eax,dword [$00400000]
add eax,$100
mov byte ptr [eax],$1
Back to top
View user's profile Send private message
Hologram
How do I cheat?
Reputation: 0

Joined: 07 Jan 2010
Posts: 8

PostPosted: Fri Jan 22, 2010 1:31 pm    Post subject: Reply with quote

If you mean you can access your value this way:
[[00400000] + 100]
than try following:
Code:

var
  pb: PBYTE;
const
  addr = $00400000;
  offset = 100;
begin
  pb := PBYTE(DWORD(addr^) + offset);
  pb^ := 1;

assuming your value is type of Byte
Back to top
View user's profile Send private message
tanjiajun_34
Grandmaster Cheater
Reputation: 0

Joined: 16 Feb 2006
Posts: 786
Location: Singapore

PostPosted: Fri Jan 22, 2010 11:34 pm    Post subject: Reply with quote

I changed to
Code:
var
  pb: PBYTE;
const
  addr = $00400000;
  offset = 100;
begin
  pb := PBYTE(DWORD(pointer(addr)^) + offset);
  pb^ := 1;
end;


And try but access violation no effect.
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sat Jan 23, 2010 12:40 am    Post subject: Reply with quote

why don't you just call the delphi equivilent of memcpy?

or http://msdn.microsoft.com/en-us/library/aa366535%28VS.85%29.aspx
Back to top
View user's profile Send private message
Hologram
How do I cheat?
Reputation: 0

Joined: 07 Jan 2010
Posts: 8

PostPosted: Sat Jan 23, 2010 4:56 am    Post subject: Reply with quote

...or the shorthand PBYTE(PDWORD($00400000)^ + 100)^ := 1;

if it doesn't work than it seems you don't have the right address-offset pair
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 474

Joined: 09 May 2003
Posts: 25952
Location: The netherlands

PostPosted: Sat Jan 23, 2010 7:30 am    Post subject: Reply with quote

perhaps it's giving an access violation because the pointer you are giving is just wrong ?
00400000 contains a pointer to a valid address? I really doubt it

_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
tanjiajun_34
Grandmaster Cheater
Reputation: 0

Joined: 16 Feb 2006
Posts: 786
Location: Singapore

PostPosted: Sun Jan 24, 2010 3:46 am    Post subject: Reply with quote

Dark Byte wrote:
perhaps it's giving an access violation because the pointer you are giving is just wrong ?
00400000 contains a pointer to a valid address? I really doubt it


Oh I am just using the address to test. Dunno if it is correct. I just thought I add address in ce and it points to some address with a value means ok... But I tried reading the value of the pointed address is ok. It is just writing I having problems.

Edit: Solved. DB is right.
Also other question
If you inject to dll to a gamguard game example sa or gb.
Then, will you be able to bypass the ring0 hooks thingy?
Back to top
View user's profile Send private message
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