Skip to content

kernullist/PyProcFilter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyProcFilter

Process Filter for Python

What

프로세스 실행 감시 및 차단을 간단하게 할 수 있도록 해주는 파이썬 도우미

Target Environment

  • Windows (x86 / x64)
  • Python 3.5

Development Environment

  • Visual Studio 2015
  • WDK 10586
  • Python 3.5

Demo

Demo Video

Example

import sys
from  pyprocfilterhelper import *

# 프로세스 실행시 호출되는 콜백
# True 리턴시 실행 허용
# False 리턴시 실행 차단
def process_callback(parentPid, processPid, processPath):
    print("{:d} ==> {:d} path : {:s}".format(parentPid, processPid, processPath))

    # 메모장 실행 차단!
    if str(processPath).lower().find("c:\\windows\\system32\\notepad.exe") != -1:
        print("Block!!!")
        return False

    return True


if __name__ == '__main__':

    pf = pyprocfilterhelper()

    # 필터 설치
    if pf.install() is False:
        print("install error")
        sys.exit(0)

    # 필터링 시작
    ret = pf.start(process_callback)
    if ret is True:
        print("Process Filtering Started...");
        try:
            while True:
                pass
        except KeyboardInterrupt:
            # 필터링 중지
            pf.stop()
            print("Process Filtering Stoped...");
    else:
        print("Error pyprocfilter()")

    # 필터 제거
    pf.uninstall()

About

Process Filter for Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages