Пользователь
- Статус
- Оффлайн
- Регистрация
- 2 Ноя 2024
- Сообщения
- 296
- Реакции
- 33
Всем привет.
У нас 2 способа:
1. designer_name (cs_player_controller, weapon_ak47)
2. class_name (C_CSPlayerPawn, C_AK47).
1 способ:
2 способ:
У нас 2 способа:
1. designer_name (cs_player_controller, weapon_ak47)
2. class_name (C_CSPlayerPawn, C_AK47).
1 способ:
Код:
std::uint32_t entities::get_schema_hash( std::uintptr_t entity ) const
{
const auto identity = g::memory.read<std::uintptr_t>( entity + 0x10 );
if ( !identity || identity < 0x10000 ) return 0;
// CEntityIdentity::m_designerName = 0x20 → designer class name
const auto name_ptr = g::memory.read<std::uintptr_t>( identity + 0x20 );
if ( !name_ptr || name_ptr < 0x10000 ) return 0;
char class_name[ 64 ]{};
g::memory.read( name_ptr, class_name, sizeof( class_name ) );
if ( !class_name[ 0 ] ) return 0;
return fnv1a::runtime_hash( class_name );
}
2 способ:
Код:
std::uint32_t entities::get_schema_hash( std::uintptr_t entity ) const
{
const auto entity_identity = g::memory.read<std::uintptr_t>( entity + 0x10 );
if ( !entity_identity )
{
return 0;
}
const auto class_info = g::memory.read<std::uintptr_t>( entity_identity + 0x8 );
if ( !class_info )
{
return 0;
}
const auto name_container = g::memory.read<std::uintptr_t>( class_info + 0x8 );
if ( !name_container )
{
return 0;
}
const auto schema_name = g::memory.read<std::uintptr_t>( name_container + 0x8 );
if ( !schema_name )
{
return 0;
}
char class_name[ 64 ]{};
g::memory.read( schema_name, class_name, sizeof( class_name ) );
if ( !class_name[ 0 ] )
{
return 0;
}
return fnv1a::runtime_hash( class_name );
}
Последнее редактирование: