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 


[Help] Driver Crashes...
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Sun Jan 18, 2009 5:04 pm    Post subject: [Help] Driver Crashes... Reply with quote

Well... I modified my driver so that it stores the call numbers and where they point then setting them after they have hooked it.

Now when I try to open applications, it gives me an error telling me that cannot write to physical memory or something... I think I screwed up my NtWriteVirtualMemory Like this...


Last edited by dnsi0 on Tue Jan 20, 2009 8:34 pm; edited 1 time in total
Back to top
View user's profile Send private message
BanMe
Master Cheater
Reputation: 0

Joined: 29 Nov 2005
Posts: 375
Location: Farmington NH, USA

PostPosted: Sun Jan 18, 2009 6:01 pm    Post subject: Reply with quote

try KeServiceDescriptorTable->NumberOfServices*4 ...

also try the disable WriteProtection to restore it and try using return; even though your functions are void...

regards BanMe
Back to top
View user's profile Send private message MSN Messenger
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Sun Jan 18, 2009 6:37 pm    Post subject: Reply with quote

should I disable before I call that load of functions or after?

and you cant return void functions lol.

and NumberOfServices Isn't a member...

Edit: Ok.. I added the disable interrupts.
Loading Driver. Brb after BSOD.

Edit2: Still BSOD.
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sun Jan 18, 2009 7:35 pm    Post subject: Reply with quote

Does it even stall your processor? Because since you didn't create a new thread for it your computer should actually freeze. Rolling Eyes You can't just use KeStallExecutionProcessor in the kernel in the your main thread, it will just stall your entire computer. Everything.

If it hasn't gotten to the freezing yet then you have a problem in SaveSDT.

How about you handle errors?? Handle exceptions?? __try/__except(1)
It'l stop you from crashing. Debug?? You can't fix an error if you don't try all these things.

Code:
BOOLEAN SaveSDT()
{
   ULONG   ulSize, ulRealLoc;
   BOOLEAN bRET;
   LPVOID   FakeSDT;
   
   ulSize = KeServiceDescriptorTable->TableSize*sizeof(ULONG);
   bRET = TRUE;
   if (ulSize > 0)
   {
      FakeSDT = ExAllocatePool(NonPagedPool, ulSize);
      if (FakeSDT != NULL)
      {
         __try
         {
            RtlCopyMemory(FakeSDT, KeServiceDescriptorTable->ServiceTable, ulSize);
            ulRealLoc = &KeServiceDescriptorTable->ServiceTable[0];
            if (ulRealLoc != NULL)
               &KeServiceDescriptorTable->ServiceTable[0] = (ULONG)FakeSDT; // Dunno if this will work...
         }
         __except(1)
         {
            bRET = FALSE;
            DbgPrint("Avoided a BSOD...");
         }
      }
   }
   return bRET;
}

_________________
Back to top
View user's profile Send private message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Sun Jan 18, 2009 8:40 pm    Post subject: Reply with quote

So If i use try/catch blocks it will prevent system crash right?

And my system is weird... It doesn't bsod it just crashes. (Reboots)
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Sun Jan 18, 2009 8:41 pm    Post subject: Reply with quote

dnsi0 wrote:
So If i use try/catch blocks it will prevent system crash right?

And my system is weird... It doesn't bsod it just crashes. (Reboots)


Im no expert, but isn't that a sign that you are writing too big of a buffer or something. or just a general write fault?

_________________
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sun Jan 18, 2009 8:52 pm    Post subject: Reply with quote

Make sure to uncheck restart automatically:


Take Off .png
 Description:
 Filesize:  80.58 KB
 Viewed:  7049 Time(s)

Take Off .png



_________________
Back to top
View user's profile Send private message
sphere90
Grandmaster Cheater
Reputation: 0

Joined: 24 Jun 2006
Posts: 912

PostPosted: Sun Jan 18, 2009 11:06 pm    Post subject: Reply with quote

The reason of BSOD is because he's trying to a write protected region of memory. You need to disable the WP bit first.

Code:
__asm
{
   cli
   mov eax,CR0
   and eax,not 0x10000
   mov CR0,eax
}

(ULONG)KeServiceDescriptorTable->ServiceTable=(ULONG)FakeSDT;

__asm
{
   mov eax,CR0
   xor eax,0x10000
   mov CR0,eax
   sti
}

_________________
Give a hungry man a fish and he'll be full for a day. Teach a hungry man how to fish and he'll be full for the rest of his life.
Back to top
View user's profile Send private message
rapion124
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Mar 2007
Posts: 1095

PostPosted: Mon Jan 19, 2009 10:49 am    Post subject: Reply with quote

That's why you should include exception handling code.
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Mon Jan 19, 2009 11:15 am    Post subject: Reply with quote

Just wondering, is KeServiceDescriptorTable documented anywhere?
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Mon Jan 19, 2009 11:20 am    Post subject: Reply with quote

oib111 wrote:
Just wondering, is KeServiceDescriptorTable documented anywhere?


Check OSR.
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Mon Jan 19, 2009 11:34 am    Post subject: Reply with quote

smartz993 wrote:
oib111 wrote:
Just wondering, is KeServiceDescriptorTable documented anywhere?


Check OSR.


You mean http://www.osronline.com/ ?

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Mon Jan 19, 2009 11:38 am    Post subject: Reply with quote

oib111 wrote:
smartz993 wrote:
oib111 wrote:
Just wondering, is KeServiceDescriptorTable documented anywhere?


Check OSR.


You mean http://www.osronline.com/ ?


Yes, that's what i mean.




dnsi0 wrote:
should I disable before I call that load of functions or after?

and you cant return void functions lol.

and NumberOfServices Isn't a member...

Edit: Ok.. I added the disable interrupts.
Loading Driver. Brb after BSOD.

Edit2: Still BSOD.



Lol are you kidding me ?

and you cant return void functions lol.

Since when ? Dumb fucks =[
Back to top
View user's profile Send private message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Mon Jan 19, 2009 6:35 pm    Post subject: Reply with quote

whats the equivalent of the @ symbol from delphi to C?

so @variable would return where the variable is located as a pointer.

Nvm... Found it its the & symbol...
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Mon Jan 19, 2009 7:10 pm    Post subject: Reply with quote

& - Reference to (or "Address of..")
* - Dereference (Value pointed by)

_________________
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
Goto page 1, 2, 3  Next
Page 1 of 3

 
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