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 


AOBScan with variable like registersymbol?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
sir-gunny
Advanced Cheater
Reputation: 0

Joined: 15 Mar 2012
Posts: 80

PostPosted: Fri May 04, 2012 12:00 am    Post subject: AOBScan with variable like registersymbol? Reply with quote

Hi.

Is it possible to use AOBScan with a variable from other cheat like registersymbol?

For example:
Code:
AOBScan(aobMoney,01 02 03 ff ab cd ef AND variable(MySymbol,4 Byte) AND 04 05 06 07 08)



Greez,
Gunny
Back to top
View user's profile Send private message
sir-gunny
Advanced Cheater
Reputation: 0

Joined: 15 Mar 2012
Posts: 80

PostPosted: Sat Jun 23, 2012 1:04 pm    Post subject: Reply with quote

Hi.

Is it possible with the new "luafunction()" function?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sat Jun 23, 2012 1:13 pm    Post subject: Reply with quote

Sure, just use lua to build up the string to scan for
_________________
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
sir-gunny
Advanced Cheater
Reputation: 0

Joined: 15 Mar 2012
Posts: 80

PostPosted: Sat Jun 23, 2012 1:52 pm    Post subject: Reply with quote

Hi.

Thank you for your answer.

Can you please give me a small example how to use it in a aa table?

EDIT:

Is this right?

Code:
[ENABLE]
Label(money)
luafunction(_SymbolAODScan(MyMoneySymbol))

AOBMoney:
Money:
 dd (int)10000

[DISABLE]


#################################


Function _SymbolAODScan(MySymbol)
   MyAOBString = "01 02 03 ff ab cd ef "..MySymbol.." 04 05 06 07 08"
   AOBMoney = AOBScan(MyAOBString)
end


Last edited by sir-gunny on Sat Jun 23, 2012 2:15 pm; edited 1 time in total
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sat Jun 23, 2012 2:11 pm    Post subject: Reply with quote

First execute this lua code so the function is available
Code:

function myscript()
local MySymbol = Whateveryoudotogetthesymbolbytesasanaob()
local mystring = "01 02 03 ff ab cd ef "..MySymbol.." 04 05 06 07 08"

autoAssemble([[
  AOBScan(aobMoney, ]]..mystring..[[

  aobMoney:
   nop
   nop
   nop
   nop
]]
end

function UndoMyScript()
--some code that disables it
end


Then write an aa script like this
Code:

[enable]
LuaCall(myscript())

[disable]
LuaCall(UndoMyScript())

_________________
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
sir-gunny
Advanced Cheater
Reputation: 0

Joined: 15 Mar 2012
Posts: 80

PostPosted: Sat Jun 23, 2012 2:49 pm    Post subject: Reply with quote

Hi Dark Byte.

Thank you that you help a LUA NOOB! Smile

does it work?
Code:
function myscript()
local MySymbol = readBytes(getAddress(MyRegSymbol),4)
local mystring = "01 02 03 ff ab cd ef "..MySymbol.." 04 05 06 07 08"

autoAssemble([[
  AOBScan(aobMoney, ]]..mystring..[[ )
]]
end


AA script:
Code:
[ENABLE]
 
LuaCall(myscript())

Label(money)

AOBMoney+08:
Money:
 dd (int)10000

[DISABLE]


Sorry that i waste your time. Embarassed
Back to top
View user's profile Send private message
sir-gunny
Advanced Cheater
Reputation: 0

Joined: 15 Mar 2012
Posts: 80

PostPosted: Sun Jun 24, 2012 9:57 am    Post subject: Reply with quote

Hi.

My script dosn't work. Whats wrong?

Code:
function FindM()
local KW = readBytes(getAddress(pKW),4)
local IW = readBytes(getAddress(pIW),4)
local MW = readBytes(getAddress(pMW),4)
local HW = readBytes(getAddress(pHW),4)

local MarinesString = "01 00 00 00 00 01 "..MW.." 01 "..HW.." 01 "..IW.." 01 "..KW.." 01 00 00 00 00"

autoAssemble([[
  AOBScan(aobMarine, ]]..MarinesString..[[ )
]])
end


aa:
Code:
[ENABLE]

LuaCall(FindMarines())

label(_MK)
label(_MI)
label(_MM)
label(_MH)

registersymbol(_MK)
registersymbol(_MI)
registersymbol(_MM)
registersymbol(_MH)

aobMarine+06:
_MM:

aobMarine+0B:
_MH:

aobMarine+10:
_MI:

aobMarine+15:
_MK:

[DISABLE]

unregistersymbol(_MK)
unregistersymbol(_MI)
unregistersymbol(_MM)
unregistersymbol(_MH)


Quote:
Error:Failure determining what means
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sun Jun 24, 2012 10:56 am    Post subject: Reply with quote

aobMarine isn't registered in your autoAssemble() script, aobscan does a local define, not a register

try:
Code:

autoAssemble([[
  label(aobMarine)
  registersymbol(aobMarine)
  AOBScan(_aobMarine, ]]..MarinesString..[[ )
  _aobMarine:
  aobMarine:

]])


also a tip but not sure if it's for use to you:
Auto assembler can access lua variables directly if used as address. You must precede them with a $ sign

_________________
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
sir-gunny
Advanced Cheater
Reputation: 0

Joined: 15 Mar 2012
Posts: 80

PostPosted: Sun Jun 24, 2012 11:45 am    Post subject: Reply with quote

I get the same error.

If i replace the getAddress() function with the address of the symbol (0x0DEC0000) i get a new error: "Error in line 15 (aobMarine+06):This address specifier is not valid"

EDIT:

I tried to use the LUA AOBScan with $ but i get an error:
Script Error:[string "function FindeMarines()..."]:9: unexpected symbol near '$'

Code:
function FindM()
local KW = readBytes(getAddress(pKW),4)
local IW = readBytes(getAddress(pIW),4)
local MW = readBytes(getAddress(pMW),4)
local HW = readBytes(getAddress(pHW),4)

local MarinesString = "01 00 00 00 00 01 "..MW.." 01 "..HW.." 01 "..IW.." 01 "..KW.." 01 00 00 00 00"

$aobMarine=AOBScan(MarinesString)
end


If i use this i get the error: Error:Failure determining what means (why is between "what" and "means" an emty area?)
Code:
function FindM()
local KW = readBytes(getAddress(pKW),4)
local IW = readBytes(getAddress(pIW),4)
local MW = readBytes(getAddress(pMW),4)
local HW = readBytes(getAddress(pHW),4)

local MarinesString = "01 00 00 00 00 01 "..MW.." 01 "..HW.." 01 "..IW.." 01 "..KW.." 01 00 00 00 00"

aobMarine = AOBScan(MarinesString)
registersymbol(aobMarine)

end
Back to top
View user's profile Send private message
sir-gunny
Advanced Cheater
Reputation: 0

Joined: 15 Mar 2012
Posts: 80

PostPosted: Tue Jun 26, 2012 9:44 am    Post subject: Reply with quote

IT WORKS!!! Very Happy

I only forget the "!!

Code:
local KW = readBytes(getAddress("pKW"),4)


Embarassed Rolling Eyes Laughing Idea Idea Idea
Thank you very much!!! Smile
Back to top
View user's profile Send private message
sir-gunny
Advanced Cheater
Reputation: 0

Joined: 15 Mar 2012
Posts: 80

PostPosted: Thu Nov 01, 2012 11:50 am    Post subject: Reply with quote

Hi DarkByte.

Can you tell me what is wrong with my script? I have nothing change but it doesn't work anymore. I hope you can help me.

EDIT: If i use the LuaCall() function in AA i get an error. I think the Lua Script is not loaded.



myscript.CT
 Description:

Download
 Filename:  myscript.CT
 Filesize:  4.38 KB
 Downloaded:  754 Time(s)

Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Thu Nov 01, 2012 12:46 pm    Post subject: Reply with quote

The luascript must have been executed yes
In general settings you can check if always execute lua scripts is enabled

Also, post the error you get. My target process does not have the aob you're scanning for, so it can't find it. So I can't test it

_________________
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
sir-gunny
Advanced Cheater
Reputation: 0

Joined: 15 Mar 2012
Posts: 80

PostPosted: Thu Nov 01, 2012 2:11 pm    Post subject: Reply with quote

The LuaScript is always executed. But i think it is not loadet?!?!


error.png
 Description:
 Filesize:  385.29 KB
 Viewed:  25121 Time(s)

error.png


Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Thu Nov 01, 2012 2:15 pm    Post subject: Reply with quote

Change FindMarines() function to this
Code:

function FindMarines()

local KW = readBytes(getAddress("pKW"),4)
local IW = readBytes(getAddress("pIW"),4)
local MW = readBytes(getAddress("pMW"),4)
local HW = readBytes(getAddress("pHW"),4)
local MarinesString = "01 00 00 00 00 01 "..MW.." 01 "..HW.." 01 "..IW.." 01 "..KW.." 01 00 00 00 00"

if (autoAssemble([[
  label(aobMarine)
  registersymbol(aobMarine)
  AOBScan(_aobMarine, ]]..MarinesString..[[ )
  _aobMarine:
  aobMarine:
]])) == false then
    print("Failure assembling this script. AOB scanned was "..MarinesString)
  end
end


Perhaps the AOB can not be found in the target process causing the script to fail and never registering aobMarine

_________________
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
sir-gunny
Advanced Cheater
Reputation: 0

Joined: 15 Mar 2012
Posts: 80

PostPosted: Thu Nov 01, 2012 2:27 pm    Post subject: Reply with quote

haha... lol...

if :
current KW = 26
current IW = 53
current MW = 14
current HW = 11

the string should look like this:

01 00 00 00 00 01 0E 00 00 00 01 0B 00 00 00 01 35 00 00 00 01 1A 00 00 00 01 00 00 00 00

but it look so:
Failure assembling this script. AOB scanned was 01 00 00 00 00 01 14 01 11 01 53 01 26 01 00 00 00 00

as 1byte int... lol?!?!? why??
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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