SolvedCrash when hooking overrideview

Posts 1–9 of 9 · Page 1 of 1
Crash when hooking overrideview
When i try to hook my overrideview stuff it crashes every time...
Code for hooking:
Code:
VMTOverrideView.Initialise((DWORD*)Interfaces::OverrideView);
VMTOverrideView.HookMethod((DWORD)&OverrideView, 36);
Any ideas?
I think the problem is the hookmethod.
Yea, OverrideView is 18 in IClientMode.
VMTOverrideView.Initialise((DWORD*)Interfaces::Ove rrideView);
VMTOverrideView.HookMethod((DWORD)&OverrideView, 18);

Still crashing :/
Attach a debugger and see if it's crashing when hooking or in the function ( which should be _fastcall ).
Code:
namespace Interfaces
{
	IBaseClientDLL* Client;
	IVEngineClient* Engine;
	IPanel* Panels;
	IClientEntityList* EntList;
	ISurface* Surface;
	IVDebugOverlay* DebugOverlay;
	DWORD *ClientMode;
	CGlobalVarsBase *Globals;
	DWORD *Prediction;
	CMaterialSystem* MaterialSystem;
	CVRenderView* RenderView;
	IVModelRender* ModelRender;
	CModelInfo* ModelInfo;
	IEngineTrace* Trace;
	IPhysicsSurfaceProps* PhysProps;
	ICVar *CVar;
	IVEffects* Dilight;
	IInputSystem* InputSys;
	CViewSetup* OverrideView;
};
Code:
	VMTOverrideView.Initialise((DWORD*)Interfaces::OverrideView);
	VMTOverrideView.HookMethod((DWORD)&OverrideView, 18);
Code:
extern void __stdcall OverrideView(CViewSetup* vsView);
typedef void(__stdcall *OverrideViewFn)(CViewSetup*);
extern OverrideViewFn oOverrideView;


// VMT Managers
namespace Hooks
{
	// VMT Managers
	Utilities::Memory::VMTManager VMTPanel; // Hooking drawing functions
	Utilities::Memory::VMTManager VMTClient; // Maybe CreateMove
	Utilities::Memory::VMTManager VMTClientMode; // CreateMove for functionality
	Utilities::Memory::VMTManager VMTModelRender; // DrawModelEx for chams
	Utilities::Memory::VMTManager VMTPrediction; // InPrediction for no vis recoil
	Utilities::Memory::VMTManager VMTOverrideView;
};
Code:
OverrideViewFn oOverrideView;
void __stdcall OverrideView(CViewSetup* vsView)
{
	if (Interfaces::Engine->IsInGame())
	{
		vsView->fov = 169; //just for testing
	}
		oOverrideView(vsView);
}
Code:
namespace Interfaces
{
	// Gets handles to all the interfaces needed
	void Initialise();

	extern IBaseClientDLL* Client;
	extern IVEngineClient* Engine;
	extern IPanel* Panels;
	extern IClientEntityList* EntList;
	extern ISurface* Surface;
	extern IVDebugOverlay* DebugOverlay;
	extern DWORD *ClientMode;
	extern CGlobalVarsBase *Globals;
	extern DWORD *Prediction;
	extern CMaterialSystem* MaterialSystem;
	extern CVRenderView* RenderView;
	extern IVModelRender* ModelRender;
	extern CModelInfo* ModelInfo;
	extern IEngineTrace* Trace;
	extern IPhysicsSurfaceProps* PhysProps;
	extern ICVar *CVar;
	extern IVEffects* Dilight;
	extern IInputSystem* InputSys;
	extern CViewSetup* OverrideView;
};
All my stuff here

- - - Updated - - -

Quote Originally Posted by ActualCheats View Post
Attach a debugger and see if it's crashing when hooking or in the function ( which should be _fastcall ).
http://prntscr.com/cj976l
Use this CViewSetup and test, idk maybe it'll work.

Code:
class CViewSetup
{
public:
	int			x, x_old;
	int			y, y_old;
	int			width, width_old;
	int			height, height_old;
	bool		m_bOrtho;
	float		m_OrthoLeft;
	float		m_OrthoTop;
	float		m_OrthoRight;
	float		m_OrthoBottom;
	bool		m_bCustomViewMatrix;
	matrix3x4	m_matCustomViewMatrix;
	char		pad_0x68[0x48];
	float		fov;
	float		fovViewmodel;
	Vector3		origin;
	Vector3		angles;
	float		zNear;
	float		zFar;
	float		zNearViewmodel;
	float		zFarViewmodel;
	float		m_flAspectRatio;
	float		m_flNearBlurDepth;
	float		m_flNearFocusDepth;
	float		m_flFarFocusDepth;
	float		m_flFarBlurDepth;
	float		m_flNearBlurRadius;
	float		m_flFarBlurRadius;
	int			m_nDoFQuality;
	int			m_nMotionBlurMode;
	float		m_flShutterTime;
	Vector3		m_vShutterOpenPosition;
	Vector3		m_shutterOpenAngles;
	Vector3		m_vShutterClosePosition;
	Vector3		m_shutterCloseAngles;
	float		m_flOffCenterTop;
	float		m_flOffCenterBottom;
	float		m_flOffCenterLeft;
	float		m_flOffCenterRight;
	int			m_EdgeBlur;
};
And are you using a base?
ty for helping guys, i fineally got it working
http://prntscr.com/cj9gj8
With this code:

VMTOverrideView.Initialise((DWORD*)Interfaces::Cli entMode);
oOverrideView = (OverrideViewFn)VMTOverrideView.HookMethod((DWORD) &OverrideView, 18);
Posts 1–9 of 9 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us