ANTICHAT

ANTICHAT (https://forum.antichat.xyz/index.php)
-   Общие вопросы программирования (https://forum.antichat.xyz/forumdisplay.php?f=206)
-   -   Хук появления диалога без SF (https://forum.antichat.xyz/showthread.php?t=1438967)

RedHolms 02.07.2022 16:12

Вопрос прост, как захукать появление диалога без SF, только sampapi

Пробовал захукать Receive у RakClientInterface'а, но поскольку все RPC забирает RakPeer, хукаются только пакеты

Прошу гуру подсказать

legendabrn 02.07.2022 16:39

0x6B9C0 r1

__thiscall:





Код:

uintptr_t pThis, int nId, int nType, const char *szCaption, const char *szText, const char *szLeftButton, const char *szRightButton, BOOL bServerside

RedHolms 02.07.2022 16:40

Цитата:

Сообщение от legendabrn

0x6B9C0 r1

__thiscall:





Код:

uintptr_t pThis, int nId, int nType, const char *szCaption, const char *szText, const char *szLeftButton, const char *szRightButton, BOOL bServerside


Пробовал, результата не дало

legendabrn 02.07.2022 16:41

Цитата:

Сообщение от RedHolms

Пробовал, результата не дало

покажи как хукал

RedHolms 02.07.2022 16:47

C++:





Код:

using
CDialog__Show_t
=
void
(
__thiscall
*
)
(
samp
::
CDialog
*
,
int
,
int
,
const
char
*
,
const
char
*
,
const
char
*
,
BOOL
)
;
#if defined(BUILD_R3)
#define CDialog__Show 0x6F8C0
#else
#define CDialog__Show 0x6B9C0
#endif
static
kthook
::
kthook_signal

show_dialog_hook
;
static
bool
OnShowDialog
(
const
kthook
::
kthook_signal

&
hk
,
samp
::
CDialog
*
,
int
nId
,
int
,
const
char
*
,
const
char
*
,
const
char
*
,
BOOL
)
{
_DebugPrn
(
"Show dialog %d"
,
nId
)
;
return
false
;
}
void
drugstimer_Init
(
)
{
nlohmann
::
json
&
settings
=
getSubSettings
(
"drugstimer"
,
DefaultSettings
)
;
drugstimer_Key
=
settings
[
"key"
]
;
show_dialog_hook
.
set_dest
(
sampapi
::
GetAddress
(
CDialog__Show
)
)
;
show_dialog_hook
.
before
.
connect
(
OnShowDialog
)
;
}


F0RQU1N and 02.07.2022 17:58

C++:





Код:

typedef
bool
(
__thiscall
*
ShowDialog
)
(
int
*
,
int
,
int
,
const
char
*
,
const
char
*
,
int
,
int
,
const
char
*
)
;
ShowDialog oShowDialog
=
nullptr
;
bool
hkDialog
(
int
*
pThis
,
int
a2
,
int
a3
,
const
char
*
a4
,
const
char
*
a5
,
int
a6
,
int
a7
,
const
char
*
a8
)
{
printf
(
"[hkDialog] id: %d\n"
,
a2
)
;
return
false
;
//return oShowDialog(pThis, nId, nType, szCaption, szText, szLeftButton, szRightButton, bServerside);
}
.
.
.
DWORD hook_addr
=
(
DWORD
)
GetModuleHandleW
(
L
"samp.dll"
)
+
0x6B9C0
;
MH_CreateHook
(
(
void
*
)
hook_addr
,
&
hkDialog
,
(
void
*
*
)
&
oShowDialog
)
;
MH_EnableHook
(
(
void
*
)
hook_addr
)
;
.
.
.



https://forum.antichat.xyz/attachments/28076181/

Кстати это не showdialog, а draw

https://forum.antichat.xyz/attachments/28076181/

sizeoftrickster 02.07.2022 18:38

Цитата:

Сообщение от legendabrn

0x6B9C0 r1

__thiscall:





Код:

uintptr_t pThis, int nId, int nType, const char *szCaption, const char *szText, const char *szLeftButton, const char *szRightButton, BOOL bServerside


C++:





Код:

ShowDialog
:
R1
->
0x6B9C0
R2
->
0x6BA70
R3
->
0x6F8C0
R4
->
0x6FFE0
EntryPoint
:
R1
->
0x31DF13
R2
->
0x3195DD
R3
->
0xCC4D0
R4
->
0xCBCB0


RedHolms 02.07.2022 19:33

Нашёл ошибку, забыл вызывать
Код:

kthook::kthook_signal::install
¯\_(ツ)_/¯


Время: 21:03