Jump to content
  • 2

How to Hook Field Offsets in Lua Script


rand1337
 Share

Question

Recommended Posts

  • 0
5 hours ago, rand1337 said:

no, field offsets in dump.cs. 

From User @NoFear in another post

"You would use a disassembler... IDA for example. Then could search strings for the "0xD0".  Granted, will be insane number of results. Because the 0xD0 I believe could be used for something else on another function. "

Field offsets don't go to a specific address or function, and they should be used to locate something else.

----------------------------------------------------------

Edit: IDA does have a freeware version but I don't think it supports arm64 you may have to use ghidra

Edited by AKidWithMidgetFriend
Link to comment
Share on other sites

  • 0

local function memoryPatch(offset, value)
  local so = gg.getRangesList('libil2cpp.so')[1].start
  local v = {}
  local v[1] = {}
  v[1].address = so + offset
  v[1].flags = gg.TYPE_QWORD
  v[1].value = value .. "r"
  gg.setValue(v)
  gg.toast('memory patched')
end

memoryPatch(0x4856E5, HEX VALUE)

 

Link to comment
Share on other sites

  • 0
On 7/31/2021 at 2:03 AM, MAARS said:


local function memoryPatch(offset, value)
  local so = gg.getRangesList('libil2cpp.so')[1].start
  local v = {}
  local v[1] = {}
  v[1].address = so + offset
  v[1].flags = gg.TYPE_QWORD
  v[1].value = value .. "r"
  gg.setValue(v)
  gg.toast('memory patched')
end

memoryPatch(0x4856E5, HEX VALUE)

 

this a offset patcher i dont need it, i need "how to hook field offsets using update function" 

[added 2 minutes later]
On 7/30/2021 at 7:41 PM, AKidWithMidgetFriend said:

From User @NoFear in another post

"You would use a disassembler... IDA for example. Then could search strings for the "0xD0".  Granted, will be insane number of results. Because the 0xD0 I believe could be used for something else on another function. "

Field offsets don't go to a specific address or function, and they should be used to locate something else.

----------------------------------------------------------

Edit: IDA does have a freeware version but I don't think it supports arm64 you may have to use ghidra

field offsets can be hooked using update function in lgl mod menu, but i ask how to do it in game guardian lua script? its possible? 

Link to comment
Share on other sites

  • 0
6 hours ago, rand1337 said:

this a offset patcher i dont need it, i need "how to hook field offsets using update function" 

[added 2 minutes later]

field offsets can be hooked using update function in lgl mod menu, but i ask how to do it in game guardian lua script? its possible? 

I'm sure it is, however I haven't done it myself... Maybe somebody else would be able to help sorry

Link to comment
Share on other sites

  • 0
On 7/30/2021 at 10:41 PM, AKidWithMidgetFriend said:

From User @NoFear in another post

"You would use a disassembler... IDA for example. Then could search strings for the "0xD0".  Granted, will be insane number of results. Because the 0xD0 I believe could be used for something else on another function. "

Field offsets don't go to a specific address or function, and they should be used to locate something else.

----------------------------------------------------------

Edit: IDA does have a freeware version but I don't think it supports arm64 you may have to use ghidra

so theres no way to mod 'field'??

 

 

 

i saw some interesting field hacks... but since they are like 0x98 or similar, i was thinking myb these cant patched

Link to comment
Share on other sites

  • 0

He is talking about instance variables from a dump.cs class 

Example: 

//Example Simulation
//Every field has an offset beside it, these are example offsets
public class Enemy {
  //Fields
  public float health; //0x12
  public boolean isDead; //0x23
  public double loot_drop_chance; //0x29
  public boolean isBoss; //0x10
  public float dmg; //0x11
  
//Next would be methods and other stuff but the starting variables are what he wants to be modded
}

You cannot Hook instance variables from a dumped lib file with lua. you may only use C++ using a function pointer 🙂 

Link to comment
Share on other sites

  • 0
1 hour ago, Crystal_Mods100x said:

He is talking about instance variables from a dump.cs class 

Example: 

//Example Simulation
//Every field has an offset beside it, these are example offsets
public class Enemy {
  //Fields
  public float health; //0x12
  public boolean isDead; //0x23
  public double loot_drop_chance; //0x29
  public boolean isBoss; //0x10
  public float dmg; //0x11
  
//Next would be methods and other stuff but the starting variables are what he wants to be modded
}

You cannot Hook instance variables from a dumped lib file with lua. you may only use C++ using a function pointer 🙂 

Thank you, that's the answer I was looking for. ☺️

Link to comment
Share on other sites

  • 0
6 minutes ago, rand1337 said:

Thank you, that's the answer I was looking for. ☺️

You are welcome, also Yes! you could learn C++ and Java so you could learn modding with lgl (template isn't for newbies) 

Learn java. then C++ then you should sign up on the polar mods forums after you are done with both. just learn the basics 😄

then you could learn the hooking, hex patching API Library they have

Have a nice Day!

 

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.