WitchBehavior::OnInjured
0x00a3e430 · 670 bytes · __cdecl
_ZN13WitchBehavior9OnInjuredEP8InfectedRK15CTakeDamageInfo
Decompiled
undefined (2 params)
/* WitchBehavior::OnInjured(Infected*, CTakeDamageInfo const&) */
Infected * WitchBehavior::OnInjured(Infected *param_1,CTakeDamageInfo *param_2)
{
uint uVar1;
int *piVar2;
undefined4 *puVar3;
undefined4 *puVar4;
undefined *puVar5;
CBaseEntity *in_stack_0000000c;
int in_stack_00000010;
undefined4 local_20;
if (((*(byte *)(in_stack_00000010 + 0x48) & 0x40) != 0) &&
(0.5 < *(float *)(in_stack_00000010 + 0x3c) / (*(float *)(in_stack_00000010 + 0x40) + 0.001)))
{
piVar2 = (int *)(**(code **)(*(int *)in_stack_0000000c + 0x590))();
if (piVar2 != (int *)0x0) {
(**(code **)(*piVar2 + 0xf0))(piVar2,*(undefined4 *)(ZombieWitchSpeedInjured._28_4_ + 0x2c));
}
uVar1 = *(uint *)(in_stack_00000010 + 0x30);
if ((((uVar1 != 0xffffffff) &&
(puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar5 + 4) != 0)) {
piVar2 = (int *)(**(code **)(*(int *)in_stack_0000000c + 0x594))();
local_20 = 0;
uVar1 = *(uint *)(in_stack_00000010 + 0x30);
if (((uVar1 != 0xffffffff) &&
(puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) {
local_20 = *(undefined4 *)(puVar5 + 4);
}
(**(code **)(*piVar2 + 0x13c))(piVar2,local_20,2,0,0,0);
}
piVar2 = (int *)0x0;
CBaseEntity::EmitSound(in_stack_0000000c,"WitchZombie.Rage",0.0,(float *)0x0);
uVar1 = *(uint *)(in_stack_00000010 + 0x30);
if (((uVar1 != 0xffffffff) &&
(puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) {
piVar2 = *(int **)(puVar5 + 4);
}
puVar3 = ::operator_new(0x48);
puVar3[8] = 0;
puVar3[9] = 0;
puVar3[10] = 0;
puVar3[3] = 0;
puVar3[4] = 0;
puVar3[5] = 0;
puVar3[6] = 0;
puVar3[7] = 0;
puVar3[2] = 0;
*(undefined1 *)(puVar3 + 0xc) = 0;
*(undefined1 *)((int)puVar3 + 0x31) = 0;
puVar3[0xb] = 0;
*puVar3 = &PTR__InfectedShoved_00d21b88;
puVar3[1] = &PTR__InfectedShoved_00d21cec;
puVar3[0xd] = 0xffffffff;
if (piVar2 == (int *)0x0) {
puVar3[0xe] = vec3_origin;
puVar3[0xf] = DAT_01053d4c;
puVar3[0x10] = DAT_01053d50;
}
else {
/* try { // try from 00a3e5b2 to 00a3e5c4 has its CatchHandler @ 00a3e6e8 */
puVar4 = (undefined4 *)(**(code **)(*piVar2 + 0xc))(piVar2);
puVar3[0xd] = *puVar4;
puVar4 = (undefined4 *)(**(code **)(*piVar2 + 0x288))(piVar2);
puVar3[0xe] = *puVar4;
puVar3[0xf] = puVar4[1];
puVar3[0x10] = puVar4[2];
}
puVar3[0x11] = 0;
*(undefined4 *)param_1 = 2;
*(undefined4 **)(param_1 + 4) = puVar3;
*(undefined4 *)(param_1 + 8) = 0;
*(undefined4 *)(param_1 + 0xc) = 1;
return param_1;
}
*(undefined4 *)param_1 = 0;
*(undefined4 *)(param_1 + 4) = 0;
*(undefined4 *)(param_1 + 8) = 0;
*(undefined4 *)(param_1 + 0xc) = 1;
return param_1;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.