PDA

View Full Version : dvar functions?



omnimouz
23rd May 2013, 08:34
Is it possible to check/set/whatever a dvar like, maxfps() instead of getdvar("com_maxfps")?

kung foo man
23rd May 2013, 09:41
You can rename the dvar's with a hex editor like WinHex

omnimouz
23rd May 2013, 09:55
What I mean is, check the actual dvar value and not get the value of example 'com_maxfps'. Because people can change com to con etc. Just wondering if there is a way to check without going through getdvar

kung foo man
23rd May 2013, 11:07
I thought about a generic way, but there isn't much room for a solution. Though com_maxfps could be detected with a trick:

Set it to e.g. 2 with player setclientcvar("com_maxfps", "2") and then watch the ping. If ping goes up: test succeeded

Of course you can't read the ping without any extension, but I rent servers with it: http://killtube.org/forumdisplay.php?37-Hosting

Alternativly you can use B3 to control the ping, wrote an easy to understand introduction for that: http://killtube.org/showthread.php?1259-Tutorial-B3-Simple-and-Easy-Command-Adding!

Tally
23rd May 2013, 11:49
What I mean is, check the actual dvar value and not get the value of example 'com_maxfps'. Because people can change com to con etc. Just wondering if there is a way to check without going through getdvar

I don't really know what you are talking about because some of the things you've said are not correct. So, talking about dvars in general:

1. You cannot permanently change the name of a dvar. These are in the engine. The only way to permanently change them is through hacking the executable, or reverse engineering the game back to source, changing what you want, then recompiling. However, you can redefine them in script.

2. The only way to get the value of a dvar is with getCvar()/getDvar() (depending on which game you are talking about).

3. You cannot get the value of a dvar for a client, as their is no getClientCvar()/getClientDvar() function in any COD game. Whenever you use getCvar()/getDvar(), it will return the value for the whole server, not for any particular client. The only way to get a the value of a dvar for a particular client is to custom-make the dvar for the client - for example by putting their entity number on the end of it - and when you get it's value, it will be for that client simply because it has an extension which is unique to a particular client.

Tally
23rd May 2013, 12:05
Is it possible to check/set/whatever a dvar like, maxfps() instead of getdvar("com_maxfps")?

maxFPS() would not be a dvar - it would be a function. You can define your own functions in COD script to replace any built-in COD engine function. For example, this is a redefinition of setCvar():


setCvarDef( dvar, value )
{
mapname = getCvar ("mapname");

if (isdefined (level.gametype))
gametype = level.gametype;
else
gametype = getCvar ("g_gametype");

suffixed_dvar = dvar + "_" + gametype + "_" + mapname;

setCvar (suffixed_dvar, value);
}


It extends the range of setCvar() to include checking map names, gametypes names, or both, when setting a dvar.

kung foo man
23rd May 2013, 12:42
1. You cannot permanently change the name of a dvar. These are in the engine. The only way to permanently change them is through hacking the executable, or reverse engineering the game back to source, changing what you want, then recompiling. However, you can redefine them in script.


Just search the name of a cvar with a hex editor and change com_maxfps to lol_maxfps e.g. and it would render some detection methods useless. You dont need to recompile anything. The manipulation of software is called cracking (http://en.wikipedia.org/wiki/Software_cracking).

To change the fps, the "hacker" would do this to change his fps: set lol_maxfps 125

Thats how my detection method would work, because this wouldn't affect anything, and that can be detected: player setclientcvar("com_maxfps", "2");

After the test, which can be done in 1 second e.g. the choosen fps can be set (125, 250 etc.)


The actual 2-fps-detection could be done with many ways I guess.

omnimouz
24th May 2013, 14:55
Sorry, tried to post yesterday but site wouldn't let me..

To change the dvar, all you need to do is edit the .exe as kung foo said, com_maxfps can be changed to lol_maxfps as with all other ones, and then the command com_maxfps with come up with 'external dvar', and wont do anything in the game

What I was asking if there is a function to change/use/check the value of the max fps without using the dvar, which i guess is impossible or very hard

randall
24th May 2013, 15:20
I think you want to limit the maxfps for players (its useful e.g. for a jump mod).
The easiest way would be make an infinity cycle, where you set a value for the cvar in every frame.

omnimouz
24th May 2013, 15:39
That can be bypassed by editing the dvar in the .exe though

kung foo man
24th May 2013, 16:15
Did you understand my idea? It should work pretty well.

Maybe thats not what you want, then you need to describe what you need more clearly :)

omnimouz
24th May 2013, 18:21
I want to enforce some commands on my server, but I don't want them bypassed by editing your .exe

I was asking if you can check what the maxfps (or other commands) by using functions. ex maxfps() drawdecals(), instead of going through the dvars (since they can be bypassed)

serthy
24th May 2013, 18:28
for me:
i still dont get it, what do you want?
what should maxfps() return?
is it in c/c++ or in gsc?
what can be bypassed when using getCvar("com_maxfps")?

omnimouz
24th May 2013, 18:42
what can be bypassed when using getCvar("com_maxfps")?

in your .exe, you can edit all the dvars to whatever you want. com_maxfps can be spf_xammoc, and when you do that, ingame when you type com_maxfps it will say that it is now an external dvar and wont do anything, but the spf_xammoc will change the actual maxfps



i still dont get it, what do you want?

to know if there is a real way to check/set what the maxfps is without going using set/getdvar()



what should maxfps() return?

maxfps() some way of setting/viewing the number that the maxfps is set at, but without going through set/getcvar() (since it can be bypassed)



is it in c/c++ or in gsc?

both i guess(?)

serthy
24th May 2013, 21:05
in your .exe, you can edit all the dvars to whatever you want. com_maxfps can be spf_xammoc, and when you do that, ingame when you type com_maxfps it will say that it is now an external dvar and wont do anything, but the spf_xammoc will change the actual maxfps

hmmm, you wanna say that if I, as a connecting player to your server, in case i hex-edited my cod2.exe, cant access to com_maxfps?

i understood what you want to know, but i still dont get it why someone would ever bypass things like that
i guess the only way to do this is to hook the exe and get the adress of com_maxfps and/or run some 3rd party proggs on it, but i really doubt that this is worth it

omnimouz
24th May 2013, 21:11
when you edit it, cod recognizes is as an external dvar

people edit it to bypass pb kicks, promod error screen (333fps, developer 1 etc) and other dvars that the server tries to force

Tally
25th May 2013, 11:13
in your .exe, you can edit all the dvars to whatever you want. com_maxfps can be spf_xammoc, and when you do that, ingame when you type com_maxfps it will say that it is now an external dvar and wont do anything, but the spf_xammoc will change the actual maxfps



to know if there is a real way to check/set what the maxfps is without going using set/getdvar()



maxfps() some way of setting/viewing the number that the maxfps is set at, but without going through set/getcvar() (since it can be bypassed)



both i guess(?)

This doesn't sound right to me. A server will ignore what dvars are in a client's executable because it doesn't use the client's executable at all. It uses its own - the server's executable. If you change a server's dvars, it changes them for everyone who connects and plays on the server. However, the converse is not the case - a client can have as many changes as he likes to his executable, it wont mean a bean because they will be ignored by a server.

That is my understanding of the client-server relationship. And its been that way since Quake 2.

kung foo man
25th May 2013, 11:25
Yea, thats correct, but his problem are cheating players, who just rename cvars. I told him how to detect fps-cheaters, but I have the feeling he didn't recognised it.

In the end he just can detect the integrity of cvars, which have some side-effects, which the server can recognise (e.g. high ping on com_maxfps=2).

Tally
25th May 2013, 12:37
Yea, thats correct, but his problem are cheating players, who just rename cvars. I told him how to detect fps-cheaters, but I have the feeling he didn't recognised it.

In the end he just can detect the integrity of cvars, which have some side-effects, which the server can recognise (e.g. high ping on com_maxfps=2).

But my point is, even if they rename their cvars, it wont make any difference to a server. So, perhaps I'm not understanding what these cheaters are doing. How can they rename a dvar and for it to affect a server? I just don't see it being possible.

omnimouz
25th May 2013, 21:45
@kung foo sorry, thanks for that. that does work, i was just also trying to find a way to detect more dvars

@tally for server side cvars im quite sure that is true, but client side no. the server can set your client side com_maxfps or whatever cvar you want, but if they have renamed it, it wont work on the new cvar, only on the old one (unless you know what the new one is). can try it on a server with devmap if you want