I was trying to make an offset to hex tool to directly hex patch methods by offset, when I ran into an error. Here is my code:
function read_file(path)-- Credit to DarkingCheater! I modified it a little
open = io.open
local file = open(path,"rb")ifnot file thenreturnnilendlocal content = file:read
"*a"
file:close()return content
endfunction write_file(path,new)
file = io.open(path,"w")
file:write(new)
file:close()endfunction gethex(directory,offset,bytes)
lib = read_file(directory)
findoffset = tonumber(offset,16)
lib:seek(0,findoffset)-- io.seek(libil2cpp,0,findoffset)return lib:read(tonumber(bytes)).hex().upper())-- This was copy and pasted from python, I will make it work in lua later. Just ignore this.endfunction example()-- edit this to see what my code does
print(gethex("Your lib file path","(example offset)A00001","(how many bytes, this input does not matter in this case) 32"))-- Edit this to make the script run!
example()
You can edit the inputs to make the code run, and you will see my error. When I have it configured correctly for me, this happens:
Script ended:
Script error: luaj.o: /sdcard/Download/OffsetToHex.lua:22
`libil2cpp:seek(0,findoffset)`
attempt to call a nil value (method 'seek')
level = 1, const = 11, proto = 0, upval = 1, vars = 8, code = 27
CALL v3..v6
; PC 13 CODE 020040DD OP 29 A 3 B 4 C 1 Bx 2049 sBx -129022
stack traceback:
/sdcard/Download/OffsetToHex.lua:22 in function 'gethex'
/sdcard/Download/OffsetToHex.lua:27 in main chunk
[Java]: in ?
at luaj.LuaValue.a(src:2835)
at luaj.LuaValue.Z(src:1966)
at luaj.LuaValue.a(src:1481)
at luaj.LuaClosure.a(src:536)
at luaj.LuaClosure.a(src:186)
at luaj.LuaClosure.a(src:536)
at luaj.LuaClosure.l(src:160)
at android.ext.Script.d(src:6056)
at android.ext.Script$ScriptThread.run(src:5785)
Yes, I have tested and confirmed that the lib file is correct. It is not nil.
So what is the problem?
As the above error message says, gameguardian does not recognize the seek method.
I know my code is correct because of this article.
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.
Question
HorridModz
I was trying to make an offset to hex tool to directly hex patch methods by offset, when I ran into an error. Here is my code:
You can edit the inputs to make the code run, and you will see my error. When I have it configured correctly for me, this happens:
Yes, I have tested and confirmed that the lib file is correct. It is not nil.
So what is the problem?
As the above error message says, gameguardian does not recognize the seek method.
I know my code is correct because of this article.
MUSHclient documentation: contents (gammon.com.au)
Can anyone help me with this? Did I do something wrong? Or is this an issue with gameguardian? Or there any workarounds?
Thanks so much for reading!
6 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.