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 


7.2 lua->AA with unregisterSymbol(*)->Access Violation

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

Joined: 28 Feb 2018
Posts: 30

PostPosted: Mon Jan 04, 2021 3:32 pm    Post subject: 7.2 lua->AA with unregisterSymbol(*)->Access Violation Reply with quote

within CE table I'm trying to use AA unregisterSymbol(*) from lua and getting error "Access Violation"
any suggestions?

table1 - "sym" works perfectly: symbol appears on Enable, and disappears on Disable
table2 - "*" generates error "Access Violation" on verification. Then after
activation symbol is created but on Disable symbol is not deleted.
table3 - "\42" does not generate errors on verification, but then behaves like table2.

table1: works as intended
Code:
{$lua}
  local aaEnable  = [[
    define(sym,$process+123456)
    registerSymbol(sym)
  ]]

  local aaDisable  = [[
    unregisterSymbol(sym)
  ]]

  local checkOk, errMsg
  if syntaxcheck then
   checkOk, errMsg = autoAssembleCheck(aaEnable)
   if not checkOk then ShowMessage(errMsg)  end
   checkOk, errMsg = autoAssembleCheck(aaDisable)
   if not checkOk then ShowMessage(errMsg)  end
   return
  end

[ENABLE]
  autoAssemble(aaEnable);

[DISABLE]
  autoAssemble(aaDisable);


table2: error on verification and then sym is not deleted
Code:
{$lua}
  local aaEnable  = [[
    define(sym,$process+123456)
    registerSymbol(sym)
  ]]

  local aaDisable  = [[
    unregisterSymbol(*)
  ]]

  local checkOk, errMsg
  if syntaxcheck then
   checkOk, errMsg = autoAssembleCheck(aaEnable)
   if not checkOk then ShowMessage(errMsg)  end
   checkOk, errMsg = autoAssembleCheck(aaDisable)
   if not checkOk then ShowMessage(errMsg)  end
   return
  end

[ENABLE]
  autoAssemble(aaEnable);

[DISABLE]
  autoAssemble(aaDisable);


table3: no error on verification and then sym is not deleted
Code:
{$lua}
  local aaEnable  = [[
    define(sym,$process+123456)
    registerSymbol(sym)
  ]]

  local aaDisable  = [[
    unregisterSymbol(\42)
  ]]

  local checkOk, errMsg
  if syntaxcheck then
   checkOk, errMsg = autoAssembleCheck(aaEnable)
   if not checkOk then ShowMessage(errMsg)  end
   checkOk, errMsg = autoAssembleCheck(aaDisable)
   if not checkOk then ShowMessage(errMsg)  end
   return
  end

[ENABLE]
  autoAssemble(aaEnable);

[DISABLE]
  autoAssemble(aaDisable);



unregError.png
 Description:
 Filesize:  92.44 KB
 Viewed:  895 Time(s)

unregError.png


Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4299

PostPosted: Mon Jan 04, 2021 5:32 pm    Post subject: Reply with quote

You're not catching/passing disableInfo from/to autoAssemble(...)

See this topic

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Bavarian
Cheater
Reputation: 0

Joined: 28 Feb 2018
Posts: 30

PostPosted: Tue Jan 05, 2021 8:27 am    Post subject: Reply with quote

thanx.
when I put [ENABLE] string inside square double brackets, I get errors as on screen. However if I put [ENABLE] into quotes, then nested call works, but look at syntax I use to avoid errors.

working table
Code:

<?xml version="1.0" encoding="utf-8"?>
<CheatTable>
  <CheatEntries>
    <CheatEntry>
      <ID>89635</ID>
      <Description>"test unreg(*) - lua-&gt;AA - OK"</Description>
      <Options moDeactivateChildrenAsWell="1"/>
      <LastState/>
      <Color>000000</Color>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{$lua}
  local script =
"[ENABLE]".."\r\n"..
[[
  define(sym,$process+123456)
  registerSymbol(sym)
]].."\r\n"..
"[DISABLE]".."\r\n"..
[[
  unregisterSymbol(*)
]]

  local checkOk, errMsg
  if syntaxcheck then
   checkOk, errMsg = autoAssembleCheck(script)
   if not checkOk then ShowMessage(errMsg)  end
   return
  end

[ENABLE]
  a, b = autoAssemble(script);

[DISABLE]
  autoAssemble(script, b);
  a,b=nil,nil;


</AssemblerScript>
    </CheatEntry>
  </CheatEntries>
</CheatTable>




a table throwing errors
Code:

<?xml version="1.0" encoding="utf-8"?>
<CheatTable>
  <CheatEntries>
    <CheatEntry>
      <ID>89638</ID>
      <Description>"test unreg(*) - lua-&gt;AA - ERROR"</Description>
      <Options moDeactivateChildrenAsWell="1"/>
      <LastState/>
      <Color>000000</Color>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{$lua}
  local script =[[
[ENABLE]
  define(sym,$process+123456)
  registerSymbol(sym)
[DISABLE]
  unregisterSymbol(*)
]]

  local checkOk, errMsg
  if syntaxcheck then
   checkOk, errMsg = autoAssembleCheck(script)
   if not checkOk then ShowMessage(errMsg)  end
   return
  end

[ENABLE]
  a, b = autoAssemble(script);

[DISABLE]
  autoAssemble(script, b);
  a,b=nil,nil;


</AssemblerScript>
    </CheatEntry>
  </CheatEntries>
</CheatTable>




unregError2.png
 Description:
 Filesize:  92.98 KB
 Viewed:  831 Time(s)

unregError2.png


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