Jump to content
  • 0

MC874
 Share

Question

[ Introduction ]

Hi! I have some struggle with my script. I have discovered on how to set memory range inside Lua Script from this forum, its barely old format because i get it from old posts. I dont know if its from the script itself or because of new game guardian version. Im using latest Game Guardian for Emulator for VM uses.

[ Problematic ]

Come to the issues, i have script to change DWORD values that equal to [' ~A ANDEQ R4, R0, R0 '] and change the result to [' 4451 ']. So here's some snippet :

gg.clearResults()
gg.setVisible(false)
gg.toast("【 1 / 8 】")
gg.clearResults()
gg.clearList()
gg.setRanges(gg.REGION_C_DATA | gg.REGION_CODE_APP)
gg.searchNumber("16384", gg.TYPE_DWORD, gg.SIGN_EQUAL, 0x04000000, 0x04ea7000)
gg.getResults(100000)
gg.editAll("4451", gg.TYPE_QWORD)

I have put the range in Hex format (' 0x04000000 ') and usual ordinary form (' 04000000 ') but its doesnt make any differences.Its always show error message :

Script ended:
Script error: luaj.n: /storage/emulated/0/Pictures/Script/Coins.lua:7
`gg.searchNumber("16384", gg.TYPE_DWORD, gg.SIGN_EQUAL, 0x04000000, 0x04ea7000)`
bad argument #3: number: boolean expected, got number (field 'searchNumber')
level = 1, const = 43, proto = 0, upval = 1, vars = 6, code = 347
CALL v0..v5
 ; PC 34 CODE 0300401D OP 29 A 0 B 6 C 1 Bx 3073 sBx -127998
stack traceback:
	/storage/emulated/0/Pictures/Script/2 Month Bypass.lua:7 in main chunk
	[Java]: in ?
	at luaj.ap.a(src:265)
	at luaj.ap.a(src:172)
	at android.ext.Script$searchNumber.d(src:3098)
	at android.ext.Script$ApiFunction.c(src:1481)
	at android.ext.Script$ApiFunction$1.run(src:1453)
	at android.os.Handler.handleCallback(Handler.java:739)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:135)
	at android.app.ActivityThread.main(ActivityThread.java:5254)
	at java.lang.reflect.Method.invoke(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:372)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)

Usually im using manual way using search button, but its really tiresome and i decide to make some script from codes that i found in this forum. In the end its lead to Bad Argument error, even i already change script EOL into Linux or Windows. I hope anyone that read this can help me out! Thanks guys! 🙂

Edited by Yuukis
Typo
Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 0
4 minutes ago, MonkeySAN said:

try this


gg.searchNumber("16384", gg.TYPE_DWORD,false, gg.SIGN_EQUAL, 0x04000000, 0x04ea7000)

 

It works charmly, i didnt know that adding false will give significant changes Thanks a lot! +Rep

Edited by Yuukis
Link to comment
Share on other sites

  • 0
35 minutes ago, MonkeySAN said:

try this


gg.searchNumber("16384", gg.TYPE_DWORD,false, gg.SIGN_EQUAL, 0x04000000, 0x04ea7000)

 

Hi MonkeySan! the script you give doesnt change any values that exist in that memory ranges. Is there any other way?

Link to comment
Share on other sites

  • 0

next time look carefully when writing a script..

you search what type of values and what type of values you are trying to edit?

gg.searchNumber("16384", gg.TYPE_DWORD, gg.SIGN_EQUAL, 0x04000000, 0x04ea7000)
gg.getResults(100000)
gg.editAll("4451", gg.TYPE_QWORD)

 

Edited by MonkeySAN
Link to comment
Share on other sites

  • 0
15 minutes ago, MonkeySAN said:

next time look carefully when writing a script..

you search what type of values and what type of values you are trying to edit?


gg.searchNumber("16384", gg.TYPE_DWORD, gg.SIGN_EQUAL, 0x04000000, 0x04ea7000)
gg.getResults(100000)
gg.editAll("4451", gg.TYPE_QWORD)

 

Both are DWORD, I have change the QWORD to DWORD like this :

gg.setVisible(false)
gg.toast("【 5 / 8 】")
gg.clearResults()
gg.clearList()
gg.setRanges(gg.REGION_C_DATA | gg.REGION_CODE_APP)
gg.searchNumber("16384", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0x0c000000, 0x0c6af000)
gg.getResults(100000)
gg.editAll("4451", gg.TYPE_DWORD)

But those didnt work, am i missing something? 

Link to comment
Share on other sites

  • 0
6 minutes ago, MonkeySAN said:

have you make sure the address stay the same between restart?

because the first one you wrote different address range than this one.

Its a static range, dont worry. I have script that has 8 stage writes, its writes to each different game library on that mentioned range. I have tested this multiple times using manual search and using cat /proc/pid/maps. Its just the script that doesnt work. I do have working script but its writing to all scanned memory. 

gg.clearResults()
gg.setRanges(gg.REGION_C_ALLOC | gg.REGION_CODE_APP)
gg.searchNumber("1685382481", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1, 0)
gg.getResults(100000)
gg.editAll("0", gg.TYPE_FLOAT)
gg.setVisible(false)
gg.clearResults()
gg.clearList()

Im trying to compare the above script with mine. Adding (' 0, -1, 0 ') to my script is also not work. Im basically stuck 😞

Link to comment
Share on other sites

  • 0
5 minutes ago, MonkeySAN said:

but searching produce results..

only when editing it didnt work?

may i know what is the game?

Its crappy 'Free Fire', the script does produce results but its not getting edited. I have fixed the issue by passing gg.getResultsCount into gg.getResults and its actually edit the values. I dont know what happen but the final script will look like this :

gg.setVisible(false)
gg.toast("【 1 / 8 】")
gg.clearResults()
gg.clearList()
gg.setRanges(gg.REGION_C_DATA | gg.REGION_CODE_APP)
gg.searchNumber(16384, gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0x04000000, 0x04ea7000)
if gg.getResultsCount() > 1 then
	gg.getResults(gg.getResultsCount())
	gg.editAll("4451", gg.TYPE_DWORD)
	gg.clearResults()
end

 

Link to comment
Share on other sites

  • 0

yeah..

im just about to suggest that..(passing gg.getResultsCount into gg.getResults)..because there is a similar case of yours(im bet you know now which one it is..)

in the forum but kinda wonder why the previous one didnt work.

on paper and i did some test..it should work.

hopefully someone with much higher knowledges will give their inputs.

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.