首页
社区
课程
招聘
[旧帖] [求助]驱动编译错误 0.00雪花
发表于: 2011-2-10 17:02 928

[旧帖] [求助]驱动编译错误 0.00雪花

2011-2-10 17:02
928
想写个驱动把指定进程名改成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期)

收藏
免费 0
支持
分享
最新回复 (1)
雪    币: 0
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
写错了应该是这个
#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
{
  ZwQuerySystemInformation(SystemInformationClass,SystemInformation,SystemInformationLength,ReturnLength OPTIONAL);
}
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;;
}
104的错误,到底是什么原因啊,请高手指点
2011-2-10 17:16
0
游客
登录 | 注册 方可回帖
返回
//