MinHook - API Hooking Library

Post your working scripts, libraries and tools for AHK v1.1 and older
tuzi
Posts: 223
Joined: 27 Apr 2016, 23:40

Re: MinHook - API Hooking Library

Post by tuzi » 05 Oct 2021, 06:21

分享一个经验,有时候 hook 函数中使用 msgbox 或 tooltip 来显示参数,可能会导致 hook 出现无法继续进行下去的情况,这时候只需用 fileappend 来代替msgbox 即可。

To share an experience, sometimes the use of msgbox or tooltip to display parameters in a hook() may cause the hook to fail to continue, so just use fileappend instead of msgbox.
Last edited by tuzi on 30 Oct 2021, 11:32, edited 1 time in total.
whynotregister
Posts: 147
Joined: 05 Nov 2016, 22:42

Re: MinHook - API Hooking Library

Post by whynotregister » 20 Oct 2021, 03:07

this is so useful. But does it only possible to api or function? The hook doesn't seem to be installed on normal address
tuzi
Posts: 223
Joined: 27 Apr 2016, 23:40

Re: MinHook - API Hooking Library

Post by tuzi » 26 Nov 2021, 05:29

When I try to hook GetTickCount, the process always crashes. :(

Code: Select all

SetWorkingDir %A_ScriptDir%
#NoEnv
#Include <MinHook>

MsgBox, Hello World

hook1 := New MinHook("kernel32.dll", "GetTickCount", "GetTickCount_Hook")
hook1.Enable()

MsgBox, This message will not be displayed because the process has crashed.

aaa:=A_TickCount

GetTickCount_Hook() {
	global hook1
	return DllCall(hook1.original)
}
Post Reply

Return to “Scripts and Functions (v1)”