L L4D2node

user

0x001fb8d0 · 266 bytes · __cdecl

_ZL4userRK8CCommand

Decompiled

undefined (1 param)

/* user(CCommand const&) */

void user(CCommand *param_1)

{
  char cVar1;
  long lVar2;
  int iVar3;
  char *pcVar4;
  char *pcVar5;
  int *piVar6;
  int iVar7;
  
  if (DAT_003b7f64 < 2) {
    param_1 = (CCommand *)s_Can_t__user___not_running_a_serv_002c1cc8;
LAB_001fb9b5:
    ConMsg((char *)param_1);
    return;
  }
  if (*(int *)param_1 != 2) {
    ConMsg("Usage: user <username / userid>\n");
    return;
  }
  iVar7 = 0;
  lVar2 = strtol(*(char **)(param_1 + 0x40c),(char **)0x0,10);
  if (0 < DAT_003b8080) {
    do {
      iVar3 = *(int *)(DAT_003b8074 + iVar7 * 4);
      piVar6 = (int *)(iVar3 + 4);
      if (iVar3 == 0) {
        piVar6 = (int *)0x0;
      }
      cVar1 = (**(code **)(*piVar6 + 0x80))(piVar6);
      if (cVar1 != '\0') {
        iVar3 = (**(code **)(*piVar6 + 0x3c))(piVar6);
        if (iVar3 != lVar2) {
          pcVar5 = "";
          if (1 < *(int *)param_1) {
            pcVar5 = *(char **)(param_1 + 0x40c);
          }
          pcVar4 = (char *)(**(code **)(*piVar6 + 0x48))(piVar6);
          iVar3 = _V_strcmp(pcVar4,pcVar5);
          if (iVar3 != 0) goto LAB_001fb94f;
        }
        param_1 = (CCommand *)s_TODO__SV_User_f__002c2f3f;
        goto LAB_001fb9b5;
      }
LAB_001fb94f:
      iVar7 = iVar7 + 1;
    } while (iVar7 < DAT_003b8080);
  }
  ConMsg("User not in server.\n");
  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)