Jump to content
  • 0

How to use offsets in scripts?


naparnik

Question

3 answers to this question

Recommended Posts

Posted

can I have more details?

14 минут назад HEROGAMEOfficial сказал:
15 minutes ago, HEROGAMEOfficial said:

смещение (расстояние addres) от addres a до b, пример:

Адрес a = 1234

Адрес b = 1235

Смещение = 4

Here is an example of offset 0x5000 and how do I use it in the game, and replace the value by it

 

Posted
4 hours ago, naparnik said:

How to use offsets in scripts? I need the script to search for the offset value, and then replace it. How to do it?

function isim(lib)
if n == lib then
return startAddress, endAddress end aralik = gg.getRangesList(lib or 'libunity')
for i, v in ipairs(aralik) do
if v.state == "Xa" then startAddress = v.start endAddress = aralik[#aralik]['end'] break end
end return startAddress, endAddress end

function setHexMemory(libisim, offset, hex)
isim(libisim) t, hepsi = {}, 0 for h in string.gmatch(hex, "%S%S") do
table.insert(t, {address = startAddress + offset + hepsi, flags = gg.TYPE_BYTE,value = h .. "r"}) hepsi = hepsi + 1 end sonuc = gg.setValues(t)
if type(sonuc) ~= 'string' then return true else gg.alert(sonuc) return false end end

function Main() menu = gg.choice({
'features'..tekvur,
'🔴 ᴇxɪ̇ᴛ'}, nil,'🌕 namegame vnumber sᴄʀɪᴘᴛ\nɢᴀᴍᴇɢᴜᴀʀᴅɪᴀɴ ʙʏ yourname')
if menu==1 then reward()end
if menu==2 then Exit()end proejder=-1 end
ac = ' [ᴏɴ]' kapa = ' [ᴏғғ]' tekvur = kapa



  
function reward() if tekvur == kapa then
   setHexMemory("libunity", 0x77B344, "00 00 A0 40")  
   gg.toast("cheat {ON]!") tekvur = ac else
   setHexMemory("libunity", 0x77B344, "0B 2E 11 3E") tekvur = kapa
   gg.toast("cheat {OFF]") end end
   
   

   
   
function Exit() print("print message") os.exit() end
s= '' while(true)do
if gg.isVisible(true) then proejder=1
gg.setVisible(false) end gg.clearResults()
if proejder==1 then Main() end end

you can take inspiration from my sample template

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.