• 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
  • Results 1 to 10 of 10
    1. #1
      Jr.Coder
       
      Coding
       
      Heisa's Avatar
      Join Date
      Jul 2013
      Posts
      75
      Thanks (-->)
      16
      Thanks (<--)
      3

      How to Replace GDI with DirectX in Fleep's tutorials?

      Silent VPN
      Hi. How do I implement fleep's ESP source with this one ?


      .CPP

      Spoiler: cDirectX.cpp
      #include "hDirectX.h"

      IDirect3D9Ex* p_Object = 0;
      IDirect3DDevice9Ex* p_Device = 0;
      D3DPRESENT_PARAMETERS p_Params;

      ID3DXLine* p_Line;
      ID3DXFont* pFontSmall = 0;

      int DirectXInit(HWND hWnd)
      {
      if(FAILED(Direct3DCreate9Ex(D3D_SDK_VERSION, &p_Object)))
      exit(1);

      ZeroMemory(&p_Params, sizeof(p_Params));
      p_Params.Windowed = TRUE;
      p_Params.SwapEffect = D3DSWAPEFFECT_DISCARD;
      p_Params.hDeviceWindow = hWnd;
      p_Params.MultiSampleQuality = D3DMULTISAMPLE_NONE;
      p_Params.BackBufferFormat = D3DFMT_A8R8G8B8 ;
      p_Params.BackBufferWidth = Width;
      p_Params.BackBufferHeight = Height;
      p_Params.EnableAutoDepthStencil = TRUE;
      p_Params.AutoDepthStencilFormat = D3DFMT_D16;

      if(FAILED(p_Object->CreateDeviceEx(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &p_Params, 0, &p_Device)))
      exit(1);

      if(!p_Line)
      D3DXCreateLine(p_Device, &p_Line);
      //p_Line->SetAntialias(1); *removed cuz crosshair was blurred*

      D3DXCreateFont(p_Device, 18, 0, 0, 0, false, DEFAULT_CHARSET, OUT_CHARACTER_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, "Calibri", &pFontSmall);

      return 0;
      }

      int Render()
      {
      p_Device->Clear(0, 0, D3DCLEAR_TARGET, 0, 1.0f, 0);
      p_Device->BeginScene();

      if(tWnd == GetForegroundWindow())
      {
      //text with shadow
      DrawShadowString("UnKnoWnCheaTs.me - Debug Overlay - by Grab", 5, 0, 240, 240, 250, pFontSmall);

      //text without shadow
      DrawString("UnKnoWnCheaTs.me - Debug Overlay - by Grab", 5, 15, 240, 240, 250, pFontSmall);

      //colored rects
      FillRGB(30, 40, 10, 10, 255, 0, 0, 155);
      FillRGB(30, 60, 10, 10, 0, 255, 0, 155);
      FillRGB(30, 80, 10, 10, 0, 0, 255, 155);

      //crosshair
      FillRGB(Width / 2 - 22, Height / 2, 44, 1, 240, 240, 250, 255);
      FillRGB(Width / 2, Height / 2 - 22, 1, 44, 240, 240, 250, 255);
      }

      p_Device->EndScene();
      p_Device->PresentEx(0, 0, 0, 0, 0);
      return 0;
      }



      Spoiler: cDrawings.cpp
      #include "hDrawings.h"

      int DrawString(char* String, int x, int y, int r, int g, int b, ID3DXFont* ifont)
      {
      RECT ShadowPos;
      ShadowPos.left = x + 1;
      ShadowPos.top = y + 1;
      RECT FontPos;
      FontPos.left = x;
      FontPos.top = y;
      ifont->DrawTextA(0, String, strlen(String), &ShadowPos, DT_NOCLIP, D3DCOLOR_ARGB(255, r / 3, g / 3, b / 3));
      ifont->DrawTextA(0, String, strlen(String), &FontPos, DT_NOCLIP, D3DCOLOR_ARGB(255, r, g, b));
      return 0;
      }
      int DrawShadowString(char* String, int x, int y, int r, int g, int b, ID3DXFont* ifont)
      {
      RECT Font;
      Font.left = x;
      Font.top = y;
      RECT Fonts;
      Fonts.left = x+1;
      Fonts.top = y;
      RECT Fonts1;
      Fonts1.left = x-1;
      Fonts1.top = y;
      RECT Fonts2;
      Fonts2.left = x;
      Fonts2.top = y+1;
      RECT Fonts3;
      Fonts3.left = x;
      Fonts3.top = y-1;
      ifont->DrawTextA(0, String, strlen(String), &Fonts3, DT_NOCLIP , D3DCOLOR_ARGB(255, 1, 1, 1));
      ifont->DrawTextA(0, String, strlen(String), &Fonts2, DT_NOCLIP, D3DCOLOR_ARGB(255, 1, 1, 1));
      ifont->DrawTextA(0, String, strlen(String), &Fonts1, DT_NOCLIP, D3DCOLOR_ARGB(255, 1, 1, 1));
      ifont->DrawTextA(0, String, strlen(String), &Fonts, DT_NOCLIP, D3DCOLOR_ARGB(255, 1, 1, 1));
      ifont->DrawTextA(0, String, strlen(String), &Font, DT_NOCLIP, D3DCOLOR_ARGB(255, r, g, b));
      return 0;
      }

      void GradientFunc(int x, int y, int w, int h,int r, int g, int b, int a)
      {
      int iColorr,iColorg,iColorb;
      for(int i = 1; i < h; i++)
      {
      iColorr = (int)((float)i/h*r);
      iColorg = (int)((float)i/h*g);
      iColorb = (int)((float)i/h*b);
      FillRGB(x ,y+ i,w,1,r-iColorr,g-iColorg,b-iColorb,a);
      }
      }
      void DrawLine(float x, float y, float xx, float yy, int r, int g, int b, int a)
      {
      D3DXVECTOR2 dLine[2];

      p_Line->SetWidth( 1 );

      dLine[0].x = x;
      dLine[0].y = y;

      dLine[1].x = xx;
      dLine[1].y = yy;

      p_Line->Draw( dLine, 2, D3DCOLOR_ARGB(a, r , g, b));

      }
      void FillRGB(float x, float y, float w, float h, int r, int g, int b, int a)
      {
      D3DXVECTOR2 vLine[2];

      p_Line->SetWidth( w );

      vLine[0].x = x + w/2;
      vLine[0].y = y;
      vLine[1].x = x + w/2;
      vLine[1].y = y + h;

      p_Line->Begin( );
      p_Line->Draw( vLine, 2, D3DCOLOR_RGBA( r, g, b, a ) );
      p_Line->End( );
      }
      void DrawBox(float x, float y, float width, float height, float px, int r, int g, int b, int a)
      {
      D3DXVECTOR2 points[5];
      points[0] = D3DXVECTOR2(x, y);
      points[1] = D3DXVECTOR2(x+width, y);
      points[2] = D3DXVECTOR2(x+width, y+height);
      points[3] = D3DXVECTOR2(x, y+height);
      points[4] = D3DXVECTOR2(x, y);
      p_Line->SetWidth(1);
      p_Line->Draw(points, 5, D3DCOLOR_RGBA(r, g, b, a));
      }
      void DrawGUIBox(float x, float y, float w, float h, int r, int g, int b, int a, int rr, int gg, int bb, int aa)
      {
      DrawBox(x,y,w,h, 1,r ,g ,b ,a);
      FillRGB(x,y,w,h,rr,gg,bb,a);
      }
      void DrawHealthBar(float x, float y, float w, float h, int r, int g)
      {
      FillRGB(x,y,w,h,r,g,0,255);
      }
      void DrawHealthBarBack(float x, float y, float w, float h)
      {
      FillRGB(x,y,w,h,0,0,0,255);
      }
      void DrawCenterLine(float x, float y, int width, int r, int g, int b)
      {
      D3DXVECTOR2 dPoints[2];
      dPoints[0] = D3DXVECTOR2(x, y);
      dPoints[1] = D3DXVECTOR2(Width / 2, Height);
      p_Line->SetWidth(width);
      p_Line->Draw(dPoints, 2, D3DCOLOR_RGBA(r, g, b, 255));
      }


      Spoiler: cMain.cpp

      #include "hMain.h"

      int Width = 800;
      int Height = 600;

      const MARGINS Margin = { 0, 0, Width, Height };

      char lWindowName[256] = "Basic Overlay - v0.1 - Credits: Grab";
      HWND hWnd;

      char tWindowName[256] = "Counter-Strike Source"; /* tWindowName ? Target Window Name */
      HWND tWnd;
      RECT tSize;

      MSG Message;

      LRESULT CALLBACK WinProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
      {
      switch (Message)
      {
      case WM_PAINT:
      Render();
      break;

      case WM_CREATE:
      DwmExtendFrameIntoClientArea(hWnd, &Margin);
      break;

      case WM_DESTROY:
      PostQuitMessage(1);
      return 0;

      default:
      return DefWindowProc(hWnd, Message, wParam, lParam);
      break;
      }
      return 0;
      }

      int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hSecInstance, LPSTR nCmdLine, INT nCmdShow)
      {

      CreateThread(0, 0, (LPTHREAD_START_ROUTINE)SetWindowToTarget, 0, 0, 0);

      WNDCLASSEX wClass;
      wClass.cbClsExtra = NULL;
      wClass.cbSize = sizeof(WNDCLASSEX);
      wClass.cbWndExtra = NULL;
      wClass.hbrBackground = (HBRUSH)CreateSolidBrush(RGB(0, 0, 0));
      wClass.hCursor = LoadCursor(0, IDC_ARROW);
      wClass.hIcon = LoadIcon(0, IDI_APPLICATION);
      wClass.hIconSm = LoadIcon(0, IDI_APPLICATION);
      wClass.hInstance = hInstance;
      wClass.lpfnWndProc = WinProc;
      wClass.lpszClassName = lWindowName;
      wClass.lpszMenuName = lWindowName;
      wClass.style = CS_VREDRAW | CS_HREDRAW;

      if(!RegisterClassEx(&wClass))
      exit(1);

      tWnd = FindWindow(0, tWindowName);
      if (tWnd)
      {
      GetWindowRect(tWnd, &tSize);
      Width = tSize.right - tSize.left;
      Height = tSize.bottom - tSize.top;
      hWnd = CreateWindowEx(WS_EX_TOPMOST | WS_EX_TRANSPARENT | WS_EX_LAYERED, lWindowName, lWindowName, WS_POPUP, 1, 1, Width, Height, 0, 0, 0, 0);
      SetLayeredWindowAttributes(hWnd, 0, 1.0f, LWA_ALPHA);
      SetLayeredWindowAttributes(hWnd, 0, RGB(0, 0, 0), LWA_COLORKEY);
      ShowWindow( hWnd, SW_SHOW);
      }

      DirectXInit(hWnd);

      for (;;)
      {
      if(PeekMessage(&Message, hWnd, 0, 0, PM_REMOVE))
      {
      DispatchMessage(&Message);
      TranslateMessage(&Message);
      }
      Sleep(1);
      }
      return 0;
      }

      void SetWindowToTarget()
      {
      while(true)
      {
      tWnd = FindWindow(0, tWindowName);
      if (tWnd)
      {
      GetWindowRect(tWnd, &tSize);
      Width = tSize.right - tSize.left;
      Height = tSize.bottom - tSize.top;
      DWORD dwStyle = GetWindowLong(tWnd, GWL_STYLE);
      if(dwStyle & WS_BORDER)
      {
      tSize.top += 23;
      Height -= 23;
      }
      MoveWindow(hWnd, tSize.left, tSize.top, Width, Height, true);
      }
      else
      {
      char ErrorMsg[125];
      sprintf(ErrorMsg, "Make sure %s is running!", tWindowName);
      MessageBox(0, ErrorMsg, "Error - Cannot find the game!", MB_OK | MB_ICONERROR);
      exit(1);
      }
      Sleep(100);
      }
      }


      HEADERS

      Spoiler: hDirectX.h
      #ifndef HDIRECTX_H
      #define HDIRECTX_H

      #include "hMain.h"
      #include "hDrawings.h"

      #include <Windows.h>
      #include <iostream>

      #include <d3d9.h>
      #include <d3dx9.h>
      #pragma comment(lib, "d3d9.lib")
      #pragma comment(lib, "d3dx9.lib")

      #include <dwmapi.h>
      #pragma comment(lib, "dwmapi.lib")

      extern IDirect3D9Ex* p_Object;
      extern IDirect3DDevice9Ex* p_Device;
      extern D3DPRESENT_PARAMETERS p_Params;
      extern ID3DXLine* p_Line;
      extern ID3DXFont* pFontSmall;

      int DirectXInit(HWND hWnd);
      int Render();

      #endif


      Spoiler: hDrawings.h
      #ifndef HDRAWFUNC_H
      #define HDRAWFUNC_H

      #include "hDirectX.h"

      #pragma warning( disable : 4244 ) //remove the incoming warns
      #pragma warning( disable : 4996 ) //remove the incoming warns

      #include <d3dx9.h>
      #include <d3d9.h>
      #pragma comment(lib, "d3d9.lib")
      #pragma comment(lib, "d3dx9.lib")

      void GradientFunc(int x, int y, int w, int h,int r, int g, int b, int a);
      void DrawCenterLine(float x, float y, int r, int g, int b, int a);
      void DrawLine(float x, float y, float xx, float yy, int r, int g, int b, int a);
      void FillRGB(float x, float y, float w, float h, int r, int g, int b, int a);
      void DrawBox(float x, float y, float width, float height, float px, int r, int g, int b, int a);
      void DrawGUIBox(float x, float y, float w, float h, int r, int g, int b, int a, int rr, int gg, int bb, int aa);
      void DrawHealthBar(float x, float y, float w, float h, int r, int g);
      void DrawHealthBarBack(float x, float y, float w, float h);

      int DrawString(char* String, int x, int y, int r, int g, int b, ID3DXFont* ifont);
      int DrawShadowString(char* String, int x, int y, int r, int g, int b, ID3DXFont* ifont);

      #endif



      Spoiler: hMain.h
      #ifndef HMAIN_H
      #define HMAIN_H

      #include "hDirectX.h"

      #include <Windows.h>
      #include <iostream>

      #include <d3d9.h>
      #include <d3dx9.h>
      #pragma comment(lib, "d3d9.lib")
      #pragma comment(lib, "d3dx9.lib")

      #include <dwmapi.h>
      #pragma comment(lib, "dwmapi.lib")

      extern int Width;
      extern int Height;
      extern char lWindowName[256];
      extern HWND hWnd;
      extern char tWindowName[256];
      extern HWND tWnd;
      extern RECT tSize;
      extern MSG Message;
      extern bool Debug_Border;

      LRESULT CALLBACK WinProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam);
      int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hSecInstance, LPSTR nCmdLine, INT nCmdShow);
      void SetWindowToTarget();

      #endif

      Credits: UnKnoWnCheaTs.me - Debug Overlay - by Grab

    2. #2
      Kim Kong Trasher
      I don't have status.
       
      Raging
       
      c5's Avatar
      Join Date
      Jul 2012
      Location
      Mankei Iland
      Posts
      1,221
      Thanks (-->)
      97
      Thanks (<--)
      492
      Maybe if you'd actually learn programming you could figure it out?
      How to Replace GDI with DirectX in Fleep's tutorials?

    3. Thanks TastyHorror, squeenie thanked for this post
    4. #3
      Jr.Coder
       
      Coding
       
      Heisa's Avatar
      Join Date
      Jul 2013
      Posts
      75
      Thanks (-->)
      16
      Thanks (<--)
      3
      Quote Originally Posted by c5 View Post
      Maybe if you'd actually learn programming you could figure it out?
      What do you mean learn how to code? I did it, I just had one error and thought someone smart could help me quicker.
      Thanks Kaz. And thanks c5, for being an ass.

      #CloseRequest

    5. Thanks kaz thanked for this post
    6. #4
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      waynetay's Avatar
      Join Date
      Nov 2013
      Posts
      7
      Thanks (-->)
      3
      Thanks (<--)
      0
      u are just copy pasta

    7. #5
      Jr.Coder
       
      Coding
       
      Heisa's Avatar
      Join Date
      Jul 2013
      Posts
      75
      Thanks (-->)
      16
      Thanks (<--)
      3
      Quote Originally Posted by waynetay View Post
      u are just copy pasta
      And you? I don't see you contributing in this community with your own code.At least I can solve errors like " couldn't open file "Hacks.h" "

    8. #6
      Kim Kong Trasher
      I don't have status.
       
      Raging
       
      c5's Avatar
      Join Date
      Jul 2012
      Location
      Mankei Iland
      Posts
      1,221
      Thanks (-->)
      97
      Thanks (<--)
      492
      Quote Originally Posted by fureimu View Post
      What do you mean learn how to code? I did it, I just had one error and thought someone smart could help me quicker.
      Thanks Kaz. And thanks c5, for being an ass.

      #CloseRequest
      You don't show any errors whatsoever.

      Hi. How do I implement fleep's ESP source with this one ?
      You simply copied a bunch of code and expect us to work it out for you.

      Happy to help as always
      How to Replace GDI with DirectX in Fleep's tutorials?

    9. #7
      Jr.Coder
       
      Coding
       
      Heisa's Avatar
      Join Date
      Jul 2013
      Posts
      75
      Thanks (-->)
      16
      Thanks (<--)
      3
      Quote Originally Posted by c5 View Post
      You don't show any errors whatsoever.



      You simply copied a bunch of code and expect us to work it out for you.

      Happy to help as always
      Work it out for me? No. I simply wanted to see how someone else would do it.

    10. #8
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      sl1ne's Avatar
      Join Date
      Apr 2014
      Posts
      13
      Thanks (-->)
      2
      Thanks (<--)
      5
      What I would do:

      Watch Fleeps DirectX Menu Tutorial. Figure out whats needed for DirectX. Replace GDI drawing with D3D:
      void DrawFilledRect(int x, int y, int w, int h, D3DCOLOR color, IDirect3DDevice9* dev)
      {
      D3DRECT BarRect = { x, y, x + w, y + h };
      dev->Clear(1, &BarRect, D3DCLEAR_TARGET | D3DCLEAR_TARGET, color, 0, 0);
      }
      void DrawBorderBox(int x, int y, int w, int h, int thickness, D3DCOLOR color, IDirect3DDevice9* dev)
      {
      DrawFilledRect(x, y, w, thickness, color,dev);
      DrawFilledRect( x, y, thickness, h, color,dev);
      DrawFilledRect((x + w), y, thickness, h, color,dev);
      DrawFilledRect(x, y + h, w+thickness, thickness, color,dev);
      }
      void DrawLine(LPDIRECT3DDEVICE9 pDevice, float x1, float y1, float x2, float y2, DWORD color)
      {
      ID3DXLine *m_Line;
      D3DXCreateLine(pDevice, &m_Line);
      D3DXVECTOR2 line[] = { D3DXVECTOR2(x1, y1), D3DXVECTOR2(x2, y2) };
      m_Line->Begin();
      m_Line->Draw(line, 2, color);
      m_Line->End();
      m_Line->Release();
      }
      void DrawString(char pString[], int x, int y, D3DCOLOR col, ID3DXFont *font)
      {
      RECT FontRect = { x, y, x+500, y+30 };
      font->DrawTextA( NULL, pString, -1, &FontRect, DT_LEFT | DT_WORDBREAK, col);//pString
      }

    11. #9
      Jr.Coder
       
      Coding
       
      Heisa's Avatar
      Join Date
      Jul 2013
      Posts
      75
      Thanks (-->)
      16
      Thanks (<--)
      3
      Quote Originally Posted by sl1ne View Post
      What I would do:

      Watch Fleeps DirectX Menu Tutorial. Figure out whats needed for DirectX. Replace GDI drawing with D3D:
      void DrawFilledRect(int x, int y, int w, int h, D3DCOLOR color, IDirect3DDevice9* dev)
      {
      D3DRECT BarRect = { x, y, x + w, y + h };
      dev->Clear(1, &BarRect, D3DCLEAR_TARGET | D3DCLEAR_TARGET, color, 0, 0);
      }
      void DrawBorderBox(int x, int y, int w, int h, int thickness, D3DCOLOR color, IDirect3DDevice9* dev)
      {
      DrawFilledRect(x, y, w, thickness, color,dev);
      DrawFilledRect( x, y, thickness, h, color,dev);
      DrawFilledRect((x + w), y, thickness, h, color,dev);
      DrawFilledRect(x, y + h, w+thickness, thickness, color,dev);
      }
      void DrawLine(LPDIRECT3DDEVICE9 pDevice, float x1, float y1, float x2, float y2, DWORD color)
      {
      ID3DXLine *m_Line;
      D3DXCreateLine(pDevice, &m_Line);
      D3DXVECTOR2 line[] = { D3DXVECTOR2(x1, y1), D3DXVECTOR2(x2, y2) };
      m_Line->Begin();
      m_Line->Draw(line, 2, color);
      m_Line->End();
      m_Line->Release();
      }
      void DrawString(char pString[], int x, int y, D3DCOLOR col, ID3DXFont *font)
      {
      RECT FontRect = { x, y, x+500, y+30 };
      font->DrawTextA( NULL, pString, -1, &FontRect, DT_LEFT | DT_WORDBREAK, col);//pString
      }
      How to Replace GDI with DirectX in Fleep's tutorials?

    12. #10
      Coder
      Creating UE3 x86/x64 tut
       
      Coding
       
      TastyHorror's Avatar
      Join Date
      Oct 2012
      Location
      Canada
      Posts
      184
      Thanks (-->)
      54
      Thanks (<--)
      82
      Silent VPN
      I know my tutorials a little ... meh, and needs a lot of work (keep in mind that I have not coded it and all credits go to grab or w.e. u spell it). But give it a shot.

      I would suggest you look at the code first, like really look at it, and then watch the video.

      https://guidedhacking.com/showthread...DirectX-Menu-C

      Also there is a screen/res problem which isn't really noticeable at first, but I'll let you figure it out.

    Similar Game Hacker Threads

    1. [Help] d3d9 menu, mouse replace to keyboard hotkeys.
      By rapt0r in forum Direct-X, OpenGL
      Replies: 3
      Last Post: 09-22-2015, 02:01 PM
    2. [Help] Replace Weapon
      By lukaluka in forum Hacking Help
      Replies: 2
      Last Post: 08-09-2015, 08:18 AM
    3. [Help] About C, C ++ and fleep video tutorials
      By small in forum GH Tutorials Help
      Replies: 9
      Last Post: 03-13-2015, 09:31 AM
    4. [Help] Need help on some of Fleep's tutorials...
      By jackendra in forum Hacking Help
      Replies: 3
      Last Post: 12-24-2014, 05:10 PM
    5. [Help] Fleep's Tutorials dont work online ?
      By PROGRAMMER-X in forum GH Tutorials Help
      Replies: 2
      Last Post: 08-14-2014, 11:56 AM

    Tags for this Thread