03.02.2014, 15:52
I'd like to temporarily overwrite native functions with public functions using pawn. It's like 10 lines of code per function using a plugin, but I wondered if this could be done using Zeex's amx_assembly. Swapping publics is as easy as
I found this, and checked the addresses - I thought native function list is next to publics, but there is some giant gap (Native index 0 at 4657632 public index 0 at 5480). So naturally using HookNative and providing public address results in a crash.
Search function here sucks, and ****** didn't help me - if there is some thread about this, I'd be grateful.
pawn Код:
forward Test1();
public Test1() {
print("Test 1 called!");
}
forward Test2();
public Test2() {
print("Test 2 called instead!");
}
//(...)
HookPublic(GetPublicIndexFromName("Test1"), GetPublicAddressFromName("Test2"));
CallLocalFunction("Test1", ""); //"Test 2 called instead"
}
Search function here sucks, and ****** didn't help me - if there is some thread about this, I'd be grateful.