Help! How to hook if CompilerGeneratedAttribute is given

ASDFGHJKLQWE

Solid & Active Platinian
Original poster
Jul 10, 2022
65
19
8
Nepal
How to Hook this
Code:
[CompilerGeneratedAttribute] // RVA: 0x671F78 Offset: 0x671F78 VA: 0x671F78
 // RVA: 0x192A2DC Offset: 0x192A2DC VA: 0x192A2DC
 public long get_Coins() { }
 

libModz

Awesome Active Platinian
Jun 2, 2022
167
29
28
UK
int (*old_Coins)(void *instance);
int Coins(void *instance){
if (instance != NULL){
return 9999;
}
}



Then put this under hack thread...

HOOK("0x192A2DC", Coins, old_Coins);
 
  • Like
Reactions: ASDFGHJKLQWE

xyzhunter

PMT Modder
Staff member
Modding-Team
Oct 28, 2020
2,094
110,206
1,213
Indonesia
1693315268299.png

don't use address compiler , use this redline address then hook like this


long(*old_get_LonglExample)(void *instance);
long get_LonglExample(void *instance) {
if (instance != NULL ) {
return 9999999999999;
}
return old_get_BoolExample(instance);
}

HOOK_LIB("libil2cpp.so", "0x192A2DC", get_LonglExample, old_get_LonglExample);

i suggest look documentation from lglteam :
 
  • Like
Reactions: ASDFGHJKLQWE

ASDFGHJKLQWE

Solid & Active Platinian
Original poster
Jul 10, 2022
65
19
8
Nepal
View attachment 546973
don't use address compiler , use this redline address then hook like this


long(*old_get_LonglExample)(void *instance);
long get_LonglExample(void *instance) {
if (instance != NULL ) {
return 9999999999999;
}
return old_get_BoolExample(instance);
}

HOOK_LIB("libil2cpp.so", "0x192A2DC", get_LonglExample, old_get_LonglExample);

i suggest look documentation from lglteam :
Thanks for this 😊.
(But Not Working)
 

ASDFGHJKLQWE

Solid & Active Platinian
Original poster
Jul 10, 2022
65
19
8
Nepal