text stringlengths 1 93.6k |
|---|
for h in g_logger.handlers:
|
g_logger.removeHandler(h)
|
g_logger.setLevel(logging.DEBUG)
|
handler = logging.StreamHandler()
|
format_str = '[%(asctime)s] [%(levelname)s] [%(threadName)s]: %(message)s'
|
formatter = logging.Formatter(format_str, datefmt='%d/%m/%Y %I:%M:%S')
|
handler.setFormatter(formatter)
|
g_logger.addHandler(handler)
|
def launch_skelenox():
|
"""
|
Create the instance and launch it
|
"""
|
configname = os.path.dirname(__file__) + "/" + "skelsettings.json"
|
skelenox = SkelCore(configname)
|
skelenox.run()
|
return skelenox
|
def PLUGIN_ENTRY():
|
"""
|
IDAPython plugin wrapper
|
"""
|
idaapi.auto_wait()
|
return SkelenoxPlugin()
|
class SkelenoxPlugin(idaapi.plugin_t):
|
"""
|
Classic IDAPython plugin
|
"""
|
PLUGIN_NAME = "Skelenox"
|
flags = idaapi.PLUGIN_UNL
|
comment = "Skelenox"
|
help = "Polichombr collaboration agent"
|
wanted_name = "Skelenox"
|
wanted_hotkey = "Ctrl-F4"
|
skel_object = None
|
def init(self):
|
"""
|
IDA plugin init
|
"""
|
self.icon_id = 0
|
self.skel_object = None
|
return idaapi.PLUGIN_OK
|
def run(self, arg=0):
|
self.skel_object = launch_skelenox()
|
return
|
def term(self):
|
if self.skel_object is not None:
|
self.skel_object.end_skelenox()
|
if __name__ == '__main__':
|
# run as a script
|
idaapi.auto_wait()
|
if "skel" in globals() and skel is not None:
|
g_logger.info("Previous instance found, killing it")
|
skel.end_skelenox()
|
skel = launch_skelenox()
|
# <FILESEP>
|
import numpy as np
|
import matplotlib.pyplot as plt
|
# This is a short python script to play around with jumpdiff
|
import jumpdiff as jd
|
# %% Let's first integrate a jump-diffusion process
|
# Define:
|
# integration time and time sampling
|
t_final = 10000
|
delta_t = 0.01
|
# A drift function
|
def a(x):
|
return -0.5*x
|
# and a (constant) diffusion term
|
def b(x):
|
return 0.75
|
# Now define a jump amplitude and rate
|
xi = 2.5
|
lamb = 1.75
|
# and let jdprocess integrate the stochastic path
|
X = jd.jd_process(t_final, delta_t, a=a, b=b, xi=xi, lamb=lamb)
|
# %% Plot the trajectory of the jump-diffusion process
|
fig, ax = plt.subplots(1,1,figsize=(6,3))
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.