The best way to get all the FactoryInterfaceFn

This method requires SigScan.

struct factorylist_t
	CreateInterfaceFn engineFactory;
	CreateInterfaceFn physicsFactory;
	CreateInterfaceFn fileSystemFactory;

void (*FactoryList_Retrieve)( factorylist_t &destData );

FactoryList_Retrieve is a function that exists in both server.dll and client.dll and can be used to get access to all the CreateInterfaceFn.

This is the signature for the server.dll only.

CSigScan::sigscan_dllfunc = Sys_GetFactory("server.dll");

		Lua()->Error("Could not get access to factories.");

	CSigScan sigscanFactories;
	sigscanFactories.Init((unsigned char *)"\x8B\x44\x24\x04\x8B\x0D\xC0\x33\x6D\x10\x8B\x15\xC4\x33\x6D\x10\x89\x08\x8B\x0D\xC8\x33\x6D\x10\x89\x50\x04\x89\x48\x08\xC3", "xxxxxx????xx????xxxx????xxxxxxx", 31);

		Lua()->Error("Could not get access to factories.");

	FactoryList_Retrieve = (void (*)(factorylist_t &))sigscanFactories.sig_addr;

	factorylist_t factories;

Now you can get all the interfaces you want.

I will post back with the signature for client.dll once I have disassembled it with IDA.

Found this a while back, not sure how up-to-date it is or exactly the headers you need to include but here you go:

I've been trying to determine which interface factories are supported by
Source Engine plugins.  Here's some code I added to the empty plugin Load()

// IClientEntityList *cliententitylist =
// if ( !cliententitylist )
//  Msg("PLUGIN: Unable to load cliententitylist, ignoring
// else
//  Msg("PLUGIN: Loaded cliententitylist

 IEngineTrace *enginetrace =
 if ( !enginetrace )
  Msg("PLUGIN: Unable to load enginetrace, ignoring
  Msg("PLUGIN: Loaded enginetrace

// IServerGameDLL *gamedll =
// if ( !gamedll )
//  Msg("PLUGIN: Unable to load gamedll, ignoring
// else
//  Msg("PLUGIN: Loaded gamedll

// IServerGameEnts *gameents =
// if ( !gameents )
//  Msg("PLUGIN: Unable to load gameents, ignoring
// else
//  Msg("PLUGIN: Loaded gameents

// IServerGameClients *gameclients =
// if ( !gameclients )
//  Msg("PLUGIN: Unable to load gameclients, ignoring
// else
//  Msg("PLUGIN: Loaded gameclients

 ISpatialPartition *spatialpartition =
 if ( !spatialpartition )
  Msg("PLUGIN: Unable to load spatialpartition, ignoring
  Msg("PLUGIN: Loaded spatialpartition

 IVoiceServer *voiceserver =
 if ( !voiceserver )
  Msg("PLUGIN: Unable to load voiceserver, ignoring
  Msg("PLUGIN: Loaded voiceserver

 IStaticPropMgr *staticprops =
 if ( !staticprops )
  Msg("PLUGIN: Unable to load staticprops, ignoring
  Msg("PLUGIN: Loaded staticprops

// IMapData *mapdata = (IMapData*)interfaceFactory(INTERFACEVERSION_MAPDATA,
// if ( !mapdata )
//  Msg("PLUGIN: Unable to load mapdata, ignoring
// else
//  Msg("PLUGIN: Loaded mapdata

// IPhysics *physics =
(IPhysics*)interfaceFactory(VPHYSICS_INTERFACE_VERSION, NULL);
// if ( !physics )
//  Msg("PLUGIN: Unable to load physics, ignoring
// else
//  Msg("PLUGIN: Loaded physics

// IPhysicsCollision *physicscol =
// if ( !physicscol )
//  Msg("PLUGIN: Unable to load physicscol, ignoring
// else
//  Msg("PLUGIN: Loaded physicscol

// IPhysicsSurfaceProps *physicssurfprop =
// if ( !physicssurfprop )
//  Msg("PLUGIN: Unable to load physicssurfprop, ignoring
// else
//  Msg("PLUGIN: Loaded physicssurfprop

 IEngineSound *enginesound =
 if ( !enginesound )
  Msg("PLUGIN: Unable to load enginesound, ignoring
  Msg("PLUGIN: Loaded enginesound

 IVEngineCache *enginecache =
 if ( !enginecache )
  Msg("PLUGIN: Unable to load enginecache, ignoring
  Msg("PLUGIN: Loaded enginecache

 IVModelInfo *modelinfo =
 if ( !modelinfo )
  Msg("PLUGIN: Unable to load modelinfo, ignoring
  Msg("PLUGIN: Loaded modelinfo

...and I obviously included the proper .h files to resolve these at compile
time (Alfred: public/engine is not in the list of default include
directories in the empty plugin project, you might want to add it for later

When I start HL2DM up, the plugin loads fine, but many of the interface
factories return NULL (they don't get resolved).  I'm assuming that plugins
only have access to certain interface factories.  I didn't even try most of
the ones that I knew were client side only (like anything with "render",
"shadow" or "client" in it).  The ones that are commented out above,
returned NULL for the interface.

Hopefully this will help some people along who are writting plugins for

v----- HELP!!!! -----v

I STILL haven't determined a method to get each player's "origin" and
"angles" in a plugin.  The best I have found so far is to use the
ICollideable::GetCollisionOrigin() and ICollideable::GetCollisionAngles()
for each client (ICollideable is available through the edict_t structure
using GetCollideable() function).

^----- HELP!!!! -----^

P.S. I *LOVE* the interface factory stuff!  It REALLY helps you figure out
exactly which functions are valid on different types of entities.  I think
that people who complained about how "messy" the Source SDK is, just isn't
used to the interface factory stuff.  Once you get the hang of it, it
ROCKS!!!  But you DEFINITELY have to use grep a lot to find stuff.  You also
need to "unlearn" all the old Half-Life/Quake engine crap.  Dump all that
you know about Half-Life, free up some brain cells, and begin learning how
Source works.  Embrace the new technology.  Open your arms up WIDE and give
the Source SDK a BIG HUG.  :)

Jeffrey "botman" Broome

Okay. How the hell can a wall of code be artistic?

It looks like art?

Maybe if you understood what it does you’d see it differently.

Eh the art credit goes to the guy who put them together. You should be able to get interfaceFactory through either getting the engine/server/client dll’s respectively

Getting the physics interface/file system interface is a bit harder.

Thanks. You really helped me with that code.
I was unable to get IFileSystem or IBaseFileSystem on a dedicated server (there is no filesystem_steam.dll you could export it from). The code above made my day and helped me really much.

I have no idea why everyone votes you dumb - That workaround really helpfull if you get into such a situation!

Because most of the people on facepunch don’t have the experience you or I have. There is only a select few people who have been in the trenches of the source engine.

In this case, the rating reflects the level of intelligence of the people who gave the rating.

[ERROR] gmcl_extras: Error getting filesystem_steam.dll factory.

  1. unknown - [C]:-1
  2. require - [C]:-1
    3. Scan - lua/autorun/client/clientcheck.lua:181
    4. oldFunc - lua/autorun/client/clientcheck.lua:201
    5. v - addons/dbugr/lua/util/modules/sh_func.lua:80
    6. unknown - lua/includes/modules/hook.lua:82

can anyone tell me what this is

This is an error. Probably caused by the fact that this thing is 3 years old?

tarosekimoto what exactly do you need this module for?

[editline]28th October 2013[/editline]

awh yeah, iRzilla post from over 3 years ago.