ANTICHAT

ANTICHAT (https://forum.antichat.xyz/index.php)
-   Общие вопросы программирования (https://forum.antichat.xyz/forumdisplay.php?f=206)
-   -   Kthook help (https://forum.antichat.xyz/showthread.php?t=1496515)

delanov 03.12.2023 18:31

Вот такая ошибка с kthook, если кто-то догадывается о моей ошибке, дайте знать пожалуйста

https://sun9-54.userapi.com/impg/qHv...4ff&type=album

Andrinall 03.12.2023 18:57

Цитата:

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

Вот такая ошибка с kthook, если кто-то догадывается о моей ошибке, дайте знать пожалуйста

https://sun9-54.userapi.com/impg/qHv...4ff&type=album

Используй
Код:

kthook::kthook_simple
kthook_simple_t там нет(я даже на гите в коммитах не нашёл его нигде)

Цитата:

Сообщение от Спойлер


C++:





Код:

#include
typedef
struct
CVector
{
float
x
,
y
,
z
;
}
CVector
;
typedef
struct
tRadarTrace
{
unsigned
int
m_nColour
;
// see eBlipColour
unsigned
int
m_nEntityHandle
;
CVector          m_vecPos
;
unsigned
short
m_nCounter
;
float
m_fSphereRadius
;
unsigned
short
m_nBlipSize
;
class
CEntryExit
*
m_pEntryExit
;
unsigned
char
m_nRadarSprite
;
// see eRadarSprite
unsigned
char
m_bBright
:
1
;
// It makes use of bright colors. Always set.
unsigned
char
m_bInUse
:
1
;
// It is available.
unsigned
char
m_bShortRange
:
1
;
// It doesn't show permanently on the radar.
unsigned
char
m_bFriendly
:
1
;
// It is affected by BLIP_COLOUR_THREAT.
unsigned
char
m_bBlipRemain
:
1
;
// It has the priority over the entity (it will still appear after the entity's deletion).
unsigned
char
m_bBlipFade
:
1
;
// Possibly a leftover. Always unset (unused).
unsigned
char
m_nCoordBlipAppearance
:
2
;
// see eBlipAppearance
unsigned
char
m_nBlipDisplay
:
2
;
// see eBlipDisplay
unsigned
char
m_nBlipType
:
4
;
// see eBlipType
}
tRadarTrace
;
class
plugin
{
protected
:
using
drawCoordBlip_t
=
void
(
__cdecl
*
)
(
int
,
std
::
uint8_t
)
;
unsigned
char
deleted_sprite_idx
=
32
;
kthook
::
kthook_simple

hk_drawCoordBlip
{
0x586D60
}
;
tRadarTrace
*
ms_RadarTrace
=
(
tRadarTrace
*
)
0xBA86F0
;
public
:
plugin
(
)
{
hk_drawCoordBlip
.
set_cb
(
[
this
]
(
const
decltype
(
hk_drawCoordBlip
)
&
hook
,
int
blipArrId
,
std
::
uint8_t
isSprite
)
{
if
(
ms_RadarTrace
[
blipArrId
]
.
m_nRadarSprite
==
deleted_sprite_idx
)
return
;
return
hook
.
get_trampoline
(
)
(
blipArrId
,
isSprite
)
;
}
)
;
hk_drawCoordBlip
.
install
(
)
;
}
~
plugin
(
)
{
hk_drawCoordBlip
.
~
kthook_simple
(
)
;
}
}
_plugin_
;





delanov 03.12.2023 19:53

Цитата:

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

Используй
Код:

kthook::kthook_simple
kthook_simple_t там нет(я даже на гите в коммитах не нашёл его нигде)

Цитата:

Сообщение от Спойлер


C++:





Код:

#include
typedef
struct
CVector
{
float
x
,
y
,
z
;
}
CVector
;
typedef
struct
tRadarTrace
{
unsigned
int
m_nColour
;
// see eBlipColour
unsigned
int
m_nEntityHandle
;
CVector          m_vecPos
;
unsigned
short
m_nCounter
;
float
m_fSphereRadius
;
unsigned
short
m_nBlipSize
;
class
CEntryExit
*
m_pEntryExit
;
unsigned
char
m_nRadarSprite
;
// see eRadarSprite
unsigned
char
m_bBright
:
1
;
// It makes use of bright colors. Always set.
unsigned
char
m_bInUse
:
1
;
// It is available.
unsigned
char
m_bShortRange
:
1
;
// It doesn't show permanently on the radar.
unsigned
char
m_bFriendly
:
1
;
// It is affected by BLIP_COLOUR_THREAT.
unsigned
char
m_bBlipRemain
:
1
;
// It has the priority over the entity (it will still appear after the entity's deletion).
unsigned
char
m_bBlipFade
:
1
;
// Possibly a leftover. Always unset (unused).
unsigned
char
m_nCoordBlipAppearance
:
2
;
// see eBlipAppearance
unsigned
char
m_nBlipDisplay
:
2
;
// see eBlipDisplay
unsigned
char
m_nBlipType
:
4
;
// see eBlipType
}
tRadarTrace
;
class
plugin
{
protected
:
using
drawCoordBlip_t
=
void
(
__cdecl
*
)
(
int
,
std
::
uint8_t
)
;
unsigned
char
deleted_sprite_idx
=
32
;
kthook
::
kthook_simple

hk_drawCoordBlip
{
0x586D60
}
;
tRadarTrace
*
ms_RadarTrace
=
(
tRadarTrace
*
)
0xBA86F0
;
public
:
plugin
(
)
{
hk_drawCoordBlip
.
set_cb
(
[
this
]
(
const
decltype
(
hk_drawCoordBlip
)
&
hook
,
int
blipArrId
,
std
::
uint8_t
isSprite
)
{
if
(
ms_RadarTrace
[
blipArrId
]
.
m_nRadarSprite
==
deleted_sprite_idx
)
return
;
return
hook
.
get_trampoline
(
)
(
blipArrId
,
isSprite
)
;
}
)
;
hk_drawCoordBlip
.
install
(
)
;
}
~
plugin
(
)
{
hk_drawCoordBlip
.
~
kthook_simple
(
)
;
}
}
_plugin_
;





Там еще много ошибок, и я полагаю связанны с неправильным подключением, в туториале -> https://www.blast.hk/threads/101433/ там так и было написано

UPD: Проблема решена, спасибо


Время: 12:58