Help! Is there any way to modify a field offset

  • You need at least 5 clean posts on our forum to be able to open a thread here [Spam Clean]

EpicCode

Rooted Member
Oct 30, 2018
23
2
3
35
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

Rooted Member
Oct 30, 2018
23
2
3
35
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

Rooted Member
Sep 28, 2017
29
5,386
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

Rooted Member
Oct 30, 2018
23
2
3
35
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

Rooted Member
Sep 28, 2017
29
5,386
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

Rooted Member
Oct 30, 2018
23
2
3
35
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

Rooted Member
Sep 28, 2017
29
5,386
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

Rooted Member
Sep 28, 2017
29
5,386
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

Rooted Member
Oct 30, 2018
23
2
3
35
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

Rooted Member
Oct 30, 2018
23
2
3
35
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

Rooted Member
Oct 30, 2018
23
2
3
35
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

Rooted Member
Sep 28, 2017
29
5,386
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

Rooted Member
Oct 30, 2018
23
2
3
35
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

Rooted Member
Oct 30, 2018
23
2
3
35
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

Rooted Member
Sep 28, 2017
29
5,386
183
that's just example of how field offset were used in the code. if you're no noob then you should know this i guess, hooking
in which you could handle the field offset.
 

ak0ztik

Rooted Member
Sep 28, 2017
29
5,386
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.
 

EpicCode

Rooted Member
Oct 30, 2018
23
2
3
35
Usa
that's just example of how field offset were used in the code. if you're no noob then you should know this i guess, hooking
in which you could handle the field offset.
Ok, I guess that answers my question you need to read from memory and inject code at runtime. I'm not sure how to call my own libraries to load at runtime to be able to do this other than on PC games and c#
 

ak0ztik

Rooted Member
Sep 28, 2017
29
5,386
183
that's easy
because there's someone already shared their code here, his resources are on github.
 

About us

  • Welcome to platinmods.com! We are proud to present you the place which let's dreams come true! Focusing on quality and trust we have spend much time to build a gaming community fitting to your wishes and needs. Actually we offer you the finest MODs and Games of the Android section and we slowly expand to the iOS section as well. But games, Android MODs & iOS MODs are not the only things we can offer you. We have tutorials, tools, a very friendly, active and solid community which will help you with any problem you have =) Your happiness is our goal. We hope you enjoy!
  • Feel free to follow us on facebook as well =)

Forum statistics

Threads
28,776
Messages
542,665
Members
670,932
Latest member
yuuki Tetsu