geokar2006 / ByNameModding

MOVED https://github.com/ByNameModding/BNM-Android
113 stars 34 forks source link

How to hook classes with : such as battleperformancecommandcard: basemonobehavior #18

Closed oobbb closed 1 year ago

oobbb commented 1 year ago

This is how I write it now

auto bsvtd = LoadClass("", "BattlePerformanceCommandCard:BaseMonoBehaviour"); HOOK(bsvtd.GetMethodOffsetByName("updateCardMag", 0), fp, &old_fp); HOOK(bsvtd.GetMethodOffsetByName("GetBaseCommandCard", 0), up, &old_up);

But it will cause the game to jam Please help me

YummyBacon5 commented 1 year ago

Try without the & for the old function

geokar2006 commented 1 year ago

@oobbb, HOOK automatically add & to old method. Use it without &.