A forum for reverse engineering, OS internals and malware analysis 

Ask your beginner questions here.
 #23751  by Vrtule
 Tue Sep 02, 2014 8:39 pm
Hello,
Code: Select all
PKPCR pKpCR = (PKPCR) _readgsdword(FIELD_OFFSET(KPCR, Self));
You should use something like readgsqword if such a macro exists. Otherwise, you get only the lower 32 bits of the pointer which makes it corrupted.
 #23765  by g4mbit
 Wed Sep 03, 2014 1:13 pm
I'm not sure I get why you gave that link. I do have the complete structure already but thanks anyways ;)

I've read (can't remember exactly where) that in x64, the kdVersionBlock might be zero'd out and that a different technique needed to be used to access it. Do you guys know anything about that? Or how I can get a hold of that structure?
 #23766  by EP_X0FF
 Wed Sep 03, 2014 1:27 pm
g4mbit wrote:I'm not sure I get why you gave that link. I do have the complete structure already but thanks anyways ;)
Because it have ready to use KeGetPcr and KeGetCurrentPrcb for x86-x64.