Jump to content
  • 0

Illuminus
 Share

Question

Hi Guys,

My knowledge in mem hacking is very basic, but I love to trail and error and find my way somehow. But sometimes I need to ask if what I am trying to do is even possible or not.

I have an RPG game (doesn't matter what game) with a team of 5 Avatars each has two attributes I like to change, this makes a value of 10. I can single search each value and change them no problem. But here my problem starts. I have to search them all 10 each match, and a match only last a few seconds. I spare more time in searching all 10 values one by one changing them start the match and then start the whole process over and over. I tried to pair them and do a group search I learned to narrow the process down by pairing the two values of each Avatar I want to change. I tried to group search 8 values at once but the range between each value is over 65536 so I don`t find any results this way(is there a way to make this range unlimited, since I know the values are there and I just would like to do the whole search in one go?).

Ok, now we have this great Lua. I had my first slight touch with Lua in World of Warcraft and done everything I wanted there really good I had my fun (even if I don't know how it works I still managed to get the things I want in trial and error to run like I wanted so I was happy about my results).  Ok back to my RPG. Is it possible to write a gg Lua where I can add in all 2 values of each 5 Avatars so the Lua makes 5 times a group search of each Avatar in one rush? Bonus question if the first question all positive: To top this I have one more issue in order to change values I have to use a formula that I have created in an excel File. So I take the visual values (they only change when an Avatar levels up so I don't do this so often) that I want to change but them in the excel(the Formula never changes), calculate the Values I have to search, enter them in game guardian, change my values and voila! would be cool if I can do all this in a Lua script that would be great fun.

Link to comment
Share on other sites

Recommended Posts

  • 0
  • Administrators

Max size for group search is 65535 and can not be increased. Big size make search slow and need lot of memory.

In script you can make one search get results, change it, clear, make second search and so on.

Params for all search you can ask from user one time.

Script support full size math so you can do any calculation inside script. See Math lib in lua reference.

Link to comment
Share on other sites

  • 0

Ok to be more specific.
I thought I could write a Lua and search Form opens up asking me to enter raw values I wish to change

Avatar 1:... value one:

                  Value two:

Avatar 2:... value one:

                  value two:

Avatar 3:... etc.

The Lua would use my formula on each value to find the needed Values to search then it starts to do a double group search for each avatar and changes all values to one.

_______________________________________________
added 2 minutes later

Thx Enyby for your real quick reply. Sounds like my dreams can come true.

Quote: "Params for all search you can ask from user one time."

I don't really understand what you try to tell me here.

Link to comment
Share on other sites

  • 0
14 minutes ago, Illuminus said:

Never mind i just read the  Lua Math lib and it won't do Integral calculations, so that part will not be possible. but that only means the script can be written quicker and easier.

If you give me proper information, I can help you make the script until possible step.

_______________________________________________
added 2 minutes later

I need these information:

1_game name

2_type of values, Encrypted or not and their region if possible

3_the algorithms you written in your excel.

Link to comment
Share on other sites

  • 0

1_doesnt realy matters

2_Dword

3_all Values need to be converted with this formula in order to be changed properly:

=1072693248+1048576*INT(LOG(B1;2))+INT(1048576*((B1+B1-POWER(2;INT(LOG(B1;2))+1))/POWER(2;INT(LOG(B1;2))+1))) 

Link to comment
Share on other sites

  • 0

I´ll explain my Steps here what I have to do:

I have 5 Avatars with 2 Values I want to change each. For each Avatar I can easily do a group scan with both values in ordered search.

Step one: collecting data and convert each value with my formula
avatar 1
Healths: visible:520
Converted by Excel Formula: =1072693248+1048576*INT(LOG(B1;2))+INT(1048576*((B1+B1-POWER(2;INT(LOG(B1;2))+1))/POWER(2;INT(LOG(B1;2))+1)))
Calculated search value: 1082146816

attackdamage:visible 45,2 Calculated search value:
Formula: =1072693248+1048576*INT(LOG(B1;2))+INT(1048576*((B1+B1-POWER(2;INT(LOG(B1;2))+1))/POWER(2;INT(LOG(B1;2))+1)))
Calculated search value: 1078368665

do groupsearch:
health+attackdamage
1082146816;
1078368665::1024

editAll 
1107468383   --(change all values to  9999999999 which needs to be converted too aka same formula -> 1107468383 but I never change this so value is always  1107468383 here)

clearResults

restart Process for avatar 2 - 5 done.

Link to comment
Share on other sites

  • 0
  • Administrators
52 minutes ago, Illuminus said:

 Lua Math lib and it won't do Integral calculations

As far as I know this lib allow do all possible calculation. Maybe it is not one liner as implemented in Excel but most of things can be done.

Show example of formula.

Link to comment
Share on other sites

  • 0

I know you could do it with math.modf but i dont have the experience in converting a excel Formula into an Lua code.

The complete excel formula ist:
=1072693248+1048576*INT(LOG(B1;2))+INT(1048576*((B1+B1-POWER(2;INT(LOG(B1;2))+1))/POWER(2;INT(LOG(B1;2))+1)))
so if i add lets take my above example for avatars first value HEALTH its 520 and his attack power of
45,2 in order to change both values i have to enter in excel the values 
520
the formula
=
1072693248+1048576*INT(LOG(B1;2))+INT(1048576*((B1+B1-POWER(2;INT(LOG(B1;2))+1))/POWER(2;INT(LOG(B1;2))+1))) 
excel calculates the search value of
1082146816
and same for attack power

45,2
equals to

1078368665
these are the values i search for in gg as dword as ordered group search like this: 1082146816;1078368665::1024 and change all results in 1107468383 

Link to comment
Share on other sites

  • 0
  • Administrators
25 minutes ago, Illuminus said:

=1072693248+1048576*INT(LOG(B1;2))+INT(1048576*((B1+B1-POWER(2;INT(LOG(B1;2))+1))/POWER(2;INT(LOG(B1;2))+1))) 

INT is not integral. Just round to int. All of this can be done at lua.

B1 = 520
A1 = 1072693248+1048576*math.floor(math.log(B1)/math.log(2))+math.floor(1048576*((B1+B1-math.pow(2,math.floor(math.log(B1)/math.log(2))+1))/math.pow(2,math.floor(math.log(B1)/math.log(2))+1))) 
print(B1, A1)

scr_1500496790.jpg

Link to comment
Share on other sites

  • 0

This is the Excel Formula:

=1072693248+1048576*INT(LOG(B1;2))+INT(1048576*((B1+B1-POWER(2;INT(LOG(B1;2))+1))/POWER(2;INT(LOG(B1;2))+1)))

now lets convert this to a normal math Formula

X=?
1072693248+1048576*INT(LOG(
X;2))+INT(1048576*((X+X-POWER(2;INT(LOG(X;2))+1))/POWER(2;INT(LOG(X;2))+1)))=

X=520
1072693248+1048576*INT(LOG(
520;2))+INT(1048576*((520+520-POWER(2;INT(LOG(520;2))+1))/POWER(2;INT(LOG(520;2))+1)))=1082146816

_______________________________________________
added 1 minute later

WOW you guys are genius! 

Link to comment
Share on other sites

  • 0
  • Administrators
function conv(B1)
	return 1072693248+1048576*math.floor(math.log(B1)/math.log(2))+math.floor(1048576*((B1+B1-math.pow(2,math.floor(math.log(B1)/math.log(2))+1))/math.pow(2,math.floor(math.log(B1)/math.log(2))+1))) 
end

local d = gg.prompt({'health 1', 'attack 1', 'health 2', 'attack 2', 'health 3', 'attack 3', 'health 4', 'attack 4', 'health 5', 'attack 5'}, nil, 
	{'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number'})

if (d == nil) then 
	os.exit()
end

for i = 1, 10, 2 do
	gg.clearResults()
	local s = conv(d[i])..';'..conv(d[i+1])..'::1024'
	gg.searchNumber (s, gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)	
	gg.getResults(100)
	print(i, 'request =', s, 'found =', gg.getResultCount(), 'edited =', gg.editAll(conv(9999999999), gg.TYPE_DWORD))
end

I used other app for run because of that found and edit 0.

 

scr_1500498032.jpgscr_1500498065.jpg

Link to comment
Share on other sites

  • 0

 this is what I wrote so far :

if gg.BUILD < 5511 then 
			gg.alert('You need a newer version of GameGuardian app to run this script. At least build 5511.') 
			os.exit() 
			end
			
gg.clearResults()

::restart::

if gg.isVisible(true) then 
   gg.setVisible(false) 
   end 
   
gg.toast('my first GG Lua script Great Thx to Backlift and Enyby') 

--Entering both values of every Avatar
   
--Avatar 1   
   
v = gg.prompt({a1_1='Enter Avatar 1 value 1'}, {a1_1='0'})
if v == nil then
   gg.alert ('Script Canceled, No input')
   os.exit()
   end

v = gg.prompt({a1_2='Enter Avatar 1 value 2'}, {a1_2='0'})
if v == nil then
   gg.alert ('Script Canceled, No input')
   os.exit()
   end

--Avatar 2

v = gg.prompt({a2_1='Enter Avatar 2 value 1'}, {a2_1='0'})
if v == nil then
   gg.alert ('Script Canceled, No input')
   os.exit()
   end

v = gg.prompt({a2_2='Enter Avatar 2 value 2'}, {a2_2='0'})
if v == nil then
   gg.alert ('Script Canceled, No input')
   os.exit()
   end

--Avatar 3

v = gg.prompt({a3_1='Enter Avatar 3 value 1'}, {a3_1='0'})
if v == nil then
   gg.alert ('Script Canceled, No input')
   os.exit()
   end

v = gg.prompt({a3_2='Enter Avatar 3 value 2'}, {a3_2='0'})
if v == nil then
   gg.alert ('Script Canceled, No input')
   os.exit()
   end

--Avatar 4

v = gg.prompt({a4_1='Enter Avatar 4 value 1'}, {a4_1='0'})
if v == nil then
   gg.alert ('Script Canceled, No input')
   os.exit()
   end

v = gg.prompt({a4_2='Enter Avatar 4 value 2'}, {a4_2='0'})
if v == nil then
   gg.alert ('Script Canceled, No input')
   os.exit()
   end

--Avatar 5
   
v = gg.prompt({a5_1='Enter Avatar 5 value 1'}, {a5_1='0'})
if v == nil then
   gg.alert ('Script Canceled, No input')
   os.exit()
   end

v = gg.prompt({a5_2='Enter Avatar 5 value 2'}, {a5_2='0'})
if v == nil then
   gg.alert ('Script Canceled, No input')
   os.exit()
   end

--Converting inputs in searchable Values

--Avatar 1

B1 = gg.getValue(a1_1)
A1 = 1072693248+1048576*math.floor(math.log(B1)/math.log(2))+math.floor(1048576*((B1+B1-math.pow(2,math.floor(math.log(B1)/math.log(2))+1))/math.pow(2,math.floor(math.log(B1)/math.log(2))+1))) 
type(B1, A1)
1_1 = read()

B1 = gg.getValue(a1_2)
A1 = 1072693248+1048576*math.floor(math.log(B1)/math.log(2))+math.floor(1048576*((B1+B1-math.pow(2,math.floor(math.log(B1)/math.log(2))+1))/math.pow(2,math.floor(math.log(B1)/math.log(2))+1))) 
type(B1, A1)
1_2 = read()

--Avatar 2

B1 = gg.getValue(a2_1)
A1 = 1072693248+1048576*math.floor(math.log(B1)/math.log(2))+math.floor(1048576*((B1+B1-math.pow(2,math.floor(math.log(B1)/math.log(2))+1))/math.pow(2,math.floor(math.log(B1)/math.log(2))+1))) 
type(B1, A1)
2_1 = read()

B1 = gg.getValue(a2_2)
A1 = 1072693248+1048576*math.floor(math.log(B1)/math.log(2))+math.floor(1048576*((B1+B1-math.pow(2,math.floor(math.log(B1)/math.log(2))+1))/math.pow(2,math.floor(math.log(B1)/math.log(2))+1))) 
type(B1, A1)
2_2 = read()

--Avatar 3

B1 = gg.getValue(a3_1)
A1 = 1072693248+1048576*math.floor(math.log(B1)/math.log(2))+math.floor(1048576*((B1+B1-math.pow(2,math.floor(math.log(B1)/math.log(2))+1))/math.pow(2,math.floor(math.log(B1)/math.log(2))+1))) 
type(B1, A1)
3_1 = read()

B1 = gg.getValue(a3_2)
A1 = 1072693248+1048576*math.floor(math.log(B1)/math.log(2))+math.floor(1048576*((B1+B1-math.pow(2,math.floor(math.log(B1)/math.log(2))+1))/math.pow(2,math.floor(math.log(B1)/math.log(2))+1))) 
type(B1, A1)
3_2 = read()

--Avatar 4

B1 = gg.getValue(a4_1)
A1 = 1072693248+1048576*math.floor(math.log(B1)/math.log(2))+math.floor(1048576*((B1+B1-math.pow(2,math.floor(math.log(B1)/math.log(2))+1))/math.pow(2,math.floor(math.log(B1)/math.log(2))+1))) 
type(B1, A1)
4_1 = read()

B1 = gg.getValue(a4_2)
A1 = 1072693248+1048576*math.floor(math.log(B1)/math.log(2))+math.floor(1048576*((B1+B1-math.pow(2,math.floor(math.log(B1)/math.log(2))+1))/math.pow(2,math.floor(math.log(B1)/math.log(2))+1))) 
type(B1, A1)
4_2 = read()

--Avatar 5

B1 = gg.getValue(a5_1)
A1 = 1072693248+1048576*math.floor(math.log(B1)/math.log(2))+math.floor(1048576*((B1+B1-math.pow(2,math.floor(math.log(B1)/math.log(2))+1))/math.pow(2,math.floor(math.log(B1)/math.log(2))+1))) 
type(B1, A1)
5_1 = read()

B1 = gg.getValue(a5_2)
A1 = 1072693248+1048576*math.floor(math.log(B1)/math.log(2))+math.floor(1048576*((B1+B1-math.pow(2,math.floor(math.log(B1)/math.log(2))+1))/math.pow(2,math.floor(math.log(B1)/math.log(2))+1))) 
type(B1, A1)
5_2 = read()


--Ordered group scan of both Search values for first avatar

gg.setRanges (gg.REGION_ANONYMOUS)

--I got so far. Problem here i cant find any commands to do a ordered group search 

--i would try this for my understanding:
gg.searchNumber(v['1_1'], gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1);(v['1_2'], gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1):1024

 

_______________________________________________
added 3 minutes later

Holy yours much shorter then mines ROFL great thx

Link to comment
Share on other sites

  • 0

Ok i tested it and i ended up with this result:

Spoiler

Script ended:
Script error: org.luaj.vm2.LuaError: @/sdcard/Download/Test.lua:2
`    return 1072693248+1048576*math.floor(math.log(B1)/math.log(2))+math.floor(1048576*((B1+B1-math.pow(2,math.floor(math.log(B1)/math.log(2))+1))/math.pow(2,math.floor(math.log(B1)/math.log(2))+1))) `
bad argument: double expected, got nil
    at org.luaj.vm2.LuaValue.argerror(LuaValue.java:1068)
    at org.luaj.vm2.LuaValue.checkdouble(LuaValue.java:860)
    at org.luaj.vm2.LuaString.checkdouble(LuaString.java:322)
    at org.luaj.vm2.lib.MathLib$UnaryOp.call(MathLib.java:134)
    at org.luaj.vm2.LuaClosure.execute(LuaClosure.java:364)
    at org.luaj.vm2.LuaClosure.call(LuaClosure.java:142)
    at org.luaj.vm2.LuaClosure.execute(LuaClosure.java:364)
    at org.luaj.vm2.LuaClosure.call(LuaClosure.java:133)
    at android.ext.Script.runScript(Script.java:1039)
    at android.ext.Script.access$8(Script.java:1032)
    at android.ext.Script$ScriptThread.run(Script.java:998)

 

 

_______________________________________________
added 4 minutes later

Never mind i messed up with Dots and Comas 

 

second attempt went trough but i have to raise search range to 2024



 

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.