コード例 #1
0
ファイル: __init__.py プロジェクト: palaniyappanBala/pyboxed
def init():
    """Initializes the backend of PyBox. Checks if a native callback
    is set up and creates management objects. """
    global HOOK_MANAGER, MODULES
    logging.debug("pybox.init - Starting script inside of process.")
    logging.debug("pybox.init - DLL CallbackAddr: " + hex(CB_ADDR))
    gen_cb_installed = emb.dllAttachPythonCallback(generic_callback_handler)
    if gen_cb_installed == 0:
        logging.debug("pybox.init - Python Callback attached.")
    else:
        logging.error("pybox.init - Failed: Attach python callback, error "\
                      "code: " + str(gen_cb_installed))

    HOOK_MANAGER = hooking.PyHookManager()
    MODULES = emodules.ExecModulesInfo()

    emb.setCleanupFunction(cleanup)

    logging.debug("pybox.init - exiting.")
コード例 #2
0
ファイル: __init__.py プロジェクト: captincook/pyboxed
def init():
    """Initializes the backend of PyBox. Checks if a native callback
    is set up and creates management objects. """
    global HOOK_MANAGER, MODULES
    logging.debug("pybox.init - Starting script inside of process.")
    logging.debug("pybox.init - DLL CallbackAddr: " + hex(CB_ADDR))
    gen_cb_installed = emb.dllAttachPythonCallback(generic_callback_handler)
    if gen_cb_installed == 0:
        logging.debug("pybox.init - Python Callback attached.")
    else:
        logging.error("pybox.init - Failed: Attach python callback, error "\
                      "code: " + str(gen_cb_installed))
    
    HOOK_MANAGER = hooking.PyHookManager()
    MODULES = emodules.ExecModulesInfo()

    emb.setCleanupFunction(cleanup)    
    
    logging.debug("pybox.init - exiting.")
コード例 #3
0
ファイル: starter.py プロジェクト: captincook/pyboxed
import pybox
import time

from pybox import proctrack

def register_hooks():
    """Register the required hooks"""

    logging.debug("Hooking")

def cleaner():
    logging.debug("cleaning up...")


if __name__ == "__main__":
    logging.basicConfig(format = "%(asctime)s - %(levelname)s - %(message)s",
                        level = logging.INFO)
    
    pybox.init()
    import emb
    emb.setCleanupFunction(cleaner)

    logging.info("Start")
    
    register_hooks()
    proctrack.init()
    
    logging.info("Let's get ready to rumble")
    time.sleep(2)
    logging.info("Done")
コード例 #4
0
ファイル: __init__.py プロジェクト: palaniyappanBala/pyboxed
def set_cleanup_function(cleanup_function):
    """Sets the cleanup function, which is called when PyBox terminates.
    @param cleanup_function: The callback to execute on cleanup
    @type cleanup_function: function
    """
    emb.setCleanupFunction(cleanup_function)
コード例 #5
0
ファイル: starter.py プロジェクト: palaniyappanBala/pyboxed
from pybox import proctrack


def register_hooks():
    """Register the required hooks"""

    logging.debug("Hooking")


def cleaner():
    logging.debug("cleaning up...")


if __name__ == "__main__":
    logging.basicConfig(format="%(asctime)s - %(levelname)s - %(message)s",
                        level=logging.INFO)

    pybox.init()
    import emb
    emb.setCleanupFunction(cleaner)

    logging.info("Start")

    register_hooks()
    proctrack.init()

    logging.info("Let's get ready to rumble")
    time.sleep(2)
    logging.info("Done")
コード例 #6
0
ファイル: __init__.py プロジェクト: captincook/pyboxed
def set_cleanup_function(cleanup_function):
    """Sets the cleanup function, which is called when PyBox terminates.
    @param cleanup_function: The callback to execute on cleanup
    @type cleanup_function: function
    """
    emb.setCleanupFunction(cleanup_function)