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 


Freeze Value in Script (not lua)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
ZoDDeL
Newbie cheater
Reputation: 1

Joined: 02 Sep 2012
Posts: 23
Location: Germany

PostPosted: Sun Feb 02, 2014 12:34 am    Post subject: Freeze Value in Script (not lua) Reply with quote

is there maybe a simple way to freeze a value (byte,2byte,4byte) in my sort of "script"?
pls no lua stuff ( i dont understand it + it wont fit to my table )


example how my stuff looks normally (when no freeze is needed)
Code:

define(ADDRESS,01200345) // info
[ENABLE]

ADDRESS:
db 00

ADDRESS+2:
db 00

ADDRESS+4:
db 00


[DISABLE]

_________________
if (math+offset) > "codingskill"
then [ignore] and [do_as_you_like]
exit
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Sun Feb 02, 2014 1:12 am    Post subject: Reply with quote

Don't quite understand what you're asking. Following this format works the same as freeze:

Code:
[ENABLE]
[[[[["game.exe"+0159ECD0]+A4]+94]+1C]+4]+14:
dd 2

[["game.exe"+0159EC00]+103C]+7C:
dd (float)2.0

[DISABLE]
[[[[["game.exe"+0159ECD0]+A4]+94]+1C]+4]+14:
dd 0

[["game.exe"+0159EC00]+103C]+7C:
dd (float)1.0
Back to top
View user's profile Send private message
Gniarf
Grandmaster Cheater Supreme
Reputation: 43

Joined: 12 Mar 2012
Posts: 1285

PostPosted: Sun Feb 02, 2014 1:19 am    Post subject: Reply with quote

...In the meantime I made this:
Code:
[enable]
define(ADDRESS_TO_FREEZE,test.exe+1D090)
define(NR_OF_BYTES_TO_WRITE,#4)
define(FREEZE_TIME,#100)   //in miliseconds
globalalloc(MyFreezer,500)

label(SourceBytes)
label(StopFreezing)
registersymbol(StopFreezing)


MyFreezer:             //never deallocate that or you risk a crash
  //this block copies NR_OF_BYTES_TO_WRITE from SourceBytes to ADDRESS_TO_FREEZE
  push NR_OF_BYTES_TO_WRITE
  push SourceBytes
  push ADDRESS_TO_FREEZE
  call memcpy //memcpy(destination,source,byte count)
  add esp,c   //undoes the 3 pushs above

//  push NR_OF_BYTES_TO_WRITE2
//  push SourceBytes2
//  push ADDRESS_TO_FREEZE2
//  call memcpy //memcpy(destination,source,byte count)
//  add esp,c   //undoes the 3 pushs above
//  ...

  push FREEZE_TIME          //sleep between each write operation
  call kernel32.Sleep       //otherwise you'll get 100% cpu usage

  cmp byte [StopFreezing],0 //should we stop?
  je MyFreezer
retn


StopFreezing:
db 0

SourceBytes:
db 00 10 00 00

createthread(MyFreezer) //create the thread that will freeze the value

[disable]
unregistersymbol(StopFreezing)

StopFreezing:
db 1
Which begs for the question: why do you even need it rather that the usual cheat entries?
_________________
DO NOT PM me if you want help on making/fixing/using a hack.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Sun Feb 02, 2014 1:29 am    Post subject: Reply with quote

If you're asking about value type, use this:

db = Define Byte
dw = Define Word
dd = Define Dword
Back to top
View user's profile Send private message
ZoDDeL
Newbie cheater
Reputation: 1

Joined: 02 Sep 2012
Posts: 23
Location: Germany

PostPosted: Sun Feb 02, 2014 2:04 am    Post subject: Reply with quote

Gniarf wrote:
...In the meantime I made this:
Code:
[enable]
define(ADDRESS_TO_FREEZE,test.exe+1D090)
define(NR_OF_BYTES_TO_WRITE,#4)
define(FREEZE_TIME,#100)   //in miliseconds
globalalloc(MyFreezer,500)

label(SourceBytes)
label(StopFreezing)
registersymbol(StopFreezing)


MyFreezer:             //never deallocate that or you risk a crash
  //this block copies NR_OF_BYTES_TO_WRITE from SourceBytes to ADDRESS_TO_FREEZE
  push NR_OF_BYTES_TO_WRITE
  push SourceBytes
  push ADDRESS_TO_FREEZE
  call memcpy //memcpy(destination,source,byte count)
  add esp,c   //undoes the 3 pushs above

//  push NR_OF_BYTES_TO_WRITE2
//  push SourceBytes2
//  push ADDRESS_TO_FREEZE2
//  call memcpy //memcpy(destination,source,byte count)
//  add esp,c   //undoes the 3 pushs above
//  ...

  push FREEZE_TIME          //sleep between each write operation
  call kernel32.Sleep       //otherwise you'll get 100% cpu usage

  cmp byte [StopFreezing],0 //should we stop?
  je MyFreezer
retn


StopFreezing:
db 0

SourceBytes:
db 00 10 00 00

createthread(MyFreezer) //create the thread that will freeze the value

[disable]
unregistersymbol(StopFreezing)

StopFreezing:
db 1
Which begs for the question: why do you even need it rather that the usual cheat entries?



thanks this was 1000% what i needed Surprised
ill give you credits in m next trainer ^^

by the way to answer your question.
6 entries address/value + hotkeys to set value and freeze is a bit crappy for a trainer...

1 script with 1 hotkey for toggle on/off is nice
thats why Rolling Eyes

_________________
if (math+offset) > "codingskill"
then [ignore] and [do_as_you_like]
exit
Back to top
View user's profile Send private message
Gniarf
Grandmaster Cheater Supreme
Reputation: 43

Joined: 12 Mar 2012
Posts: 1285

PostPosted: Sun Feb 02, 2014 2:22 am    Post subject: Reply with quote

ZoDDeL wrote:
by the way to answer your question.
6 entries address/value + hotkeys to set value and freeze is a bit crappy for a trainer...

1 script with 1 hotkey for toggle on/off is nice
thats why
Yeah I kinda smelled something like that, the best solution is to create 12 hotkeys in CE, but map them all to the same button.
_________________
DO NOT PM me if you want help on making/fixing/using a hack.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Sun Feb 02, 2014 2:28 am    Post subject: Reply with quote

Shocked
Back to top
View user's profile Send private message
Gniarf
Grandmaster Cheater Supreme
Reputation: 43

Joined: 12 Mar 2012
Posts: 1285

PostPosted: Sun Feb 02, 2014 2:44 am    Post subject: Reply with quote

Aww c'mon, who doesn't love taking a hike around the moon to fetch the paper mail? Smile
_________________
DO NOT PM me if you want help on making/fixing/using a hack.
Back to top
View user's profile Send private message
ZoDDeL
Newbie cheater
Reputation: 1

Joined: 02 Sep 2012
Posts: 23
Location: Germany

PostPosted: Sun Feb 02, 2014 2:41 pm    Post subject: Reply with quote

okay i got a new problem ^^

Code:

[enable]
define(AURABATTLESTAT,01D00123)
define(AURAFREEZE1,AURA_BATTLESTAT)
define(AURAFREEZE2,AURA_BATTLESTAT+D0)
define(AURAFREEZE3,AURA_BATTLESTAT+1A0)

define(AURABYTES_TO_WRITE1,#1)
define(AURABYTES_TO_WRITE2,#1)
define(AURABYTES_TO_WRITE3,#1)

define(AURAFREEZE_TIME,#100)   //in miliseconds
globalalloc(AURAMyFreezer,1024)

label(AURASourceBytes1)
label(AURASourceBytes2)
label(AURASourceBytes3)

label(StopFreezing)
registersymbol(StopFreezing)



AURAMyFreezer:             //never deallocate that or you risk a crash
  //this block copies NR_OF_BYTES_TO_WRITE from SourceBytes to ADDRESS_TO_FREEZE
  push AURABYTES_TO_WRITE1
  push AURASourceBytes1
  push AURAFREEZE1
  call memcpy //memcpy(destination,source,byte count)
  add esp,c   //undoes the 3 pushs above


  push AURABYTES_TO_WRITE2
  push AURASourceBytes2
  push AURAFREEZE2
  call memcpy //memcpy(destination,source,byte count)
  add esp,c   //undoes the 3 pushs above


  push AURABYTES_TO_WRITE3
  push AURASourceBytes3
  push AURAFREEZE3
  call memcpy //memcpy(destination,source,byte count)
  add esp,c   //undoes the 3 pushs above
//  push NR_OF_BYTES_TO_WRITE2
//  push SourceBytes2
//  push ADDRESS_TO_FREEZE2
//  call memcpy //memcpy(destination,source,byte count)
//  add esp,c   //undoes the 3 pushs above
//  ...

  push FREEZE_TIME          //sleep between each write operation
  call kernel32.Sleep       //otherwise you'll get 100% cpu usage

  cmp byte [StopFreezing],0 //should we stop?
  je AURAMyFreezer
retn


AURASourceBytes1:
db 01

AURASourceBytes2:
db 01

AURASourceBytes3:
db 01

createthread(AURAMyFreezer) //create the thread that will freeze the value

[disable]
unregistersymbol(StopFreezing)

StopFreezing:
db 1


i got the error:
Not all code is injectable.
(Error in line 18 (label(StopFreezing)) :label StopFreezing is not defined in the script)

as you seed i tried to freeze 3 adresses with 1 byte value
what did i miss?

_________________
if (math+offset) > "codingskill"
then [ignore] and [do_as_you_like]
exit
Back to top
View user's profile Send private message
Gniarf
Grandmaster Cheater Supreme
Reputation: 43

Joined: 12 Mar 2012
Posts: 1285

PostPosted: Sun Feb 02, 2014 5:10 pm    Post subject: Reply with quote

Seriously, paste that in cheat engine's main menu and press F4:
Code:
<?xml version="1.0" encoding="utf-8"?>
<CheatTable>
  <CheatEntries>
    <CheatEntry>
      <ID>4</ID>
      <Description>"Aura"</Description>
      <Options moBindActivation="1" moRecursiveSetValue="1"/>
      <LastState Value="" Activated="0" RealAddress="00000000"/>
      <Color>80000008</Color>
      <GroupHeader>1</GroupHeader>
      <Hotkeys>
        <Hotkey>
          <Action>Toggle Activation</Action>
          <Keys>
            <Key>115</Key>
          </Keys>
          <ID>0</ID>
        </Hotkey>
        <Hotkey>
          <Action>Set Value</Action>
          <Keys>
            <Key>115</Key>
          </Keys>
          <Value>1</Value>
          <ID>1</ID>
        </Hotkey>
      </Hotkeys>
      <CheatEntries>
        <CheatEntry>
          <ID>5</ID>
          <Description>"address 1"</Description>
          <LastState Value="??" Activated="0" RealAddress="01D00123"/>
          <Color>80000008</Color>
          <VariableType>Byte</VariableType>
          <Address>01D00123</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>6</ID>
          <Description>"address 2"</Description>
          <LastState Value="??" Activated="0" RealAddress="01D001F3"/>
          <Color>80000008</Color>
          <VariableType>Byte</VariableType>
          <Address>01D00123+D0</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>7</ID>
          <Description>"address 3"</Description>
          <LastState Value="??" Activated="0" RealAddress="01D002C3"/>
          <Color>80000008</Color>
          <VariableType>Byte</VariableType>
          <Address>01D00123+1A0</Address>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
  </CheatEntries>
</CheatTable>


ZoDDeL wrote:
i got the error:
Not all code is injectable.
(Error in line 18 (label(StopFreezing)) :label StopFreezing is not defined in the script)

as you seed i tried to freeze 3 adresses with 1 byte value
what did i miss?
ctrl+F StopFreezing on this page, and you'll see there is one more match in my code that in yours.
_________________
DO NOT PM me if you want help on making/fixing/using a hack.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Sun Feb 02, 2014 5:15 pm    Post subject: Reply with quote

Mr. Green
Back to top
View user's profile Send private message
henrysimon
How do I cheat?
Reputation: 0

Joined: 29 May 2015
Posts: 8

PostPosted: Tue Jun 30, 2015 4:56 am    Post subject: Reply with quote

Gniarf wrote:
...In the meantime I made this:[code][enable]
define(ADDRESS_TO_FREEZE,test.exe+1D090)
define(NR_OF_BYTES_TO_WRITE,#4)
define(FREEZE_TIME,#100) //in miliseconds
globalalloc(MyFreezer,500)


hi the timer is working, it is looping and setting the address, but when the address is change, it seems the function is not being updated (i'm trying to do step 8 tutorial using script, it will repeatedly change value 5000, but when i click change pointer, the timer doesnt work, only when i disable and enable again, the value change (it seems the address got refreshed when I enable it)

here is my code (some of it)

MyFreezer: //never deallocate that or you risk a crash
mov [[[[["Tutorial-i386.exe"+00245390]+C]+14]+0]+18],#5000
push FREEZE_TIME //sleep between each write operation
call kernel32.Sleep //otherwise you'll get 100% cpu usage

cmp byte [StopFreezing],0 //should we stop?
je MyFreezer
retn

----even when I do above the it will stop working once i click change the pointer......
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Tue Jun 30, 2015 4:03 pm    Post subject: Reply with quote

Code:
push eax
mov eax,["Tutorial-i386.exe"+00245390]
mov eax,[eax+C]
mov eax,[eax+14]
mov eax,[eax+0]
mov [eax+18],#5000
pop eax
Back to top
View user's profile Send private message
henrysimon
How do I cheat?
Reputation: 0

Joined: 29 May 2015
Posts: 8

PostPosted: Tue Jun 30, 2015 8:48 pm    Post subject: Reply with quote

Zanzer wrote:
Code:
push eax
mov eax,["Tutorial-i386.exe"+00245390]
mov eax,[eax+C]
mov eax,[eax+14]
mov eax,[eax+0]
mov [eax+18],#5000
pop eax


thanks finally got it working...... Razz
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