Solvedgmod vtables or dylibs

Posts 1–15 of 26 · Page 1 of 2
gmod vtables or dylibs
hey whats up gamers,
anyone got gmod's latest vtables, or just dylibs?
Pretty sure some shit changed but it's the same for CSS, Createmove is 21, Paint is 41 Input it 8 I think
Quote Originally Posted by 0x28 View Post
Pretty sure some shit changed but it's the same for CSS, Createmove is 21, Paint is 41 Input it 8 I think
yes, but what i need is to call surface functions to drawalso yeah, p sure something's fucked up
Code:
const char *pszPanel = ipanel_ptr->GetName( panel ); 
	if( !strcmp(pszPanel, "MatSystemTopPanel") ) { 
		//Msg("MSTP\n");

	}
anything ran inside crashes gmod
Quote Originally Posted by fuckinggggg View Post
yes, but what i need is to call surface functions to drawalso yeah, p sure something's fucked up
Code:
const char *pszPanel = ipanel_ptr->GetName( panel ); 
	if( !strcmp(pszPanel, "MatSystemTopPanel") ) { 
		//Msg("MSTP\n");

	}
anything ran inside crashes gmod
My paint works, try OverlayPopupPanel instead.
Quote Originally Posted by 0x28 View Post
My paint works, try OverlayPopupPanel instead.
Same. This is my IPanel class.
Code:
typedef unsigned long VPANEL;

class KeyValues;

	class SurfacePlat;
	class IClientPanel;

	//!! must be removed
	class Panel;

	//-----------------------------------------------------------------------------
	// Purpose: interface from Client panels -> vgui panels
	//-----------------------------------------------------------------------------
	class IPanel
	{
	public:
		virtual void Init(VPANEL vguiPanel, IClientPanel *panel) = 0;

		// methods
		virtual void SetPos(VPANEL vguiPanel, int x, int y) = 0;
		virtual void GetPos(VPANEL vguiPanel, int &x, int &y) = 0;
		virtual void SetSize(VPANEL vguiPanel, int wide, int tall) = 0;
		virtual void GetSize(VPANEL vguiPanel, int &wide, int &tall) = 0;
		virtual void SetMinimumSize(VPANEL vguiPanel, int wide, int tall) = 0;
		virtual void GetMinimumSize(VPANEL vguiPanel, int &wide, int &tall) = 0;
		virtual void SetZPos(VPANEL vguiPanel, int z) = 0;
		virtual int  GetZPos(VPANEL vguiPanel) = 0;

		virtual void GetAbsPos(VPANEL vguiPanel, int &x, int &y) = 0;
		virtual void GetClipRect(VPANEL vguiPanel, int &x0, int &y0, int &x1, int &y1) = 0;
		virtual void SetInset(VPANEL vguiPanel, int left, int top, int right, int bottom) = 0;
		virtual void GetInset(VPANEL vguiPanel, int &left, int &top, int &right, int &bottom) = 0;

		virtual void SetVisible(VPANEL vguiPanel, bool state) = 0;
		virtual bool IsVisible(VPANEL vguiPanel) = 0;
		virtual void SetParent(VPANEL vguiPanel, VPANEL newParent) = 0;
		virtual int GetChildCount(VPANEL vguiPanel) = 0;
		virtual VPANEL GetChild(VPANEL vguiPanel, int index) = 0;
		virtual void* &GetChildren(VPANEL vguiPanel) = 0; // CUtlVector< VPANEL >
		virtual VPANEL GetParent(VPANEL vguiPanel) = 0;
		virtual void MoveToFront(VPANEL vguiPanel) = 0;
		virtual void MoveToBack(VPANEL vguiPanel) = 0;
		virtual bool HasParent(VPANEL vguiPanel, VPANEL potentialParent) = 0;
		virtual bool IsPopup(VPANEL vguiPanel) = 0;
		virtual void SetPopup(VPANEL vguiPanel, bool state) = 0;
		virtual bool IsFullyVisible(VPANEL vguiPanel) = 0;

		// gets the scheme this panel uses
		virtual void* GetScheme(VPANEL vguiPanel) = 0; // hscheme
		// gets whether or not this panel should scale with screen resolution
		virtual bool IsProportional(VPANEL vguiPanel) = 0;
		// returns true if auto-deletion flag is set
		virtual bool IsAutoDeleteSet(VPANEL vguiPanel) = 0;
		// deletes the Panel * associated with the vpanel
		virtual void DeletePanel(VPANEL vguiPanel) = 0;

		// input interest
		virtual void SetKeyBoardInputEnabled(VPANEL vguiPanel, bool state) = 0;
		virtual void SetMouseInputEnabled(VPANEL vguiPanel, bool state) = 0;
		virtual bool IsKeyBoardInputEnabled(VPANEL vguiPanel) = 0;
		virtual bool IsMouseInputEnabled(VPANEL vguiPanel) = 0;

		// calculates the panels current position within the hierarchy
		virtual void Solve(VPANEL vguiPanel) = 0;

		// gets names of the object (for debugging purposes)
		virtual const char *GetName(VPANEL vguiPanel) = 0;
		virtual const char *GetClassName(VPANEL vguiPanel) = 0;

		// delivers a message to the panel
		virtual void SendMessage(VPANEL vguiPanel, KeyValues *params, VPANEL ifromPanel) = 0;

		// these pass through to the IClientPanel
		virtual void Think(VPANEL vguiPanel) = 0;
		virtual void PerformApplySchemeSettings(VPANEL vguiPanel) = 0;
		virtual void PaintTraverse(VPANEL vguiPanel, bool forceRepaint, bool allowForce = true) = 0;
		virtual void Repaint(VPANEL vguiPanel) = 0;
		virtual VPANEL IsWithinTraverse(VPANEL vguiPanel, int x, int y, bool traversePopups) = 0;
		virtual void OnChildAdded(VPANEL vguiPanel, VPANEL child) = 0;
		virtual void OnSizeChanged(VPANEL vguiPanel, int newWide, int newTall) = 0;

		virtual void InternalFocusChanged(VPANEL vguiPanel, bool lost) = 0;
		virtual bool RequestInfo(VPANEL vguiPanel, KeyValues *outputData) = 0;
		virtual void RequestFocus(VPANEL vguiPanel, int direction = 0) = 0;
		virtual bool RequestFocusPrev(VPANEL vguiPanel, VPANEL existingPanel) = 0;
		virtual bool RequestFocusNext(VPANEL vguiPanel, VPANEL existingPanel) = 0;
		virtual VPANEL GetCurrentKeyFocus(VPANEL vguiPanel) = 0;
		virtual int GetTabPosition(VPANEL vguiPanel) = 0;

		// used by ISurface to store platform-specific data
		virtual SurfacePlat *Plat(VPANEL vguiPanel) = 0;
		virtual void SetPlat(VPANEL vguiPanel, SurfacePlat *Plat) = 0;

		// returns a pointer to the vgui controls baseclass Panel *
		// destinationModule needs to be passed in to verify that the returned Panel * is from the same module
		// it must be from the same module since Panel * vtbl may be different in each module
		virtual Panel *GetPanel(VPANEL vguiPanel, const char *destinationModule) = 0;

		virtual bool IsEnabled(VPANEL vguiPanel) = 0;
		virtual void SetEnabled(VPANEL vguiPanel, bool state) = 0;

		// Used by the drag/drop manager to always draw on top
		virtual bool IsTopmostPopup(VPANEL vguiPanel) = 0;
		virtual void SetTopmostPopup(VPANEL vguiPanel, bool state) = 0;

		virtual void SetMessageContextId(VPANEL vguiPanel, int nContextId) = 0;
		virtual int GetMessageContextId(VPANEL vguiPanel) = 0;

		virtual const void* *GetUnpackStructure(VPANEL vguiPanel) const = 0; // DmxElementUnpackStructure_t
		virtual void OnUnserialized(VPANEL vguiPanel, void* *pElement) = 0; // CDmxElemen

		// sibling pins
		virtual void SetSiblingPin(VPANEL vguiPanel, VPANEL newSibling, void* iMyCornerToPin = 0, void* iSiblingCornerToPinTo = 0) = 0; // bytes

	};
I grabbed it from the GMod SDK, but I think it's the only thing that could be wrong.
Quote Originally Posted by fuckinggggg View Post
Same. This is my IPanel class.
Code:
typedef unsigned long VPANEL;

class KeyValues;

	class SurfacePlat;
	class IClientPanel;

	//!! must be removed
	class Panel;

	//-----------------------------------------------------------------------------
	// Purpose: interface from Client panels -> vgui panels
	//-----------------------------------------------------------------------------
	class IPanel
	{
	public:
		virtual void Init(VPANEL vguiPanel, IClientPanel *panel) = 0;

		// methods
		virtual void SetPos(VPANEL vguiPanel, int x, int y) = 0;
		virtual void GetPos(VPANEL vguiPanel, int &x, int &y) = 0;
		virtual void SetSize(VPANEL vguiPanel, int wide, int tall) = 0;
		virtual void GetSize(VPANEL vguiPanel, int &wide, int &tall) = 0;
		virtual void SetMinimumSize(VPANEL vguiPanel, int wide, int tall) = 0;
		virtual void GetMinimumSize(VPANEL vguiPanel, int &wide, int &tall) = 0;
		virtual void SetZPos(VPANEL vguiPanel, int z) = 0;
		virtual int  GetZPos(VPANEL vguiPanel) = 0;

		virtual void GetAbsPos(VPANEL vguiPanel, int &x, int &y) = 0;
		virtual void GetClipRect(VPANEL vguiPanel, int &x0, int &y0, int &x1, int &y1) = 0;
		virtual void SetInset(VPANEL vguiPanel, int left, int top, int right, int bottom) = 0;
		virtual void GetInset(VPANEL vguiPanel, int &left, int &top, int &right, int &bottom) = 0;

		virtual void SetVisible(VPANEL vguiPanel, bool state) = 0;
		virtual bool IsVisible(VPANEL vguiPanel) = 0;
		virtual void SetParent(VPANEL vguiPanel, VPANEL newParent) = 0;
		virtual int GetChildCount(VPANEL vguiPanel) = 0;
		virtual VPANEL GetChild(VPANEL vguiPanel, int index) = 0;
		virtual void* &GetChildren(VPANEL vguiPanel) = 0; // CUtlVector< VPANEL >
		virtual VPANEL GetParent(VPANEL vguiPanel) = 0;
		virtual void MoveToFront(VPANEL vguiPanel) = 0;
		virtual void MoveToBack(VPANEL vguiPanel) = 0;
		virtual bool HasParent(VPANEL vguiPanel, VPANEL potentialParent) = 0;
		virtual bool IsPopup(VPANEL vguiPanel) = 0;
		virtual void SetPopup(VPANEL vguiPanel, bool state) = 0;
		virtual bool IsFullyVisible(VPANEL vguiPanel) = 0;

		// gets the scheme this panel uses
		virtual void* GetScheme(VPANEL vguiPanel) = 0; // hscheme
		// gets whether or not this panel should scale with screen resolution
		virtual bool IsProportional(VPANEL vguiPanel) = 0;
		// returns true if auto-deletion flag is set
		virtual bool IsAutoDeleteSet(VPANEL vguiPanel) = 0;
		// deletes the Panel * associated with the vpanel
		virtual void DeletePanel(VPANEL vguiPanel) = 0;

		// input interest
		virtual void SetKeyBoardInputEnabled(VPANEL vguiPanel, bool state) = 0;
		virtual void SetMouseInputEnabled(VPANEL vguiPanel, bool state) = 0;
		virtual bool IsKeyBoardInputEnabled(VPANEL vguiPanel) = 0;
		virtual bool IsMouseInputEnabled(VPANEL vguiPanel) = 0;

		// calculates the panels current position within the hierarchy
		virtual void Solve(VPANEL vguiPanel) = 0;

		// gets names of the object (for debugging purposes)
		virtual const char *GetName(VPANEL vguiPanel) = 0;
		virtual const char *GetClassName(VPANEL vguiPanel) = 0;

		// delivers a message to the panel
		virtual void SendMessage(VPANEL vguiPanel, KeyValues *params, VPANEL ifromPanel) = 0;

		// these pass through to the IClientPanel
		virtual void Think(VPANEL vguiPanel) = 0;
		virtual void PerformApplySchemeSettings(VPANEL vguiPanel) = 0;
		virtual void PaintTraverse(VPANEL vguiPanel, bool forceRepaint, bool allowForce = true) = 0;
		virtual void Repaint(VPANEL vguiPanel) = 0;
		virtual VPANEL IsWithinTraverse(VPANEL vguiPanel, int x, int y, bool traversePopups) = 0;
		virtual void OnChildAdded(VPANEL vguiPanel, VPANEL child) = 0;
		virtual void OnSizeChanged(VPANEL vguiPanel, int newWide, int newTall) = 0;

		virtual void InternalFocusChanged(VPANEL vguiPanel, bool lost) = 0;
		virtual bool RequestInfo(VPANEL vguiPanel, KeyValues *outputData) = 0;
		virtual void RequestFocus(VPANEL vguiPanel, int direction = 0) = 0;
		virtual bool RequestFocusPrev(VPANEL vguiPanel, VPANEL existingPanel) = 0;
		virtual bool RequestFocusNext(VPANEL vguiPanel, VPANEL existingPanel) = 0;
		virtual VPANEL GetCurrentKeyFocus(VPANEL vguiPanel) = 0;
		virtual int GetTabPosition(VPANEL vguiPanel) = 0;

		// used by ISurface to store platform-specific data
		virtual SurfacePlat *Plat(VPANEL vguiPanel) = 0;
		virtual void SetPlat(VPANEL vguiPanel, SurfacePlat *Plat) = 0;

		// returns a pointer to the vgui controls baseclass Panel *
		// destinationModule needs to be passed in to verify that the returned Panel * is from the same module
		// it must be from the same module since Panel * vtbl may be different in each module
		virtual Panel *GetPanel(VPANEL vguiPanel, const char *destinationModule) = 0;

		virtual bool IsEnabled(VPANEL vguiPanel) = 0;
		virtual void SetEnabled(VPANEL vguiPanel, bool state) = 0;

		// Used by the drag/drop manager to always draw on top
		virtual bool IsTopmostPopup(VPANEL vguiPanel) = 0;
		virtual void SetTopmostPopup(VPANEL vguiPanel, bool state) = 0;

		virtual void SetMessageContextId(VPANEL vguiPanel, int nContextId) = 0;
		virtual int GetMessageContextId(VPANEL vguiPanel) = 0;

		virtual const void* *GetUnpackStructure(VPANEL vguiPanel) const = 0; // DmxElementUnpackStructure_t
		virtual void OnUnserialized(VPANEL vguiPanel, void* *pElement) = 0; // CDmxElemen

		// sibling pins
		virtual void SetSiblingPin(VPANEL vguiPanel, VPANEL newSibling, void* iMyCornerToPin = 0, void* iSiblingCornerToPinTo = 0) = 0; // bytes

	};
I grabbed it from the GMod SDK, but I think it's the only thing that could be wrong.
Yea, you're right, it's wrong. Source sdk 2013 is what you want to use, not the alliedmodders gmod sdk
Quote Originally Posted by _haffy View Post
Yea, you're right, it's wrong. Source sdk 2013 is what you want to use, not the alliedmodders gmod sdk
diffchecker.com/wbkgdgbc

its the same except for the last 2 functions. still not working
Quote Originally Posted by fuckinggggg View Post
diffchecker.com/wbkgdgbc
its the same except for the last 2 functions. still not working
Yea, IPanel might be fine but I know for a fact that a lot of interfaces and structs are wrong (ISurface for example), but, it would help if we knew what exactly is causing your crash? Attach your debugger and check where and what is causing the crash.

You can add me if you need any help: http://steamcommunity.com/id/premiumshot69/
Quote Originally Posted by _haffy View Post
Yea, IPanel might be fine but I know for a fact that a lot of interfaces and structs are wrong (ISurface for example), but, it would help if we knew what exactly is causing your crash? Attach your debugger and check where and what is causing the crash.

You can add me if you need any help: snip
looks like const char in "*pszPanel = ipanel_ptr->GetName( panel )" pszPanel returns null pointer. I will add you later, if I can't manage to fix it - although it sounds strange.

edit:
checking if pszPanel is nullptr still crashes, always throws read access violation
Quote Originally Posted by fuckinggggg View Post
Same. This is my IPanel class.
Code:
typedef unsigned long VPANEL;

class KeyValues;

	class SurfacePlat;
	class IClientPanel;

	//!! must be removed
	class Panel;

	//-----------------------------------------------------------------------------
	// Purpose: interface from Client panels -> vgui panels
	//-----------------------------------------------------------------------------
	class IPanel
	{
	public:
		virtual void Init(VPANEL vguiPanel, IClientPanel *panel) = 0;

		// methods
		virtual void SetPos(VPANEL vguiPanel, int x, int y) = 0;
		virtual void GetPos(VPANEL vguiPanel, int &x, int &y) = 0;
		virtual void SetSize(VPANEL vguiPanel, int wide, int tall) = 0;
		virtual void GetSize(VPANEL vguiPanel, int &wide, int &tall) = 0;
		virtual void SetMinimumSize(VPANEL vguiPanel, int wide, int tall) = 0;
		virtual void GetMinimumSize(VPANEL vguiPanel, int &wide, int &tall) = 0;
		virtual void SetZPos(VPANEL vguiPanel, int z) = 0;
		virtual int  GetZPos(VPANEL vguiPanel) = 0;

		virtual void GetAbsPos(VPANEL vguiPanel, int &x, int &y) = 0;
		virtual void GetClipRect(VPANEL vguiPanel, int &x0, int &y0, int &x1, int &y1) = 0;
		virtual void SetInset(VPANEL vguiPanel, int left, int top, int right, int bottom) = 0;
		virtual void GetInset(VPANEL vguiPanel, int &left, int &top, int &right, int &bottom) = 0;

		virtual void SetVisible(VPANEL vguiPanel, bool state) = 0;
		virtual bool IsVisible(VPANEL vguiPanel) = 0;
		virtual void SetParent(VPANEL vguiPanel, VPANEL newParent) = 0;
		virtual int GetChildCount(VPANEL vguiPanel) = 0;
		virtual VPANEL GetChild(VPANEL vguiPanel, int index) = 0;
		virtual void* &GetChildren(VPANEL vguiPanel) = 0; // CUtlVector< VPANEL >
		virtual VPANEL GetParent(VPANEL vguiPanel) = 0;
		virtual void MoveToFront(VPANEL vguiPanel) = 0;
		virtual void MoveToBack(VPANEL vguiPanel) = 0;
		virtual bool HasParent(VPANEL vguiPanel, VPANEL potentialParent) = 0;
		virtual bool IsPopup(VPANEL vguiPanel) = 0;
		virtual void SetPopup(VPANEL vguiPanel, bool state) = 0;
		virtual bool IsFullyVisible(VPANEL vguiPanel) = 0;

		// gets the scheme this panel uses
		virtual void* GetScheme(VPANEL vguiPanel) = 0; // hscheme
		// gets whether or not this panel should scale with screen resolution
		virtual bool IsProportional(VPANEL vguiPanel) = 0;
		// returns true if auto-deletion flag is set
		virtual bool IsAutoDeleteSet(VPANEL vguiPanel) = 0;
		// deletes the Panel * associated with the vpanel
		virtual void DeletePanel(VPANEL vguiPanel) = 0;

		// input interest
		virtual void SetKeyBoardInputEnabled(VPANEL vguiPanel, bool state) = 0;
		virtual void SetMouseInputEnabled(VPANEL vguiPanel, bool state) = 0;
		virtual bool IsKeyBoardInputEnabled(VPANEL vguiPanel) = 0;
		virtual bool IsMouseInputEnabled(VPANEL vguiPanel) = 0;

		// calculates the panels current position within the hierarchy
		virtual void Solve(VPANEL vguiPanel) = 0;

		// gets names of the object (for debugging purposes)
		virtual const char *GetName(VPANEL vguiPanel) = 0;
		virtual const char *GetClassName(VPANEL vguiPanel) = 0;

		// delivers a message to the panel
		virtual void SendMessage(VPANEL vguiPanel, KeyValues *params, VPANEL ifromPanel) = 0;

		// these pass through to the IClientPanel
		virtual void Think(VPANEL vguiPanel) = 0;
		virtual void PerformApplySchemeSettings(VPANEL vguiPanel) = 0;
		virtual void PaintTraverse(VPANEL vguiPanel, bool forceRepaint, bool allowForce = true) = 0;
		virtual void Repaint(VPANEL vguiPanel) = 0;
		virtual VPANEL IsWithinTraverse(VPANEL vguiPanel, int x, int y, bool traversePopups) = 0;
		virtual void OnChildAdded(VPANEL vguiPanel, VPANEL child) = 0;
		virtual void OnSizeChanged(VPANEL vguiPanel, int newWide, int newTall) = 0;

		virtual void InternalFocusChanged(VPANEL vguiPanel, bool lost) = 0;
		virtual bool RequestInfo(VPANEL vguiPanel, KeyValues *outputData) = 0;
		virtual void RequestFocus(VPANEL vguiPanel, int direction = 0) = 0;
		virtual bool RequestFocusPrev(VPANEL vguiPanel, VPANEL existingPanel) = 0;
		virtual bool RequestFocusNext(VPANEL vguiPanel, VPANEL existingPanel) = 0;
		virtual VPANEL GetCurrentKeyFocus(VPANEL vguiPanel) = 0;
		virtual int GetTabPosition(VPANEL vguiPanel) = 0;

		// used by ISurface to store platform-specific data
		virtual SurfacePlat *Plat(VPANEL vguiPanel) = 0;
		virtual void SetPlat(VPANEL vguiPanel, SurfacePlat *Plat) = 0;

		// returns a pointer to the vgui controls baseclass Panel *
		// destinationModule needs to be passed in to verify that the returned Panel * is from the same module
		// it must be from the same module since Panel * vtbl may be different in each module
		virtual Panel *GetPanel(VPANEL vguiPanel, const char *destinationModule) = 0;

		virtual bool IsEnabled(VPANEL vguiPanel) = 0;
		virtual void SetEnabled(VPANEL vguiPanel, bool state) = 0;

		// Used by the drag/drop manager to always draw on top
		virtual bool IsTopmostPopup(VPANEL vguiPanel) = 0;
		virtual void SetTopmostPopup(VPANEL vguiPanel, bool state) = 0;

		virtual void SetMessageContextId(VPANEL vguiPanel, int nContextId) = 0;
		virtual int GetMessageContextId(VPANEL vguiPanel) = 0;

		virtual const void* *GetUnpackStructure(VPANEL vguiPanel) const = 0; // DmxElementUnpackStructure_t
		virtual void OnUnserialized(VPANEL vguiPanel, void* *pElement) = 0; // CDmxElemen

		// sibling pins
		virtual void SetSiblingPin(VPANEL vguiPanel, VPANEL newSibling, void* iMyCornerToPin = 0, void* iSiblingCornerToPinTo = 0) = 0; // bytes

	};
I grabbed it from the GMod SDK, but I think it's the only thing that could be wrong.
surface inherits AppSystem
Quote Originally Posted by fuckinggggg View Post
looks like const char in "*pszPanel = ipanel_ptr->GetName( panel )" pszPanel returns null pointer. I will add you later, if I can't manage to fix it - although it sounds strange.

edit:
checking if pszPanel is nullptr still crashes, always throws read access violation
Try GetClassName instead
Quote Originally Posted by _haffy View Post
Try GetClassName instead
if you look at the sdk for 15 minutes you can see there is a billions time better way to check panel without using strings

and thread creator guy show us your painttraverse prototype
Quote Originally Posted by D3M0L1T10N View Post
if you look at the sdk for 15 minutes you can see there is a billions time better way to check panel without using strings

and thread creator guy show us your painttraverse prototype
like checking if its PANEL_ROOT?

anyways i just copy pasted mpgh.net/forum/showthread.php?t=860780
and i hook like this:
Code:
CVMTHookManager *panel_vmt;
	if (panel_vmt = new CVMTHookManager((DWORD**)ipanel_ptr))

		print(COLOR_GREEN, "IPanel VMT Hooked!\n");
	else
		Warning("Failed to hook IPanel VMT!\n");


	if (oPaintTraverse = (PaintTraverseFn)panel_vmt->dwHookMethod((DWORD)hooked_PaintTraverse, 41))
		print(COLOR_GREEN, "PaintTraverse hooked!\n");
	else
		Warning("Failed to hook PaintTraverse!\n");
heres the hooked ptrav
Code:
void __stdcall hooked_PaintTraverse(VPANEL panel, bool forceRepaint, bool allowForce) {
	oPaintTraverse(panel, forceRepaint, allowForce);
	const char *pszPanel = ipanel_ptr->GetName( panel );
	if(!strcmp(pszPanel, "MatSystemTopPanel") ) {
		//isurface_ptr->DrawLine(20,20,400,400);
		Msg("mstp\n");

	}
}
Quote Originally Posted by fuckinggggg View Post
like checking if its PANEL_ROOT?

anyways i just copy pasted mpgh.net/forum/showthread.php?t=860780
and i hook like this:
Code:
CVMTHookManager *panel_vmt;
	if (panel_vmt = new CVMTHookManager((DWORD**)ipanel_ptr))

		print(COLOR_GREEN, "IPanel VMT Hooked!\n");
	else
		Warning("Failed to hook IPanel VMT!\n");


	if (oPaintTraverse = (PaintTraverseFn)panel_vmt->dwHookMethod((DWORD)hooked_PaintTraverse, 41))
		print(COLOR_GREEN, "PaintTraverse hooked!\n");
	else
		Warning("Failed to hook PaintTraverse!\n");
heres the hooked ptrav
Code:
void __stdcall hooked_PaintTraverse(VPANEL panel, bool forceRepaint, bool allowForce) {
	oPaintTraverse(panel, forceRepaint, allowForce);
	const char *pszPanel = ipanel_ptr->GetName( panel );
	if(!strcmp(pszPanel, "MatSystemTopPanel") ) {
		//isurface_ptr->DrawLine(20,20,400,400);
		Msg("mstp\n");

	}
}
idk why your using stdcall convention

show me how you get your ipanel interface
Quote Originally Posted by D3M0L1T10N View Post
idk why your using stdcall convention

show me how you get your ipanel interface
using stdcall because it cleans up the stack for me, although i know its not the "correct" way

thats how i get my ipanel interface
Code:
IPanel *ipanel_ptr;
CreateInterfaceFn vInterface = (CreateInterfaceFn)GetProcAddress(GetModuleHandleA("vgui2.dll"), "CreateInterface");
ipanel_ptr = (IPanel*)vInterface("VGUI_Panel009", 0);
	if (!ipanel_ptr)
		Warning("ERROR: Failed to get IPanel!\n");
	else
		print(COLOR_GREEN, "IPanel found!                       0x%p\n", ipanel_ptr);
Posts 1–15 of 26 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us