Help! How to hook Transform in fields

ASDFGHJKLQWE

Solid & Active Platinian
Original poster
Jul 10, 2022
65
19
8
Nepal
How to hook this?
Code:
//Fields 
 public Transform newoldShotgun; // 0x198

//Method 
 // RVA: 0x5EB5CC Offset: 0x5EB5CC VA: 0x5EB5CC
 private void Update() { }
 

ASDFGHJKLQWE

Solid & Active Platinian
Original poster
Jul 10, 2022
65
19
8
Nepal
@·҉ dollaz·҉. . Like this:-
Code:
bool newgun;
void (*old_Update)(void *instance);
void update(void *instance){
    if(instance != NULL){
       if (newgun) {
void newoldShotgun = *(void *)((uint64_t)instance + 0x198);
}
}
return old_Update(instance);
}
 

·҉ dollaz·҉. .

Approved iModder
Approved iModder
Mar 26, 2021
159
1,819
193
Somewhere
@·҉ dollaz·҉. . Like this:-
Code:
bool newgun;
void (*old_Update)(void *instance);
void update(void *instance){
    if(instance != NULL){
       if (newgun) {
void newoldShotgun = *(void *)((uint64_t)instance + 0x198);
}
}
return old_Update(instance);
}
Yeah that’s how you get the transform. Now you gotta use it for something. Idk what that’s supposed to be for but you can like change position or scale or stuff like that
 
  • Like
Reactions: ASDFGHJKLQWE

priyanshu88064

Platinian
Sep 2, 2023
5
0
1
21
What if Transform is a return type of a function we want to hook.
C#:
public Transform myTransform
{
get{}
private set{}
}