
12.11.2024, 21:30
|
|
Постоянный
Регистрация: 15.09.2021
Сообщений: 396
С нами:
2453766
Репутация:
68
|
|
Сообщение от AdCKuY_DpO4uLa
C++:
Код:
using
CDialogShow_t
=
void
(
__thiscall
*
)
(
void
*
,
int
,
int
,
const
char
*
,
const
char
*
,
const
char
*
,
const
char
*
,
BOOL
)
;
kthook
::
kthook_simple
CDialogShowHook
;
void
customhook
(
)
{
std
::
uintptr_t SampBase
=
reinterpret_cast
(
GetModuleHandle
(
"samp.dll"
)
)
;
CDialogShowHook
.
set_dest
(
SampBase
+
0x6B3E7
)
;
CDialogShowHook
.
set_cb
(
[
]
(
const
decltype
(
CDialogShowHook
)
&
hook
,
void
*
pDialog
,
void
*
edx86
,
int
nId
,
int
nType
,
const
char
*
szCaption
,
const
char
*
szText
,
const
char
*
szLeftButton
,
const
char
*
szRightButton
,
BOOL bServerside
)
{
std
::
string NewMessage
{
"test message"
}
;
return
hook
.
get_trampoline
(
)
(
pDialog
,
nId
,
nType
,
NewMessage
.
c_str
(
)
,
szText
,
szLeftButton
,
szRightButton
,
bServerside
)
;
}
)
;
CDialogShowHook
.
install
(
)
;
}
я изначально пытался таким методом делать, но у меня бьет эрроры на лямбду
ERROR:
Код:
no suitable user-defined conversion from "lambda [](const kthook::kthook_simple &hook, void *pDialog, void *edx86, int nId, int nType, const char *szCaption, const char *szText, const char *szLeftButton, const char *szRightButton, BOOL bServerside)->void" to "kthook::kthook_simple::cb_type" (aka "std::function &, std::add_lvalue_reference_t, std::add_lvalue_reference_t, std::add_lvalue_reference_t, std::add_lvalue_reference_t, std::add_lvalue_reference_t, std::add_lvalue_reference_t, std::add_lvalue_reference_t, std::add_lvalue_reference_t)>") existsC/C++(312)
|
|
|