Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Attach a debugger

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Sat Jan 08, 2011 11:35 pm    Post subject: Attach a debugger Reply with quote

I want to add a debugger to my memory scanner before I release it to the public, so far the good features it has is:

- Super fast scans (really close to CE's scans)
- HEX View
- Pointer Scanner (Faster then CE's and MHS, i'll provide a video later to prove it)

I want to add a debugger to find inline asm code but I don't know where to start, can any of you guys provide a link or comment something that can help me out?

Thank you Smile

EDIT

so far this is what I have (attaching a debugger):

Code:

#include <windows.h>
#include <iostream>

using namespace std;

void main ()
{
   system ( "TITLE Debugger" );
   system ( "COLOR 3" );

   DWORD ProcessID;

   HANDLE hToken;
   TOKEN_PRIVILEGES tkp;

   if ( OpenProcessToken ( GetCurrentProcess (), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken ) )
   {
      LookupPrivilegeValue ( NULL, SE_DEBUG_NAME, &tkp.Privileges [0].Luid );

      tkp.PrivilegeCount = 1;
      tkp.Privileges [0].Attributes = SE_PRIVILEGE_ENABLED;

      AdjustTokenPrivileges ( hToken, false, &tkp, sizeof (tkp), NULL, NULL );
   }

   HWND hWnd = FindWindowA ( NULL, "Cheat Engine Tutorial v3" );
   GetWindowThreadProcessId ( hWnd, &ProcessID );

   if ( DebugActiveProcess ( ProcessID ) )
   {
      cout << "Attached the debugger to the target" << endl << endl;

      DEBUG_EVENT dbg;

      WaitForDebugEvent ( &dbg, 100 );

      cout << "Process ID: " << dbg.dwProcessId << endl;
      cout << "Thread  ID: "  << dbg.dwThreadId  << endl << endl;

      ContinueDebugEvent ( dbg.dwProcessId, dbg.dwThreadId, DBG_CONTINUE );
   }
   else
   {
      cout << "failed to debug" << endl;
   }

   DebugActiveProcessStop ( ProcessID );

   cin.get ();
}


excuse my void main, i did it because of a rush.
Back to top
View user's profile Send private message MSN Messenger
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sun Jan 09, 2011 12:41 am    Post subject: Reply with quote

was it really that hard to type 7 more characters
Back to top
View user's profile Send private message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Sun Jan 09, 2011 12:45 am    Post subject: Reply with quote

I just realized i'd have to find the bytes of each address and convert them to inline asm, these api's are useless.
Back to top
View user's profile Send private message MSN Messenger
NoMercy
Master Cheater
Reputation: 1

Joined: 09 Feb 2009
Posts: 289

PostPosted: Sun Jan 09, 2011 3:31 am    Post subject: Reply with quote

Is a debugger not based on BreakPoints?
Back to top
View user's profile Send private message
zile
Advanced Cheater
Reputation: 0

Joined: 11 Jul 2009
Posts: 75

PostPosted: Sun Jan 09, 2011 4:14 am    Post subject: Reply with quote

are you sure your pointer scanner is faster than ce's , cause ce is so damn fast and it scans for many pointer levels as well, does your pointer scanner has pointer level option?

and i think darkbyte gave a few advice regarding what you are doing before
Back to top
View user's profile Send private message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Sun Jan 09, 2011 1:31 pm    Post subject: Reply with quote

@zile I will show a video of my pointer-scanner, however, it only scans for level 1 pointers

@NoMercy I think so, we set a breakpoint to find what out accesses / writes to the address when it reaches the address.
Back to top
View user's profile Send private message MSN Messenger
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sun Jan 09, 2011 2:21 pm    Post subject: Reply with quote

You aren't using the debugging API correctly as it is, there is no loop to handle each exception, there's no checks if things fail etc. Rather then keep rushing into everything you do and not understand it, why not go read up on the debugging API and learn the flow of how they work.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Sun Jan 09, 2011 6:38 pm    Post subject: Reply with quote

These tutorials may be conceptually helpful:
http://win32assembly.online.fr/tut28.html
http://win32assembly.online.fr/tut29.html
http://win32assembly.online.fr/tut30.html
Back to top
View user's profile Send private message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Sun Jan 09, 2011 7:12 pm    Post subject: Reply with quote

iPromise wrote:
I just realized i'd have to find the bytes of each address and convert them to inline asm, these api's are useless.


Maybe today is the day you learn that real software just isn't a wrapper around an API, and that there is actual work involved.

Probably not though. Laughing
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites