Improved naming for function 'get_client_name_stub'. #5
| @@ -98,6 +98,16 @@ namespace colors | |||||||
| 			return result; | 			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) | 		void rb_lookup_color_stub(const char index, DWORD* color) | ||||||
| 		{ | 		{ | ||||||
| 			*color = RGB(255, 255, 255); | 			*color = RGB(255, 255, 255); | ||||||
| @@ -143,6 +153,9 @@ namespace colors | |||||||
| 				// don't apply colors to overhead names | 				// don't apply colors to overhead names | ||||||
| 				utils::hook::call(0x14025CE79, get_client_name_stub); | 				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 | 				// patch I_CleanStr | ||||||
| 				utils::hook::jump(0x1404F63C0, i_clean_str_stub); | 				utils::hook::jump(0x1404F63C0, i_clean_str_stub); | ||||||
| 			} | 			} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user