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 


Loading your driver, receiving output..

 
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: Thu Aug 09, 2012 5:36 am    Post subject: Loading your driver, receiving output.. Reply with quote

I am on a Windows 7 x86 os. Each time I attempt to load my driver, I get no errors however, when I wait to see output from DebugView, I don't see my drivers text.

I am lost, and I don't know how to fix this error.

Driver.c

Code:

#include <ntddk.h>

NTSTATUS DriverEntry (PDRIVER_OBJECT pDriverObject, PUNICODE_STRING  pRegistryPath)
{
   DbgPrint("DriverEntry Called \r\n");

   return STATUS_SUCCESS;
}


Loader.cpp

Code:

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

using namespace std;

void main ()
{
   // Open the service manager
   SC_HANDLE hscManager = OpenSCManager ( NULL, NULL, SC_MANAGER_CREATE_SERVICE );
   SERVICE_STATUS ss;

   if ( hscManager )
   {
      // Attempt to open service
      SC_HANDLE hService = OpenService ( hscManager, "First", SERVICE_START | DELETE | SERVICE_STOP );

      // If the service does not exist, create the service
      if ( !hService )
         hService = CreateService ( hscManager, "First", "First Driver", SERVICE_START | DELETE | SERVICE_STOP, SERVICE_KERNEL_DRIVER,
                  SERVICE_DEMAND_START, SERVICE_ERROR_IGNORE, "C:\\FirstDriver.sys", NULL, NULL, NULL, NULL, NULL );

      if ( hService )
      {
         // Start the driver
         StartService ( hService, 0, NULL );

         cout << "Enter any key to close the driver." << endl;
         system ("PAUSE");

         // Stop the driver
         ControlService(hService, SERVICE_CONTROL_STOP, &ss);
         CloseServiceHandle ( hService );
            DeleteService(hService);
      }
      else
         cout << "Failed to create the service." << endl;
   }
   else
      cout << "Failed to open service." << endl;

   // Close the manager
   CloseServiceHandle ( hscManager );

   system ( "CLS" );
   system ( "PAUSE" );
}


thx
Back to top
View user's profile Send private message MSN Messenger
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25833
Location: The netherlands

PostPosted: Thu Aug 09, 2012 8:44 am    Post subject: Reply with quote

is dbgview set to capture all kernelmode messages? (default it's off)

Also, check if your service is valid (!hService) is not a good method, as INVALID_HANDLE (-1) is also not 0

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Thu Aug 09, 2012 10:26 am    Post subject: Reply with quote

Yep that fixed it.

How do I go about viewing the global memory pool?
Back to top
View user's profile Send private message MSN Messenger
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