View previous topic :: View next topic |
Author |
Message |
bosman88 How do I cheat?
Reputation: 0
Joined: 06 Oct 2015 Posts: 9
|
Posted: Sun Nov 08, 2015 5:56 pm Post subject: [Delphi] address + string |
|
|
Hello
I'm trying to find solution to change value of address as string
for example this is my value ( I want to write in Edit "abc123" )
Code: |
var
myval9: string;
begin
myval9 := sEdit14.Text;
|
then I have address
Code: | pdword(pdword($00AB1914)^+$182c)^ |
and now I just want to connect my address with value from Edit
and get value from my project same like I would write in CE,
Can someone help me with this procedure?
Description: |
|
Filesize: |
2.46 KB |
Viewed: |
6758 Time(s) |

|
|
|
Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sun Nov 08, 2015 7:44 pm Post subject: |
|
|
The address of myval9 and sEdit14.Text are both inside your trainer.
You need to create a new memory address inside of the game and assign it the string value.
Then change the in-game string to point to your new address instead.
Or if the existing in-game string has enough space, directly write to that address.
|
|
Back to top |
|
 |
bosman88 How do I cheat?
Reputation: 0
Joined: 06 Oct 2015 Posts: 9
|
Posted: Mon Nov 09, 2015 5:30 am Post subject: |
|
|
Yes but it is a DLL trainer which uses game memory
for example for only for integer value which I used for example for RANGE was something like this
Code: | procedure TForm1.sButton8Click(Sender: TObject);
var
I, Code: Integer;
myval1: string;
begin
myval1 := sEdit3.Text;
Val(myval1, I, Code);
if Code = 0 then
begin
Pbyte($00f5715f)^:= I;
end;
end; |
this code allows to write only numbers and it works well for my range address
Well to write string I think I have to convert the value maybe cuz I want to give string for address PDword or maybe is way to use something other than PDword, My game allows to write 14 chars
|
|
Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Mon Nov 09, 2015 7:22 am Post subject: |
|
|
Have you tried pchar or pansichar instead?
Or loop through each character and write one pbyte at a time?
Sorry, I've never actually used delphi.
Code: | var
myval9 : string;
myCharPtr : pchar;
i : integer;
addr : integer;
begin
i := 1;
myCharPtr := Addr(myval9);
addr := pdword(pdword($00AB1914)^+$182c)^;
while i <= Length(myval9) do
begin
pchar(addr)^ := myCharPtr^;
Inc(i);
Inc(addr);
Inc(myCharPtr);
end;
end; |
|
|
Back to top |
|
 |
bosman88 How do I cheat?
Reputation: 0
Joined: 06 Oct 2015 Posts: 9
|
Posted: Mon Nov 09, 2015 8:23 am Post subject: |
|
|
I'm working with delphi 2-3 weeks only ;p as my new hobby before I worked a bit with lua, Your code looks good ;p but missing something,
Here I have other code I thought maybe to edit it to make this, But dunno I use it for change AOB, but my experience isn't enough to change it to edit string
Code: |
var
NoMinPChar : PChar;
begin
if sCheckBox25.Checked then
begin
NoMinPChar := #$31#$C0#$C3;
MoveMemory(Pointer($0077884A),NoMinPChar,3); |
Description: |
|
Filesize: |
57 KB |
Viewed: |
6656 Time(s) |

|
|
|
Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Mon Nov 09, 2015 9:29 am Post subject: |
|
|
Oops, that was my fault, I named a variable addr when that's also the name of the function.
Combining the code you provided, try something like the following:
Code: | var
mychar : PChar;
myval9 : string;
begin
mychar := Addr(myval9)
MoveMemory(Pointer($0077884A), mychar, Length(myval9)); |
|
|
Back to top |
|
 |
|