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 


A quick suggestion for more 'freezing' options

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
random8743
Advanced Cheater
Reputation: 0

Joined: 26 Jun 2006
Posts: 57

PostPosted: Fri Jul 21, 2006 5:11 pm    Post subject: A quick suggestion for more 'freezing' options Reply with quote

In my UCE, I added <= (a.k.a. upper bound/limit) and >= (a.k.a. lower bound/limit) functionality for freezing values. It might be handy for others as well.

I ran across a rapidly cycling countdown timer, and freezing that timer at 0 causes a d/c. What I really wanted to do was change the upper bound of the timer without code-caving. I added upper bound and lower bound to the freeze options, and they work like a charm.

_________________
PMs may be ignored. Not trying to be rude, just trying to stay sane. Plus I'm lazy.
Back to top
View user's profile Send private message
Glest
Master Cheater
Reputation: 0

Joined: 12 Jul 2006
Posts: 334
Location: The Netherlands

PostPosted: Fri Jul 21, 2006 11:56 pm    Post subject: Reply with quote

cool.. Sounds handy, you got my support.
_________________
Keyboard Piano
www.keyboard-piano.com

Reprograming in C++
Computer Piano
*Not done yet*
Back to top
View user's profile Send private message Visit poster's website
linosal
Grandmaster Cheater
Reputation: 1

Joined: 27 Jun 2006
Posts: 821
Location: http://www.thedarkalliance.org

PostPosted: Sat Jul 22, 2006 6:47 pm    Post subject: Re: A quick suggestion for more 'freezing' options Reply with quote

random8743 wrote:
In my UCE, I added <= (a.k.a. upper bound/limit) and >= (a.k.a. lower bound/limit) functionality for freezing values. It might be handy for others as well.

I ran across a rapidly cycling countdown timer, and freezing that timer at 0 causes a d/c. What I really wanted to do was change the upper bound of the timer without code-caving. I added upper bound and lower bound to the freeze options, and they work like a charm.


Sounds cool, care to share the changes w/ db or any of the rest of us? Smile

_________________
http://www.thedarkalliance.org
Thank you for visiting!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
random8743
Advanced Cheater
Reputation: 0

Joined: 26 Jun 2006
Posts: 57

PostPosted: Sun Jul 23, 2006 12:53 am    Post subject: Reply with quote

Sure.
Bear in mind that my changes aren't particularly clean or robust.

All of this is in MainUnit.pas

First, there's the case statement that changes the label text
Code:

      begin
        case memrec[rec].Frozendirection of
          0:
          begin
            col:=clBlue;
            temp:='=';
          end;

          1:
          begin
            temp:='-';
            col:=clRed;
          end;

          2:
          begin
            temp:='+';
            col:=clGreen;
          end;

// Add These Two Cases

          3:
          begin
            temp:='<=';
            col:=clGreen;
          end;

          4:
          begin
            temp:='>=';
            col:=clGreen;
          end;

        end;


Change an 'if' statement so that you can actually use cases 3 and 4 in the first case statement

Code:

// old statement
//    if memrec[sel].Frozendirection=3 then memrec[sel].Frozendirection:=0;

// new statement
    if memrec[sel].Frozendirection=5 then memrec[sel].Frozendirection:=0;


Then there are the hints

Code:

          if temp='-' then freezedirection[i].Hint:=strAllowNegative;//'Allow negative changes';
          if temp='+' then freezedirection[i].Hint:=strAllowPositive;//'Allow positive changes';
          if temp='=' then freezedirection[i].Hint:=strNormalFreeze; //'Don''t allow any change';

// Add these two lines

          if temp='<=' then freezedirection[i].Hint:=strBoundAbove; //'Don''t change to number bigger than X';
          if temp='>=' then freezedirection[i].Hint:=strBoundBelow; //'Don''t change to number smaller than X';


The actual text for the hints

Code:
resourcestring
  strAllowNegative='Allow negative changes';
  strAllowPositive='Allow positive changes';
  strNormalFreeze='Don''t allow any change';

// Add these two lines

  strBoundAbove='Don''t go above value';
  strBoundBelow='Don''t go below value';


Finally, the code that actually does the work, and it's in another case statement.

Code:

      case memrec[i].VarType of
        0:      begin
                  if memrec[i].Frozendirection=0 then
                  begin
                    write1:=byte(memrec[i].FrozenValue);
                    writeprocessmemory(processhandle,pointer(realaddress),addr(write1),1,write);
                  end
                  else
                  begin
                    readprocessmemory(processhandle,pointer(realaddress),@write1,1,write);
                    if write=1 then
                    if memrec[i].Frozendirection=1 then
                    begin
                      if hotkeypressed=i then
                      begin
                        write1:=write1-memrec[i].FrozenValue; //decrease with frozenvalue
                        writeprocessmemory(processhandle,pointer(realaddress),addr(write1),1,write);
                      end
                      else
                      begin
                        //allow decreased values
                        if write1<=byte(memrec[i].FrozenValue) then memrec[i].FrozenValue:=write1
                        else
                        begin
                          write1:=byte(memrec[i].FrozenValue);
                          writeprocessmemory(processhandle,pointer(realaddress),addr(write1),1,write);
                        end;
                      end
                    end
 
// Add this block
// --BLOCK START--
                   else if memrec[i].Frozendirection=3 then
                    begin
                      if write1>byte(memrec[i].FrozenValue) then
                      begin
                        write1:=byte(memrec[i].FrozenValue);
                        writeprocessmemory(processhandle,pointer(realaddress),addr(write1),1,write);
                      end
                    end
                    else if memrec[i].Frozendirection=4 then
                    begin
                      if write1<byte(memrec[i].FrozenValue) then
                      begin
                        write1:=byte(memrec[i].FrozenValue);
                        writeprocessmemory(processhandle,pointer(realaddress),addr(write1),1,write);
                      end
                    end
// --BLOCK END--

                    else
                    begin
                      //allow increased values
                      if hotkeypressed=i then
                      begin
                        write1:=write1+memrec[i].FrozenValue; //increase with frozenvalue
                        writeprocessmemory(processhandle,pointer(realaddress),addr(write1),1,write);
                      end
                      else
                      begin
                        if write1>=byte(memrec[i].FrozenValue) then memrec[i].FrozenValue:=write1
                        else
                        begin
                          write1:=byte(memrec[i].FrozenValue);
                          writeprocessmemory(processhandle,pointer(realaddress),addr(write1),1,write);
                        end;
                      end;
                    end;
                  end;
                  error:=write<>1;
                end;


Add in a similar block for each case. You will have to change the block up a bit for each case (i.e. byte becomes word or dword or...; write1 becomes write2 or write3 or...; in the call to writeprocessmemory, 1 becomes 2 or 4 or...), just take cues fron the rest of the code in each case.

Hopefully that wasn't too traumatic for all you readers. Wink
You'll notice there is precious little error checking (though it hopefully won't be needed) and no functionality regarding hotkeys. If you really want it, you'll need to add it yourself.

GL

_________________
PMs may be ignored. Not trying to be rude, just trying to stay sane. Plus I'm lazy.
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 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