Пользователь
- Статус
- Оффлайн
- Регистрация
- 3 Янв 2020
- Сообщения
- 140
- Реакции
- 150
hay been learning more reversing and working on chams idk why atm but the players are just invisible when the mats applied would appreciate any help sigs are correct i believe
c++:
set_type_kv3)>(FIND_PATTERN("tier0.dll", "40 53 48 83 EC ? 4C 8B 11 41 B9"));
load_key_values)>(utils::find_export(m_modules.tier0.get_module_hash(), FNV1A("?LoadKV3@@YA_NPEAVKeyValues3@@PEAVCUtlString@@PEAVCUtlBuffer@@AEBUKV3ID_t@@PEBDI@Z")));
//load_key_values)>(utils::get_absolute_address(FIND_PATTERN("tier0.dll", "E8 ? ? ? ? EB ? F7 43"), 0x1, 0x0));
create_material)>(FIND_PATTERN("materialsystem2.dll", "48 89 5C 24 ?? 48 89 6C 24 ?? 56 57 41 56 48 81 EC ?? ?? ?? ?? 48 8B 05"));
class CSceneAnimatableObject
{
Memory_pad(0xB8);
sdk::CHandle<C_BaseEntity> hOwner;
};
class CMeshData
{
public:
Memory_pad(0x18); // 0x0
CSceneAnimatableObject* m_pSceneAnimatableObject; // 0x18
CMaterial2* m_pMaterial; // 0x20
CMaterial2* m_pMaterialCopy;
Memory_pad(0x10);
CObjectInfo* pObjectInfo;
Memory_pad(0x8);
Color m_colValue; // 0x48
};
class IMaterialSystem2
{
public:
};
bool chams_t::ProcessSceneObject(void* pAnimatableSceneObjectDesc, void* pDx11, sdk::CMeshData* arrMeshDraw, int nDataCount, void* pSceneView, void* pSceneLayer, void* pUnk, void* pUnk2)
{
if (!b_initialized)
return false;
auto pPawn = GetPlayerPawn(arrMeshDraw);
if (!pPawn)
return false;
if (!pPawn->is_alive())
return false;
return OverrideMaterial(pPawn, pAnimatableSceneObjectDesc, pDx11, arrMeshDraw, nDataCount, pSceneView, pSceneLayer, pUnk, pUnk2);
}
sdk::C_CSPlayerPawn* chams_t::GetPlayerPawn(sdk::CMeshData* pMesh)
{
if (!pMesh || !pMesh->m_pSceneAnimatableObject)
return nullptr;
const auto hOwner = pMesh->m_pSceneAnimatableObject->hOwner;
if (!hOwner.valid())
return nullptr;
auto entity = manager->interfaces.resource_service->game_entity_system->get_entity_by_index<sdk::C_CSPlayerPawn>(hOwner.get_entry_index());
if (entity && entity->find_class(FNV1A("C_CSPlayerPawn")))
return entity;
return nullptr;
}
bool chams_t::OverrideMaterial(sdk::C_CSPlayerPawn* pPawn, void* pAnimatableSceneObjectDesc, void* pDx11, sdk::CMeshData* arrMeshDraw, int nDataCount, void* pSceneView, void* pSceneLayer, void* pUnk, void* pUnk2)
{
ChamsMaterials_t& objMaterial = m_Materials[CHAMS_GLOW]; // Example: Use glow material
color color_enemy = cfg.visuals.chams.enemy_pl.col1.get();
color color_enemy_invis = cfg.visuals.chams.enemy_pl.col_z.get();
if (cfg.visuals.chams.enemy_pl.ignorez)
{
ApplyMaterial(objMaterial.m_Occluded, color_enemy_invis, pAnimatableSceneObjectDesc, pDx11, arrMeshDraw, nDataCount, pSceneView, pSceneLayer, pUnk, pUnk2);
}
ApplyMaterial(objMaterial.m_Visible, color_enemy, pAnimatableSceneObjectDesc, pDx11, arrMeshDraw, nDataCount, pSceneView, pSceneLayer, pUnk, pUnk2);
return true;
}
CStrongHandle<sdk::CMaterial2> CreateMaterial(const char* szMaterialName, const char* szVmatBuffer)
{
utils::CKeyValues3* pKeyValues3 = utils::CKeyValues3::CreateMaterialResource();
pKeyValues3->LoadFromBuffer(szVmatBuffer);
CStrongHandle<sdk::CMaterial2> pCustomMaterial = {};
core::functions.create_material(nullptr, &pCustomMaterial, szMaterialName, pKeyValues3, 0, 1);
return pCustomMaterial;
}
void ApplyMaterial(sdk::CMaterial2* material, const color& color, void* pAnimatableSceneObjectDesc, void* pDx11, sdk::CMeshData* arrMeshDraw, int nDataCount, void* pSceneView, void* pSceneLayer, void* pUnk, void* pUnk2)
{
if (!material)
return;
arrMeshDraw->m_pMaterial = material;
arrMeshDraw->m_colValue = color{ color.get_r(), color.get_g(), color.get_b(), color.get_a() };
hook_manager.draw_object->call(pAnimatableSceneObjectDesc, pDx11, arrMeshDraw, nDataCount, pSceneView, pSceneLayer, pUnk, pUnk2);
}
Вложения
Последнее редактирование: