L L4D2node

CEngineTrace::GetPointContents

0x00159a50 · 710 bytes · __thiscall

_ZN12CEngineTrace16GetPointContentsERK6VectoriPP13IHandleEntity

Decompiled

undefined (4 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CEngineTrace::GetPointContents(Vector const&, int, IHandleEntity**) */

uint __thiscall
CEngineTrace::GetPointContents
          (CEngineTrace *this,Vector *param_1,int param_2,IHandleEntity **param_3)

{
  code *pcVar1;
  int iVar2;
  char cVar3;
  uint uVar4;
  undefined4 *puVar5;
  IHandleEntity *pIVar6;
  int iVar7;
  int *piVar8;
  undefined4 uVar9;
  uint uVar10;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_48;
  undefined4 local_44;
  int local_40;
  undefined **local_3c;
  uint local_38;
  undefined4 *local_34;
  CEngineTrace *local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  
  local_54 = 0;
  local_50 = 0;
  if (_exit == 0) {
    local_40 = 0;
  }
  else {
    (**(code **)(_exit + 0x50))
              (_exit,&local_54,0,0,0,0,"/data/src/engine/./enginetrace.cpp",0x1a3,
               &GetPointContents(Vector_const&,int,IHandleEntity**)::tm_fmt,"(%s)%s","Unaccounted",
               "CEngineTrace_GetPointContents");
    local_40 = _exit;
  }
  iVar2 = _DAT_0040b9d4;
  local_48 = local_54;
  local_44 = local_50;
                    /* try { // try from 00159c06 to 00159c54 has its CatchHandler @ 00159d3b */
  if (((_DAT_0040b028 != 0) || (DAT_0040b02c == '\0')) &&
     (iVar7 = ThreadGetCurrentId(), iVar2 == iVar7)) {
    if ((char *)*_DAT_0040b030 != "CEngineTrace_GetPointContents") {
      _DAT_0040b030 =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0040b030,0x2aeac7,&DAT_00000001,0x2a054b);
    }
    CVProfNode::EnterScope();
    DAT_0040b02c = '\0';
  }
  *(int *)(this + 0x10) = *(int *)(this + 0x10) + 1;
                    /* try { // try from 00159b20 to 00159b58 has its CatchHandler @ 00159d50 */
  uVar4 = CM_PointContents(param_1,0,param_2);
  uVar4 = param_2 & uVar4;
  if ((uVar4 & 0xbc0000) == 0) {
    if (uVar4 != 1) goto LAB_00159c6d;
  }
  else {
    uVar4 = 0x20;
LAB_00159c6d:
    local_2c = *(undefined4 *)param_1;
    local_3c = &PTR_EnumElement_002aef68;
    local_38 = 0;
    local_28 = *(undefined4 *)(param_1 + 4);
    local_30 = this;
    local_24 = *(undefined4 *)(param_1 + 8);
    local_20 = param_2;
    local_34 = (undefined4 *)0x0;
                    /* try { // try from 00159ca8 to 00159d01 has its CatchHandler @ 00159d50 */
    piVar8 = (int *)SpatialPartition();
    pcVar1 = *(code **)(*piVar8 + 0x44);
    uVar9 = (**(code **)(*(int *)this + 0x6c))(this);
    (*pcVar1)(piVar8,uVar9,param_1,0,&local_3c);
    uVar10 = local_38;
    if (((local_38 & 0xbc0000) != 0) || (local_38 != 0)) {
      if (param_3 != (IHandleEntity **)0x0) {
        pIVar6 = (IHandleEntity *)(**(code **)*local_34)(local_34);
        *param_3 = pIVar6;
      }
      goto LAB_00159b60;
    }
  }
  uVar10 = uVar4;
  if (param_3 != (IHandleEntity **)0x0) {
    puVar5 = (undefined4 *)(**(code **)(*(int *)this + 100))(this);
    pIVar6 = (IHandleEntity *)(**(code **)*puVar5)(puVar5);
    *param_3 = pIVar6;
  }
LAB_00159b60:
  iVar2 = _DAT_0040b9d4;
  if (((DAT_0040b02c == '\0') || (_DAT_0040b028 != 0)) &&
     (iVar7 = ThreadGetCurrentId(), iVar2 == iVar7)) {
    cVar3 = CVProfNode::ExitScope();
    if (cVar3 != '\0') {
      _DAT_0040b030 = (int *)_DAT_0040b030[0x19];
    }
    DAT_0040b02c = _DAT_0040b030 == (int *)0x40b034;
  }
  if (local_40 != 0) {
    (**(code **)(local_40 + 0x54))(local_40,local_48,local_44,0,0,0);
  }
  return uVar10;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)