[Orpheu] Hook server response to queries

Сообщения
20
Реакции
1
Hey,
I wish to hook server response to queries. Could someone tell me which function to use for it? If possible, a example with it would be better. I'm trying to hook server response and then edit the response info. Or exactly, block it and send my own response so as to prevent the processing of it by engine.
3 Июн 2018
UPDATE : Found out the function which responds to client is "SV_SendServerinfo" (not sure though). Could anyone give an example of how to hook this. Also, how to block it and reply with a similar message myself ? And lastly, how to find out the values this function is sending so I can store them in a variable for later use..

EDIT : Found something "SVC_InfoString" in rehlds files. However, I'm unable to find this function in IDA in the .so files.
 

Garey

ninjaCow
Сообщения
411
Реакции
1,051
Помог
10 раз(а)
Do you use ReHLDS or 7xxx HLDS?
3 Июн 2018
If you wanna hook SV_SendServerinfo in ReHLDS better to do it in C++, because ReHLDS have API to this... (no need to use some hooking libs)
Btw anyway as you see in original SV_SendServerinfo function you also will need all functions are used in this function to work get it work properly, so you also need to hook MSG_Write.. functions COM_* functions and some SV_* functions at the end of function to get it work right, and yes more easy it to-do with C++.
 
Сообщения
20
Реакции
1
What do you mean by c++. I'm thinking to do it in amxmodx. What other way is there? I dont know how to program metamod plugins..
4 Июн 2018
What I actually want is that store the values of the info transmitted to player queries in variables every 5 second and then, when alot of queries (flood) come, instead of retrieving data again and again (cause more cpu), I reply with that data stored in variables (cause less cpu). Also, I wish to put some other checks to not allow too many queries from one IP in a very less time. And most of all, learn something new :D
 

Garey

ninjaCow
Сообщения
411
Реакции
1,051
Помог
10 раз(а)
So... you not answered what u use ReHLDS or HLDS?
 
Сообщения
198
Реакции
273
Помог
5 раз(а)
ishchhabra, orphey may not work with rehlds due offset-difference in binary code.
 
Сообщения
20
Реакции
1
I was thinking to refind the orpheu signatures. However, as garey said there is another way, please explain about that
 

Garey

ninjaCow
Сообщения
411
Реакции
1,051
Помог
10 раз(а)
If u need to block too fast queries than there cvars:
- Added rate limiting code to Out-Of-Band queries (i.e. players, info).
* "max_queries_sec <queries>" (default: 0.5) defines max queries per second per user (averaged over max_queries_window) то есть подсчитывается для каждого юзера за в среднем за период заданный max_queries_window
* "max_queries_sec_global <queries>" (default: 10) defines max queries per second for all queries
* "max_queries_window <seconds>" (default: 30) defines time window to average query rates over
* "sv_logblocks" (default: 0, 0=off, 1=on) logs which IP addresses have been blocked by this code
If you wanna modify response, than i cant help - because this breaks Valve's Policy of Truth.
 

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу