
26.08.2025, 23:22
|
|
Флудер
Регистрация: 19.06.2022
Сообщений: 2,997
С нами:
2055431
Репутация:
3
|
|
Сообщение от undefine
короче есть такой код
C++:
Код:
void
show_cursor
(
bool
state
)
{
using
RwD3D9GetCurrentD3DDevice_t
=
LPDIRECT3DDEVICE9
(
__cdecl
*
)
(
)
;
auto
rwCurrentD3dDevice
{
reinterpret_cast
(
0x7F9D50U
)
(
)
}
;
if
(
nullptr
==
rwCurrentD3dDevice
)
{
return
;
}
static
DWORD
updateMouseProtection
,
rsMouseSetPosProtFirst
,
rsMouseSetPosProtSecond
;
if
(
state
)
{
::
VirtualProtect
(
reinterpret_cast
(
0x53F3C6U
)
,
5U
,
PAGE_EXECUTE_READWRITE
,
&
updateMouseProtection
)
;
::
VirtualProtect
(
reinterpret_cast
(
0x53E9F1U
)
,
5U
,
PAGE_EXECUTE_READWRITE
,
&
rsMouseSetPosProtFirst
)
;
::
VirtualProtect
(
reinterpret_cast
(
0x748A1BU
)
,
5U
,
PAGE_EXECUTE_READWRITE
,
&
rsMouseSetPosProtSecond
)
;
// NOP: CPad::UpdateMouse
*
reinterpret_cast
(
0x53F3C6U
)
=
0xE9U
;
*
reinterpret_cast
(
0x53F3C6U
+
1U
)
=
0x15BU
;
// NOP: RsMouseSetPos
memset
(
reinterpret_cast
(
0x53E9F1U
)
,
0x90
,
5U
)
;
memset
(
reinterpret_cast
(
0x748A1BU
)
,
0x90
,
5U
)
;
rwCurrentD3dDevice
->
ShowCursor
(
TRUE
)
;
}
else
{
// Original: CPad::UpdateMouse
memcpy
(
reinterpret_cast
(
0x53F3C6U
)
,
"\xE8\x95\x6C\x20\x00"
,
5U
)
;
// Original: RsMouseSetPos
memcpy
(
reinterpret_cast
(
0x53E9F1U
)
,
"\xE8\xAA\xAA\x0D\x00"
,
5U
)
;
memcpy
(
reinterpret_cast
(
0x748A1BU
)
,
"\xE8\x80\x0A\xED\xFF"
,
5U
)
;
using
CPad_ClearMouseHistory_t
=
void
(
__cdecl
*
)
(
)
;
using
CPad_UpdatePads_t
=
void
(
__cdecl
*
)
(
)
;
reinterpret_cast
(
0x541BD0U
)
(
)
;
reinterpret_cast
(
0x541DD0U
)
(
)
;
::
VirtualProtect
(
reinterpret_cast
(
0x53F3C6U
)
,
5U
,
updateMouseProtection
,
&
updateMouseProtection
)
;
::
VirtualProtect
(
reinterpret_cast
(
0x53E9F1U
)
,
5U
,
rsMouseSetPosProtFirst
,
&
rsMouseSetPosProtFirst
)
;
::
VirtualProtect
(
reinterpret_cast
(
0x748A1BU
)
,
5U
,
rsMouseSetPosProtSecond
,
&
rsMouseSetPosProtSecond
)
;
rwCurrentD3dDevice
->
ShowCursor
(
FALSE
)
;
}
}
и там есть трабл в том что при выводе курсора можно управлять педом, но а мне надо что бы при выводе курсора нельзя было типо как в сампе открываешь чат/esc что бы так же выводило
SAMP-API/src/sampapi/0.3.7-R1/CGame.cpp at 6d4db99ab41f19d1a6a7c6cd48f5878bd1e14b62 · BlastHackNet/SAMP-API
A library for interacting with functions, classes and structures of SA-MP client - BlastHackNet/SAMP-API
github.com
|
|
|