SysDbgWriteMsr

Ask your support questions in here

Moderator: Moderator Team

Post Reply
morphique
Posts: 1
Joined: Thu Jan 18, 2007 7:02 am

SysDbgWriteMsr

Post by morphique »

I m trying to write MSR register with following function but NtSystemDebugControl returns 0xc0000022(access denied). Any ideas on what might be the possible cause? Is it because of some new protection?


typedef struct _SysDbgMsr{
ULONG Address;
ULONGLONG *Data;
}SysDbgMsr, *PSysDbgMsr;

void SetMsr(){

PSysDbgMsr msr;
SysDbgMsr readmsr;
msr = (PSysDbgMsr)LocalAlloc(LPTR, sizeof(*msr));
msr->Address = 0x01D9;
ULONGLONG value = 2;
msr->Data = &value;
NtSystemDebugControl = (PNtSystemDebugControl)getfunc("ntdll", "NtSystemDebugControl");
if (!NtSystemDebugControl)
error("failed retrieving the systemdebugcontrol pointer");
NTSTATUS status = NtSystemDebugControl(SysDbgWriteMsr, (PVOID)msr, sizeof(*msr), 0, 0, 0);
printf("Return status: 0x%08x\n", status);

}

Post Reply

Who is online

Users browsing this forum: DotBot [Crawler] and 3 guests