Page 1 of 3 123 LastLast
Results 1 to 15 of 39
  1. #1
    Herp Derpinstine's Avatar
    Join Date
    Apr 2014
    Gender
    male
    Location
    Drug Induced Rainbow
    Posts
    134
    Reputation
    10
    Thanks
    87
    My Mood
    Psychedelic

    Post Fast Dynamic NetVar Offset and Hook System


    This should work on any Source Engine game. Enjoy.



    Could be better but I wrote and tested this in under 15 minutes.

    CNetVarMgr.h
    Code:
    class CNetVarMgr_NetVar
    {
    public:
    	CNetVarMgr_NetVar(const char* DataTable_Name = NULL, const char* NetVar_Name = NULL, RecvVarProxyFn Hook_Proxy = NULL);
    	const char* GetDataTableName();
    	void SetDataTableName(const char* DataTable_Name = NULL);
    	const char* GetNetVarName();
    	void SetNetVarName(const char* NetVar_Name = NULL);
    	int GetOffset();
    	void SetOffset(int Offset = NULL);
    	RecvVarProxyFn GetOriginalProxy();
    	void SetOriginalProxy(RecvVarProxyFn Original_Proxy = NULL);
    	RecvVarProxyFn GetHookProxy();
    	void SetHookProxy(RecvVarProxyFn Hook_Proxy = NULL);
    private:
    	const char* datatable_name = NULL;
    	const char* netvar_name = NULL;
    	int offset = NULL;
    	RecvVarProxyFn original_proxy = NULL;
    	RecvVarProxyFn hook_proxy = NULL;
    };
    
    class CNetVarMgr_Que
    {
    public:
    	CNetVarMgr_Que(const char* DataTable_Name, CNetVarMgr_NetVar* &Manager_Variable);
    	const char* GetDataTableName();
    	void SetDataTableName(const char* DataTable_Name = NULL);
    	CNetVarMgr_NetVar* GetNetVar(UINT Index = NULL);
    	CNetVarMgr_NetVar* GetNetVar(const char* NetVar_Name = NULL);
    	void AddNetVar(CNetVarMgr_NetVar* &Manager_Variable);
    	CNetVarMgr_NetVar* Back();
    	void Clear();
    private:
    	const char* datatable_name;
    	std::vector<CNetVarMgr_NetVar*>netvars;
    };
    
    class CNetVarMgr
    {
    public:
    	void Initialize();
    	CNetVarMgr_Que* GetQue(UINT Index = NULL);
    	CNetVarMgr_Que* GetQue(const char* DataTable_Name = NULL);
    	void Get(const char* DataTable_Name, const char* NetVar_Name, CNetVarMgr_NetVar* &Manager_Variable, RecvVarProxyFn Hook_Proxy = NULL);
    	void CreateQue();
    	void RunQue();
    	void ClearQue();
    
    	// PUT NETVAR MANAGER VARIABLES HERE
    	// EXAMPLE:
    	// CNetVarMgr_NetVar* m_angEyeAngles_x;
    
    private:
    	std::vector<CNetVarMgr_Que*>que;
    };
    
    extern CNetVarMgr g_NetVarMgr;
    CNetVarMgr.cpp
    Code:
    #include "CNetVarMgr.h"
    
    CNetVarMgr g_NetVarMgr;
    
    void CNetVarMgr::CreateQue()
    {
    	// GET AND HOOK NETVARS HERE
    	// Get(DATATABLE_NAME, NETVAR_NAME, NETVAR_MANAGER_VARIABLE, NETVAR_PROXY_HOOK)
    	
    	// GET EXAMPLE:
    	// Get("DT_GMOD_Player", "m_angEyeAngles[0]", m_angEyeAngles_x);
    
    	// HOOK EXAMPLE:
    	// Get("DT_GMOD_Player", "m_angEyeAngles[0]", m_angEyeAngles_x, Hooked_m_angEyeAngles_x);
    }
    
    void CNetVarMgr::Initialize()
    {
    	CreateQue();
    	RunQue();
    	ClearQue();
    }
    
    CNetVarMgr_Que* CNetVarMgr::GetQue(UINT Index)
    {
    	return que[Index];
    }
    
    CNetVarMgr_Que* CNetVarMgr::GetQue(const char* DataTable_Name)
    {
    	CNetVarMgr_Que* output_que = nullptr;
    	for (UINT i = 0; i < que.size(); i++)
    	{
    		CNetVarMgr_Que* tmp_que = GetQue(i);
    		if (tmp_que)
    		{
    			if (strcmp(tmp_que->GetDataTableName(), DataTable_Name) == 0)
    			{
    				output_que = tmp_que;
    				break;
    			}
    		}
    	}
    	return output_que;
    }
    
    void CNetVarMgr::Get(const char* DataTable_Name, const char* NetVar_Name, CNetVarMgr_NetVar* &Manager_Variable, RecvVarProxyFn Hook_Proxy)
    {
    	Manager_Variable = new CNetVarMgr_NetVar(DataTable_Name, NetVar_Name, Hook_Proxy);
    	CNetVarMgr_Que* tmp_que = GetQue(DataTable_Name);
    	if (tmp_que)
    	{
    		tmp_que->AddNetVar(Manager_Variable);
    	}
    	else
    	{
    		que.push_back(new CNetVarMgr_Que(DataTable_Name, Manager_Variable));
    	}
    }
    
    void CNetVarMgr::RunQue()
    {
    	for (ClientClass* clientclass = g_pClient->GetAllClasses(); clientclass; clientclass = clientclass->m_pNext)
    	{
    		RecvTable* classtbl = clientclass->m_pRecvTable;
    		CNetVarMgr_Que* tmp_que = GetQue(classtbl->GetName());
    		if (tmp_que)
    		{
    			RecvProp* props[3];
    			CNetVarMgr_NetVar* tmp_netvars[3];
    			for (int n1 = 0; n1 < classtbl->GetNumProps(); ++n1)
    			{
    				props[0] = classtbl->GetProp(n1);
    				if (isdigit(props[0]->m_pVarName[0]))
    					continue;
    				tmp_netvars[0] = tmp_que->GetNetVar(props[0]->GetName());
    				if (tmp_netvars[0])
    				{
    					tmp_netvars[0]->SetOffset(props[0]->GetOffset());
    					tmp_netvars[0]->SetOriginalProxy(props[0]->GetProxyFn());
    					if (tmp_netvars[0]->GetHookProxy())
    					{
    						props[0]->SetProxyFn(tmp_netvars[0]->GetHookProxy());
    					}
    				}
    				if (!props[0]->m_pDataTable)
    					continue;
    				for (int n2 = 0; n2 < props[0]->m_pDataTable->m_nProps; ++n2)
    				{
    					props[1] = props[0]->m_pDataTable->GetProp(n2);
    					if (isdigit(props[1]->m_pVarName[0]))
    						continue;
    					tmp_netvars[1] = tmp_que->GetNetVar(props[1]->GetName());
    					if (tmp_netvars[1])
    					{
    						tmp_netvars[1]->SetOffset(props[1]->GetOffset());
    						tmp_netvars[1]->SetOriginalProxy(props[1]->GetProxyFn());
    						if (tmp_netvars[1]->GetHookProxy())
    						{
    							props[1]->SetProxyFn(tmp_netvars[1]->GetHookProxy());
    						}
    					}
    					if (!props[1]->m_pDataTable)
    						continue;
    					for (int n3 = 0; n3 < props[1]->m_pDataTable->m_nProps; ++n3)
    					{
    						props[2] = props[1]->m_pDataTable->GetProp(n3);
    						if (isdigit(props[2]->m_pVarName[0]))
    							continue;
    						tmp_netvars[2] = tmp_que->GetNetVar(props[2]->GetName());
    						if (tmp_netvars[2])
    						{
    							tmp_netvars[2]->SetOffset(props[2]->GetOffset());
    							tmp_netvars[2]->SetOriginalProxy(props[2]->GetProxyFn());
    							if (tmp_netvars[2]->GetHookProxy())
    							{
    								props[2]->SetProxyFn(tmp_netvars[2]->GetHookProxy());
    							}
    						}
    					}
    				}
    			}
    		}
    	}
    }
    
    void CNetVarMgr::ClearQue()
    {
    	for (UINT i = 0; i < que.size(); i++)
    	{
    		CNetVarMgr_Que* tmp_que = GetQue(i);
    		if (tmp_que)
    		{
    			tmp_que->Clear();
    		}
    	}
    	que.clear();
    }
    
    CNetVarMgr_Que::CNetVarMgr_Que(const char* DataTable_Name, CNetVarMgr_NetVar* &Manager_Variable)
    {
    	SetDataTableName(DataTable_Name);
    	AddNetVar(Manager_Variable);
    }
    
    const char* CNetVarMgr_Que::GetDataTableName()
    {
    	return datatable_name;
    }
    
    void CNetVarMgr_Que::SetDataTableName(const char* DataTable_Name)
    {
    	datatable_name = DataTable_Name;
    }
    
    CNetVarMgr_NetVar* CNetVarMgr_Que::GetNetVar(UINT Index)
    {
    	return netvars[Index];
    }
    
    CNetVarMgr_NetVar* CNetVarMgr_Que::GetNetVar(const char* NetVar_Name)
    {
    	CNetVarMgr_NetVar* output_netvar = nullptr;
    	for (UINT i = 0; i < netvars.size(); i++)
    	{
    		CNetVarMgr_NetVar* tmp_netvar = GetNetVar(i);
    		if (tmp_netvar)
    		{
    			if (strcmp(tmp_netvar->GetNetVarName(), NetVar_Name) == 0)
    			{
    				output_netvar = tmp_netvar;
    				break;
    			}
    		}
    	}
    	return output_netvar;
    }
    
    void CNetVarMgr_Que::AddNetVar(CNetVarMgr_NetVar* &Manager_Variable)
    {
    	netvars.push_back(Manager_Variable);
    }
    
    CNetVarMgr_NetVar* CNetVarMgr_Que::Back()
    {
    	return netvars.back();
    }
    
    void CNetVarMgr_Que::Clear()
    {
    	netvars.clear();
    }
    
    CNetVarMgr_NetVar::CNetVarMgr_NetVar(const char* DataTable_Name, const char* NetVar_Name, RecvVarProxyFn Hook_Proxy)
    {
    	SetDataTableName(DataTable_Name);
    	SetNetVarName(NetVar_Name);
    	SetHookProxy(Hook_Proxy);
    }
    
    const char* CNetVarMgr_NetVar::GetDataTableName()
    {
    	return datatable_name;
    }
    
    void CNetVarMgr_NetVar::SetDataTableName(const char* DataTable_Name)
    {
    	datatable_name = DataTable_Name;
    }
    
    const char* CNetVarMgr_NetVar::GetNetVarName()
    {
    	return netvar_name;
    }
    
    void CNetVarMgr_NetVar::SetNetVarName(const char* NetVar_Name)
    {
    	netvar_name = NetVar_Name;
    }
    
    int CNetVarMgr_NetVar::GetOffset()
    {
    	return offset;
    }
    
    void CNetVarMgr_NetVar::SetOffset(int Offset)
    {
    	offset = Offset;
    }
    
    RecvVarProxyFn CNetVarMgr_NetVar::GetOriginalProxy()
    {
    	return original_proxy;
    }
    
    void CNetVarMgr_NetVar::SetOriginalProxy(RecvVarProxyFn Original_Proxy)
    {
    	original_proxy = Original_Proxy;
    }
    
    RecvVarProxyFn CNetVarMgr_NetVar::GetHookProxy()
    {
    	return hook_proxy;
    }
    
    void CNetVarMgr_NetVar::SetHookProxy(RecvVarProxyFn Hook_Proxy)
    {
    	hook_proxy = Hook_Proxy;
    }

    Call g_NetVarMgr.Initialize() when you want your NetVars to be found.

    Call GetOffset() of the NetVar Manager Variable to get the Offset of the stored NetVar.

    Call GetOriginalProxy() of the NetVar Manager Variable to get and/or run the Original Proxy of the stored NetVar.
    Mostly just used inside of your NetVar Proxy Hook.


    EXPLANATION

    For the sake of this explanation lets say you already have a Dynamic NetVar Offset System and that it is only 1 function.
    Something along the lines of GetOffset(DATATABLE, NETVAR) that scans the Client Classes and returns the Offset.
    m_Local: 237
    m_vecPunchAngle: 505
    m_hConstraintEntity: 1601
    m_iHealth: 1960
    m_lifeState: 3219
    m_iObserverMode: 3565
    m_hObserverTarget: 3912
    m_fFlags: 4257
    m_iTeamNum: 4453
    m_hOwnerEntity: 4653
    m_hActiveWeapon: 4942
    m_iClip1: 5215
    m_iClip2: 5497
    m_flNextPrimaryAttack: 5784
    m_flNextSecondaryAttack: 6068
    m_nTickBase: 6388
    m_vecOrigin: 6596
    m_vecViewOffset[0]: 6875
    m_vecViewOffset[1]: 7174
    m_vecViewOffset[2]: 7474
    Above is a chart of NetVars that I used in order with a 1 function Offset System.
    Next to the NetVars in the chart is the approximate total number of for statement loops it has to go through before getting the NetVar.

    IE: ( Loops_Before_GetOffset_Function_Call + Loops_to_NetVar )

    Using the IE above the total loop count will always be the largest loop count displayed.

    An approximate total of 7474 loops to get all 20 of those NetVars. A bit excessive even when you get all NetVars only once.

    However, when I use the same NetVars in the same order with my system this is what it displays.
    m_Local: 237
    m_vecPunchAngle: 248
    m_hConstraintEntity: 323
    m_iHealth: 339
    m_lifeState: 340
    m_iObserverMode: 345
    m_hObserverTarget: 346
    m_fFlags: 344
    m_iTeamNum: 361
    m_hOwnerEntity: 365
    m_hActiveWeapon: 491
    m_iClip1: 624
    m_iClip2: 625
    m_flNextPrimaryAttack: 630
    m_flNextSecondaryAttack: 631
    m_nTickBase: 315
    m_vecOrigin: 354
    m_vecViewOffset[0]: 278
    m_vecViewOffset[1]: 279
    m_vecViewOffset[2]: 280
    An approximate total of 631 loops to get all 20 NetVars.
    6843 loops less than before to do exactly the same thing.

    The loop count of my system may seem a little wierd because my system organizes the NetVars by DataTable in the Que.

    Also the first NetVar you add will either have a loop count equal to or a little more than the 1 function Offset System
    due to the Que's vector size.

    If you see a mistake or something that could be improved let me know. I am always open to helpful ideas.
    Last edited by Herp Derpinstine; 07-13-2015 at 06:01 PM.

  2. The Following 2 Users Say Thank You to Herp Derpinstine For This Useful Post:

    Ecco2000 (07-21-2015),yashine59fr (02-18-2017)

  3. #2
    c0deine's Avatar
    Join Date
    Feb 2015
    Gender
    male
    Posts
    190
    Reputation
    10
    Thanks
    167
    My Mood
    Aggressive
    hello hacker fucker

  4. #3
    Herp Derpinstine's Avatar
    Join Date
    Apr 2014
    Gender
    male
    Location
    Drug Induced Rainbow
    Posts
    134
    Reputation
    10
    Thanks
    87
    My Mood
    Psychedelic
    Quote Originally Posted by c0deine View Post
    hello hacker fucker
    Hello fellow supporter of the Down with Jim Morrison campaign.

  5. #4
    ehex's Avatar
    Join Date
    Dec 2011
    Gender
    male
    Posts
    150
    Reputation
    22
    Thanks
    555
    this is way bigger than it needs to be, and have you ever heard of recursion? i dont know what i expected from you sperginstine

    why not use c++11 and do recursive calls to get all netvars in like 10 lines or is that too hard for you?
    Last edited by ehex; 07-13-2015 at 07:33 PM.

  6. #5
    Herp Derpinstine's Avatar
    Join Date
    Apr 2014
    Gender
    male
    Location
    Drug Induced Rainbow
    Posts
    134
    Reputation
    10
    Thanks
    87
    My Mood
    Psychedelic
    Quote Originally Posted by ehex View Post
    this is way bigger than it needs to be, and have you ever heard of recursion? i dont know what i expected from you sperginstine

    why not use c++11 and do recursive calls to get all netvars in like 10 lines or is that too hard for you?
    Lmao. Can you read? I wrote this in under 15 minutes. You think it will be good?
    Hey jackass. I'll still take your advice even though you hate me because no matter how you act to me your still my bae .
    Last edited by Herp Derpinstine; 07-13-2015 at 08:14 PM.

  7. #6
    ehex's Avatar
    Join Date
    Dec 2011
    Gender
    male
    Posts
    150
    Reputation
    22
    Thanks
    555
    Quote Originally Posted by Herp Derpinstine View Post
    Lmao. Can you read? I wrote this in under 15 minutes. You think it will be good?
    Hey jackass. I'll still take your advice even though you hate me because no matter how you act to me your still my bae .
    It would've took less time to just call the function again instead of just adding more for loops

  8. #7
    Flying Gooby's Avatar
    Join Date
    Jan 2015
    Gender
    male
    Posts
    62
    Reputation
    10
    Thanks
    12
    Sadly, no one here knows what this is useful for, apart from a few people.

  9. #8
    Scetch08's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Location
    your hallucinations
    Posts
    101
    Reputation
    10
    Thanks
    107
    My Mood
    Lurking
    inb4 "virus scans are wrong of the source code" thx jim morrison
    什么他妈的你他妈的刚才说我,你这小婊子?我会让你知道我毕业了我班的顶部的海豹突击队,我已经参与了许多 秘密袭击的基地组织,和我有超过300证实杀死。我在训练的大猩猩战,我在整个美国军队的最高狙击手。你是 我什么都不是,但只是一个目标。我会消灭你他妈的精度喜欢哪一个从未见过在这个地球上,记住我的话他妈的。 你以为你可以逃脱说狗屎我在互联网上?再想想,笨蛋。在我们发言,我联系我的秘密横跨美国间谍网络和IP被 追踪作为现在让您风暴,蛆更好的准备。这抹了你打电话

  10. #9
    c0deine's Avatar
    Join Date
    Feb 2015
    Gender
    male
    Posts
    190
    Reputation
    10
    Thanks
    167
    My Mood
    Aggressive
    please post at least:
    2 virus scans
    6 screen shots
    18 videos
    4 vouches to "trustable members"
    signed approval by moderator
    hot jerk-off-able anime babe (no source tho)

    thank you
    MPGH Poster Team

  11. The Following 4 Users Say Thank You to c0deine For This Useful Post:

    KorkiPoo (07-14-2015),Kyouko (07-17-2015),Liquidsocks (07-17-2015),xCyberxx (07-17-2015)

  12. #10
    TheyCallMeDaz's Avatar
    Join Date
    May 2013
    Gender
    female
    Location
    Ukraine
    Posts
    367
    Reputation
    58
    Thanks
    279
    My Mood
    Yeehaw
    Quote Originally Posted by Herp Derpinstine View Post
    Lmao. Can you read? I wrote this in under 15 minutes. You think it will be good?
    Hey jackass. I'll still take your advice even though you hate me because no matter how you act to me your still my bae .
    It would've taken you infinitely less time to do proper recursion, you probably could've had this done in 5 minutes tops if you used proper recursion, not to mention strcmp is extremely slow (which is why SSE exists...) and all the loops you use significantly impact performance.

    www.strchr.com/strcmp_and_strlen_using_sse_4.2

  13. The Following 3 Users Say Thank You to TheyCallMeDaz For This Useful Post:

    DownSA8 (07-14-2015),Herp Derpinstine (07-17-2015),Liquidsocks (07-17-2015)

  14. #11
    ExiledStyles's Avatar
    Join Date
    Jan 2014
    Gender
    male
    Posts
    104
    Reputation
    10
    Thanks
    66
    this is not useful to anyone, neither is this made by you and the original code has been posted everywhere already
    if you had more than one brain cell you do full data iteration (m_MoveType and others) but we all know if it's not public you don't have it

  15. #12
    Herp Derpinstine's Avatar
    Join Date
    Apr 2014
    Gender
    male
    Location
    Drug Induced Rainbow
    Posts
    134
    Reputation
    10
    Thanks
    87
    My Mood
    Psychedelic
    Quote Originally Posted by ExiledStyles View Post
    this is not useful to anyone, neither is this made by you and the original code has been posted everywhere already
    if you had more than one brain cell you do full data iteration (m_MoveType and others) but we all know if it's not public you don't have it
    LMAO. I would like you to provide proof I didn't write this.
    Also why should I care what you think?
    I have been on a drug and alcohol bender for the past few days so the only one I will tolerate abuse from is my bae and my unicorn room-mate named Charlie. <3

    - - - Updated - - -

    Quote Originally Posted by TheyCallMeDaz View Post
    It would've taken you infinitely less time to do proper recursion, you probably could've had this done in 5 minutes tops if you used proper recursion, not to mention strcmp is extremely slow (which is why SSE exists...) and all the loops you use significantly impact performance.

    www.strchr.com/strcmp_and_strlen_using_sse_4.2
    +rep for useful post without any dick waving contests. That is why MPGH is lucky to have you Daz.

  16. #13
    ExiledStyles's Avatar
    Join Date
    Jan 2014
    Gender
    male
    Posts
    104
    Reputation
    10
    Thanks
    66
    Quote Originally Posted by Herp Derpinstine View Post
    LMAO. I would like you to provide proof I didn't write this.
    Also why should I care what you think?
    I have been on a drug and alcohol bender for the past few days so the only one I will tolerate abuse from is my bae and my unicorn room-mate named Charlie. <3

    - - - Updated - - -



    +rep for useful post without any dick waving contests. That is why MPGH is lucky to have you Daz.
    funny how you didn't pay attention to anything i said, should be enough proof to show you don't have the brain cells to write something like this
    you and all the talentless queers on here have to post random pasted code because constantly making unfunny anime jokes isn't enough

  17. #14
    HealthbarsGA's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Location
    DRUNKEN CHEETAH OWNS YOU
    Posts
    0
    Reputation
    10
    Thanks
    4
    Quote Originally Posted by ExiledStyles View Post
    xxxxxxxxxxxxx
    teach me how 2 make fast aimbot styles

  18. #15
    dfdffdfdad's Avatar
    Join Date
    Jan 2015
    Gender
    male
    Posts
    4
    Reputation
    10
    Thanks
    1
    My Mood
    Lurking
    yes yes yes yes finally stop the weaboo pasters!

  19. The Following User Says Thank You to dfdffdfdad For This Useful Post:

    Herp Derpinstine (07-17-2015)

Page 1 of 3 123 LastLast

Similar Threads

  1. finding and hooking an unknown function
    By JonnyD in forum General Game Hacking
    Replies: 1
    Last Post: 08-26-2010, 06:51 AM
  2. [Release] LabX And Hook 1.8!
    By R45H1D in forum Combat Arms Hacks & Cheats
    Replies: 87
    Last Post: 05-26-2010, 02:39 PM
  3. 2 difeerent cpu and 2 systems and no hack works plz help
    By sehooo in forum Combat Arms Help
    Replies: 2
    Last Post: 02-21-2010, 01:53 PM
  4. [Help] How to find offsets and addresses
    By shad0wboss in forum WarRock Discussions
    Replies: 0
    Last Post: 12-20-2009, 04:47 PM
  5. Replies: 5
    Last Post: 04-07-2009, 05:43 PM