As the title suggests, I want to remove the hard-coded scale limit for env_sprite entities to go above 64.
This is a maximum value that's defined in the entity's netprops, but the maximum is only initialized on the server when it's networked to the client, and I think it may be possible to remove this limit.
gubka did a similar modification of server datatables for CS:GO's HUD elements: https://forums.alliedmods.net/showthread.php?t=314962
I was trying to copy what gubka did, but I am having troubles figuring out how he managed to get the server to recognize that the tables have changed and push updates accordingly.
I made my own gamedata file for the TF2 server/engine binaries. The signature and offsets for ServerClassInit<DT_Sprite::ignored> are correct, but I am not sure what offset gubka uses to send a new CRC value in SendTable_Init.
I am fairly new to server binary analysis in IDA. Would anybody be able to help me find the proper offset?
spritescale.sp is a small script I wrote that is essentially what I'm trying to accomplish.
You can use interface to find SendProps and change their bits property, the last one is CRC since i don't have tf2 binaries i will make example on l4d2.
To get this variable you need to dereference 4 bytes which represents absolute address of this variable (like a pointer to some variable).
Spoiler
but before that we need to find an offset by which we will find a pointer to this variable (in most cases this is the signature of some function + offset or module base + offset)
so create signature for the function and subtract the pointer offset from the signature address and this is will be offset to your variable ptr off signature
bool result = ChangePropBits("CSprite", "m_fScale", 12);
Thank you for the detailed response.
I edited your plugin to call ChangePropBits("CSprite", "m_flSpriteScale", 12) on plugin load, but it makes my client crash when I try to join.
I also am unable to join the server after I change the class table CRC, regardless of whether or not I have sv_sendtables set to 1. If I don't change the value, I get the expected "Server uses different class tables" error.
If I do change the value, I get a different, rather amusing error:
Also, would you be able to explain to me what 12 is supposed to represent? I see it referred in gubka's code as well, but it looks like an arbitrary number.
Also, would you be able to explain to me what 12 is supposed to represent? I see it referred in gubka's code as well, but it looks like an arbitrary number.
It seems to be broken in TF2 as well. If I try to send the updated tables, I hang on the Sending client info... screen, and opening the console shows this line:
If I start the server without setting sv_sendtables to 1, let it finish starting, set the convar, then try joining, my client crashes instead.
Is there something else I need to do to get this working? Am I missing something? I'd say it's a CS:GO only thing, but apparently gubka was able to get his plugin working in CS:S.
I've attached a super-simple plugin that replicates the issue.