Jump to content

LUA scripting


Enyby
 Share

Recommended Posts

  • Administrators
5 hours ago, Aufar_R said:

If the cheat only works with versioncode 291, how to make the script only works with that ver. Code?

local v = gg.getTargetInfo()
if v.versionCode ~= 291 then
	print('This script only works with game version 291. You have game version ', v.versionCode, ' Please install version 291 and try again.')
	os.exit()
end

scr_1503114009.jpg

Link to comment
Share on other sites

1 hour ago, Enyby said:

local v = gg.getTargetInfo()
if v.versionCode ~= 291 then
	print('This script only works with game version 291. You have game version ', v.versionCode, ' Please install version 291 and try again.')
	os.exit()
end

scr_1503114009.jpg

Function checking obb version?

Link to comment
Share on other sites

  • Administrators
35 minutes ago, shinobi97 said:

Function checking obb version?

@Aufar_R is right. Obb do not have version. It can have special name. You can check for some file exists.

For example I have next obb's on my emulator:

/sdcard/Android/obb/com.blayzegames.iosfps/main.100.com.blayzegames.iosfps.obb
/sdcard/Android/obb/com.gamedevltd.modernstrike/main.79.com.gamedevltd.modernstrike.obb
/sdcard/Android/obb/com.ea.game.pvzfree_row/main.91.com.ea.game.pvzfree_row.obb
function file_exists(name)
   local f=io.open(name,"r")
   if f~=nil then io.close(f) return true else return false end
end

local obb = '/sdcard/Android/obb/com.blayzegames.iosfps/main.100.com.blayzegames.iosfps.obb'
if not file_exists(obb) then
	print('Obb not found: ', obb)
	os.exit()
end

local obb = '/sdcard/Android/obb/com.blayzegames.iosfps/main.101.com.blayzegames.iosfps.obb'
if not file_exists(obb) then
	print('Obb not found: ', obb)
	os.exit()
end

scr_1503124055.jpg

Link to comment
Share on other sites

3 hours ago, Enyby said:

@Aufar_R is right. Obb do not have version. It can have special name. You can check for some file exists.

For example I have next obb's on my emulator:


/sdcard/Android/obb/com.blayzegames.iosfps/main.100.com.blayzegames.iosfps.obb
/sdcard/Android/obb/com.gamedevltd.modernstrike/main.79.com.gamedevltd.modernstrike.obb
/sdcard/Android/obb/com.ea.game.pvzfree_row/main.91.com.ea.game.pvzfree_row.obb

function file_exists(name)
   local f=io.open(name,"r")
   if f~=nil then io.close(f) return true else return false end
end

local obb = '/sdcard/Android/obb/com.blayzegames.iosfps/main.100.com.blayzegames.iosfps.obb'
if not file_exists(obb) then
	print('Obb not found: ', obb)
	os.exit()
end

local obb = '/sdcard/Android/obb/com.blayzegames.iosfps/main.101.com.blayzegames.iosfps.obb'
if not file_exists(obb) then
	print('Obb not found: ', obb)
	os.exit()
end

scr_1503124055.jpg

In xiaomi devices usually data and obb stored in internal. Whether we can use 2 calling function path ? Internal & sdcard stored 

Xiaomi path name:

/ storage / emulated / legacy / Android / obb

Edited by shinobi97
Link to comment
Share on other sites

  • Administrators

For my phone:

$ ls -l /storage/emulated
lrwxrwxrwx root     root              2017-08-18 06:23 legacy -> /storage/sdcard0

Maybe you need use /storage/sdcard0/Android/obb/

_______________________________________________
added 1 minute later

I think game always use same path to obb. You need use same path for check it. It can use some symlinks for different locations. 

Link to comment
Share on other sites

12 minutes ago, shinobi97 said:

In xiaomi devices usually data and obb stored in internal. 

12 minutes ago, shinobi97 said:

 

Xiaomi path name:

/ storage / emulated / legacy / Android / obb

Most low-level datas are stored in /sdcard/Android/data/*.

But MOST of the data is stored in /data/data/*.

Obb is always stored in /sdcard/Android/obb/*.

That happens on most phones. I'll bet 97% of them are the same.

/sdcard is INTERCHANGEABLE with /storage/emulated/legacy or /storage/emulated/0.

It's not that device-specific....

12 minutes ago, shinobi97 said:

Internal & sdcard stored

Apps don't store data in external storage.

Maybe a few, very few. And games won't be stored in external storage.

This is not the case with phone using Adoptable Storage, in which I'm totally certain you won't use it.

14 minutes ago, shinobi97 said:

Whether we can use 2 calling function path ?

Checking for app data or obb won't do any good. It's useless. Why do you have to look for an app data? Different versions of an app have THE SAME data and obb label.

--------

Hope that helps.

Link to comment
Share on other sites

14 minutes ago, Enyby said:

For my phone:

 


$ ls -l /storage/emulated
lrwxrwxrwx root     root              2017-08-18 06:23 legacy -> /storage/sdcard0

 

Maybe you need use /storage/sdcard0/Android/obb/

_______________________________________________
added 1 minute later

I think game always use same path to obb. You need use same path for check it. It can use some symlinks for different locations. 

Thnks for advice 

_______________________________________________
added 4 minutes later

@Aufar_R

Crisis action game has a strange problem. If we do not install the app via play store. They just raise the app version but not with the build obb

Edited by shinobi97
Link to comment
Share on other sites

20 hours ago, shinobi97 said:

@Aufar_R

Crisis action game has a strange problem. If we do not install the app via play store. They just raise the app version but not with the build obb

Obbs do not update after install. Any update AFTER app installation goes to '/data/app/*' and '/data/data/*'.

Once again, we don't need to do ANYTHING with obb. If you still insist, then do it for yourself. I'm certain that messing up with obbs won't do anything.

If you don't install via Play Store. CA only updates its app when a big change comes. I've used the MOL apk since ver. 1.9.2 and must reinstall the app when 2.0 comes in. But i didn't have to reinstall the app when 2.0.1 comes in.

Link to comment
Share on other sites

On 8/18/2017 at 11:41 PM, NotAnulots said:

Man you're too good at coding, I will ask something aren't these codes basically C#? If you reply it would be too helps. Thanks...

I don't know if it's C#, (Don't know C#).

It's lua, it's a programming language like other (C++, Java, etc...)

It's more like C++.

Thanks to this implementation to gameguardian (I would thank @Enyby) I found out I like programming!

I'm now very interested in it and I'm learning it (C++). It's fun for me LOL

It made me busy and I'm rarely here...almost not here :D.

I suggest you to try Lua too, it's a good take off point to learn other complicated programming languages.

--- Cheers

 

 

Link to comment
Share on other sites

Hi. I have a question. I am hacking units in one game. How do I do that. I can search unit's current stats in memory (they change with time). Than I remember an unique sequence which is preceding unit's stats. Now I can search that sequence and edit unit's stats right in the memory. There is also a problem that for stats there are 20~30 results, but for unique sequence there is always only one. 

I wanted to understand how to write a script which could ask me what units I want to edit with multi-choice then for whichof them find in the memory corresponding unique sequence and then edit memory which is shifted on the fixed bytes from found value. But I cannot find in the help a function which would allow me to edit memory in the known address. And also I don't want to edit values before getting addresses of found values (as I understand it is how it works according to editAll description). So can I do it or I will still need to do it all manually?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.