|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
hackasn How do I cheat? Reputation: 0
Joined: 17 Sep 2018 Posts: 2
|
Posted: Tue Sep 18, 2018 3:58 am Post subject: autoAssemble dealloc won't work |
|
|
Code: | local script_on = [==[
alloc(newmem,$1000,"Game.exe"+1BDAD36)
]==]
local script_off = [==[
dealloc(newmem)
]==]
if(checkbox_getState(CETrainer.CECheckbox1)==1)then
autoAssemble(scrip_on)
else
autoAssemble(script_off)
end
or
local scriptStr = [==[
[ENABLE]
alloc(newmem,$1000,"Game.exe"+1BDAD36)
[DISABLE]
dealloc(newmem)
]==]
---- Enable script
local enabledOk, disableInfo = autoAssemble(scriptStr)
if enabledOk then
print('The auto assembler script was enabled successfully.')
else
print('There was an error enabling the auto assembler script.')
end
---- Disable script
local disabledOk = autoAssemble(scriptStr, disableInfo)
if disabledOk then
disableInfo = nil
print('The auto assembler script was disabled successfully.')
else
print('There was an error disabling the auto assembler script.')
end | [/list]
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Tue Sep 18, 2018 5:22 am Post subject: |
|
|
Bottom one seems to work just fine when I remove the address or replace it with Code: | local scriptStr = ([==[
[ENABLE]
alloc(newmem,$1000,%s)
[DISABLE]
dealloc(newmem)
]==]):format(process) | so that it's always valid. It prints Code: | The auto assembler script was enabled successfully.
The auto assembler script was disabled successfully. |
If I change it to something like Code: | local scriptStr = ([==[
[ENABLE]
alloc(newmem,$1000,%s)
[DISABLE]
dealloc(newmem)
]==]):format(process)
---- Enable script
local enabledOk, disableInfo = autoAssemble(scriptStr)
if enabledOk then
print('The auto assembler script was enabled successfully.')
else
print('There was an error enabling the auto assembler script.')
end
print(disableInfo.allocs.newmem.address)
local val = readInteger(disableInfo.allocs.newmem.address)
print(tostring(val))
---- Disable script
local disabledOk = autoAssemble(scriptStr, disableInfo)
if disabledOk then
--disableInfo = nil
print('The auto assembler script was disabled successfully.')
else
print('There was an error disabling the auto assembler script.')
end
local val = readInteger(disableInfo.allocs.newmem.address)
print('after disable', tostring(val)) | I get Code: | The auto assembler script was enabled successfully.
36110336
0
The auto assembler script was disabled successfully.
after disable nil |
with the readInteger call returning nil clearly showing that the memory has been deallocated.
edit: hm, looking at the first one you can't just use dealloc in a separate script like that unless you register the memory as a symbol, without registering it it's just a label and labels aren't known to other scripts, which is why you can use the same names like newmem and originalcode and returnhere etc. in multiple scripts at the same time and still have them refer to different addresses.
_________________
|
|
Back to top |
|
|
hackasn How do I cheat? Reputation: 0
Joined: 17 Sep 2018 Posts: 2
|
Posted: Tue Sep 18, 2018 5:49 am Post subject: |
|
|
FreeER wrote: | Bottom one seems to work just fine when I remove the address or replace it with Code: | local scriptStr = ([==[
[ENABLE]
alloc(newmem,$1000,%s)
[DISABLE]
dealloc(newmem)
]==]):format(process) | so that it's always valid. It prints Code: | The auto assembler script was enabled successfully.
The auto assembler script was disabled successfully. |
If I change it to something like Code: | local scriptStr = ([==[
[ENABLE]
alloc(newmem,$1000,%s)
[DISABLE]
dealloc(newmem)
]==]):format(process)
---- Enable script
local enabledOk, disableInfo = autoAssemble(scriptStr)
if enabledOk then
print('The auto assembler script was enabled successfully.')
else
print('There was an error enabling the auto assembler script.')
end
print(disableInfo.allocs.newmem.address)
local val = readInteger(disableInfo.allocs.newmem.address)
print(tostring(val))
---- Disable script
local disabledOk = autoAssemble(scriptStr, disableInfo)
if disabledOk then
--disableInfo = nil
print('The auto assembler script was disabled successfully.')
else
print('There was an error disabling the auto assembler script.')
end
local val = readInteger(disableInfo.allocs.newmem.address)
print('after disable', tostring(val)) | I get Code: | The auto assembler script was enabled successfully.
36110336
0
The auto assembler script was disabled successfully.
after disable nil |
with the readInteger call returning nil clearly showing that the memory has been deallocated.
edit: hm, looking at the first one you can't just use dealloc in a separate script like that unless you register the memory as a symbol, without registering it it's just a label and labels aren't known to other scripts, which is why you can use the same names like newmem and originalcode and returnhere etc. in multiple scripts at the same time and still have them refer to different addresses. |
Thanks for your help.I don’t know how to express my gratitude.
|
|
Back to top |
|
|
|
|
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
|
|