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 


Help with some code

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Source
View previous topic :: View next topic  
Author Message
Rawrrr
How do I cheat?
Reputation: 0

Joined: 01 Mar 2007
Posts: 9

PostPosted: Thu Mar 08, 2007 11:56 am    Post subject: Help with some code Reply with quote

Darkbyte-

In your 5.3 source code in the "formMemoryModifier.pas" you have some code (i'm assuming for the trainer icon) that seems to cause an error if it is not commented out in some places. Maybe i'm wrong... but would like to know how to correct this error so i can make trainers with icons.

Code:
 //search for the icon
    searcher:=trainer.memory;
    scanstring:='And so, Dark Byte, wrote the text into the icon, So he could find it back...';

    i:=0;
    j:=1;
    while (i<trainer.size) do
    begin
      if searcher^=scanstring[j] then
      begin
        if j=length(scanstring) then
        begin
          dec(searcher,j);
          dec(i,j+199);
          break;
        end;
        inc(j);
      end else j:=1;

      inc(searcher);
      inc(i);
    end;

    if  j<length(scanstring) then raise exception.create('Please, dont mess with the exe!');

    //replace it
    iconstream:=TMemorystream.Create;
    icon.Picture.Icon.SaveToStream(iconstream);

    getmem(iconbuf,744);

    iconstream.Position:=22;
    iconstream.ReadBuffer(iconbuf^,744);

    iconstream.Free;

    trainer.Position:=i;
    trainer.WriteBuffer(iconbuf^,744);

    freemem(iconbuf);


Now if i leave this how it is... then when i go to make trainers with my UCE what i get is "Please, dont mess with the exe!" even after i choose a new icon for the program.

If i comment out this line.
Code:
//if  j<length(scanstring) then raise exception.create('Please, dont mess with the exe!"

I can make trainers... choose an icon for the trainer but it doesn't save the icon to the trainer when the trainer is made. Could you please lend some insight into this. Thanks.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Thu Mar 08, 2007 12:04 pm    Post subject: Reply with quote

Give the standalone trainer the "findicon.ico" icon.
That icon is used to find the spot that should be overwritten with the user's icon

_________________
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
Rawrrr
How do I cheat?
Reputation: 0

Joined: 01 Mar 2007
Posts: 9

PostPosted: Thu Mar 08, 2007 1:05 pm    Post subject: Reply with quote

Thanks for the quick reply...

Edit* was confused at your post for a min... but slowly it started sinking in. It works perfectly without a hitch now. Thanks a million.
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