[英]How to make a file filter by hooking kernel32.dll
我是一個新手。 我正在搜索一個python程序,該程序可以隱藏文件或通過使用win API hooking
過濾其中的一些結果來過濾結果來阻止它。 我已經讀過,還有另一種方法,使用文件系統過濾驅動程序,或使用內核模式API掛鈎,我從這里得到了想法。
無論如何,我是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會對過濾器產生影響嗎? 知道了 我現在猜測到這一點,kernel32.dll需要內核模式掛鈎 ,而這是python所無法企及的。
WINDDK
和VS(Visual Studio)
提供了內核調試器和環境,以創建可被exe調用的.sys文件。
只需使用WIN32HLP
定義的WIN32HLP
現在我只是想知道該exe是否可以由python制作(順便說一下,我更喜歡)/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.