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 


Small request

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Ike21
Newbie cheater
Reputation: 0

Joined: 31 Jul 2007
Posts: 14

PostPosted: Wed Nov 05, 2008 3:01 pm    Post subject: Small request Reply with quote

I have a small request, I've started coding in delphi no long ago and I want to get into DLL memory editing. I already made my own small trainer for minesweeper, turned out good for most of people. Anyways, here's the question : Could anyone show me a little exemple of a DLL using assembler scripts to edit the memory? Just a quick explanation is alright.

Thanks in advance.
Back to top
View user's profile Send private message
Innovation
Grandmaster Cheater
Reputation: 12

Joined: 14 Aug 2008
Posts: 617

PostPosted: Wed Nov 05, 2008 3:10 pm    Post subject: Reply with quote

For C++ and Delphi DLL memory editing reference:
http://forum.cheatengine.org/viewtopic.php?p=2729175#2729175

Delphi DLL:
Code:
PLongWord($00AA0C62)^ := 9999999;
// 00AA0C62 is the address.
// 9999999 are the bytes being written.
Back to top
View user's profile Send private message
Ike21
Newbie cheater
Reputation: 0

Joined: 31 Jul 2007
Posts: 14

PostPosted: Wed Nov 05, 2008 3:21 pm    Post subject: Reply with quote

Yeah, I understand that. But what I don't get is how you input an assembler script in a delphi code. :/
Back to top
View user's profile Send private message
Innovation
Grandmaster Cheater
Reputation: 12

Joined: 14 Aug 2008
Posts: 617

PostPosted: Wed Nov 05, 2008 3:27 pm    Post subject: Reply with quote

Post an example script so I can explain better.
Back to top
View user's profile Send private message
Ike21
Newbie cheater
Reputation: 0

Joined: 31 Jul 2007
Posts: 14

PostPosted: Wed Nov 05, 2008 3:33 pm    Post subject: Reply with quote

Err.. okay here you go :

Code:
6236A8:
db 00 00
8Fca27:
db 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
8Fd2a7:
db 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Back to top
View user's profile Send private message
Innovation
Grandmaster Cheater
Reputation: 12

Joined: 14 Aug 2008
Posts: 617

PostPosted: Wed Nov 05, 2008 3:42 pm    Post subject: Reply with quote

Layout:
Code:
PLongWord($[INSERT ADDRESS HERE])^ := [INSERT BYTES HERE];


Replace [INSERT ADDRESS HERE] with the address you are writing to.
Replace [INSERT BYTES HERE] with the bytes you want to write.

This shouldn't be too hard.
>.>

[-----------------------------------------------------------------------]
Code:
6236A8:
db 00 00

Becomes:
Code:
PLongWord($006236A8)^ := 0000;

[-----------------------------------------------------------------------]
Code:
8Fca27:
db 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Becomes:
Code:
PLongWord($008FCA27)^ := 000000000000000000000000000000000000000000000000;

[-----------------------------------------------------------------------]
Code:
8Fd2a7:
db 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Becomes:
Code:
PLongWord($008Fd2a7)^ := 00000000000000000000000000000000;

[-----------------------------------------------------------------------]
Back to top
View user's profile Send private message
Ike21
Newbie cheater
Reputation: 0

Joined: 31 Jul 2007
Posts: 14

PostPosted: Wed Nov 05, 2008 3:47 pm    Post subject: Reply with quote

Ohh, It's that simple? Wow. I feel stupid. Thanks for helping.
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Wed Nov 05, 2008 3:48 pm    Post subject: Reply with quote

inoobzx wrote:
Layout:
Code:
PLongWord($[INSERT ADDRESS HERE])^ := [INSERT BYTES HERE];


Replace [INSERT ADDRESS HERE] with the address you are writing to.
Replace [INSERT BYTES HERE] with the bytes you want to write.

This shouldn't be too hard.
>.>

[-----------------------------------------------------------------------]
Code:
6236A8:
db 00 00

Becomes:
Code:
PLongWord($006236A8)^ := 0000;

[-----------------------------------------------------------------------]
Code:
8Fca27:
db 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Becomes:
Code:
PLongWord($008FCA27)^ := 000000000000000000000000000000000000000000000000;

[-----------------------------------------------------------------------]
Code:
8Fd2a7:
db 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Becomes:
Code:
PLongWord($008Fd2a7)^ := 00000000000000000000000000000000;

[-----------------------------------------------------------------------]


That's not gonna work.

00000000000000000000000000000000000000 converts to 0, and since a word is two bytes, It'll overwrite the first 2 bytes with "00", then not do anything about the rest.

I suggest a loop.

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
Innovation
Grandmaster Cheater
Reputation: 12

Joined: 14 Aug 2008
Posts: 617

PostPosted: Wed Nov 05, 2008 3:50 pm    Post subject: Reply with quote

To edit memory like that you have to to use a DLL otherwise you would be editing memory of your own process.

Edit:

Oh ya thanks samuri25404 I forgot about that.

If you really want to edit that many bytes all to 00 edit them using a loop (just like samuri25404 said).

Like this:

Code:
8Fd2a7:
db 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00


Code:
library MyDLL;

var
   Address : Cardinal;
begin

Address := $008FD2A7;

repeat 
PLongWord(Address)^ := 00;
Address := Address + 1; // That might not be right I forgot how to add to cardinal integers...
until (Address = $008FD2B6);

end.


Last edited by Innovation on Wed Nov 05, 2008 4:04 pm; edited 3 times in total
Back to top
View user's profile Send private message
Ike21
Newbie cheater
Reputation: 0

Joined: 31 Jul 2007
Posts: 14

PostPosted: Wed Nov 05, 2008 4:01 pm    Post subject: Reply with quote

Oh. Well, thanks for helping you two Smile
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Wed Nov 05, 2008 6:20 pm    Post subject: Reply with quote

Or, if you're using C++, you could use memset(); I'm not sure if Delphi has use of that, or not.
_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
pkedpker
Master Cheater
Reputation: 1

Joined: 11 Oct 2006
Posts: 412

PostPosted: Wed Nov 05, 2008 9:22 pm    Post subject: Reply with quote

yah you have to use memset for that.

in delphi

memset = FillChar(var Address; Count: Integer; value: Byte);

http://www.delphibasics.co.uk/RTL.asp?Name=FillChar

so

8Fd2a7:
db 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

would be like 15 of zero so....

FillChar(DunnoHowToDoAddress, 15,0);

_________________
Hacks I made for kongregate.
Kongregate Universal Badge Hack: http://forum.cheatengine.org/viewtopic.php?p=4129411
Kongreate Auto Rating/Voter hack: http://forum.cheatengine.org/viewtopic.php?t=263576
Took a test lol
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