• Amused
  • Angry
  • Annoyed
  • Awesome
  • Bemused
  • Cocky
  • Cool
  • Crazy
  • Crying
  • Down
  • Drunk
  • Embarrased
  • Enraged
  • Friendly
  • Geeky
  • Godly
  • Happy
  • Hateful
  • Hungry
  • Innocent
  • Meh
  • Piratey
  • Poorly
  • Sad
  • Secret
  • Shy
  • Sneaky
  • Tired
  • Wtf
  • At Work
  • CodenzHub
  • Coding
  • Deejaying
  • Donating
  • Drinking
  • Eating
  • Editing
  • Hacking
  • Hate Mailing
  • Jamin'
  • Lagging
  • Live Streaming
  • Lurking
  • No Status
  • Pawning
  • PC Gaming
  • PS Gaming
  • Raging
  • Reversing
  • Sleeping
  • Steam Gaming
  • Trolling
  • TwitchStreamer
  • Vodka!
  • Watching TV/Movie
  • Xbox Gaming
  • Youtuber
  • Zombies
  • Page 1 of 2 12 LastLast
    Results 1 to 10 of 11
    1. #1
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      bzh's Avatar
      Join Date
      Oct 2012
      Posts
      28
      Thanks (-->)
      1
      Thanks (<--)
      0

      [ CODE ]GDI Drawing Crosshair

      Silent VPN
      Read my current post.
      Last edited by bzh; 07-02-2013 at 05:32 PM.

    2. #2
      Hacker
      Learning to hack games!
       
      Pawning
       
      Fleep's Avatar
      Join Date
      May 2012
      Posts
      626
      Thanks (-->)
      208
      Thanks (<--)
      743
      Good luck, feel free to give us a preview of it working if you like.

      Fleep

    3. #3
      Coder
      Learning to hack games!
       
      Feeling Normal
       
      brinkz's Avatar
      Join Date
      Sep 2012
      Posts
      213
      Thanks (-->)
      5
      Thanks (<--)
      74
      GetSystemMetrics or GetClientRect for 4)

    4. #4
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      bzh's Avatar
      Join Date
      Oct 2012
      Posts
      28
      Thanks (-->)
      1
      Thanks (<--)
      0
      Quote Originally Posted by brinkz View Post
      GetSystemMetrics or GetClientRect for 4)
      Don't I just use the the X/Y coordinates of the window I'm drawing over?

      I put them in an array as fleep did in his tutorial.

      Also do I need to use World2Screen?

      Edit : I put my current source so far in an attachment, if someone could comment in or show me what I'm doing wrong.
      Attached Files Attached Files
      Last edited by bzh; 06-30-2013 at 04:11 PM.

    5. #5
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      bzh's Avatar
      Join Date
      Oct 2012
      Posts
      28
      Thanks (-->)
      1
      Thanks (<--)
      0
      I really would just appreciate it if someone helped me.

      I figured out that I should use a Pen to draw the lines as it's easier. As I also found out brushes are mainly used for filling objects.

      I'm using this to create and select a drawing device

      Code:
      //Assign a Drawing Device
      //Select Pen Sytle, Width, Color
      HPEN REDPEN = CreatePen(PS_SOLID, 3, RGB(255,0,0));
      HGDIOBJ oldPen=SelectObject(hdesktop,REDPEN);
      Now how do I just grab the Resolution variables of the X/Y coords for my CenterofScreen array for the UpdateResolution function Fleep used in his examples?
      Last edited by bzh; 06-30-2013 at 06:18 PM.

    6. #6
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      bzh's Avatar
      Join Date
      Oct 2012
      Posts
      28
      Thanks (-->)
      1
      Thanks (<--)
      0
      Figured all of it out so far by using MSDN.

      Few problems now, how do I hook WM_PAINT to keep my GDI Draw concurrent without using a resource hogging while(1) loop?

      Next, how to take the values from my RECT structure (left,top,right,bottom) of the window, to calculate the center of the window for my crosshair?

      MSDN : https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx

    7. #7
      Respected Hacker
      Learning to hack games!
       
      Coding
       
      till0sch's Avatar
      Join Date
      Oct 2012
      Location
      Germany.
      Posts
      1,168
      Thanks (-->)
      179
      Thanks (<--)
      340
      Quote Originally Posted by bzh View Post
      Next, how to take the values from my RECT structure (left,top,right,bottom) of the window, to calculate the center of the window for my crosshair?

      MSDN : https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx
      1. Get the rect
      2. Get Screen res
      3. (Screen Width - right - left ) / 2 should be right, same for height (( Screen width - top - bot )) /2

    8. #8
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      bzh's Avatar
      Join Date
      Oct 2012
      Posts
      28
      Thanks (-->)
      1
      Thanks (<--)
      0
      Quote Originally Posted by till0sch97 View Post
      1. Get the rect
      2. Get Screen res
      3. (Screen Width - right - left ) / 2 should be right, same for height (( Screen width - top - bot )) /2
      I am yet, still trying to explain to people I'm not trying to get my SCREEN metrics what so ever. I'm trying to get my WINDOW metrics, which I receive from doing the following calculations!

      Code:
      xCenter = REC.right - REC.left;
      yCenter = REC.bottom - REC.top;
      This gives me Width and Height, now when I divide them.

      Code:
      xCenter = REC.right - REC.left / 2;
      yCenter = REC.bottom - REC.top / 2;
      I don't get the center, or even half of the value. That's the problem. To give you the simple reason why I don't want the SCREEN metrics is because the window won't always be in the center of my screen.

    9. #9
      Respected Hacker
      Learning to hack games!
       
      Coding
       
      till0sch's Avatar
      Join Date
      Oct 2012
      Location
      Germany.
      Posts
      1,168
      Thanks (-->)
      179
      Thanks (<--)
      340
      Quote Originally Posted by bzh View Post
      I am yet, still trying to explain to people I'm not trying to get my SCREEN metrics what so ever. I'm trying to get my WINDOW metrics, which I receive from doing the following calculations!

      Code:
      xCenter = REC.right - REC.left;
      yCenter = REC.bottom - REC.top;
      This gives me Width and Height, now when I divide them.

      Code:
      xCenter = REC.right - REC.left / 2;
      yCenter = REC.bottom - REC.top / 2;
      I don't get the center, or even half of the value. That's the problem. To give you the simple reason why I don't want the SCREEN metrics is because the window won't always be in the center of my screen.

      Shouldn't the mid of window be at Left + (WindowWidth/2) ? And Top + WindowHeight/2

    10. #10
      Coder
      Learning to hack games!
       
      Feeling Normal
       
      brinkz's Avatar
      Join Date
      Sep 2012
      Posts
      213
      Thanks (-->)
      5
      Thanks (<--)
      74
      Silent VPN
      Code:
      Resolution.x = clientRect.right;
      Resolution.y = clientRect.bottom;
      Center.x = Resolution[ 0 ] / 2;
      Center.y = Resolution[ 1 ] / 2;

    Page 1 of 2 12 LastLast

    Similar Game Hacker Threads

    1. [Help] Logic For Drawing ESP
      By Ashesh in forum ESP - WorldToScreen - ViewMatrix
      Replies: 2
      Last Post: 05-22-2016, 09:28 AM
    2. [Help] External drawing for GTA V [C#]
      By Raw Development in forum Hacking Help
      Replies: 5
      Last Post: 04-01-2016, 08:56 AM
    3. [Help] Only drawing 1 box ENDSCENE
      By j3b in forum C/C++
      Replies: 3
      Last Post: 02-14-2014, 07:17 PM
    4. [Help] GDI Drawing Esp Box for CS 1.6
      By CHAMPION in forum C/C++
      Replies: 10
      Last Post: 01-13-2014, 11:06 PM
    5. [Help] D3D drawing...
      By Szaka in forum Direct-X, OpenGL
      Replies: 6
      Last Post: 11-19-2013, 07:27 AM

    Tags for this Thread