我是挂钩的新手。我正在搜索一个python程序,它可以隐藏文件或通过使用win API hooking
过滤其中一些来过滤结果来阻止它。我已经读过,还有另一种方法可以使用文件系统过滤驱动程序,或使用内核模式API挂钩,我从here得到了这个想法。
无论如何,我是python的家伙,所以我希望它在python中,搜索我到达PyBox。这是我可以将某些DLL注入应用程序然后可以运行它的地方。
以下是执行此操作的代码:
if kernel32.CreateProcessA(self.exe,
None,
None,
None,
None,
creation_flags,
None,
None,
byref(startupinfo),
byref(process_information)):
self.pid = process_information.dwProcessId
self.tid = process_information.dwThreadId
self.h_process = process_information.hProcess
self.h_thread = process_information.hThread
print "Process successfully launched with PID %d." % self.pid
return True
else:
print "Process could not be launched!"
raise WinError()
return False
这会以暂停模式创建进程,然后:
def resume(self):
if (kernel32.ResumeThread(self.h_thread) == 0):
print "Process could note be resumed!"
raise WinError()
return False
else:
print "Process resumed."
return True
此函数在注入DLL后恢复进程。我想知道两件事:
ntQueryDirectoryfile function
或zwQueryDirectoryfile function
,以便我可以向文件添加过滤器而不是阻止它。那么DLL会对过滤器产生任何影响吗?答案 0 :(得分:0)
顺便说一句。 我现在猜测kernel32.dll需要内核模式挂钩,这远远不是python的。
WINDDK
和VS(Visual Studio)
提供内核调试器和环境来创建可以调用exe的.sys文件。
只需使用WIN32HLP
现在我只是想知道这个exe是否可以用python制作(顺便提一下)/