Help! How can i hook a field that has no update function?

My Field Doenst have an update function but i analysed it in dnspy and found related classes that have an update function, how can i hook the update function from that related class to modify the fields?

C#:
class Item //Does not have an update function
//field
Money = 0x30
//Method
//nothing intresting

   
class NetworkPlayer //this is a class related to the class :Item , and it has an update function
//field
etc = etc

//Method

//Offset = 0x114A120
private void Update()
 
Well if the class got access to that item class, it should also have access to the field too. Just hook the update normally and call the field normally too. You shouldn’t needa do anything extra
Well if the class got access to that item class, it should also have access to the field too. Just hook the update normally and call the field normally too. You shouldn’t needa do anything extra

This on the rigth side is class Item i on the rigth side beneath you see that its used by NetworkPlayer
 

Attachments

  • 1.PNG
    1.PNG
    145 KB · Views: 239
Now i went to the the suposed Item field in NetworPlayer and the field offset in NetworkPlayer is 0x58 should i still hook Class Item normally with the update function of Class NetworkPlayer?
 

Attachments

  • Capture.PNG
    Capture.PNG
    133 KB · Views: 107
Well if the class got access to that item class, it should also have access to the field too. Just hook the update normally and call the field normally too. You shouldn’t needa do anything extra
the class NetworkPlayer has 2 fields with "Item" the first image is field one wich field offset is "0x10" the second one is = 0x58
 

Attachments

  • Capture.PNG
    Capture.PNG
    121.5 KB · Views: 135
  • Capture2.PNG
    Capture2.PNG
    119.9 KB · Views: 121
the class NetworkPlayer has 2 fields with "Item" the first image is field one wich field offset is "0x10" the second one is = 0x58
Okay so just do something like this
C++:
void (*PointerToClass)(void *instance); // the pointer of the class field

void (*old_Update)(void *instance);
void Update(void *instance)
{
    if(instance != NULL)
    {
        if(EnableCheat)
        {
            if(MyPointer != NULL)
            {
            void *OtherClass = *(void *)((uint64_t)PointerToClass + 0x10);//i think te 0x10 one would be better to use
                 if(OtherClass != NULL)
                 {
                 *(void *)((uint64_t)OtherClass + 0x224); //modify the other field here
                 }
            }
        }
    }
    old_Update(instance);
}
 
Okay so just do something like this
C++:
void (*PointerToClass)(void *instance); // the pointer of the class field

void (*old_Update)(void *instance);
void Update(void *instance)
{
    if(instance != NULL)
    {
        if(EnableCheat)
        {
            if(MyPointer != NULL)
            {
            void *OtherClass = *(void *)((uint64_t)PointerToClass + 0x10);//i think te 0x10 one would be better to use
                 if(OtherClass != NULL)
                 {
                 *(void *)((uint64_t)OtherClass + 0x224); //modify the other field here
                 }
            }
        }
    }
    old_Update(instance);
}
ok ill try
 
Okay so just do something like this
C++:
void (*PointerToClass)(void *instance); // the pointer of the class field

void (*old_Update)(void *instance);
void Update(void *instance)
{
    if(instance != NULL)
    {
        if(EnableCheat)
        {
            if(MyPointer != NULL)
            {
            void *OtherClass = *(void *)((uint64_t)PointerToClass + 0x10);//i think te 0x10 one would be better to use
                 if(OtherClass != NULL)
                 {
                 *(void *)((uint64_t)OtherClass + 0x224); //modify the other field here
                 }
            }
        }
    }
    old_Update(instance);
}
my hook should be like
A64hookfunction((void*)getAbsoluteAddress(UpdateOffset), (void*)Update, (void**)&old_Update);
 
Okay so just do something like this
C++:
void (*PointerToClass)(void *instance); // the pointer of the class field

void (*old_Update)(void *instance);
void Update(void *instance)
{
    if(instance != NULL)
    {
        if(EnableCheat)
        {
            if(MyPointer != NULL)
            {
            void *OtherClass = *(void *)((uint64_t)PointerToClass + 0x10);//i think te 0x10 one would be better to use
                 if(OtherClass != NULL)
                 {
                 *(void *)((uint64_t)OtherClass + 0x224); //modify the other field here
                 }
            }
        }
    }
    old_Update(instance);
}
MyPointer gives an eror
 
Okay so just do something like this
C++:
void (*PointerToClass)(void *instance); // the pointer of the class field

void (*old_Update)(void *instance);
void Update(void *instance)
{
    if(instance != NULL)
    {
        if(EnableCheat)
        {
            if(MyPointer != NULL)
            {
            void *OtherClass = *(void *)((uint64_t)PointerToClass + 0x10);//i think te 0x10 one would be better to use
                 if(OtherClass != NULL)
                 {
                 *(void *)((uint64_t)OtherClass + 0x224); //modify the other field here
                 }
            }
        }
    }
    old_Update(instance);
}
All this code gives an eror
 
dont worry
Okay so just do something like this
C++:
void (*PointerToClass)(void *instance); // the pointer of the class field

void (*old_Update)(void *instance);
void Update(void *instance)
{
    if(instance != NULL)
    {
        if(EnableCheat)
        {
            if(MyPointer != NULL)
            {
            void *OtherClass = *(void *)((uint64_t)PointerToClass + 0x10);//i think te 0x10 one would be better to use
                 if(OtherClass != NULL)
                 {
                 *(void *)((uint64_t)OtherClass + 0x224); //modify the other field here
                 }
            }
        }
    }
    old_Update(instance);
}
dont worry i found a code similar to urs
 
C++:
void (*old_update)(void* _this);
void update(void* _this) {
if(_this != NULL) {
void *MoneyClass = *(void**)((uint64_t)_this + 0x20);
{
if(Coin != NULL) {
*(int *) ((uint64_t) MoneyClass + 0x10) = 999;
}
}
}
        old_update(_this);
}
 
Back
Top Bottom