想写个驱动把指定进程名改成svchost.exe,然后进程ID改成0,不过编译错误,104个错误
#include <ntddk.h>
#include <windows.h>
NTKERNELAPI
NTSTATUS ZwQuerySystemInformation(
IN ULONG SystemInformationClass,
IN OUT PVOID SystemInformation,
IN ULONG SystemInformationLength,
OUT PULONG ReturnLength OPTIONAL
);
char* oldname="waigua.exe";
char* newname="svchost.exe";
DWORD newid=0;
NTSTATUS MyZwQuerySystemInformation(
ULONG SystemInformationClass,
PVOID SystemInformation,
ULONG SystemInformationLength,
ReturnLength OPTIONAL
)
{
pInfo = (PSYSTEM_PROCESS_INFORMATION)SystemInformation;
while(1)
{
LPWSTR pszProcessName = pInfo->ProcessName.Buffer;
if((char*)pszProcessName==oldname)
{
pInfo->ProcessName.Buffer=newname;
pInfo->ProcessId=newid;
return 0;
}
else
{
_asm
{
jump ZwQuerySystemInformation
}
}
if (pInfo->NextEntryDelta == 0)
{
break;
}
pInfo = (PSYSTEM_PROCESS_INFORMATION)(((PUCHAR)pInfo) + pInfo->NextEntryDelta);
}
}
extern "C" NTSTATUS DriverEntry (IN PDRIVER_OBJECT pDriverObject,IN PUNICODE_STRING pRegistryPath)
{
ZwQuerySystemInformation=MyZwQuerySystemInformation;
return STATUS_SUCCESS;;
}
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)