Added hook and fn stub to clean color from agent overhead name.

This commit is contained in:
Caball 2024-12-30 23:13:16 +01:00
parent d0003da606
commit 27d1f61789

View File

@ -98,6 +98,16 @@ namespace colors
return result;
}
int clean_agent_name_stub(char* out, int max_size, const char* fmt, const char* in)
{
// format agent overhead name like [%s]
const auto length = sprintf_s(out, max_size, fmt, in);
utils::string::strip(in, out, std::min(static_cast<size_t>(length), static_cast<size_t>(max_size)));
return length;
}
void rb_lookup_color_stub(const char index, DWORD* color)
{
*color = RGB(255, 255, 255);
@ -143,6 +153,9 @@ namespace colors
// don't apply colors to overhead names
utils::hook::call(0x14025CE79, get_client_name_stub);
// don't apply colors to overhead names of agents (like dogs or juggernauts)
utils::hook::call(0x1402CF760, clean_agent_name_stub);
// patch I_CleanStr
utils::hook::jump(0x1404F63C0, i_clean_str_stub);
}