L L4D2node

BlackBox_Record

0x003de310 · 303 bytes · __cdecl

_Z15BlackBox_RecordPKcS0_z

Decompiled

undefined (2 params)

/* BlackBox_Record(char const*, char const*, ...) */

void BlackBox_Record(char *param_1,char *param_2,...)

{
  char cVar1;
  int iVar2;
  char *pcVar3;
  int iVar4;
  int in_GS_OFFSET;
  char local_420 [1024];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (BlackBox_Record(char_const*,char_const*,...)::blackbox == '\0') {
    iVar2 = __cxa_guard_acquire(&BlackBox_Record(char_const*,char_const*,...)::blackbox);
    if (iVar2 != 0) {
                    /* try { // try from 003de42f to 003de433 has its CatchHandler @ 003de44a */
      ConVarRef::ConVarRef
                ((ConVarRef *)&BlackBox_Record(char_const*,char_const*,...)::blackbox,"blackbox");
      __cxa_guard_release(&BlackBox_Record(char_const*,char_const*,...)::blackbox);
    }
  }
  cVar1 = ConVarRef::IsValid((ConVarRef *)&BlackBox_Record(char_const*,char_const*,...)::blackbox);
  if ((cVar1 != '\0') &&
     (iVar2 = 0, *(int *)(BlackBox_Record(char_const*,char_const*,...)::blackbox._4_4_ + 0x30) != 0)
     ) {
    while( true ) {
      iVar4 = (**(code **)(*blackboxrecorder + 0x18))(blackboxrecorder);
      if (iVar4 <= iVar2) break;
      pcVar3 = (char *)(**(code **)(*blackboxrecorder + 0x14))(blackboxrecorder,iVar2);
      iVar4 = V_strcasecmp(pcVar3,param_1);
      if (iVar4 == 0) break;
      iVar2 = iVar2 + 1;
    }
    iVar4 = (**(code **)(*blackboxrecorder + 0x18))(blackboxrecorder);
    if (iVar2 < iVar4) {
      V_vsnprintf(local_420,0x400,param_2,&stack0x0000000c);
      (**(code **)*blackboxrecorder)(blackboxrecorder,iVar2,local_420);
    }
    else {
      Msg("Invalid blackbox type: %s\n",param_1);
    }
  }
  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)