* Add m.add_hook test * Add @m.hook test * Add `hook` decorator for convenience * Update readme and examples * Update run_callback * Improve `add_hook` docstring expound on callback structure * Rm debug print * Improve docstring
22 lines
543 B
Python
22 lines
543 B
Python
import unittest
|
|
|
|
from manticore import Manticore
|
|
|
|
class ManticoreTest(unittest.TestCase):
|
|
def setUp(self):
|
|
self.m = Manticore('test/binaries/arguments_linux_amd64')
|
|
|
|
def test_add_hook(self):
|
|
def tmp(state):
|
|
pass
|
|
entry = 0x00400e40
|
|
self.m.add_hook(entry, tmp)
|
|
self.assertTrue(tmp in self.m._hooks[entry])
|
|
|
|
def test_hook_dec(self):
|
|
entry = 0x00400e40
|
|
@self.m.hook(entry)
|
|
def tmp(state):
|
|
pass
|
|
self.assertTrue(tmp in self.m._hooks[entry])
|