L L4D2node

CNetworkStringTableDictionaryManager::WriteDictionaryToBSP

0x001a34e0 · 436 bytes · __thiscall

_ZN36CNetworkStringTableDictionaryManager20WriteDictionaryToBSPEPKcR10CUtlBufferb

Decompiled

undefined (4 params)

/* CNetworkStringTableDictionaryManager::WriteDictionaryToBSP(char const*, CUtlBuffer&, bool) */

undefined4 __thiscall
CNetworkStringTableDictionaryManager::WriteDictionaryToBSP
          (CNetworkStringTableDictionaryManager *this,char *param_1,CUtlBuffer *param_2,bool param_3
          )

{
  undefined4 uVar1;
  CSysModule *pCVar2;
  code *pcVar3;
  int *piVar4;
  char *pcVar5;
  int in_GS_OFFSET;
  char *local_134;
  char local_124 [260];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  V_snprintf(local_124,0x104,"maps/%s.bsp",param_1);
  uVar1 = (**(code **)(*(int *)(g_pFileSystem + 4) + 0x2c))
                    (g_pFileSystem + 4,local_124,&DAT_002a076d);
  if ((char)uVar1 != '\0') {
    pCVar2 = (CSysModule *)FileSystem_LoadModule("bsppack");
    if (pCVar2 != (CSysModule *)0x0) {
      pcVar3 = (code *)Sys_GetFactory(pCVar2);
      if (pcVar3 != (code *)0x0) {
        piVar4 = (int *)(*pcVar3)("IBSPPACK003",0);
        if (piVar4 != (int *)0x0) {
          (**(code **)*piVar4)(piVar4,g_pFileSystem,local_124);
          if (param_3) {
            local_134 = "stringtable_dictionary_xbox.dct";
            pcVar3 = *(code **)(*piVar4 + 0x2c);
            pcVar5 = "stringtable_dictionary_fallback_xbox.dct";
          }
          else {
            local_134 = "stringtable_dictionary.dct";
            pcVar3 = *(code **)(*piVar4 + 0x2c);
            pcVar5 = "stringtable_dictionary_fallback.dct";
          }
          (*pcVar3)(piVar4,pcVar5);
          (**(code **)(*piVar4 + 0x10))
                    (piVar4,local_134,*(undefined4 *)param_2,*(undefined4 *)(param_2 + 0x10),0);
          (**(code **)(*piVar4 + 4))(piVar4,local_124);
          (**(code **)(*piVar4 + 8))(piVar4);
          FileSystem_UnloadModule(pCVar2);
          Msg("Updated stringtable dictionary saved to %s\n",local_124);
          goto LAB_001a3551;
        }
      }
      Sys_UnloadModule(pCVar2);
    }
    uVar1 = 0;
    ConMsg("Can\'t load bsppack.dll\n");
  }
LAB_001a3551:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return uVar1;
  }
                    /* 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)