View Single Post
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 02-02-2017 , 00:33   Re: StudioSetupBones Fix for CS
Reply With Quote #20

Quote:
Originally Posted by joropito View Post
Ok, I know this is very old

I don't know if there's other thread related to this but after some question that Rirre sent to me, I've checked few things and this is very interesting.


Engine at startup (Host_InitializeGameDLL) set up the blending interface API for game dll (dlsym on gamedll for Server_GetBlendingInterface).

This is what is called on CS library:

PHP Code:
Server_GetBlendingInterface(1, &g_pSvBlendingAPIserver_studio_apirotationmatrixbonetransform
Where



IEngineStudio struct (engine exported)

PHP Code:
struct server_studio_api_s {
        
void *                     (*Mem_Calloc)(intsize_t); /*     0     4 */
        
void *                     (*Cache_Check)(class cache_user_s *); /*     4     4 */
        
void                       (*LoadCacheFile)(char *, class cache_user_s *); /*     8     4 */
        
void *                     (*Mod_Extradata)(class model_s *); /*    12     4 */

        /* size: 16, cachelines: 1, members: 4 */
        /* last cacheline: 16 bytes */
}; 
Anyone that knows how goldsrc API works could handle this. I thing hooking this setup with a small metamod module could be the best way to get SV_StudioSetupBones both on windows and linux.

Also, this is the correct prototype:

PHP Code:
SV_StudioSetupBones(model_s *, floatint, const vec_t  *, const vec_t  *, const byte  *, const byte  *, int, const edict_t  *); 
By just giving a look to the engine, it seems you can retrieve both functions addresses without using memory patches. Nice
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline