L L4D2node

COM_AddNoise

0x00126260 · 118 bytes · __cdecl

_Z12COM_AddNoisePhii

Decompiled

undefined (3 params)

/* COM_AddNoise(unsigned char*, int, int) */

void COM_AddNoise(uchar *param_1,int param_2,int param_3)

{
  byte bVar1;
  byte bVar2;
  int iVar3;
  byte bVar4;
  int iVar5;
  
  if (0 < param_3) {
    iVar5 = 0;
    do {
      iVar3 = RandomInt(0,param_2 + -1);
      bVar2 = RandomInt(0,7);
      bVar1 = param_1[iVar3];
      bVar4 = bVar1 | bVar2;
      if ((bVar1 & bVar2) != 0) {
        bVar4 = ~bVar2 & bVar1;
      }
      iVar5 = iVar5 + 1;
      param_1[iVar3] = bVar4;
    } while (iVar5 != param_3);
  }
  return;
}

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)