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 


need help

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
isaacay
How do I cheat?
Reputation: 0

Joined: 06 Nov 2015
Posts: 3

PostPosted: Fri Nov 06, 2015 11:46 pm    Post subject: need help Reply with quote

I have this aob scanner and it only prints the first address it finds even if there's more then one and so I need help making it show all address's with the aob
Code:
function scanAob(array)
result = nil
scan = createMemScan(true)

memscan_returnOnlyOneResult(scan, true)
memscan_firstScan(scan, soExactValue, vtByteArray, rtTruncated, array, nil, 0x00000000, 0xFFFFFFFF, "*W", fsmNotAligned, nil, true, false, false, false)
memscan_waitTillDone(scan)

result = memscan_getOnlyResult(scan)
result = string.format("%x", result)
result = ("0"):rep(8-#result) .. result
return result
end

function CreateMenu(form, name)
local menu = form.getMenu().getItems()

local newItem = createMenuItem(menu)
newItem.Caption = name
menu.add(newItem)

return newItem
end

function CreateMenuChild(parent, caption, onclick)
local newItem = createMenuItem(parent)
parent.add(newItem)
newItem.Caption = ca ption
newItem.setOnClick(onclick)
return newItem
end

lMenu = CreateMenu(getMemoryViewForm(), "Test")

local Scanlist = {
["Speed"] = "?? ?? ?? 0? ?? ?? ?? 06 01 00 00 00 E2 30 57 C1";
}
local get = CreateMenuChild(lMenu, "Find", function()
getLuaEngine().show();
for i,v in next, Scanlist do
  local r = scanAob(v);
  if r then
   print(i..": "..r);
  else
   print(i..": Failed! :(");
  end
end
end)
Back to top
View user's profile Send private message
Cake-san
Grandmaster Cheater
Reputation: 8

Joined: 18 Dec 2014
Posts: 541
Location: Semenanjung

PostPosted: Sat Nov 07, 2015 2:07 am    Post subject: Reply with quote

Seriously,I know nothing about Lua Shocked
All I had been using was this script provided by Dark Byte :
Code:

{$lua}
function FindAOBEntryX(AOBToScan, entrynr)
  local result=nil
  local results=AOBScan(AOBToScan)
  if results.Count>entrynr then
    result=results[entrynr]
  end

  results.destroy();

  return result
end

registersymbol("_ID", FindAOBEntryX("00 40 8F 40 D0 D7 ?? ?? FB FF FF FF 00 00 00 00",2))

I'm sorry if this is not the one that you're looking for Confused
You might want to wait for other Masters that expertise in this field to reply to your post or you have to search the forum on your own.

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

Joined: 06 Nov 2015
Posts: 3

PostPosted: Sat Nov 07, 2015 4:28 am    Post subject: Reply with quote

Cake-san wrote:
Seriously,I know nothing about Lua Shocked
All I had been using was this script provided by Dark Byte :
Code:

{$lua}
function FindAOBEntryX(AOBToScan, entrynr)
  local result=nil
  local results=AOBScan(AOBToScan)
  if results.Count>entrynr then
    result=results[entrynr]
  end

  results.destroy();

  return result
end

registersymbol("_ID", FindAOBEntryX("00 40 8F 40 D0 D7 ?? ?? FB FF FF FF 00 00 00 00",2))

I'm sorry if this is not the one that you're looking for Confused
You might want to wait for other Masters that expertise in this field to reply to your post or you have to search the forum on your own.

thanks for that i mofified it so it can find more then one without having to modify it and execute again
Code:
showMessage("once it scans all and prints all address's it will error")
aob = "?? ?? ?? ?? ?? ?? ?? 06 01 00 00 00 E2 30 57 C1"
local scannum = 0
function FindAOBEntryX(AOBToScan, entrynr)
  local result=nil
  local results=AOBScan(AOBToScan)
  if results.Count>entrynr then
    result=results[entrynr]
  end





repeat
print("AOB Scan "..scannum..":   "..result)
scannum = scannum + 1
registerSymbol( FindAOBEntryX(aob, scannum))
until result==nil
return result
end
registerSymbol( FindAOBEntryX(aob, scannum))

if anyone wants to do a code clean up to make it more efficient also i would also gladly appreciate the orignial code i put in this fourm to find more then the first affress if you do to code clean up of fixing the orignial code i put in this fourm please post it here
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sat Nov 07, 2015 7:22 am    Post subject: Reply with quote

Just wanted to point out that your original script contained:
Code:
memscan_returnOnlyOneResult(scan, true)

Not sure if the function name is descriptive enough for you, but
...that causes the memscan to return only one result.
Back to top
View user's profile Send private message
isaacay
How do I cheat?
Reputation: 0

Joined: 06 Nov 2015
Posts: 3

PostPosted: Sat Nov 07, 2015 7:38 am    Post subject: Reply with quote

wow i never even saw that
btw my friend gave me it and so i never saw that when trying to modify it to work for more then one
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 Lua Scripting 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