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 


Stopping code from checking the state of a file before load

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

Joined: 08 Dec 2017
Posts: 3

PostPosted: Fri Jul 06, 2018 9:15 am    Post subject: Stopping code from checking the state of a file before load Reply with quote

So I'm trying to play around with a lua file that's being loaded by a game. I've tried to the best of my ability to find the lua_gettop using CE, but no luck. There's a way around this though, I have access to all the lua files, and I can modify them *before* I run the game.

However, when I run the game with modified lua files it doesn't load! There must be some code that checks if the lua files are as expected (same length, same hash, etc. - I don't know). I have found 3 string references to the files:

1. Error message about trying to load the files
2. & 3. just a reference to the files themselves.

I assume I need to do something to skip either #2 or #3 however I have to do this before I run the code as this seems the be one of the first things the game checks. If I search for the addresses of 2 or 3 when opening the file (File -> Open file) then it just takes me to a load of question marks (??).

Is there any way in cheat engine to load a process with command line arguments, instantly break the process, then go about editing the code? If not, can anyone see a better way to do what I'm trying to do.


FYI - my plan to edit the code is to direct one of #2 or #3 to the original file and the other to my edited version, hopefully allowing the code to check the file is correct but then load my edited version. If more information is required about any of this please just ask! Here's the lua references I've found thus far in case anyone can see an easy way to edit a lua script in situ:

luaJIT 2.0.4
LUA script 01B2134
LUA_CPATH 0145A80C
LUA_NOENV 0145A7AC
LUA_PATH 0145A7E0
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8517
Location: 127.0.0.1

PostPosted: Fri Jul 06, 2018 9:09 pm    Post subject: Reply with quote

If the game does not externally import Lua and reference its exports to make calls etc. then you wont generally find lua_gettop. Along with that, your strings show that the game uses LuaJit instead of normal Lua which is a heavily modded version of Lua.

If the library is statically linked, then its usually not going to have a function for gettop. Instead, it will be inlined when compiled due to optimization.

Rather than hook / look for gettop, focus on a different Lua call instead to get what you need.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
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