diff --git a/proxyclient/m1n1/hv.py b/proxyclient/m1n1/hv.py index 7126b795..63d10fd2 100644 --- a/proxyclient/m1n1/hv.py +++ b/proxyclient/m1n1/hv.py @@ -133,6 +133,7 @@ class HV(Reloadable): self.xnu_mode = False self._update_shell_locals() self.wdt_cpu = None + self.hook_exceptions = False def _reloadme(self): super()._reloadme() @@ -579,7 +580,8 @@ class HV(Reloadable): ctx.elr += 4 - #self.patch_exception_handling() + if self.hook_exceptions: + self.patch_exception_handling() return True diff --git a/proxyclient/tools/run_guest.py b/proxyclient/tools/run_guest.py index 373c12bb..53c4240e 100755 --- a/proxyclient/tools/run_guest.py +++ b/proxyclient/tools/run_guest.py @@ -10,6 +10,7 @@ parser.add_argument('-s', '--symbols', type=pathlib.Path) parser.add_argument('-m', '--script', type=pathlib.Path, action='append', default=[]) parser.add_argument('-c', '--command', action="append", default=[]) parser.add_argument('-S', '--shell', action="store_true") +parser.add_argument('-e', '--hook-exceptions', action="store_true") parser.add_argument('payload', type=pathlib.Path) parser.add_argument('boot_args', default=[], nargs="*") args = parser.parse_args() @@ -27,6 +28,8 @@ u = ProxyUtils(p, heap_size = 128 * 1024 * 1024) hv = HV(iface, p, u) +hv.hook_exceptions = args.hook_exceptions + hv.init() if len(args.boot_args) > 0: