L L4D2node

CVEngineServer::Message_CheckMessageLength

0x0022cdd0 · 360 bytes · __cdecl

_ZN14CVEngineServer26Message_CheckMessageLengthEv

Decompiled

undefined (0 params)

/* CVEngineServer::Message_CheckMessageLength() */

int CVEngineServer::Message_CheckMessageLength(void)

{
  undefined4 uVar1;
  char cVar2;
  int iVar3;
  int in_GS_OFFSET;
  int local_114;
  undefined1 local_110 [256];
  int local_10;
  
  uVar1 = s_MsgData._764_4_;
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  if (s_MsgData._520_4_ == 0x3ef830) {
    local_114 = -1;
    cVar2 = (**(code **)(*serverGameDLL + 0x70))
                      (serverGameDLL,s_MsgData._764_4_,local_110,0x100,&local_114);
    if (cVar2 == '\0') {
      Warning("Unable to find user message for index %i\n",uVar1);
      iVar3 = -1;
    }
    else {
      iVar3 = s_MsgData._820_4_ + 7 >> 3;
      if (local_114 == -1) {
        if (0xff < iVar3) {
          Warning("DLL_MessageEnd:  Refusing to send user message %s of %i bytes to client, user message size limit is %i bytes\n"
                  ,local_110,iVar3,0xff);
          iVar3 = -1;
        }
      }
      else if (local_114 != iVar3) {
        Warning("User Msg \'%s\': %d bytes written, expected %d\n",local_110,iVar3,local_114);
        iVar3 = -1;
      }
    }
  }
  else if (s_MsgData._520_4_ == 0x3ef79c) {
    iVar3 = s_MsgData._676_4_ + 7 >> 3;
    if (0xff < iVar3) {
      Warning("Entity Message to %i, %i bytes written (max is %d)\n",s_MsgData._616_4_,iVar3,0xff);
      iVar3 = -1;
    }
  }
  else {
    Warning("MessageEnd unknown message type.\n");
    iVar3 = -1;
  }
  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {
    return iVar3;
  }
                    /* 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)