Overwrite native with public
#1

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

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"
}
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.
Reply


Messages In This Thread
Overwrite native with public - by Misiur - 03.02.2014, 15:52
Re: Overwrite native with public - by Misiur - 04.02.2014, 12:02
Re: Overwrite native with public - by BullseyeHawk - 04.02.2014, 12:13
Re: Overwrite native with public - by Misiur - 04.02.2014, 12:21
Re: Overwrite native with public - by Misiur - 05.02.2014, 12:53
Re: Overwrite native with public - by Misiur - 05.02.2014, 21:54

Forum Jump:


Users browsing this thread: 1 Guest(s)