PDA

View Full Version : [Release] Server Hitboxes



Gumble
06-15-2011, 04:15 PM
This plugin brings back the old sv_showhitboxes ConVar

http://cloud.steampowered.com/ugc/541771335587331282/4E9A4D4FF5AF1352BA961A5CAB149DE3A1766E51/

>Run game with -insecure
>plugin_load addons/hit.dll
>???
>PROFIT


I am planning to add sv_showhitboxes_lag, to see lag compensated hitboxes.

3949

Credits to aVitamin

0x6077
06-16-2011, 02:56 AM
Can you show us the Source of the Plugin?

Gumble
06-16-2011, 06:39 AM
Can you show us the Source of the Plugin?


void CServerPlugin::GameFrame( bool simulating )
{

if(!simulating)
return;

if(g_pServerDLL == NULL)
{
g_pServerDLL = (DWORD)GetModuleHandle("server.dll");
dwFuncPtr1 = g_pServerDLL + 0x9b0a0;
}

if(sv_showhitboxes.GetBool())
{
edict_t* edc = engine->PEntityOfEntIndex(sv_showhitboxes.GetInt());

if(edc)
{
IServerEntity * s_ent = edc->GetIServerEntity();

if(s_ent && strstr(s_ent->GetModelName().ToCStr(),"player"))
{
CBaseEntity* pEnt = s_ent->GetBaseEntity();

if(pEnt != NULL)
{
CBasePlayer *player = dynamic_cast<CBasePlayer *>( pEnt );
float dlDuration = sv_showhitboxes_duration.GetFloat();
__asm
{
FLD DWORD PTR DS:[dlDuration]
PUSH 0
MOV ECX, pEnt
PUSH ECX
FSTP DWORD PTR SS:[ESP]
CALL dwFuncPtr1
}
}
}
}
}
}

wav
10-05-2011, 08:22 AM
sorry gumble but you fail



typedef void ( __thiscall * DrawServerHitboxes_t )( void* thisptr, float duration, bool monocolor );
DrawServerHitboxes_t DrawServerHitboxes;
//====================================================================== ==================
void CServerPlugin::GameFrame( bool simulating )
{
static unsigned long dwServerBase = 0;

if ( simulating )
{
if ( dwServerBase == 0 )
{
dwServerBase = ( unsigned long )GetModuleHandleA ( "server.dll" );

if ( dwServerBase != NULL )
DrawServerHitboxes = ( DrawServerHitboxes_t )( dwServerBase + 0x9B920 );
}
if ( sv_showhitboxes.GetInt() > 0 && sv_showhitboxes.GetInt() <= gpGlobals->maxClients && dwServerBase != NULL )
{
edict_t* edict = engine->PEntityOfEntIndex ( sv_showhitboxes.GetInt() );

if ( edict )
{
IServerEntity* spEnt = edict->GetIServerEntity();

if ( spEnt != NULL )
{
CBaseEntity* cpEnt = spEnt->GetBaseEntity();

if ( cpEnt != NULL )
{
DrawServerHitboxes ( cpEnt, 0, false );
}
}
}
}
}
}


http://www.usaupload.net/d/ul6nx7ra09i

Gumble
10-05-2011, 08:49 AM
so whats better about yours solution now?

you dont even use inline asm, you cant be as cool as me

wav
10-05-2011, 08:51 AM
so whats better about yours solution now?

you dont even use inline asm, you cant be as cool as me

less code, smaller dll, not using inline asm

wav
10-28-2011, 11:36 PM
doop de doop

4182

Forza
04-01-2012, 08:55 AM
Bumping for another simple way to show server hitboxes. This will (obviously) only work if you're running a local server.



void DrawServerHitboxes()
{
static DWORD dwDrawHitboxesFn = gTools.ServerFindPattern( "\x83\xEC\x28\x56\x8B\xF1\x80\xBE\x00\x00\x00\x00\x00\x89\x74\x24\x10", "xxxxxxxx?????xxxx" );
typedef void ( __thiscall* DrawHitboxesFn )( PVOID, float, bool );
DrawHitboxesFn DrawHitboxes = ( DrawHitboxesFn )dwDrawHitboxesFn;

static DWORD dwUtilGetPlayerFn = gTools.ServerFindPattern( "\x8B\x44\x24\x04\x56\x33\xF6\x85\xC0\x7E\x3B", "xxxxxxxxxxx" );
typedef PVOID ( __cdecl* UtilGetPlayerFn )( int );
UtilGetPlayerFn UtilGetPlayer = ( UtilGetPlayerFn )dwUtilGetPlayerFn;

for ( int i = 0; i < gGlobals->maxClients; i ++ )
{
PVOID Player = UtilGetPlayer( i );

if ( Player )
DrawHitboxes( Player, 4.0, true );
}
}


http://screensnapr.com/e/JtMgXU.jpg

wav
04-01-2012, 12:48 PM
Korruption your code is a piece of shit. You're using static but not checking if the value has been set. Fix it or I shove an infraction where the sun doesn't shine. Also I imagine your FindPattern is shit too.

Forza
04-01-2012, 06:10 PM
Korruption your code is a piece of shit. You're using static but not checking if the value has been set. Fix it or I shove an infraction where the sun doesn't shine. Also I imagine your FindPattern is shit too.

That's because my find pattern never fails, it's perfect in every way and recognizes if it made a mistake and fixes itself. Also, your static values fail so you might want to fix that.

wav
04-01-2012, 09:00 PM
That's because my find pattern never fails, it's perfect in every way and recognizes if it made a mistake and fixes itself. Also, your static values fail so you might want to fix that.

cry about it fgt

kingorgy96
04-02-2012, 06:19 AM
nice work but i prefer red

!Slrig
05-03-2012, 04:22 PM
I fixed the signatures for Korruption's method for TF2.


void DrawServerHitboxes()
{
static DWORD dwDrawHitboxesFn = gTools.ServerFindPattern( "\x55\x8B\xEC\x83\xEC\x2C\x56\x8B\xF1", "xxxxxxxxx" );
typedef void ( __thiscall* DrawHitboxesFn )( PVOID pBaseEntity, float flWidth, bool bEnabled );
DrawHitboxesFn DrawHitboxes = ( DrawHitboxesFn )dwDrawHitboxesFn;

static DWORD dwUtilGetPlayerFn = gTools.ServerFindPattern( "\x55\x8B\xEC\x8B\x45\x08\x56\x33\xF6", "xxxxxxxxx" );
typedef PVOID ( __cdecl* UtilGetPlayerFn )( int iIndex );
UtilGetPlayerFn UtilGetPlayer = ( UtilGetPlayerFn )dwUtilGetPlayerFn;

for ( int i = 0; i < gGlobals->maxClients; i ++ )
{
PVOID Player = UtilGetPlayer( i );

if ( Player )
DrawHitboxes( Player, 1.0f, true ); //Don't want it too think now.
}
}