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 


AobScanModule if / else function?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Reaper79
Advanced Cheater
Reputation: 2

Joined: 21 Nov 2013
Posts: 68
Location: Germany

PostPosted: Mon Aug 04, 2014 1:59 pm    Post subject: AobScanModule if / else function? Reply with quote

Hi there,

is it possible to check the Result of the AOBScanModule ?

Like:
Code:

  if (AOBScanModule(test1, module1.dll, xx xx xx) != null)
    then inject blabla1
  else if (AOBScanModule(test2, module2.dll, xx xx xx) != null)
    then inject blabla2


My problem is, if you change the Scenario or Expansion pack of the game, it loads / reloads another DLL which destroys my code injection / jump.

For Example, all i want is, if you press Numkey 1 (e.g. Raise Gold) that it checks if the code injection is still valid, else rescan and re-set the jump...

is this possible with CE ?

puh..hope you understand my german english Smile

Reaper

EDIT: nevermind, i think LUA will be my new friend Sad
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Mon Aug 04, 2014 3:33 pm    Post subject: Reply with quote

yeah, lua would be the only solution.

but you can do a hybrid solution

Code:

{$LUA}
errorOnLookupFailure(false)
local addressOfBla=getAddress("bla")
if addressOfBla~=0 then
  --bla exists, this means it may have been hooked already
  local firstbyte=readBytes(addressOfBla, 1)
  if (firstbyte==0xe9) then --jmp to your codecave
    --error('Activation is not needed. This script is still active')
   return ''  --do not reassign bla and reuse it
  end
end

--still here, so not yet initialized or changed. Tell the auto assembler to (re)initialize bla
return [[
  aobscanmodule(bla,module1.dll,11 22 33 44 55 66)
  registersymbol(bla)
]]

{$ASM}
alloc(mycodecave, 65536)
label(exit)

bla:
jmp mycodecave
...

_________________
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
Reaper79
Advanced Cheater
Reputation: 2

Joined: 21 Nov 2013
Posts: 68
Location: Germany

PostPosted: Mon Aug 04, 2014 4:19 pm    Post subject: Reply with quote

sooo much bla Smile I like bla.

This helps me a lot, thank you very much.
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