2 ;; (C)2005-2007 AlliedModders LLC
3 ;; By the Metamod:Source Development Team
4 ;; This software is licensed under the zlib/libpng free software license.
6 ;; This assembly file is a short thunk wrapper to let us load as a VSP and exit quietly,
7 ;; without any overhead of the rest of the interface, and also to prevent linking against
12 ;; void GetBaseDir(char *buffer, maxlength);
13 ;; void *GetThisPointer();
15 ;; void LoadFunction();
19 global GetThisPointer, GetGameDir
20 global _GetThisPointer, _GetGameDir
25 mov eax, GLOBAL_POINTER
33 mov ecx, [engine] ;get this pointer
34 mov edx, [ecx] ;get the vtable
36 push ecx ;push this pointer
38 push dword [ebp+12] ;push maxlenth
39 push dword [ebp+8] ;push buffer
40 call dword [edx+216] ;call IVEngineServer::GetGameDir
42 add esp, 8 ;correct stack
56 push dword VENGINESERVER ;iface name
57 call eax ;call factory
58 add esp, 8 ;correct stack
60 test eax, eax ;do we have a valid pointer?
63 mov [engine], eax ;store the engine pointer
68 ;We never load, never ever ever!
81 INTERFACE_NAME DB "ISERVERPLUGINCALLBACKS001", 0
82 VENGINESERVER DB "VEngineServer021", 0
84 VIRTUAL_TABLE DD thisLoadFunction
86 ;We don't need any more of the vtable here
88 GLOBAL_POINTER DD VIRTUAL_TABLE