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 


NtProtectVirtualMemory

 
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 Nov 03, 2012 3:26 pm    Post subject: NtProtectVirtualMemory Reply with quote

How come MSDN has no documentation on this function?

Its also not defined in the ntdll so I how do I access it with my driver?

Any ideas? If its not defined, and I need to obtain its address what function can I use?

Thanks a bunch
Back to top
View user's profile Send private message MSN Messenger
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Sat Nov 03, 2012 5:18 pm    Post subject: Reply with quote

http://undocumented.ntinternals.net/UserMode/Undocumented%20Functions/Memory%20Management/Virtual%20Memory/NtProtectVirtualMemory.html

Use MmGetSystemRoutineAddress to get the address of that function

Also, it is exported in ntdll so you can even use it in usermode

_________________
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: Sat Nov 03, 2012 8:38 pm    Post subject: Reply with quote

Code:

// Obtain address to NtProtectVirtualMemory
   RtlInitUnicodeString ( &pText, L"NtProtectVirtualMemory" );
   NtProtect = MmGetSystemRoutineAddress ( &pText );
   DbgPrint ( "%x", NtProtect );


It keeps returning zero.

not much documentation or topcis on MmGetSystemRoutineAddress.
Back to top
View user's profile Send private message MSN Messenger
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Sun Nov 04, 2012 3:22 am    Post subject: Reply with quote

Try the Zw version
_________________
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: Sun Nov 04, 2012 11:21 am    Post subject: Reply with quote

Code:
if ( KeGetCurrentIrql () == PASSIVE_LEVEL )
      DbgPrint ( "Its not the IRQL." );

   // Obtain address to ZwProtectVirtualMemory
   RtlInitUnicodeString ( &pText, L"ZwProtectVirtualMemory" );
   NtProtect = MmGetSystemRoutineAddress ( &pText );
   DbgPrint ( "%x", NtProtect );


It returns zero. ZwReadVirtualMemory and other functions also returns zero. I think the problem is bigger then that?
Back to top
View user's profile Send private message MSN Messenger
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Sun Nov 04, 2012 1:12 pm    Post subject: Reply with quote

ZwReadVirtualMemory is defined in the exports of the kernel and in it's .lib, so if you just define it as a export to be loaded it should just work
Not sure why The MmGetSystemRoutineAddress fails though

_________________
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: Sun Nov 04, 2012 4:01 pm    Post subject: Reply with quote

MmGetSystemRoutineAddress works for any other address like itself and other addresses supported by the DDK I think. How can i grab the kernal address of NtProtectVirtualMemory without using MmGetSystemRoutineAddress?
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