Raised This Month: $32 Target: $400
 8% 

CSoundEnvelopeController interface


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 08-20-2016 , 10:52   CSoundEnvelopeController interface
Reply With Quote #1

I'm trying to get CSoundEnvelopeController interface, but I can't find a way to, is there any?
kadet.89 is offline
Send a message via Skype™ to kadet.89
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 08-21-2016 , 13:51   Re: CSoundEnvelopeController interface
Reply With Quote #2

It doesn't seem to have an interface. Which isn't a surprise since Valve names its interfaces starting with an I (i.e. ISoundSystem or ISoundEmitterSystemBase)
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 08-21-2016 at 13:52.
Powerlord is offline
donrevan
AlliedModders Donor
Join Date: Jul 2010
Old 08-22-2016 , 15:52   Re: CSoundEnvelopeController interface
Reply With Quote #3

Ghetto way for windows:
I'm not 100% sure if gamedata is still up2date..

PHP Code:

// sigscan references to a func that returns the SoundEnvelopeController
static CSoundEnvelopeController *GetSoundController()
{
    
// "Invalid starting duration value in env" bellow 2, first function
    
META_CONPRINTF("[%s] Getting Soundcontroller - "g_Monster.GetLogTag());
    
DWORD pGetSoundCtrl_Call;
    if(!
g_pGameConf->GetMemSig("g_SoundController", (void**)&pGetSoundCtrl_Call))
    {
        
META_CONPRINT("Failed\n");
        
META_CONPRINTF("[%s] Couldn't find sig: g_SoundController"g_Monster.GetLogTag());
        return 
NULL;
    }
    
int pGetSoundCtrl_Offs;
    if(!
g_pGameConf->GetOffset("g_SoundController", &pGetSoundCtrl_Offs))
    {
        
META_CONPRINT("Failed\n");
        
META_CONPRINTF("[%s] Couldn't find offs: g_SoundController"g_Monster.GetLogTag());
        return 
NULL;
    }
    
META_CONPRINTF("Success\n");

    
typedef CSoundEnvelopeController* (*GetSoundCtrler_t)();
    
pGetSoundCtrl_Call += pGetSoundCtrl_Offs// point to call offset E8 >?? ?? ?? ??<
    
DWORD dwJmpOffs = *(DWORD*)pGetSoundCtrl_Call;
    
GetSoundCtrler_t getSoundController = (GetSoundCtrler_t)(pGetSoundCtrl_Call dwJmpOffs);
    return 
getSoundController();
}

/////// GAMEDATAA
// sigs
"g_SoundController"    // "Invalid starting duration value in enve" the down 2 func , first 8B
{
                
"library"    "server"
                "windows"    "\x76\x1B\xE8\x2A\x2A\x2A\x2A\xFF\x36\x8B\xC8\x8B\x10\xFF\x52\x28"
                "linux"     "@_ZL12g_Controller"
 
}
// offsets
"g_SoundController"
{
                
"windows"    "3"

@Powerlord: it's actually a interface soundenvelope.h

Last edited by donrevan; 08-22-2016 at 15:53.
donrevan is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 08-22-2016 , 18:22   Re: CSoundEnvelopeController interface
Reply With Quote #4

Quote:
Originally Posted by donrevan View Post
@Powerlord: it's actually a interface soundenvelope.h
Not in the srcds sense. If it was, you'd have a define with the interface name which you can use from MetaMod Source plugins / SourceMod extensions to grab a pointer to it using GET_V_IFACE_ANY / GET_V_IFACE_CURRENT
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
psychonic

BAFFLED
Join Date: May 2008
Old 08-22-2016 , 19:49   Re: CSoundEnvelopeController interface
Reply With Quote #5

It's an interface. It's not an exposed/public interface.
psychonic is offline
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 08-26-2016 , 15:26   Re: CSoundEnvelopeController interface
Reply With Quote #6

donrevan, thanks for the example, it definitely works, though I always try to avoid such sort of decisions. In this particular case the subroutine is very small, and if the binary is updated it would be difficult to update the gamedata.

Last edited by kadet.89; 08-26-2016 at 15:28.
kadet.89 is offline
Send a message via Skype™ to kadet.89
donrevan
AlliedModders Donor
Join Date: Jul 2010
Old 08-26-2016 , 17:13   Re: CSoundEnvelopeController interface
Reply With Quote #7

It doesn't really matter if GetSoundCtrler_t is updated or not, it finds a function in the code that is using it. From there you get the CALL offset and figure out where GetSoundCtrler_t is located..

You don't really have any other choice. Though, you could try to re-create what the function does (it is probably just a getter).. If I remember correctly I opted for the first method as I failed to pin down the pointer to the sound controller instance.

Last edited by donrevan; 08-26-2016 at 17:18.
donrevan is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:27.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode