• 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 13

    Thread: DLL Hack

    1. #1
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      zoratz's Avatar
      Join Date
      Jul 2013
      Posts
      47
      Thanks (-->)
      5
      Thanks (<--)
      1

      DLL Hack

      John Kittz
      Hey guys, i'm trying to get around DLL hacking, step by step.. Because Fleep's tutorial about it, doesn't clear my head.

      So, i created a new project like this:
      Win32 Console Application -> DLL / Empty project
      And put this code:
      [PHP]#include <iostream>
      #include <Windows.h>
      #include <string>
      #include <ctime>
      using namespace std;

      string Nops[] = {
      "\x90",
      "\x90\x90",
      "\x90\x90\x90",
      "\x90\x90\x90\x90"
      };

      // ------------- AMMO SETTINGS ------------//
      bool AmmoStatus; //
      char AmmoOpCode[] = "/xFF/x06"; //
      char AmmoDefaultOpCode[] = "\xFF\x0E"; //
      DWORD AmmoAddress = 0x4637E9; //
      // ----------------------------------------//

      void WriteToMemory(DWORD addressToWrite, char* valueToWrite, int byteNum)
      {
      unsigned long OldProtection;

      VirtualProtect((LPVOID)(addressToWrite), byteNum, PAGE_EXECUTE_READWRITE, &OldProtection);

      memcpy( (LPVOID)addressToWrite, valueToWrite, byteNum);

      VirtualProtect((LPVOID)(addressToWrite), byteNum, OldProtection, NULL);
      }

      int Hacks(){
      int GameAvailTMR = clock();
      bool IsGameAvail = true;
      bool ammoStatus = true;

      MessageBoxA(NULL, "Hacks", "Hacks", NULL);

      while(!GetAsyncKeyState(VK_INSERT)){
      MessageBoxA(NULL, "WHILE", "WHILE", NULL);
      if(clock() - OnePressTMR > 400 && IsGameAvail){
      MessageBoxA(NULL, "IF CLOCK", "IF CLOCK", NULL);
      if(GetAsyncKeyState(VK_F1)){
      MessageBoxA(NULL, "IF F1", "IF F1", NULL);
      OnePressTMR = clock();
      if(ammoStatus){
      MessageBoxA(NULL, "AMMOSTATUS", "AMMOSTATUS", NULL);
      WriteToMemory(AmmoAddress, AmmoOpCode, 2);
      ammoStatus = false;
      break;
      }else{
      MessageBoxA(NULL, "ELSE", "ELSE", NULL);
      WriteToMemory(AmmoAddress, AmmoDefaultOpCode, 2);
      ammoStatus = true;
      break;
      }
      }
      }
      }

      return 0;
      }

      DWORD WINAPI Main_thread( LPVOID lpParam )
      {
      MessageBoxA(NULL, "ATTACHED", "ATTACHED", NULL);
      Hacks();
      return S_OK;
      }

      BOOL APIENTRY DllMain( HMODULE hModule,
      DWORD _reason,
      LPVOID lpReserved
      )
      {
      if (_reason == DLL_PROCESS_ATTACH)
      {
      CreateThread(0, 0x1000, &Main_thread, 0, 0, NULL);
      }
      return TRUE;
      }[/PHP]

      It inject sucessfully and changed the code OK (i guess). However, when I shoot (left-clicking) pops up an error and crashes:
      AssaultCube fatal error

      Win32 Exception: 0xc0000005 [0x7c]

      ()
      Now, what i'm doing wrong and how to fix it?
      Last edited by zoratz; 06-19-2014 at 12:01 PM.

    2. #2
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      zoratz's Avatar
      Join Date
      Jul 2013
      Posts
      47
      Thanks (-->)
      5
      Thanks (<--)
      1
      char AmmoOpCode[] = "/xFF/x06";
      char AmmoDefaultOpCode[] = "\xFF\x0E";

      I found the error.. It's not the common bar "/", it's the inversed one "\".. So, I come to another question.

      [1] Why it only works with \ and not with /?

      [2] The 'while' loop makes the game super laggy. How can I fiz that?



      ------------ UPDATE ------------

      [2] I fixed the LAG bug with : Sleep(25). Is there another option?
      Last edited by zoratz; 06-19-2014 at 01:56 PM.

    3. #3
      Coder
      C++(Qt)/C# Coder
       
      Coding
       
      Cyrion's Avatar
      Join Date
      Dec 2013
      Location
      Canada,Québec
      Posts
      110
      Thanks (-->)
      6
      Thanks (<--)
      15
      [2] I fixed the LAG bug with : Sleep(25). Is there another option?
      Youd id the right thing. That's how it works. :P

      Actual project in progress :
      - Cloud File storage using Qt (In the same style as Dropbox)

      DLL Hack

    4. #4
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      zoratz's Avatar
      Join Date
      Jul 2013
      Posts
      47
      Thanks (-->)
      5
      Thanks (<--)
      1
      Quote Originally Posted by Cyrion View Post
      Youd id the right thing. That's how it works. :P
      I understand.

      Now, what can I do to open a prompt command for the hack display, instead of an application window like fleep did?

    5. #5
      Coder
      Creating UE3 x86/x64 tut
       
      Coding
       
      TastyHorror's Avatar
      Join Date
      Oct 2012
      Location
      Canada
      Posts
      184
      Thanks (-->)
      54
      Thanks (<--)
      81
      To answer your question specifically...you would need to create an external hack to create that "console application", as far as I am aware.

      However, there are possible ways to create a console with a DLL hack...

    6. #6
      Hacker
      Turning to page 394...
       
      Coding
       
      Liduen's Avatar
      Join Date
      May 2013
      Location
      Germany
      Posts
      713
      Thanks (-->)
      161
      Thanks (<--)
      225
      AllocConsole();
      AttachConsole(GetProcessId(hModule));
      SetConsoleTitle(L"1337 hack");
      My contributions
      UrbanTerror | OpenGL - ModelLogger | Polymorphic junk code | Tutorial/Article Collection
      Admiring technological singularity

    7. Thanks zoratz thanked for this post
    8. #7
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      zoratz's Avatar
      Join Date
      Jul 2013
      Posts
      47
      Thanks (-->)
      5
      Thanks (<--)
      1
      Quote Originally Posted by Liduen View Post
      AllocConsole();
      AttachConsole(GetProcessId(hModule));
      SetConsoleTitle(L"1337 hack");
      I tested it out with this code:
      LPCSTR GameWindow = "AssaultCube";
      HWND hGameWindow = NULL;
      DWORD proc_id;
      hGameWindow = FindWindow( NULL, GameWindow);
      GetWindowThreadProcessId(hGameWindow, &proc_id);
      AllocConsole();
      AttachConsole(proc_id);
      SetConsoleTitle("1337 hack");
      if(proc_id){
      MessageBoxA(NULL, "Attached", "Attached", NULL);
      }else{
      MessageBoxA(NULL, "NOT Attached", "NOT Attached", NULL);
      }


      The "Attached" message box did pop up..
      But, i'm not able to write to the console with:
      std::cout << "Assault Cube Hack" << std::endl;

      or anything else..
      Last edited by zoratz; 06-20-2014 at 05:09 PM.

    9. #8
      Hacker
      Turning to page 394...
       
      Coding
       
      Liduen's Avatar
      Join Date
      May 2013
      Location
      Germany
      Posts
      713
      Thanks (-->)
      161
      Thanks (<--)
      225
      Is the console window even showing up?
      Use
      _cprintf("%s \n", "1337 hack");

      to write into console.
      My contributions
      UrbanTerror | OpenGL - ModelLogger | Polymorphic junk code | Tutorial/Article Collection
      Admiring technological singularity

    10. #9
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      zoratz's Avatar
      Join Date
      Jul 2013
      Posts
      47
      Thanks (-->)
      5
      Thanks (<--)
      1
      Quote Originally Posted by Liduen View Post
      Is the console window even showing up?.
      The console does open, but i'm not able to write to it.
      Click image for larger version. 

Name:	z5gr.jpg 
Views:	12 
Size:	294.6 KB 
ID:	2648


      Quote Originally Posted by Liduen View Post
      Use
      _cprintf("%s \n", "1337 hack");

      to write into console.
      Well, i think that's C or C# code.. I'm using C++..
      The 'cprintf' does not work for me, and says its 'undeclared'.
      I tryed including <stdio.h>, but didn't work too.
      Last edited by zoratz; 06-21-2014 at 08:58 AM.

    11. #10
      Hacker
      Turning to page 394...
       
      Coding
       
      Liduen's Avatar
      Join Date
      May 2013
      Location
      Germany
      Posts
      713
      Thanks (-->)
      161
      Thanks (<--)
      225
      Cheats'n'Trainers
      Quote Originally Posted by zoratz View Post
      The console does open, but i'm not able to write to it.
      Click image for larger version. 

Name:	z5gr.jpg 
Views:	12 
Size:	294.6 KB 
ID:	2648



      Well, i think that's C or C# code.. I'm using C++..
      The 'cprintf' does not work for me, and says its 'undeclared'.
      I tryed including <stdio.h>, but didn't work too.
      #include <conio.h>

      I used it in my own dll hack, also in C++, so it definitely works.
      My contributions
      UrbanTerror | OpenGL - ModelLogger | Polymorphic junk code | Tutorial/Article Collection
      Admiring technological singularity

    12. Thanks zoratz thanked for this post
    Page 1 of 2 12 LastLast

    Similar Game Hacker Threads

    1. [VideoTutorial] C++ How to Hack Counter Strike Bunny Hop Hack bhop DIFFICULTY [2/10]
      By Fleep in forum GH Hack Video Tutorials
      Replies: 61
      Last Post: 05-25-2017, 10:04 AM
    2. [VideoTutorial] C++ How to HACK Call of Duty 4 Wall Hack with Chams DirectX DIFFICULTY[6/10]
      By Fleep in forum GH Hack Video Tutorials
      Replies: 71
      Last Post: 03-12-2017, 04:47 PM
    3. [Source Code] [Fleep Hack Updated for CS GO] cs go hack source code
      By vikingtiger911 in forum CS:GO Hacks
      Replies: 39
      Last Post: 11-03-2016, 01:43 PM
    4. [VideoTutorial] C++ How to Hack RAPID FIRE Call of Duty 4 Hack DIFFICULTY [3/10]
      By Fleep in forum GH Hack Video Tutorials
      Replies: 12
      Last Post: 08-03-2016, 05:38 AM
    5. [Release] TorchLight 2 Hacks v2.0 - Level hack, Health Hack, Strength and more!
      By Crazywink in forum Other Game Hacks
      Replies: 22
      Last Post: 12-09-2013, 05:35 PM

    Tags for this Thread