L L4D2node

Test_RandomChance

0x002197f0 · 175 bytes · __regparm3

_ZL17Test_RandomChanceRK8CCommand.part.3

Decompiled

undefined (1 param)

/* Test_RandomChance(CCommand const&) [clone .part.3] */

void __regparm3 Test_RandomChance(CCommand *param_1)

{
  int iVar1;
  undefined4 uVar2;
  int iVar3;
  int in_GS_OFFSET;
  char local_420 [1024];
  int local_20;
  
  iVar3 = 2;
  local_420[0] = '\0';
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (2 < *(int *)param_1) {
    do {
      iVar1 = iVar3 * 4;
      iVar3 = iVar3 + 1;
      V_strncat(local_420,*(char **)(param_1 + iVar1 + 0x408),0x400,-1);
      V_strncat(local_420," ",0x400,-1);
    } while (iVar3 < *(int *)param_1);
  }
  uVar2 = Cbuf_GetCurrentPlayer();
  Cbuf_InsertText(uVar2,local_420,0);
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)