diff --git a/examples/cpushark/Capture.py b/examples/cpushark/Capture.py
index 3bfa78b..48ed59b 100644
--- a/examples/cpushark/Capture.py
+++ b/examples/cpushark/Capture.py
@@ -18,6 +18,7 @@ class Capture(NSObject):
self.session = None
self.script = None
self.modules = Modules()
+ self.recvTotal = 0
self.calls = Calls(self)
return self
@@ -104,7 +105,7 @@ class Capture(NSObject):
self._updateState_(CaptureState.ATTACHED)
else:
self._updateState_(CaptureState.DETACHED)
- self.delegate.captureFailedToAttachWithError_(error)
+ self._delegate.captureFailedToAttachWithError_(error)
def _sessionDidDetach(self):
if self.state == CaptureState.ATTACHING or self.state == CaptureState.ATTACHED:
@@ -121,7 +122,8 @@ class Capture(NSObject):
elif fromAddress == "/stalker/calls" and name == '+add':
self.calls._add_(stanza['payload'])
elif fromAddress == "/interceptor/functions" and name == '+add':
- pass
+ self.recvTotal += 1
+ self._delegate.captureRecvTotalDidChange()
else:
if not self.calls._handleStanza_(stanza):
print "Woot! Got stanza: %s from=%s" % (stanza['name'], stanza['from'])
diff --git a/examples/cpushark/MainWindow.xib b/examples/cpushark/MainWindow.xib
index 5f4fab7..6cd6feb 100644
--- a/examples/cpushark/MainWindow.xib
+++ b/examples/cpushark/MainWindow.xib
@@ -12,6 +12,8 @@
+
+
@@ -21,10 +23,10 @@
-
-
+
+
-
+
@@ -129,14 +131,14 @@ DQ
-
+
-
+
-
+
@@ -169,7 +171,7 @@ DQ
-
+
@@ -192,22 +194,45 @@ DQ
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/cpushark/MainWindowController.py b/examples/cpushark/MainWindowController.py
index 6627212..63e14df 100644
--- a/examples/cpushark/MainWindowController.py
+++ b/examples/cpushark/MainWindowController.py
@@ -9,6 +9,7 @@ class MainWindowController(NSWindowController):
attachProgress = objc.IBOutlet()
attachButton = objc.IBOutlet()
detachButton = objc.IBOutlet()
+ recvTotalLabel = objc.IBOutlet()
callTableView = objc.IBOutlet()
def __new__(cls):
@@ -118,6 +119,9 @@ class MainWindowController(NSWindowController):
def captureFailedToAttachWithError_(self, error):
NSRunCriticalAlertPanel("Error", "Failed to attach: %s" % error, None, None, None)
+ def captureRecvTotalDidChange(self):
+ self.recvTotalLabel.setStringValue_(self.capture.recvTotal)
+
def callsDidChange(self):
self.callTableView.reloadData()