L L4D2node

writeid

0x001ef8a0 · 315 bytes · __cdecl

_ZL7writeidRK8CCommand

Decompiled

undefined (1 param)

/* writeid(CCommand const&) */

void writeid(CCommand *param_1)

{
  code *pcVar1;
  int iVar2;
  USERID_s *pUVar3;
  undefined4 uVar4;
  int iVar5;
  int iVar6;
  int in_GS_OFFSET;
  char local_124 [260];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  V_strncpy(local_124,"cfg/banned_user.cfg",0x104);
  ConMsg("Writing %s.\n",local_124);
  iVar2 = (**(code **)(g_pFileSystem[1] + 8))(g_pFileSystem + 1,local_124,&DAT_002a5c80,0);
  if (iVar2 == 0) {
    ConMsg("Couldn\'t open %s\n",local_124);
  }
  else {
    iVar6 = 0;
    iVar5 = 0;
    if (0 < DAT_003b244c) {
      do {
        while (pUVar3 = (USERID_s *)(g_UserFilters + iVar6), *(float *)(pUVar3 + 0x14) != 0.0) {
          iVar5 = iVar5 + 1;
          iVar6 = iVar6 + 0x18;
          if (DAT_003b244c <= iVar5) goto LAB_001ef9a2;
        }
        iVar5 = iVar5 + 1;
        iVar6 = iVar6 + 0x18;
        pcVar1 = *(code **)(*g_pFileSystem + 100);
        uVar4 = GetUserIDString(pUVar3);
        (*pcVar1)(g_pFileSystem,iVar2,"banid 0 %s\r\n",uVar4);
      } while (iVar5 < DAT_003b244c);
    }
LAB_001ef9a2:
    (**(code **)(g_pFileSystem[1] + 0xc))(g_pFileSystem + 1,iVar2);
  }
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  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)