From bf68ffebf5e220a8372ec8329348e9c8c6a9fe3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Andr=C3=A9=20Vadla=20Ravn=C3=A5s?= Date: Sat, 25 Oct 2014 21:10:15 +0200 Subject: [PATCH] Fix `this` binding for `onEnter` and `onLeave` callbacks --- src/frida/tracer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frida/tracer.py b/src/frida/tracer.py index 6c59a13..93c3b86 100644 --- a/src/frida/tracer.py +++ b/src/frida/tracer.py @@ -203,10 +203,10 @@ function add(targets) { pending.push(function attachToTarget() { Interceptor.attach(ptr(targetAddress), { onEnter: function onEnter(args) { - h[0].onEnter(log, args, state); + h[0].onEnter.call(this, log, args, state); }, onLeave: function onLeave(retval) { - h[0].onLeave(log, retval, state); + h[0].onLeave.call(this, log, retval, state); } }); });