http://wforum.heroes35.net/showthread.php?tid=6573&pid=139358#pid139358
Было:
Code:
Core.Hook(Ptr($44D270), Core.HOOKTYPE_BRIDGE, @Hook_OpenBik);
https://github.com/ethernidee/b2/blob/7c...e.pas#L440
Code:
function Hook (HandlerAddr: pointer; HookType: integer; PatchSize: integer; CodeAddr: pointer): {n} pointer;
Стало: ЭРА начиная с версии 3.9.15 (24.07.2024)
Code:
Code:
ApiJack.HookCode(Ptr($44D270), @Hook_OpenBik);
Quote:(* Writes call to user handler at specified location. If handler returns true, overwritten commands are executed
in original way. Otherwise they are skipped and Context.RetAddr is used to determine return address.
Returns address to a default code bridge. It's possible to specify minimum number of bytes to be overriden by hook patch or nopped *)
function HookCode (Addr: pointer; HandlerFunc: THookHandler; {n} AppliedPatch: PAppliedPatch = nil; MinPatchSize: integer = 0): pointer;
https://github.com/ethernidee/b2/commit/...c39d78eL76
=======================
Эра следующая версия 3.9.16
Code:
ApiJack.StdSplice(Ptr($44D270), @Splice_OpenBik, CONV_FASTCALL, 2);
Quote:(* Replaces original function with the new one with the same prototype and 1-2 extra arguments.
Calling convention is changed to STDCALL. The new argument is callable pointer, which can be used to
execute original function. The pointer is passed as THE FIRST argument. If custom parameter address
is given, the value of custom parameter will be passed to handler as THE SECOND argument. If AppliedPatch
pointer is given, it will be assigned an opaque pointer to applied patch data structure. This
pointer can be used to rollback the patch (remove splicing).
Returns address of the bridge to original function *)
function StdSplice (OrigFunc, HandlerFunc: pointer; CallingConv: TCallingConv; NumArgs: integer; {n} CustomParam: pinteger = nil; {n} AppliedPatch: PAppliedPatch = nil): {n} pointer;
Code:
pop eax;Главная процедура
push edx
push ecx
push 58946C4;Ret
push eax;
jmp era.4B9F6DC
nop
nop
nop
nop
nop
nop
push ebp; Address 58946C4
mov ebp,esp
sub esp,28
jmp h3era hd2222.598A96