Help! Is there any way to modify a field offset

EpicCode

1/3 Games Approved
Original poster
Oct 30, 2018
39
7
83
39
Usa
I have a few things I'd like to modify but they only give field offsets. Can this be done..? If so how..? Thanks for anyone's input, I haven't seen anything regarding this.
 

EpicCode

1/3 Games Approved
Original poster
Oct 30, 2018
39
7
83
39
Usa
Well I know there is a way just kind of need to know what address I start counting away from. Ok so I posted a example. Say I want to modify "targethp" the field offset is 2C. Looks like it falls under enemy scanner which starts at 0x6947B4. This would make it fall at 0x6947E0.

Does this sound correct..? If no one has ever done this we can figure it out together as it would be beneficial.
15731603947957125222770348840215.jpg
 

ak0ztik

Platinian
Sep 28, 2017
25
190
183
i'm not an expert modder but in your example i'm more curious with 'HandleTargetHPChange', it's a void that returns an int value.
 

EpicCode

1/3 Games Approved
Original poster
Oct 30, 2018
39
7
83
39
Usa
i'm not an expert modder but in your example i'm more curious with 'HandleTargetHPChange', it's a void that returns an int value.
No it takes a int value as a parameter and does something with it but doesn't return a value. :)
 

ak0ztik

Platinian
Sep 28, 2017
25
190
183
No it takes a int value as a parameter and does something with it but doesn't return a value. :)
ah yes you're right,
but when it comes to hooking, that is the one i'd like to mess up. those fields that you were mentioning could be called, and set it to a value.

I'm new to hooking, so don't ask me about it.
 

EpicCode

1/3 Games Approved
Original poster
Oct 30, 2018
39
7
83
39
Usa
Yes they absolutely are able to be called, just need to know the starting place and add the field offset to it to get the exact address. I just need some direction on where the starting address is because there is usually a public and static method which both are different starting offsets entirely. I guess I could trial and error to figure it out, just wondered if anyone has done this. I've never seen anyone do it. Most of the good stuff is not a actual direct memory address but rather a field offset. :face55:
 

ak0ztik

Platinian
Sep 28, 2017
25
190
183
add the field offset to what?
i don't understand, what i know about field offset, they are like a legends that should be called.
example if you view the hex
28 00 90 E5 1E FF 2F E1

so 0x28(targethp) is called there which is you're targethp.
 

ak0ztik

Platinian
Sep 28, 2017
25
190
183
and the 0x28, has nothing to do with the virtual address. you're not going to add the field offset to virtual address, that's not how field offset works.
Just like my example above, that's how field offset is used.
 

EpicCode

1/3 Games Approved
Original poster
Oct 30, 2018
39
7
83
39
Usa
Field offset is the bytes away from another main address holder like player entity. So you add the field offset to the main address in which case is player entity.
 

EpicCode

1/3 Games Approved
Original poster
Oct 30, 2018
39
7
83
39
Usa
Atleast that's how it's done with pc games. Ok so like for example you have Entityzombies. The game defines a field offset for each zombie on map once spawned and places the HP holder on it. That is the direct bytes away from each starting point of each zombie info followed by coordinates
 

EpicCode

1/3 Games Approved
Original poster
Oct 30, 2018
39
7
83
39
Usa
What I do know is on PC games that address is defined at runtime and without being able to read from memory I'm not sure how to go about figuring it out.
 

ak0ztik

Platinian
Sep 28, 2017
25
190
183
i dont know how it's written in memory but in il2cpp or assembly-csharp games of androids, we usually edit the dll or so file not memory.

field
enemyhp 0x28

method
public int hp(): RVA: 0x1009fc0

if you open the dll or so file in hex editor in address 0x1009fc0 you see
28 00 90 E5 1E FF 2F E1
or
LDR R0, [R0, #0x28]
BX LR
or
load the 0x28 to R0, return

we edit that to
01 00 A0 E3 1E FF 2F E1
or
MOV R0, #1
BX LR

to make hp = 1
 

EpicCode

1/3 Games Approved
Original poster
Oct 30, 2018
39
7
83
39
Usa
Yea but where are you getting the address if only given a field offset. I'm no noob. I'm a very very advanced modder that even can exploit server sided stuff. The example I have is nothing I'm actually working on, it was merely a example. I'm literally only given a field offset so how can you even locate the address to look at lol
 

EpicCode

1/3 Games Approved
Original poster
Oct 30, 2018
39
7
83
39
Usa
I was at work so it was a bit hard to concentrate on what you were saying at the time but I get what you are saying now, if you modded enemy health to return 1 they would never die as it would always return 1 as their health :P

Better to modify something like StartAttack and return it to false.
 

ak0ztik

Platinian
Sep 28, 2017
25
190
183
also from my example the enemy are weakened to hp1 not always 1, it can die, because that value can be changed in game, it just tells the program how many hp the enemy has? then you return 1.
 

ak0ztik

Platinian
Sep 28, 2017
25
190
183
that's easy
because there's someone already shared their code here, his resources are on github.
 

CM_OfficialYT

1/3 Games Approved
Jun 16, 2023
16
1
3
16
Philippines
Well I know there is a way just kind of need to know what address I start counting away from. Ok so I posted a example. Say I want to modify "targethp" the field offset is 2C. Looks like it falls under enemy scanner which starts at 0x6947B4. This would make it fall at 0x6947E0.

Does this sound correct..? If no one has ever done this we can figure it out together as it would be beneficial. View attachment 182225
You need to ensure that the field offset has its own values in order to use methods to update those offsets.

Example: 0x20 - targetHp, and it says paramvalue, you need to check the paramvalue class and check the methods on previous class that you're checking on and find the best working method to make it work.