Raised This Month: $62 Target: $400
 15% 

DHooks (Dynamic Hooks - Dev Preview)


Post New Thread Reply   
 
Thread Tools Display Modes
Shadowysn
Member
Join Date: Sep 2015
Old 06-12-2019 , 11:23   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #681

Quote:
Originally Posted by nosoop View Post
Cool; I'll trim down the code and make sure it's reproducible.



You might be able to allocate a CTakeDamageInfo on the SourcePawn stack as an int[], or you could try passing in a pointer from Source Scramble's MemoryBlock handle. Haven't taken an in-depth look at either approach. I'd say both are absolutely filthy hacks.

You can get info with DHook OnTakeDamage with an objectptr passed in byref, then get the information with DHookGetParamObjectPtrVar.
SM-TFOnTakeDamage implements that.
Oh lord, I'm working with that stuff for the first time. I'm a bit lost.
Shadowysn is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 06-12-2019 , 20:01   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #682

Quote:
Originally Posted by Shadowysn View Post
Oh lord, I'm working with that stuff for the first time. I'm a bit lost.
For the second, DHooks-relevant bit, most of the important stuff is located in the dhook_takedamageinfo.inc file. Those offsets are based on the layout of CTakeDamageInfo in the SDK.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH)
nosoop is offline
Had3s99
Junior Member
Join Date: Sep 2015
Location: France
Old 06-13-2019 , 12:45   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #683

Hello,

I use Sourcemod (build 1.10.0.6425) and Dhooks doesn't work with this, i need this build for shavit's plugin so if u can help me that will be nice ;)
Had3s99 is offline
Shadowysn
Member
Join Date: Sep 2015
Old 06-14-2019 , 09:07   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #684

Quote:
Originally Posted by nosoop View Post
For the second, DHooks-relevant bit, most of the important stuff is located in the dhook_takedamageinfo.inc file. Those offsets are based on the layout of CTakeDamageInfo in the SDK.
Welp, didn't succeed. All I did was find another way to crash the game with a ragdoll signature.
Here's the dhook:
PHP Code:
public MRESReturn OnTakeDamage(clientHandle hReturnHandle hParams)
{
    
PrintToServer("DHooksHacks = Victim %i, Attacker %i, Inflictor %i, Damage %f"clientDHookGetParamObjectPtrVar(hParams140ObjectValueType_Ehandle), DHookGetParamObjectPtrVar(hParams136ObjectValueType_Ehandle), DHookGetParamObjectPtrVar(hParams148ObjectValueType_Float));
    
    if (!
IsValidEntity(client) || !IsClientInGame(client) || (GetClientTeam(client) != && GetClientTeam(client) != && GetClientTeam(client) != 4))
    return 
MRES_Ignored;
    
    
/*if(client <= MaxClients && client > 0 && !IsFakeClient(client))
    {
        DHookSetParamObjectPtrVar(hParams, 1, 48, ObjectValueType_Float, 0.0);
        PrintToChat(client, "Pimping your hp");
    }*/
    
float damageForce[3], damagePosition[3], damageReportedPosition[3];
    
DHookGetParamObjectPtrVarVector(hParams112ObjectValueType_VectordamageForce);
    
DHookGetParamObjectPtrVarVector(hParams112ObjectValueType_VectordamagePosition);
    
DHookGetParamObjectPtrVarVector(hParams124ObjectValueType_VectordamageReportedPosition);
    
    
int inflictor DHookGetParamObjectPtrVar(hParams136ObjectValueType_Ehandle);
    
int attacker DHookGetParamObjectPtrVar(hParams136ObjectValueType_Ehandle);
    
int weapon DHookGetParamObjectPtrVar(hParams136ObjectValueType_Ehandle);
    
    
float flDamage DHookGetParamObjectPtrVar(hParams136ObjectValueType_Float);
    
float bitsDamageType DHookGetParamObjectPtrVar(hParams136ObjectValueType_Int);
    
float damagecustom DHookGetParamObjectPtrVar(hParams136ObjectValueType_Int);
    
    
//Action result = CallOnTakeDamage(victim, attacker, inflictor, flDamage, 
    //bitsDamageType, weapon, damageForce, damagePosition, damagecustom);
    
Call_StartForward(g_FwdOnTakeDamage); // There is already a forward defined in OnPluginStart, and it's the same forward in the TF2 CTakeDamageInfo scripting file minus the CritType.
    
Call_PushCell(client);
    
Call_PushCellRef(attacker);
    
Call_PushCellRef(inflictor);
    
Call_PushFloatRef(flDamage);
    
Call_PushCellRef(bitsDamageType);
    
Call_PushCellRef(weapon);
    
Call_PushArrayEx(damageForce3SM_PARAM_COPYBACK);
    
Call_PushArrayEx(damagePosition3SM_PARAM_COPYBACK);
    
Call_PushCell(damagecustom);
    
    
Action result;
    
Call_Finish(result);
    
    
SDKCall(hCreateRagdollclientresult);
    
    
//g_DamageInfo[client] = result;
    
    
return MRES_Ignored;


Last edited by Shadowysn; 06-14-2019 at 09:12.
Shadowysn is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:41.


Powered by vBulletin®
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Theme made by Freecode