L L4D2node

CServerGameDLL::GetSaveComment

0x006c4940 · 350 bytes · __thiscall

_ZN14CServerGameDLL14GetSaveCommentEPciffb

Decompiled

undefined (6 params)

/* CServerGameDLL::GetSaveComment(char*, int, float, float, bool) */

void __thiscall
CServerGameDLL::GetSaveComment
          (CServerGameDLL *this,char *param_1,int param_2,float param_3,float param_4,bool param_5)

{
  char cVar1;
  char *__s;
  size_t sVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  char *pcVar6;
  int iVar7;
  int in_GS_OFFSET;
  char local_60 [64];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  pcVar6 = *(char **)(gpGlobals + 0x3c);
  if (pcVar6 == (char *)0x0) {
    pcVar6 = "";
  }
  iVar7 = 0;
  do {
    __s = (&gTitleComments)[iVar7 * 2];
    sVar2 = strlen(__s);
    iVar3 = V_strnicmp(pcVar6,__s,sVar2);
    if (iVar3 == 0) {
      pcVar6 = local_60;
      V_strncpy(pcVar6,(&PTR_s__HL2_Chapter1_Title_00c91ce4)[iVar7 * 2],0x40);
      iVar7 = 0;
      goto LAB_006c49da;
    }
    iVar7 = iVar7 + 1;
  } while (iVar7 != 0x39);
  goto LAB_006c49f8;
  while (iVar7 = iVar7 + 1, iVar7 < 0x40) {
LAB_006c49da:
    cVar1 = local_60[iVar7];
    if (cVar1 == '\0') break;
    if ((cVar1 == '\r') || (cVar1 == '\n')) {
      local_60[iVar7] = '\0';
      if (0x3f < iVar7) break;
      goto LAB_006c49da;
    }
  }
LAB_006c49f8:
  if (param_5) {
    V_snprintf(param_1,param_2,"%-64.64s",pcVar6);
  }
  else {
    if ((int)param_3 < 1000) {
      iVar7 = (int)param_4;
      iVar4 = iVar7 >> 0x1f;
      iVar5 = iVar7 / 0x3c + iVar4;
      iVar3 = (int)param_3 + (iVar5 - iVar4);
      iVar7 = iVar7 + (iVar5 - iVar4) * -0x3c;
    }
    else {
      iVar3 = 999;
      iVar7 = 0x3b;
    }
    V_snprintf(param_1,param_2,"%-64.64s %03d:%02d",pcVar6,iVar3,iVar7);
  }
  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)