Page 11 of 11 FirstFirst ... 91011
Results 101 to 108 of 108

Thread: Gw2lib

  1. #101
    Junior Member
    Join Date
    Dec 2014
    Posts
    2
    I think you already know the new GW" patch did your code stop to work.

    thanx for your work

  2. #102
    Junior Member
    Join Date
    Dec 2014
    Posts
    2
    I think you already know the new GW" patch did your code stop to work.

    thanx for your work

  3. #103
    Just a heads up, the game has been going through some large updates and many of the pointers in gw2lib.h need to be updated. For example, the pointer to CharClientHealth is now 160 instead of 174. Let me know if you need any help and I'll do what I can. As always, thanks for the good work.

  4. #104
    Administrator qqqw's Avatar
    Join Date
    May 2009
    Posts
    352
    Quote Originally Posted by iceboatherald View Post
    Just a heads up, the game has been going through some large updates and many of the pointers in gw2lib.h need to be updated. For example, the pointer to CharClientHealth is now 160 instead of 174. Let me know if you need any help and I'll do what I can. As always, thanks for the good work.
    hacklib is a open source project. you can contribute by sending patches.

  5. #105
    Senior Member rafi's Avatar
    Join Date
    Sep 2009
    Location
    munich
    Posts
    200
    It is mostly updated now and I added information on how to find the offsets, so it is easier for people to update. If you do please send a pull request on bitbucket to help others.

    Should be pretty easy for anyone now, if you are able to google how to use basic functions of debuggers or RE tools.

    - For viewing memory I like Cheat Engine as it highlights changes as they appear.
    - Ollydbg is useful when searching for referenced strings like the many assert strings in Gw2.

    The following is an example of what you see when following a referenced string within a Gw2 assert. We are looking for GetPlayer here. There are two virtual function calls here (CALL instruction on something that is not static). GetPlayer is likely to be the first call and looking at the old offset, 0xf0 is more likely than 0x24. Most other assembler reading you'll have to do is even more obvious.


  6. #106
    Still rollin' GoldCoin's Avatar
    Join Date
    Jul 2009
    Location
    Neverland
    Posts
    490
    Thank you!
    They say it can't be done? We ain't never not done it yet, have we?

  7. #107

    Post

    Thank you very much for the update and guides rafi.


    Made a quick radar in order to get used to the library again if anyone wants it:


    Radar In-Game:




    Src:
    Code:
    #include "gw2lib.h"
    
    class GW2_Radar{
    
    	const float PI = 3.141592653f;
    
    	const DWORD RadarBackgroundColor = 0xBB62B3E2;
    	const DWORD RadarBorderColor = 0xFFFFFFFF;
    
    	const DWORD Attitude_FRIENDLY = 0x00FF30;
    	const DWORD Attitude_HOSTILE = 0xFF0000;
    	const DWORD Attitude_INDIFFERENT = 0xFFDE00;
    	const DWORD Attitude_NEUTRAL = 0x665E5E;
    
    	float dist2D(GW2LIB::Vector3 p1, GW2LIB::Vector3 p2)
    	{
    		return sqrt(pow(p1.x - p2.x, 2) + pow(p1.y - p2.y, 2));
    	}
    
    public:
    
    
    	void Render(){
    		using namespace GW2LIB;
    
    		GW2LIB::Agent curAg, agSelf;
    		GW2LIB::Character curChar;
    		GW2LIB::Vector3 camVec, agPos, agSelfPos;
    
    		float curDist, Rotation, CoordX, CoordY;
    
    		float CenterX, CenterY;
    
    		camVec = GetViewVector();
    		agSelf = GetOwnAgent();
    		agSelfPos = agSelf.GetPos();
    
    		CenterX = GetWindowWidth() - 170;
    		CenterY = GetWindowHeight() / 2 + 50;
    
    		DrawRectFilled(CenterX - 150, CenterY - 150, 300, 300, RadarBackgroundColor);
    		DrawRect(CenterX - 150, CenterY - 150, 300, 300, RadarBorderColor);
    		DrawLine(CenterX, CenterY - 150, CenterX, CenterY + 150, RadarBorderColor);
    		DrawLine(CenterX - 150, CenterY, CenterX + 150, CenterY, RadarBorderColor);
    
    		while (curAg.BeNext()){
    
    			if (curAg.GetAgentId() == GetOwnAgent().GetAgentId()) continue;
    
    			if (!curAg.IsValid()) continue;
    
    			curChar = curAg.GetCharacter();
    			agPos = curAg.GetPos();
    
    			curDist = dist2D(agSelfPos, agPos);
    
    			if (curDist > 5000.0f) continue;
    
    			Rotation = (atan2(agPos.y - agSelfPos.y, agPos.x - agSelfPos.x) - atan2(camVec.y, camVec.x)) + (PI / 2);
    
    			CoordX = CenterX + (curDist * cos(Rotation)) / 30;
    			CoordY = CenterY - (curDist * sin(Rotation)) / 30;
    
    			if (CoordX > CenterX + 150) CoordX = CenterX + 150;
    			if (CoordX < CenterX - 150) CoordX = CenterX - 150;
    			if (CoordX > CenterX + 150) CoordX = CenterX + 150;
    			if (CoordY > CenterY + 150) CoordY = CenterY + 150;
    			if (CoordY < CenterY - 150) CoordY = CenterY - 150;
    
    			DWORD color = 0xDD000000;
    			switch (curChar.GetAttitude()){
    			case GW2::ATTITUDE_FRIENDLY:
    				color |= Attitude_FRIENDLY;
    				break;
    			case GW2::ATTITUDE_HOSTILE:
    				color |= Attitude_HOSTILE;
    				break;
    			case GW2::ATTITUDE_INDIFFERENT:
    				color |= Attitude_INDIFFERENT;
    				break;
    			case GW2::ATTITUDE_NEUTRAL:
    				color |= Attitude_NEUTRAL;
    				break;
    			}
    
    
    			DrawCircleFilled(CoordX, CoordY, 4, 0xFF000000);
    			DrawCircleFilled(CoordX, CoordY, 3, color);
    
    		}
    
    	}
    };
    
    
    GW2_Radar* Radar = new GW2_Radar();
    
    void cbESP()
    {
    	Radar->Render();
    }
    
    
    void GW2LIB::gw2lib_main()
    {
    	EnableEsp(cbESP);
    
    	while (GetAsyncKeyState(VK_HOME) >= 0)
    		Sleep(100);
    }
    Attached Files Attached Files
    Last edited by 4D 1; 04-04-2015 at 06:47 AM.

  8. #108
    Quote Originally Posted by rafi View Post
    It is mostly updated now and I added information on how to find the offsets, so it is easier for people to update. If you do please send a pull request on bitbucket to help others.

    Should be pretty easy for anyone now, if you are able to google how to use basic functions of debuggers or RE tools.

    - For viewing memory I like Cheat Engine as it highlights changes as they appear.
    - Ollydbg is useful when searching for referenced strings like the many assert strings in Gw2.

    The following is an example of what you see when following a referenced string within a Gw2 assert. We are looking for GetPlayer here. There are two virtual function calls here (CALL instruction on something that is not static). GetPlayer is likely to be the first call and looking at the old offset, 0xf0 is more likely than 0x24. Most other assembler reading you'll have to do is even more obvious.

    Very nice, thank you for the update and your hard work, especially for providing the additional comments!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •