问在DELPHI中怎么实现在进程列表中隐藏运行的程序

问在DELPHI中怎么实现在进程列表中隐藏运行的程序,第1张

恢复隐藏的进程然后用常规的方法来取得

你得先知道它是怎么隐藏的,可能是被HOOK了系统的API,你恢复一下就行了

还有一种方法是穷举所有的PID值直接打开进程的空间

当然得先把系统可见的PID排除,然后穷举

for

i:=0

to

10000

{这个值可以再大些,没关系}

do

begin

if

i=系统可见的

then

//系统可见的,肯定不是要找的进程

else

begin

if

OpenProcess(XXX,XXX,i)>0

then

begin

//可能就是要找的进程的PID

end

end

end

我不是说了麻,系统中能列出的可以直接跳过

if

i=系统可见的

then

//系统可见的,肯定不是要找的进程

else

这里跳过系统中可见的

那得看它是如何隐脊逗贺藏的,樱派是HOOK

API的,还是删除了进程的双向链表的对象的

不过这些都得在内核中 *** 作,穷举是最方便不过的指信事情了

//隐藏外部程序的窗体

procedure

TForm1.Button1Click(Sender:

TObject)

var

hw:THandle

begin

hw:=Findwindow(nil,'窗体标题')

ShowWindow(hw,SW_HIDE)

end

//显示外部程序的窗体

procedure

TForm1.Button4Click(Sender:

TObject)

var

hw:THandle

begin

hw:=Findwindow(nil,'窗体标题')

ShowWindow(hw,SW_SHOW)

end

代码中'窗局笑体标题'桐森含处可能要修改为:'tomcat'

,具体视tomcat的春察窗体标题栏文字而定。

用下面这个函数可以解决你的问题:

function  WinExecAndWait32(FileName:String  Visibility  :  integer):  DWORD  

var  

        zAppName:array[0..512]  of  char

        zCurDir:array[0..255]  of  char

        WorkDir:String

    租携山    StartupInfo:TStartupInfo

        ProcessInfo:TProcessInformation

begin

        StrPCopy(zAppName,FileName)

        GetDir(0,WorkDir)

        StrPCopy(zCurDir,WorkDir)

        FillChar(StartupInfo,Sizeof(StartupInfo),#0)

        StartupInfo.cb  :=  Sizeof(StartupInfo)

        StartupInfo.dwFlags  :=  STARTF_USESHOWWINDOW

        StartupInfo.wShowWindow  :=  Visibility

        if  not  CreateProcess(

        nil,

        zAppName,  {  pointer  to  command  line  string  }

  隐手      nil,  {  pointer  to  process  security  attributes  }

        nil,  {  pointer  to  thread  security  attributes  }

        false,  {  handle  inheritance  flag  }

        CREATE_NEW_CONSOLE  or  {  creation  flags  }

        NORMAL_PRIORITY_CLASS,

        nil,  {  pointer  to  new  environment  block  }

        nil,  {  pointer  to  current  directory 弊中 name  }

        StartupInfo,  {  pointer  to  STARTUPINFO  }

        ProcessInfo  {  pointer  to  PROCESS_INF  }

        )

        then  Result  :=  $FFFFFFFF  else  begin

                WaitforSingleObject(ProcessInfo.hProcess,INFINITE)

                GetExitCodeProcess(ProcessInfo.hProcess,Result)

        end

end


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/12550504.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-26
下一篇 2023-05-26

发表评论

登录后才能评论

评论列表(0条)

保存