0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

pyreboxの作法 その2

Posted at

概要

pyreboxの作法、調べて見た。
pluginを作って見た。

サンプルコード

リムーブされたプロセスの表示。

from __future__ import print_function
from ipython_shell import start_shell
from api import CallbackManager
from api import BP

cm = None
pyrebox_print = None

def remove_proc(params):
	pid = params["pid"] 
	pgd = params["pgd"]
	name = params["name"]
	pyrebox_print("Process removed! pid: %x, pgd: %x, name: %s" % (pid, pgd, name))

def clean():
	global cm
	print("[*]	Cleaning module")
	cm.clean()
	print("[*]	Cleaned module")

def initialize_callbacks(module_hdl, printer):
	global cm
	global pyrebox_print
	pyrebox_print = printer
	pyrebox_print("[*]	Initializing callbacks")
	cm = CallbackManager(module_hdl, new_style = True)
	cm.add_callback(CallbackManager.REMOVEPROC_CB, remove_proc, name="vmi_remove_proc")
	pyrebox_print("[*]	Initialized callbacks")

if __name__ == "__main__":
	print("[*] Loading python module %s" % (__file__))


以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?