L L4D2node

CUtlVector<Response,CUtlMemoryConservative<Response>>::InsertBefore

0x005c29a0 · 463 bytes · __thiscall

_ZN10CUtlVectorI8Response22CUtlMemoryConservativeIS0_EE12InsertBeforeEiRKS0_

Decompiled

undefined (3 params)

/* CUtlVector<Response, CUtlMemoryConservative<Response> >::InsertBefore(int, Response const&) */

int __thiscall
CUtlVector<Response,CUtlMemoryConservative<Response>>::InsertBefore
          (CUtlVector<Response,CUtlMemoryConservative<Response>> *this,int param_1,Response *param_2
          )

{
  Response RVar1;
  Response RVar2;
  undefined2 uVar3;
  Response *pRVar4;
  undefined4 uVar5;
  
  GrowVector(this,1);
  ShiftElementsRight(this,param_1,1);
  pRVar4 = (Response *)(param_1 * 0x50 + *(int *)this);
  if (pRVar4 != (Response *)0x0) {
    *(undefined4 *)(pRVar4 + 0x19) = 0;
    *(undefined4 *)(pRVar4 + 0x1d) = 0;
    *(undefined4 *)(pRVar4 + 0x21) = 0;
    *(undefined2 *)(pRVar4 + 0xe) = 0;
    *(undefined2 *)(pRVar4 + 0xc) = 100;
    uVar3 = float16::ConvertFloatTo16bits(0.0);
    pRVar4[0x10] = (Response)0x0;
    *(undefined2 *)pRVar4 = uVar3;
    *(undefined2 *)(pRVar4 + 2) = uVar3;
    *(undefined2 *)(pRVar4 + 4) = uVar3;
    *(undefined2 *)(pRVar4 + 6) = uVar3;
    *(undefined2 *)(pRVar4 + 8) = uVar3;
    *(undefined2 *)(pRVar4 + 10) = uVar3;
    *(undefined2 *)(pRVar4 + 0x11) = uVar3;
    *(undefined2 *)(pRVar4 + 0x13) = uVar3;
    *(undefined4 *)(pRVar4 + 0x15) = 0;
    *(undefined4 *)(pRVar4 + 0x30) = 0;
    *(undefined4 *)(pRVar4 + 0x34) = 0;
    *(undefined4 *)(pRVar4 + 0x38) = 0;
    *(undefined4 *)(pRVar4 + 0x3c) = 0;
    *(undefined4 *)(pRVar4 + 0x40) = 0;
    *(undefined4 *)(pRVar4 + 0x44) = 0;
    *(undefined4 *)(pRVar4 + 0x48) = 0;
    pRVar4[0x4c] = (Response)0x0;
    if (param_2 != pRVar4) {
      *(undefined2 *)(pRVar4 + 0x2c) = *(undefined2 *)(param_2 + 0x2c);
      pRVar4[0x2f] = (Response)((byte)pRVar4[0x2f] & 0xc0 | (byte)param_2[0x2f] & 0x3f);
                    /* try { // try from 005c2aa1 to 005c2b4d has its CatchHandler @ 005c2b6f */
      uVar5 = ResponseCopyString(*(char **)(param_2 + 0x28));
      *(undefined4 *)(pRVar4 + 0x28) = uVar5;
      pRVar4[0x2e] = param_2[0x2e];
      RVar1 = pRVar4[0x2f];
      RVar2 = param_2[0x2f];
      pRVar4[0x2f] = (Response)((byte)RVar1 & 0xbf | (byte)RVar2 & 0x40);
      pRVar4[0x2f] = (Response)
                     ((byte)RVar1 & 0x3f | (byte)RVar2 & 0x40 | (byte)param_2[0x2f] & 0x80);
      *(undefined4 *)pRVar4 = *(undefined4 *)param_2;
      *(undefined4 *)(pRVar4 + 4) = *(undefined4 *)(param_2 + 4);
      *(undefined4 *)(pRVar4 + 8) = *(undefined4 *)(param_2 + 8);
      *(undefined2 *)(pRVar4 + 0xc) = *(undefined2 *)(param_2 + 0xc);
      *(undefined2 *)(pRVar4 + 0xe) = *(undefined2 *)(param_2 + 0xe);
      pRVar4[0x10] = param_2[0x10];
      *(undefined4 *)(pRVar4 + 0x11) = *(undefined4 *)(param_2 + 0x11);
      *(undefined4 *)(pRVar4 + 0x15) = *(undefined4 *)(param_2 + 0x15);
      AI_ResponseParams::ScriptFollowup_t::operator=
                ((ScriptFollowup_t *)(pRVar4 + 0x19),(ScriptFollowup_t *)(param_2 + 0x19));
      uVar5 = ResponseCopyString(*(char **)(param_2 + 0x30));
      *(undefined4 *)(pRVar4 + 0x30) = uVar5;
      uVar5 = ResponseCopyString(*(char **)(param_2 + 0x34));
      *(undefined4 *)(pRVar4 + 0x34) = uVar5;
      uVar5 = ResponseCopyString(*(char **)(param_2 + 0x3c));
      *(undefined4 *)(pRVar4 + 0x3c) = uVar5;
      uVar5 = ResponseCopyString(*(char **)(param_2 + 0x44));
      *(undefined4 *)(pRVar4 + 0x44) = uVar5;
      uVar5 = ResponseCopyString(*(char **)(param_2 + 0x40));
      *(undefined4 *)(pRVar4 + 0x40) = uVar5;
      *(undefined4 *)(pRVar4 + 0x38) = *(undefined4 *)(param_2 + 0x38);
      *(undefined4 *)(pRVar4 + 0x48) = *(undefined4 *)(param_2 + 0x48);
    }
  }
  return param_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)