| View previous topic :: View next topic |
| Author |
Message |
Ike21 Newbie cheater
Reputation: 0
Joined: 31 Jul 2007 Posts: 14
|
Posted: Wed Nov 05, 2008 3:01 pm Post subject: Small request |
|
|
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 |
|
 |
Innovation Grandmaster Cheater
Reputation: 12
Joined: 14 Aug 2008 Posts: 617
|
|
| Back to top |
|
 |
Ike21 Newbie cheater
Reputation: 0
Joined: 31 Jul 2007 Posts: 14
|
Posted: Wed Nov 05, 2008 3:21 pm Post subject: |
|
|
| Yeah, I understand that. But what I don't get is how you input an assembler script in a delphi code. :/ |
|
| Back to top |
|
 |
Innovation Grandmaster Cheater
Reputation: 12
Joined: 14 Aug 2008 Posts: 617
|
Posted: Wed Nov 05, 2008 3:27 pm Post subject: |
|
|
| Post an example script so I can explain better. |
|
| Back to top |
|
 |
Ike21 Newbie cheater
Reputation: 0
Joined: 31 Jul 2007 Posts: 14
|
Posted: Wed Nov 05, 2008 3:33 pm Post subject: |
|
|
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 |
|
 |
Innovation Grandmaster Cheater
Reputation: 12
Joined: 14 Aug 2008 Posts: 617
|
Posted: Wed Nov 05, 2008 3:42 pm Post subject: |
|
|
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.
>.>
[-----------------------------------------------------------------------]
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 |
|
 |
Ike21 Newbie cheater
Reputation: 0
Joined: 31 Jul 2007 Posts: 14
|
Posted: Wed Nov 05, 2008 3:47 pm Post subject: |
|
|
| Ohh, It's that simple? Wow. I feel stupid. Thanks for helping. |
|
| Back to top |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Wed Nov 05, 2008 3:48 pm Post subject: |
|
|
| 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.
>.>
[-----------------------------------------------------------------------]
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. _________________
|
|
| Back to top |
|
 |
Innovation Grandmaster Cheater
Reputation: 12
Joined: 14 Aug 2008 Posts: 617
|
Posted: Wed Nov 05, 2008 3:50 pm Post subject: |
|
|
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 |
|
 |
Ike21 Newbie cheater
Reputation: 0
Joined: 31 Jul 2007 Posts: 14
|
Posted: Wed Nov 05, 2008 4:01 pm Post subject: |
|
|
Oh. Well, thanks for helping you two  |
|
| Back to top |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Wed Nov 05, 2008 6:20 pm Post subject: |
|
|
Or, if you're using C++, you could use memset(); I'm not sure if Delphi has use of that, or not. _________________
|
|
| Back to top |
|
 |
pkedpker Master Cheater
Reputation: 1
Joined: 11 Oct 2006 Posts: 412
|
Posted: Wed Nov 05, 2008 9:22 pm Post subject: |
|
|
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); _________________
|
|
| Back to top |
|
 |
|