• 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
       
      Portujua's Avatar
      Join Date
      Jan 2013
      Posts
      8
      Thanks (-->)
      0
      Thanks (<--)
      0

      Question Can't access handler? Why?

      Silent VPN
      Hi, i'm trying to make a bot for an online game... Not hacking, just like a macro to send key strokes to the game .. But, when i check for "hProc" it doesn't exist..
      Here's the code:
      Code:
      HWND hWnd = NULL;
      DWORD dwProcId = NULL;
      	HANDLE hProc = NULL;	
      
      	while (1 == 1)
      	{
      		hWnd = FindWindow(L"Eden Eternal                   ", L"Eden Eternal                   ");
      		if (hWnd)
      		{
      			GetWindowThreadProcessId(hWnd, &dwProcId);
      			if (dwProcId)
      			{
      				hProc = OpenProcess(PROCESS_ALL_ACCESS, false, dwProcId);
      				if (hProc)
      				{
      					cout << "FOUND IT" << endl;
      					break;
      				}
                                      else
                                      {
                                            cout << "hProc is null" << endl;
                                      }
                             }
                      } 
             }
      It's telling me that hProc doesn't exist.. Maybe it has something to be with the window info? idk, having all those blank spaces.... (?)

      As you may know by now, the game is Eden Eternal...

      EDIT: The code is working perfectly cause i tested on other app, but idk why it can't access process handler in this game :S

    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
      Run with the same elevation as game, eg with admin rights.
      Can't access handler? Why?

    3. #3
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      Portujua's Avatar
      Join Date
      Jan 2013
      Posts
      8
      Thanks (-->)
      0
      Thanks (<--)
      0
      Still nothing.... :S can't access hProc neither send key strokes using PostMessage method (that uses only hWnd)

      Code:
      bool SendKey(UINT uiKeyValue)
      {
                return PostMessage(hWnd, WM_KEYDOWN, uiKeyValue, (MapVirtualKey(uiKeyValue, 0) << 16) + 1);
      }

    4. #4
      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
      Are you 100% sure that only openprocess fails? Add more checks to your code and see where it actually does.

      If it's the window you can't find, try this:
      Code:
      hWnd = FindWindow(L"Eden Eternal", 0);
      https://msdn.microsoft.com/en-us/lib...=vs.85%29.aspx
      Can't access handler? Why?

    5. #5
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      Portujua's Avatar
      Join Date
      Jan 2013
      Posts
      8
      Thanks (-->)
      0
      Thanks (<--)
      0
      Yes, i'm sure.. My code it's bigger, i just copy here the more important, here's the full code:


      Code:
      bool SendKey(UINT uiKeyValue)
      {
          return PostMessage( hWnd, WM_KEYDOWN, uiKeyValue, (MapVirtualKey(uiKeyValue, 0) << 16) + 1));
      }
      
      
      
      void main()
      {	
      	DWORD dwProcId = NULL;
      	HANDLE hProc = NULL;	
      
      	while (1 == 1)
      	{
      		hWnd = FindWindow(L"Eden Eternal                              ", L"Eden Eternal                              ");
      		if (hWnd)
      		{
      			GetWindowThreadProcessId(hWnd, &dwProcId);
      			if (dwProcId)
      			{
      				hProc = OpenProcess(PROCESS_ALL_ACCESS, false, dwProcId);
      				if (hProc)
      				{
      					cout << "EDEN encontrado" << endl;
      					SendKey(0x20);
      					SendKey(0x4B);
      					break;
      				}
      				else
      				{
      					if (SendKey(0x20))
      						cout << "Espacio mandado" << endl;
      					else
      						cout << "No pudo enviarse ESPACIO" << endl;
      					if (SendKey(0x6C))
      						cout << "Enter Mandado?? " << endl;
      					else
      						cout << "No pudo enviarse ENTER" << endl;
      					cout << "No existe hProc" << endl;
      					break;
      				}
      			}
      			else
      			{
      				cout << "No se pudo asignar dwProcId" << endl;
      				break;
      			}
      		}
      		else
      		{
      			system("cls");
      			cout << "EDEN NOT FOUND" << endl;
      			break;
      			//system("PAUSE");
      		}
      	}
      	system("pause");
      It's always going through that hProc else statement...

      By the way, i can't search for "Eden Eternal" without spaces cause that returns nothing.. Thats not the name of the window neither the process class... also, i just realize it changes everytime i run the game.. i had "Eden Eternal " on my code, i re-open the game and it changed to "Eden Eternal " (more spaces, this shit is not showing spaces but they're changing everytime i run the game)
      Last edited by Portujua; 03-27-2013 at 02:26 PM.

    6. #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
      After calling OpenProcess, call GetLastError and print out what it returns (https://msdn.microsoft.com/en-us/lib...=vs.85%29.aspx). I'm guessing it's still to do with privileges and lack of some rights..
      Can't access handler? Why?

    7. #7
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      Portujua's Avatar
      Join Date
      Jan 2013
      Posts
      8
      Thanks (-->)
      0
      Thanks (<--)
      0
      I was actually thinking about that, but the game only runs as administrator... So, if it's lacking of privileges even if run my code as administrator what can i do? :S i'll do that and post result.

    8. #8
      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 Portujua View Post
      I was actually thinking about that, but the game only runs as administrator... So, if it's lacking of privileges even if run my code as administrator what can i do? :S i'll do that and post result.
      Try enable debugging privileges for example, loads of reading about that topic on the web.
      Can't access handler? Why?

    9. #9
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      Portujua's Avatar
      Join Date
      Jan 2013
      Posts
      8
      Thanks (-->)
      0
      Thanks (<--)
      0
      Okay, GetLastError() returns a 5... How exactly do i use FormatMessage() to see it as string?, i mean.. what parameters should i pass? lol

      Code:
      DWORD WINAPI FormatMessage(
        _In_      DWORD dwFlags,
        _In_opt_  LPCVOID lpSource,
        _In_      DWORD dwMessageId,
        _In_      DWORD dwLanguageId,
        _Out_     LPTSTR lpBuffer,
        _In_      DWORD nSize,
        _In_opt_  va_list *Arguments
      );
      O.o?

    10. #10
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      Portujua's Avatar
      Join Date
      Jan 2013
      Posts
      8
      Thanks (-->)
      0
      Thanks (<--)
      0
      Silent VPN
      Okay, about debugging privileges.. I found this code:

      Code:
      #pragma comment(lib, "advapi32.lib")
      
      BOOL SetPrivilege(
          HANDLE hToken,          // access token handle
          LPCTSTR lpszPrivilege,  // name of privilege to enable/disable
          BOOL bEnablePrivilege   // to enable or disable privilege
          ) 
      {
          TOKEN_PRIVILEGES tp;
          LUID luid;
      
          if ( !LookupPrivilegeValue( 
                  NULL,            // lookup privilege on local system
                  lpszPrivilege,   // privilege to lookup 
                  &luid ) )        // receives LUID of privilege
          {
              printf("LookupPrivilegeValue error: %u\n", GetLastError() ); 
              return FALSE; 
          }
      
          tp.PrivilegeCount = 1;
          tp.Privileges[0].Luid = luid;
          if (bEnablePrivilege)
              tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
          else
              tp.Privileges[0].Attributes = 0;
      
          // Enable the privilege or disable all privileges.
      
          if ( !AdjustTokenPrivileges(
                 hToken, 
                 FALSE, 
                 &tp, 
                 sizeof(TOKEN_PRIVILEGES), 
                 (PTOKEN_PRIVILEGES) NULL, 
                 (PDWORD) NULL) )
          { 
                printf("AdjustTokenPrivileges error: %u\n", GetLastError() ); 
                return FALSE; 
          } 
      
          if (GetLastError() == ERROR_NOT_ALL_ASSIGNED)
      
          {
                printf("The token does not have the specified privilege. \n");
                return FALSE;
          } 
      
          return TRUE;
      }

      And i'm calling it like this:

      Code:
      HANDLE currentProcessToken;
          OpenProcessToken(GetCurrentProcess(), TOKEN_ALL_ACCESS, &currentProcessToken);
          SetPrivilege(currentProcessToken,TEXT("SeDebugPrivilege") ,true);

      But it's telling me "The token does not have the specified privileges."

    Page 1 of 2 12 LastLast

    Similar Game Hacker Threads

    1. [Help] Cheat Engine Access violation
      By Clarityworld in forum Hacking Help
      Replies: 1
      Last Post: 04-03-2016, 10:00 AM
    2. [Help] Finding a way to access a specific value
      By Yothri in forum Hacking Help
      Replies: 10
      Last Post: 10-11-2015, 12:59 PM
    3. How do I access process threads - to inject code?
      By SICGames88 in forum Hacking Help
      Replies: 3
      Last Post: 09-13-2015, 04:28 PM
    4. [Help] how does one access console commands?
      By habit in forum C/C++
      Replies: 2
      Last Post: 01-17-2015, 09:32 PM
    5. Access Denied - wat
      By squeenie in forum C#
      Replies: 13
      Last Post: 03-31-2013, 07:15 AM

    Tags for this Thread