Results 1 to 12 of 12
  1. #1
    agentsix1's Avatar
    Join Date
    Aug 2013
    Gender
    male
    Posts
    21
    Reputation
    10
    Thanks
    11

    C# RCS & Player Name [EXTERNAL]

    I recently have been in search of basically a tutorial or a well worded explanation of how to create an RCS in C#. If you are unable to do that I would be ok with just code. But if some one had a way to explain what was going on it would help me out a ton so I can fully learn the fuctions.

    This second this is not a requirement but I have been having a pain trying to read the users player name for my Rank Reveal. The rank reveal works but I don't have a way to get the username to pair it with. When it comes to int/floats/bool whatever. I seem to do that with easy but when it comes to reading a string I have nothing or even where to start.

    I greatly appreciate any help.


    I did do a search for C# RCS and nothing appeared except for currently released hacks.

  2. #2
    I love myself
    나도 너를 사랑해

    Former Staff
    Premium Member
    Jhem's Avatar
    Join Date
    Mar 2012
    Gender
    male
    Location
    167,646,447
    Posts
    5,150
    Reputation
    1220
    Thanks
    7,392
    My Mood
    Stressed
    All you need to do is search for RCS source code. It's pretty simple if you really know how it works.

    I just made this today, i haven't tested it yet.
    Code:
    static DWORD WINAPI recoil_thread(PVOID param)
    	{
    		Vector oPunchAngle, nClientAngle;
    		while (true)
    		{
    			Sleep(1);
    			DWORD localPlayer = UtilsT->Read<DWORD>(UtilsT->modClient.dwBase + dwLocalPlayer);
    			if (!localPlayer)
    				continue;
    
    			DWORD pShotFired = UtilsT->Read<DWORD>(localPlayer + dwShotFired);
    			if (!pShotFired)
    				continue;
    
    			if (pShotFired > 1)
    			{
    				DWORD pClientState = UtilsT->Read<DWORD>(UtilsT->modClient.dwBase + dwClientState);
    				if (!pClientState)
    					continue;
    
    				Vector vPunchAngle = UtilsT->Read<Vector>(localPlayer + dwViewPunchAngle);
    				Vector vClientAngle = UtilsT->Read<Vector>(pClientState + dwViewClientStateAngle);
    
    
    				nClientAngle.x = ((vClientAngle.x + oPunchAngle.x) - (vPunchAngle.x * 2.f));
    				nClientAngle.y = ((vClientAngle.y + oPunchAngle.y) - (vPunchAngle.y * 2.f));
    				nClientAngle.z = 0;
    
    				while (nClientAngle.y > 180)
    					nClientAngle.y -= 360;
    
    				while (nClientAngle.y < -180)
    					nClientAngle.y += 360;
    
    				if (nClientAngle.x > 89.0f)
    					nClientAngle.x = 89.0f;
    
    				if (nClientAngle.x < -89.0f)
    					nClientAngle.x = -89.0f;
    
    				oPunchAngle.x = vPunchAngle.x * 2.f;
    				oPunchAngle.y = vPunchAngle.y * 2.f;
    				oPunchAngle.z = 0;
    
    				UtilsT->Write<Vector>(pClientState + dwViewClientStateAngle, nClientAngle);
    			}
    			else {
    				oPunchAngle.x = oPunchAngle.y = oPunchAngle.z = 0;
    			}
    		}
    	}

  3. The Following User Says Thank You to Jhem For This Useful Post:

    agentsix1 (07-09-2019)

  4. #3
    agentsix1's Avatar
    Join Date
    Aug 2013
    Gender
    male
    Posts
    21
    Reputation
    10
    Thanks
    11
    Quote Originally Posted by Jhem View Post
    All you need to do is search for RCS source code. It's pretty simple if you really know how it works.

    I just made this today, i haven't tested it yet.
    Code:
    static DWORD WINAPI recoil_thread(PVOID param)
    	{
    		Vector oPunchAngle, nClientAngle;
    		while (true)
    		{
    			Sleep(1);
    			DWORD localPlayer = UtilsT->Read<DWORD>(UtilsT->modClient.dwBase + dwLocalPlayer);
    			if (!localPlayer)
    				continue;
    
    			DWORD pShotFired = UtilsT->Read<DWORD>(localPlayer + dwShotFired);
    			if (!pShotFired)
    				continue;
    
    			if (pShotFired > 1)
    			{
    				DWORD pClientState = UtilsT->Read<DWORD>(UtilsT->modClient.dwBase + dwClientState);
    				if (!pClientState)
    					continue;
    
    				Vector vPunchAngle = UtilsT->Read<Vector>(localPlayer + dwViewPunchAngle);
    				Vector vClientAngle = UtilsT->Read<Vector>(pClientState + dwViewClientStateAngle);
    
    
    				nClientAngle.x = ((vClientAngle.x + oPunchAngle.x) - (vPunchAngle.x * 2.f));
    				nClientAngle.y = ((vClientAngle.y + oPunchAngle.y) - (vPunchAngle.y * 2.f));
    				nClientAngle.z = 0;
    
    				while (nClientAngle.y > 180)
    					nClientAngle.y -= 360;
    
    				while (nClientAngle.y < -180)
    					nClientAngle.y += 360;
    
    				if (nClientAngle.x > 89.0f)
    					nClientAngle.x = 89.0f;
    
    				if (nClientAngle.x < -89.0f)
    					nClientAngle.x = -89.0f;
    
    				oPunchAngle.x = vPunchAngle.x * 2.f;
    				oPunchAngle.y = vPunchAngle.y * 2.f;
    				oPunchAngle.z = 0;
    
    				UtilsT->Write<Vector>(pClientState + dwViewClientStateAngle, nClientAngle);
    			}
    			else {
    				oPunchAngle.x = oPunchAngle.y = oPunchAngle.z = 0;
    			}
    		}
    	}
    Thank you.

    I will post a version of my code once I use your code as a reference and test it all ensuring it all works!

  5. #4
    Not Officer's Avatar
    Join Date
    Nov 2015
    Gender
    male
    Posts
    3,653
    Reputation
    836
    Thanks
    152,064
    My Mood
    Amused
    Quote Originally Posted by Jhem View Post
    nClientAngle.z = 0;
    You should use a 2d vector.









  6. #5
    agentsix1's Avatar
    Join Date
    Aug 2013
    Gender
    male
    Posts
    21
    Reputation
    10
    Thanks
    11
    So I went ahead and threw the code together in a fashion that works. However, This was not exactly the result I was expecting. Maybe it has to do with the way I am doing it but to me it seems to be super jumpy and fairly obvious what is going on. As well its not as clean of a rcs I as I was expecting to get. Is there a way to tighten up the shots to get them closer together and maybe make it less ew. I appreciate your help.

    Code:
    public static void rcs()
            {
                Vector2 oPunchAngle, nClientAngle;
                oPunchAngle.X = oPunchAngle.Y = 0;
                while (true)
                {
                    Thread.Sleep(1);
                    
                    int localPlayer = ReadMemory<int>((int)g_pClient + Offsets.offsetList["dwLocalPlayer"]);
                    int pShotFired = ReadMemory<int>(localPlayer + Offsets.offsetList["m_iShotsFired"]);
                    int pClientState = ReadMemory<int>((int)g_pEngine + Offsets.offsetList["dwClientState"]);
                    Vector2 BClientAngle = ReadMemory<Vector2>(pClientState + Offsets.offsetList["dwClientState_ViewAngles"]);
                    if (pShotFired > 1)
                    {
                        Vector2 vPunchAngle = ReadMemory<Vector2>(localPlayer + Offsets.offsetList["m_viewPunchAngle"]);
                        Vector2 vClientAngle = ReadMemory<Vector2>(pClientState + Offsets.offsetList["dwClientState_ViewAngles"]);
                        nClientAngle.X = ((vClientAngle.X + oPunchAngle.X) - (vPunchAngle.X * 2.0f));
                        nClientAngle.Y = ((vClientAngle.Y + oPunchAngle.Y) - (vPunchAngle.Y * 2.0f));
                        
                        
                        while (nClientAngle.Y > 180)
                            nClientAngle.Y -= 360;
    
                        while (nClientAngle.Y < -180)
                            nClientAngle.Y += 360;
    
                        if (nClientAngle.X > 89.0f)
                            nClientAngle.X = 89.0f;
    
                        if (nClientAngle.X < -89.0f)
                            nClientAngle.X = -89.0f;
                            
                        WriteMemory<Vector2>(pClientState + Offsets.offsetList["dwClientState_ViewAngles"], nClientAngle);
    
                        oPunchAngle.X = vPunchAngle.X * 2.0f;
                        oPunchAngle.Y = vPunchAngle.Y * 2.0f;
    
    
    
                    }
                    else
                    {
                        oPunchAngle.X = oPunchAngle.Y = 0;
                    }
                }
            }

  7. #6
    I love myself
    나도 너를 사랑해

    Former Staff
    Premium Member
    Jhem's Avatar
    Join Date
    Mar 2012
    Gender
    male
    Location
    167,646,447
    Posts
    5,150
    Reputation
    1220
    Thanks
    7,392
    My Mood
    Stressed
    Quote Originally Posted by agentsix1 View Post
    So I went ahead and threw the code together in a fashion that works. However, This was not exactly the result I was expecting. Maybe it has to do with the way I am doing it but to me it seems to be super jumpy and fairly obvious what is going on. As well its not as clean of a rcs I as I was expecting to get. Is there a way to tighten up the shots to get them closer together and maybe make it less ew. I appreciate your help.

    Code:
    public static void rcs()
            {
                Vector2 oPunchAngle, nClientAngle;
                oPunchAngle.X = oPunchAngle.Y = 0;
                while (true)
                {
                    Thread.Sleep(1);
                    
                    int localPlayer = ReadMemory<int>((int)g_pClient + Offsets.offsetList["dwLocalPlayer"]);
                    int pShotFired = ReadMemory<int>(localPlayer + Offsets.offsetList["m_iShotsFired"]);
                    int pClientState = ReadMemory<int>((int)g_pEngine + Offsets.offsetList["dwClientState"]);
                    Vector2 BClientAngle = ReadMemory<Vector2>(pClientState + Offsets.offsetList["dwClientState_ViewAngles"]);
                    if (pShotFired > 1)
                    {
                        Vector2 vPunchAngle = ReadMemory<Vector2>(localPlayer + Offsets.offsetList["m_viewPunchAngle"]);
                        Vector2 vClientAngle = ReadMemory<Vector2>(pClientState + Offsets.offsetList["dwClientState_ViewAngles"]);
                        nClientAngle.X = ((vClientAngle.X + oPunchAngle.X) - (vPunchAngle.X * 2.0f));
                        nClientAngle.Y = ((vClientAngle.Y + oPunchAngle.Y) - (vPunchAngle.Y * 2.0f));
                        
                        
                        while (nClientAngle.Y > 180)
                            nClientAngle.Y -= 360;
    
                        while (nClientAngle.Y < -180)
                            nClientAngle.Y += 360;
    
                        if (nClientAngle.X > 89.0f)
                            nClientAngle.X = 89.0f;
    
                        if (nClientAngle.X < -89.0f)
                            nClientAngle.X = -89.0f;
                            
                        WriteMemory<Vector2>(pClientState + Offsets.offsetList["dwClientState_ViewAngles"], nClientAngle);
    
                        oPunchAngle.X = vPunchAngle.X * 2.0f;
                        oPunchAngle.Y = vPunchAngle.Y * 2.0f;
    
    
    
                    }
                    else
                    {
                        oPunchAngle.X = oPunchAngle.Y = 0;
                    }
                }
            }

    If you do really understand the code then I guess, you already know what to do next and optimize it.

  8. #7
    agentsix1's Avatar
    Join Date
    Aug 2013
    Gender
    male
    Posts
    21
    Reputation
    10
    Thanks
    11
    Quote Originally Posted by Jhem View Post



    If you do really understand the code then I guess, you already know what to do next and optimize it.
    Yea kinda figured I would get that response. Off to the drawing board and time to spend a few hours trying to make it nicer. I do appreciate the help so far!

  9. #8
    I love myself
    나도 너를 사랑해

    Former Staff
    Premium Member
    Jhem's Avatar
    Join Date
    Mar 2012
    Gender
    male
    Location
    167,646,447
    Posts
    5,150
    Reputation
    1220
    Thanks
    7,392
    My Mood
    Stressed
    Quote Originally Posted by agentsix1 View Post
    Yea kinda figured I would get that response. Off to the drawing board and time to spend a few hours trying to make it nicer. I do appreciate the help so far!
    And to your another question, I usually create another RPM function to read the string.
    Code:
    std::string ReadString(DWORD addr)
    	{
    		char _read[260];
    		ReadProcessMemory(_process, (LPVOID)addr, &_read, sizeof(_read), NULL);
    		return _read;
    	}
    This is how it looks.

    You can add another parameter to get the size of your string.

  10. #9
    agentsix1's Avatar
    Join Date
    Aug 2013
    Gender
    male
    Posts
    21
    Reputation
    10
    Thanks
    11
    Quote Originally Posted by Jhem View Post


    And to your another question, I usually create another RPM function to read the string.
    Code:
    std::string ReadString(DWORD addr)
    	{
    		char _read[260];
    		ReadProcessMemory(_process, (LPVOID)addr, &_read, sizeof(_read), NULL);
    		return _read;
    	}
    This is how it looks.

    You can add another parameter to get the size of your string.
    Where do you pull the player's name from? I have heard you can do it from the local player or radar. Is there a better place to pull from or which of the 2 is the better of the 2.

  11. #10
    I love myself
    나도 너를 사랑해

    Former Staff
    Premium Member
    Jhem's Avatar
    Join Date
    Mar 2012
    Gender
    male
    Location
    167,646,447
    Posts
    5,150
    Reputation
    1220
    Thanks
    7,392
    My Mood
    Stressed
    Quote Originally Posted by agentsix1 View Post
    Where do you pull the player's name from? I have heard you can do it from the local player or radar. Is there a better place to pull from or which of the 2 is the better of the 2.
    No, from the word "local" it means you, not other player. Use the Entity pointer, and look for the offsets of the player's name.

  12. #11
    Ninja429282's Avatar
    Join Date
    Sep 2017
    Gender
    male
    Posts
    15
    Reputation
    10
    Thanks
    1
    where do you get the names from

  13. #12
    I love myself
    나도 너를 사랑해

    Former Staff
    Premium Member
    Jhem's Avatar
    Join Date
    Mar 2012
    Gender
    male
    Location
    167,646,447
    Posts
    5,150
    Reputation
    1220
    Thanks
    7,392
    My Mood
    Stressed
    No response from OP after 1 week, looks like the problem has been solved.
    Contract if you want to re-open it.

Similar Threads

  1. [Help] Get player name externally
    By randon2121 in forum Garry's Mod Discussions & Help
    Replies: 0
    Last Post: 10-13-2018, 01:40 PM
  2. [Help Request] Adding Player names to External ESP [C#]
    By haens12 in forum DayZ Help & Requests
    Replies: 0
    Last Post: 01-31-2015, 10:03 AM
  3. Player name ----> Power up
    By maxtkd in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 11
    Last Post: 10-05-2010, 05:18 PM
  4. [AssaultCube]Get player entities(external)
    By Retoxified in forum C++/C Programming
    Replies: 1
    Last Post: 04-03-2010, 07:23 AM
  5. B> Player Name Change for 10.00 Paypal
    By Sneaks in forum Trade Accounts/Keys/Items
    Replies: 3
    Last Post: 09-20-2009, 03:09 PM