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 


Can anything be done to make CE use 2nd AoB found?

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

Joined: 02 Sep 2018
Posts: 44
Location: Rhode Island, USA

PostPosted: Sun Jul 23, 2023 3:11 pm    Post subject: Can anything be done to make CE use 2nd AoB found? Reply with quote

Is there any (n00b-friendly) way to have Cheat Engine use the second address that it finds, not the first? I have tried everything to get a unique AoB, but the first address it finds the routine is exactly the same as the second, but does not change the values - I tried finding different points in the first one to change the values, but it seems that one is for display only. I have been stumped by this for the past 3 days, and finally admitted defeat, and decided to ask in here if there is an easy solution - Can anyone help me out?

P.S. Game is Dead Island 2 (Offline Single Player)

_________________
.: Cheat Engine N00b in Progress :.

I'll earn my avatar someday ...
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 468

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

PostPosted: Sun Jul 23, 2023 3:20 pm    Post subject: Reply with quote

are both in the same module? as you could try aobscanmodule

or in memory view look at them and tick view->show section addresses perhaps there are in different sections, and you can then use aobscanregion to filter the section you need

_________________
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
relentlesstech
Cheater
Reputation: 1

Joined: 02 Sep 2018
Posts: 44
Location: Rhode Island, USA

PostPosted: Sun Jul 23, 2023 7:35 pm    Post subject: Reply with quote

The first one it finds is just a basic address, the one I need is listed as 'DeadIsland-Win64-Shipping.exe+xxxx'

I'll look up how to do an 'aobscanmodule', and give that a try, thanks for responding!

EDIT 2:
They are both in the same section - There's no difference between the two in memory view, and I compared the bytes 15 lines down from the start (40 per line)

EDIT:

Turns out I was already doing an aobscanmodule from the template, so that doesn't work for me - I attached a screenshot of the 2 addresses I get when I scan the aob I need (The 2nd in the list is the one I need to manipulate)

I don't know if it matters, but I am using an undetectable version of CE that I compiled, but has worked perfectly fine with all other games so far.



ce_screen1.PNG
 Description:
 Filesize:  51.26 KB
 Viewed:  3532 Time(s)

ce_screen1.PNG



_________________
.: Cheat Engine N00b in Progress :.

I'll earn my avatar someday ...
Back to top
View user's profile Send private message
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1066
Location: 0x90

PostPosted: Sun Jul 23, 2023 8:41 pm    Post subject: Reply with quote

You can use Lua to achieve this:
Code:

local a = '8B 42 20 48 8D 54 24 20 48 49 4c 24 48 48 83 C1 50'

local function getAOBResultByIndex(aob, idx, permissions)
      if aob == nil or aob == '' then return nil end
      permissions = permissions or '*X*W*C'
      idx = idx or 0
      local as = AOBScan(aob, permissions)

      if as.Count > 0 then
         return as[idx]
      else
         error('AOB not found')
      end
      as.destroy()
end

-- Example: AOBScan results are 0-based meaning 0 is the first entry. You want the second entry so we want index 1
local address = getAOBResultByIndex(a, 1)

-- This just prints the address
print(address)


Edit: updated to include destruction of aobscan object. An oversight on my part.


Last edited by LeFiXER on Mon Jul 24, 2023 8:10 pm; edited 3 times in total
Back to top
View user's profile Send private message
relentlesstech
Cheater
Reputation: 1

Joined: 02 Sep 2018
Posts: 44
Location: Rhode Island, USA

PostPosted: Sun Jul 23, 2023 9:12 pm    Post subject: Reply with quote

LeFiXER wrote:
You can use Lua to achieve this:
Code:

local a = '8B 42 20 48 8D 54 24 20 48 49 4c 24 48 48 83 C1 50'

local function getAOBResultByIndex(aob, idx, permissions)
      if aob == nil or aob == '' then return nil end
      permissions = permissions or '*X*W*C'
      idx = idx or 0
      local as = AOBScan(aob, permissions)

      if as.Count > 0 then
         return as[idx]
      else
         error('AOB not found')
      end
end

-- Example: AOBScan results are 0-based meaning 0 is the first entry. You want the second entry so we want index 1
local address = getAOBResultByIndex(a, 1)

-- This just prints the address
print(address)


I have 0% knowledge of LUA Razz
How would I implement this into my existing script? (Screenshot attached)



ce2.PNG
 Description:
 Filesize:  50.88 KB
 Viewed:  3515 Time(s)

ce2.PNG



_________________
.: Cheat Engine N00b in Progress :.

I'll earn my avatar someday ...
Back to top
View user's profile Send private message
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1066
Location: 0x90

PostPosted: Sun Jul 23, 2023 9:46 pm    Post subject: This post has 1 review(s) Reply with quote

I've compacted it a little bit for this specific scenario. The function I posted can be used more globally

To use Lua in the same script just use {$LUA}/{$ASM} pre-processors:
Code:

[ENABLE]
{$LUA}
if syntaxcheck then return end
local as = AOBScan('8B 42 20 48 8D 54 24 20 48 49 4c 24 48 48 83 C1 50', '*newmem*W*C')
if as.Count > 0 then
   registerSymbol('cash-items', as[1], true)
else
   error('AOB not found')
end
as.destroy()
{$ASM}

alloc(newmem, $1000)

label(cash)
label(items)
label(code)
label(return)

newmem:
   cmp [rcx+0238],00280008
   je cash
   cmp [rcx+0238],FFFFFFFF
   je items
   jmp code

cash:
   mov [rdx+20],#9999999
   mov eax,[rdx+20]
   lea rdx,[rsp+20]
   mov [rsp+48],rcx
   add rcx,50
   jmp return

items:
   mov [rdx+20],63
   mov eax,[rdx+20]
   lea rdx,[rsp+20]
   mov [rsp+48],rcx
   add rcx,50
   jmp return


code:
   mov eax,[rdx+20]
   lea rdx,[rsp+20]
   mov [rsp+48],rcx
   add rcx,50
   jmp return

cash-items:
   jmp far newmem
   nop 3

return:

[DISABLE]

cash-tems:
   db 8B 42 20 48 8D 54 24 20 48 49 4c 24 48 48 83 C1 50

unregistersymbol(cash-items)
unregistersymbol(newmem)
dealloc(cash-items)
dealloc(newmem)


Last edited by LeFiXER on Mon Jul 24, 2023 8:10 pm; edited 1 time in total
Back to top
View user's profile Send private message
relentlesstech
Cheater
Reputation: 1

Joined: 02 Sep 2018
Posts: 44
Location: Rhode Island, USA

PostPosted: Sun Jul 23, 2023 10:02 pm    Post subject: Reply with quote

Seems to be working (So far)! Thank you!
_________________
.: Cheat Engine N00b in Progress :.

I'll earn my avatar someday ...
Back to top
View user's profile Send private message
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1066
Location: 0x90

PostPosted: Sun Jul 23, 2023 10:08 pm    Post subject: Reply with quote

You're welcome Smile
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 150

Joined: 06 Jul 2014
Posts: 4654

PostPosted: Sun Jul 23, 2023 10:13 pm    Post subject: Reply with quote

The lower word of the address is the same... is there a copy of the entire module in memory?

If you're using aobscanmodule, CE shouldn't find the first one. If you go to "Memory View -> View -> Enumerate DLLs and Symbols" do you see multiple copies of the exe?

_________________
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
relentlesstech
Cheater
Reputation: 1

Joined: 02 Sep 2018
Posts: 44
Location: Rhode Island, USA

PostPosted: Mon Jul 24, 2023 1:39 pm    Post subject: Found a better AoB to work with Reply with quote

I ended up scrolling up through the routine until I found differences, and managed to get a unique AoB - The LUA method did work, but for my ease-of-use taking the extra time to check more of the routine paid off - Thanks again to all who took the time to help me out!
_________________
.: Cheat Engine N00b in Progress :.

I'll earn my avatar someday ...
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Mon Jul 24, 2023 1:53 pm    Post subject: Re: Found a better AoB to work with Reply with quote

relentlesstech wrote:
I ended up scrolling up through the routine until I found differences, and managed to get a unique AoB
-Here is an AOB generator that can help you save a lot of time:

https://fearlessrevolution.com/viewtopic.php?f=23&t=15547
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 468

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

PostPosted: Mon Jul 24, 2023 1:53 pm    Post subject: Reply with quote

when doing the lua AOBScan, don't forget to do as.destroy()
_________________
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
relentlesstech
Cheater
Reputation: 1

Joined: 02 Sep 2018
Posts: 44
Location: Rhode Island, USA

PostPosted: Mon Jul 24, 2023 5:10 pm    Post subject: Re: Found a better AoB to work with Reply with quote

++METHOS wrote:
relentlesstech wrote:
I ended up scrolling up through the routine until I found differences, and managed to get a unique AoB
-Here is an AOB generator that can help you save a lot of time:

https://fearlessrevolution.com/viewtopic.php?f=23&t=15547


I made something similar in VB.NET for comparing multiple AoBs



aoccompare.PNG
 Description:
 Filesize:  12.85 KB
 Viewed:  3406 Time(s)

aoccompare.PNG



_________________
.: Cheat Engine N00b in Progress :.

I'll earn my avatar someday ...
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Tue Jul 25, 2023 3:49 am    Post subject: Reply with quote

No need to compare with generator. Take care.
Back to top
View user's profile Send private message
Csimbi
I post too much
Reputation: 97

Joined: 14 Jul 2007
Posts: 3298

PostPosted: Tue Jul 25, 2023 4:38 am    Post subject: Reply with quote

I think this is exactly what mgr.inz.Player's LUA extension does.
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