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

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Source
View previous topic :: View next topic  
Author Message
vener
Grandmaster Cheater Supreme
Reputation: 0

Joined: 18 Feb 2006
Posts: 1668

PostPosted: Sat Oct 14, 2006 8:53 pm    Post subject: coding delphi Reply with quote

Code:
procedure TTrainer.CheckBox6Click(Sender: TObject);
var
address:integer;
size:integer;
fzid1:integer;
maxid:integer;
baseaddress:integer;
offsetcount:integer;
i:dword;
offsets:cefuncproc.pDwordarray;
a:dword;
begin
if checkbox6.checked then
begin
baseaddress:=($00642818);
offsetcount:=1;
offsets[i]:=($274);
ce_getaddressfrompointer(baseaddress,offsetcount,offsets);
label1.caption:=inttostr(a);
address:=(a);
size:=4;
ce_freezemem(address,size);
maxid:=fzid1 ;
label1.caption:=inttostr(fzid1);
end
else
begin
ce_unfreezemem(fzid1);
label1.Caption:='sucess';
end;
end;

when i activaed it it showed
---------------------------
ProjectX
---------------------------
Access violation at address 0045AADB in module 'ProjectX.exe'. Read of address 00000260.
---------------------------
OK
---------------------------
any ideas?

whats offsetcount anyway?
Back to top
View user's profile Send private message  
Dark Byte
Site Admin
Reputation: 468

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

PostPosted: Sun Oct 15, 2006 1:55 am    Post subject: Reply with quote

you're forgetting to allocate memory for the offsets array and initializing i (or in this case replace it with 0)


so at least before the line: offsets[i]:=$274; have the code:
Code:

setlength(offsets,1);
i:=0;


and you're also forgetting to set a.
should be:
Code:

a:=ce_getaddressfrompointer(baseaddress,offsetcount,offsets);


same goes for fzid, should be:
Code:

ce_freezemem(address,size);


and fzid has to be declared globally or at least inside the TTrainer object. Not inside the current function since that variable gets destroyed as soon as you exit the function

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

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

Joined: 18 Feb 2006
Posts: 1668

PostPosted: Sun Oct 15, 2006 10:50 am    Post subject: Reply with quote

after the modifications recomended by you,theres still errors

---------------------------
ProjectX
---------------------------
Access violation at address 004F238F in module 'ProjectX.exe'. Write of address 00000000.
---------------------------
OK
---------------------------
but with
Code:
a:=ce_getaddressfrompointer(baseaddress,offsetcount,offsets);

and
Code:
fzid1:=ce_freezemem(address,size);

commented

it wont show errors,i also put the array directly instead of declearing I=0

offsets[0]:=$274;

since setlength will generate a imcopatible type error
PS:this is my first time working with arrays
Back to top
View user's profile Send private message  
N-Y-M
Master Cheater
Reputation: 0

Joined: 13 Jul 2006
Posts: 475
Location: Emergency

PostPosted: Sun Oct 15, 2006 11:58 am    Post subject: Reply with quote

1. can i call writeprocessmemory to freeze addr? (just like what db do under freezethem)
2. may i know where is processhandle being declared in mainunit?

thanks

_________________

---| Powered by Dark Byte |---
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger 
ICQ Number
vener
Grandmaster Cheater Supreme
Reputation: 0

Joined: 18 Feb 2006
Posts: 1668

PostPosted: Mon Oct 23, 2006 10:22 pm    Post subject: Reply with quote

simillarly to changing registers i tried to use the same idea on AA
1stly i tried to use the plugin exports part

i try it with this code
Code:
procedure TTrainer.CheckBox4Click(Sender: TObject);
var script: tstringlist;
s:pchar;
begin
if checkbox4.checked then
begin
  script:=tstringlist.create;
    with script do
    begin
add('code...');
add('code...');
    autoassemble(script,false);
  script.free;
end
end
else
  script:=tstringlist.create;
    with fscript  do
    begin
add('code...');
add('code...');
    autoassemble(script,false);
  script.free;
    end;
end;


the code executed and works like i want it to be but returned with this

---------------------------
ProjectX
---------------------------
Access violation at address 00506508 in module 'ProjectX.exe'. Read of address 000003A0.
---------------------------
OK
---------------------------
any help?
Back to top
View user's profile Send private message  
Dark Byte
Site Admin
Reputation: 468

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

PostPosted: Tue Oct 24, 2006 1:30 am    Post subject: Reply with quote

no idea, it should work (assuming you included the autoassembler unit to the uses), looks like a property of a undeclared (nil) object is being accessed

Is this code execute before the symbolhandler is initialized ? (usually happens in oncreate iof mainform)

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

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

Joined: 18 Feb 2006
Posts: 1668

PostPosted: Tue Oct 24, 2006 6:21 am    Post subject: Reply with quote

no,its executed after mainunit is executed,i special thing is when i disable it
Code:
else
  script:=tstringlist.create;
    with fscript  do
    begin
add('code...');
add('code...');
    autoassemble(script,false);
  script.free;
    end;

it won't have that violation,any ideas?

btw symbolhandler,frmautoinject,autoassembler is included in uses
Back to top
View user's profile Send private message  
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Source 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