
07.08.2024, 09:31
|
|
Флудер
Регистрация: 02.02.2019
Сообщений: 5,070
С нами:
3831395
Репутация:
183
|
|
[QUOTE="!Sam#0235"]
Почему крючок не работает?
C++:
[CODE]
#include
#include
#include
#include
using
CTimer__UpdateSignature
=
void
(
__cdecl
*
)
(
)
;
using
WndProcSignature
=
HRESULT
(
__stdcall
*
)
(
HWND
,
UINT
,
WPARAM
,
LPARAM
)
;
using
InitGameInstance
=
HWND
(
__cdecl
*
)
(
HINSTANCE
)
;
kthook
::
kthook_simple
CTimerHook
{
}
;
kthook
::
kthook_signal
hookGameInstanceInit
{
0x745560
}
;
kthook
::
kthook_simple
WndProcHook
{
}
;
HWND gameHwnd
=
[
]
(
)
{
HWND
*
pHwnd
=
*
reinterpret_cast
(
0xC17054
)
;
if
(
pHwnd
!=
nullptr
)
{
return
*
pHwnd
;
}
else
{
hookGameInstanceInit
.
after
+=
[
]
(
const
auto
&
hook
,
HWND
&
returnValue
,
HINSTANCE inst
)
{
gameHwnd
=
returnValue
;
}
;
return
HWND
(
0
)
;
}
}
(
)
;
HRESULT
hWndProc
(
const
decltype
(
WndProcHook
)
&
hook
,
HWND hwnd
,
UINT uMsg
,
WPARAM wParam
,
LPARAM lParam
)
{
std
::
cout
|
|
|