L L4D2node

CMoveHelperServer::AddToTouched

0x006f69c0 · 652 bytes · __thiscall

_ZN17CMoveHelperServer12AddToTouchedERK10CGameTraceRK6Vector

Decompiled

undefined (3 params)

/* CMoveHelperServer::AddToTouched(CGameTrace const&, Vector const&) */

undefined4 __thiscall
CMoveHelperServer::AddToTouched(CMoveHelperServer *this,CGameTrace *param_1,Vector *param_2)

{
  int *piVar1;
  int iVar2;
  undefined4 uVar3;
  int iVar4;
  undefined4 *puVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  void *pvVar9;
  void *pvVar10;
  void *local_28;
  
  if ((*(int *)(param_1 + 0x4c) != 0) && (*(int *)(param_1 + 0x4c) != *(int *)(this + 4))) {
    iVar8 = *(int *)(this + 0x14);
    local_28 = *(void **)(this + 8);
    *(float *)(this + 0x1c) = *(float *)(this + 0x1c) + *(float *)(param_1 + 0x18);
    iVar2 = iVar8 * 0x60;
    *(float *)(this + 0x20) = *(float *)(this + 0x20) + *(float *)(param_1 + 0x1c);
    pvVar10 = (void *)((int)local_28 + iVar2);
    *(float *)(this + 0x24) = *(float *)(this + 0x24) + *(float *)(param_1 + 0x20);
    iVar4 = iVar8;
    pvVar9 = pvVar10;
    do {
      iVar4 = iVar4 + -1;
      if (iVar4 < 0) {
        iVar4 = iVar8 + 1;
        iVar7 = *(int *)(this + 0xc);
        if (iVar4 <= iVar7) goto LAB_006f6a55;
        iVar6 = *(int *)(this + 0x10);
        if (iVar6 < 0) goto LAB_006f6a55;
        if (iVar6 != 0) {
          for (iVar6 = (iVar8 / iVar6 + 1) * iVar6; iVar6 < iVar4; iVar6 = (iVar6 + iVar4) / 2) {
          }
          goto LAB_006f6bdf;
        }
        if (iVar7 != 0) goto LAB_006f6c20;
        if (1 < iVar4) {
          iVar7 = 1;
          goto LAB_006f6c20;
        }
        iVar6 = 1;
        goto LAB_006f6bdf;
      }
      piVar1 = (int *)((int)pvVar9 + -8);
      pvVar9 = (void *)((int)pvVar9 + -0x60);
    } while (*piVar1 != *(int *)(param_1 + 0x4c));
  }
  return 0;
  while (iVar6 = iVar7 * 4, iVar7 = iVar6, iVar6 < iVar4) {
LAB_006f6c20:
    iVar6 = iVar7 * 2;
    if (iVar4 <= iVar6) break;
  }
LAB_006f6bdf:
  *(int *)(this + 0xc) = iVar6;
  if (local_28 == (void *)0x0) {
    local_28 = malloc(iVar6 * 0x60);
    *(void **)(this + 8) = local_28;
    pvVar10 = (void *)(iVar2 + (int)local_28);
  }
  else {
    local_28 = realloc(local_28,iVar6 * 0x60);
    *(void **)(this + 8) = local_28;
    iVar4 = *(int *)(this + 0x14) + 1;
    pvVar10 = (void *)(iVar2 + (int)local_28);
  }
LAB_006f6a55:
  *(int *)(this + 0x14) = iVar4;
  iVar8 = (iVar4 - iVar8) + -1;
  *(void **)(this + 0x18) = local_28;
  if (0 < iVar8) {
    _V_memmove((void *)((int)local_28 + iVar2 + 0x60),pvVar10,iVar8 * 0x60);
    pvVar10 = (void *)(iVar2 + *(int *)(this + 8));
  }
  *(undefined4 *)((int)pvVar10 + 0xc) = *(undefined4 *)param_1;
  *(undefined4 *)((int)pvVar10 + 0x10) = *(undefined4 *)(param_1 + 4);
  *(undefined4 *)((int)pvVar10 + 0x14) = *(undefined4 *)(param_1 + 8);
  *(undefined4 *)((int)pvVar10 + 0x18) = *(undefined4 *)(param_1 + 0xc);
  *(undefined4 *)((int)pvVar10 + 0x1c) = *(undefined4 *)(param_1 + 0x10);
  *(undefined4 *)((int)pvVar10 + 0x20) = *(undefined4 *)(param_1 + 0x14);
  *(undefined4 *)((int)pvVar10 + 0x24) = *(undefined4 *)(param_1 + 0x18);
  *(undefined4 *)((int)pvVar10 + 0x28) = *(undefined4 *)(param_1 + 0x1c);
  *(undefined4 *)((int)pvVar10 + 0x2c) = *(undefined4 *)(param_1 + 0x20);
  *(undefined4 *)((int)pvVar10 + 0x30) = *(undefined4 *)(param_1 + 0x24);
  *(CGameTrace *)((int)pvVar10 + 0x34) = param_1[0x28];
  *(CGameTrace *)((int)pvVar10 + 0x35) = param_1[0x29];
  *(undefined2 *)((int)pvVar10 + 0x36) = *(undefined2 *)(param_1 + 0x2a);
  *(undefined4 *)((int)pvVar10 + 0x38) = *(undefined4 *)(param_1 + 0x2c);
  *(undefined4 *)((int)pvVar10 + 0x3c) = *(undefined4 *)(param_1 + 0x30);
  *(undefined2 *)((int)pvVar10 + 0x40) = *(undefined2 *)(param_1 + 0x34);
  *(CGameTrace *)((int)pvVar10 + 0x42) = param_1[0x36];
  *(CGameTrace *)((int)pvVar10 + 0x43) = param_1[0x37];
  *(undefined4 *)((int)pvVar10 + 0x44) = *(undefined4 *)(param_1 + 0x38);
  uVar3 = *(undefined4 *)(param_1 + 0x40);
  *(undefined4 *)((int)pvVar10 + 0x48) = *(undefined4 *)(param_1 + 0x3c);
  *(undefined4 *)((int)pvVar10 + 0x4c) = uVar3;
  *(undefined4 *)((int)pvVar10 + 0x50) = *(undefined4 *)(param_1 + 0x44);
  *(undefined2 *)((int)pvVar10 + 0x54) = *(undefined2 *)(param_1 + 0x48);
  *(undefined2 *)((int)pvVar10 + 0x56) = *(undefined2 *)(param_1 + 0x4a);
  *(undefined4 *)((int)pvVar10 + 0x58) = *(undefined4 *)(param_1 + 0x4c);
  *(undefined4 *)((int)pvVar10 + 0x5c) = *(undefined4 *)(param_1 + 0x50);
  puVar5 = (undefined4 *)(iVar2 + *(int *)(this + 8));
  *puVar5 = *(undefined4 *)param_2;
  puVar5[1] = *(undefined4 *)(param_2 + 4);
  puVar5[2] = *(undefined4 *)(param_2 + 8);
  return 1;
}

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)