but it didn't work out as I thought, so I'm asking you a question.
I find the offset value that I want to change through dnspy
And I got the address and Hex code of the offset through HxD.
local memFrom, memTo, lib, num, lim, results, src, ok =0,-1,nil,0,32,{},nil,falsefunction name(n)if lib ~= n then
lib = n
local ranges = gg.getRangesList(lib)if#ranges ==0then
print("⚠ERROR: ".. lib .." are not found!⚠")
gg.toast("⚠ERROR: ".. lib .." are not found!⚠")
os.exit()else
memFrom = ranges[1].start
memTo = ranges[#ranges]["end"]endendendfunction hex2tbl(hex)local ret ={}
hex:gsub("%S%S",function(ch)
ret[#ret +1]= ch
return""end)return ret
endfunction original(orig)local tbl = hex2tbl(orig)local len =#tbl
if len ==0thenreturnendlocal used = len
if len > lim then
used = lim
endlocal s =""for i =1, used doif i ~=1then
s = s ..";"endlocal v = tbl[i]if v =="??"or v =="**"then
v ="0~~0"end
s = s .. v .."r"end
s = s .."::".. used
gg.searchNumber(s, gg.TYPE_BYTE,false, gg.SIGN_EQUAL, memFrom, memTo)if len > used thenfor i = used +1, len dolocal v = tbl[i]if v =="??"or v =="**"then
v =256else
v =("0x".. v)+0if v >127then
v = v -256endend
tbl[i]= v
endendlocal found = gg.getResultCount()
results ={}local count =0local checked =0whiletruedoif checked >= found thenbreakendlocal all = gg.getResults(8)local total =#all
local start = checked
if checked + used > total thenbreakendfor i, v in ipairs(all)do
v.address = v.address + myoffset
end
gg.loadResults(all)while start < total dolocal good =truelocal offset = all[1+ start].address -1if used < len thenlocal get ={}for i = lim +1, len do
get[i - lim]={address = offset + i, flags = gg.TYPE_BYTE, value =0}end
get = gg.getValues(get)for i = lim +1, len dolocal ch = tbl[i]if ch ~=256and get[i - lim].value ~= ch then
good =falsebreakendendendif good then
count = count +1
results[count]= offset
checked = checked + used
elselocal del ={}for i =1, used do
del[i]= all[i + start]end
gg.removeResults(del)end
start = start + used
endendendfunction replaced(repl)
num = num +1local tbl = hex2tbl(repl)if src ~=nilthenlocal source = hex2tbl(src)for i, v in ipairs(tbl)doif v ~="??"and v ~="**"and v == source[i]then
tbl[i]="**"endend
src =nilendlocal cnt =#tbl
local set ={}local s =0for _, addr in ipairs(results)dofor i, v in ipairs(tbl)doif v ~="??"and v ~="**"then
s = s +1
set[s]={["address"]= addr + i,["value"]= v .."r",["flags"]= gg.TYPE_BYTE}endendendif s ~=0then
gg.setValues(set)end
ok =trueendfunction HOME()
A =
gg.multiChoice({"AutoaimDistance","Exit"},nil,"qwer098 Prototype")if A ==nilthenelseif A[1]==truethen
AutoaimDistance()endif A[1]==truethen
os.exit()endendendfunction AutoaimDistance()
gg.setRanges ( gg .REGION_CODE_APP | gg .REGION_C_DATA)
name('libil2cpp.so')
myoffset =0x3175834
original('F4 4F BE A9 FD 7B 01 A9')
replaced('7A 04 44 E3 1E FF 2F E1')
gg.toast("Done!")end
HOME()
...and I wrote the script, referencing the article above, and I ran it in the game.
And here's the result.
I don't think I found the wrong offset. Of course, I'll have to try something more diverse, but I don't think that offset was useless.
And, there are too many unexpectedly searched values like 300k. (I don't know if this is wrong, do other scripts work this way too?)
plus, the offset value is float, but in gg it's written as byte.
If you have any tips on Hex Patch, please let me know. It's not easy..
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
qwer098
I wrote a script after looking at
Work around with libil2cpp and GG using offset (#by5yarnv)(thanks to @TekMonts for awesome article)
but it didn't work out as I thought, so I'm asking you a question.
I find the offset value that I want to change through dnspy
And I got the address and Hex code of the offset through HxD.
...and I wrote the script, referencing the article above, and I ran it in the game.
And here's the result.
I don't think I found the wrong offset. Of course, I'll have to try something more diverse, but I don't think that offset was useless.
And, there are too many unexpectedly searched values like 300k. (I don't know if this is wrong, do other scripts work this way too?)
plus, the offset value is float, but in gg it's written as byte.
If you have any tips on Hex Patch, please let me know. It's not easy..
4 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.