L L4D2node

Sys_LoadLibrary

0x00b6c510 · 227 bytes · __regparm3

_ZL15Sys_LoadLibraryPKc9Sys_Flags

Decompiled

undefined (2 params)

/* Sys_LoadLibrary(char const*, Sys_Flags) */

void __regparm3 Sys_LoadLibrary(char *param_1,undefined4 param_2)

{
  int *piVar1;
  int iVar2;
  char *pcVar3;
  char *pcVar4;
  int in_GS_OFFSET;
  char local_124 [260];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  piVar1 = (int *)CommandLine_Tier0();
  iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,"-xlsp");
  pcVar4 = "_xlsp";
  if (iVar2 == 0) {
    piVar1 = (int *)CommandLine_Tier0();
    iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,"-valveinternal");
    if (iVar2 != 0) {
      pcVar4 = "_valveinternal";
      goto LAB_00b6c54d;
    }
  }
  else {
LAB_00b6c54d:
    strcpy(local_124,param_1);
    pcVar3 = strchr(local_124,0x2e);
    if (pcVar3 != (char *)0x0) {
      *pcVar3 = '\0';
    }
    V_strncat(local_124,pcVar4,0x104,-1);
    iVar2 = Sys_LoadLibraryGuts(local_124,param_2);
    if (iVar2 != 0) goto LAB_00b6c5b4;
  }
  Sys_LoadLibraryGuts(param_1,param_2);
LAB_00b6c5b4:
  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)