From d115483d329d0242e258e64c0d89daff59f87002 Mon Sep 17 00:00:00 2001 From: iddoeldor Date: Tue, 11 Aug 2020 12:22:26 +0300 Subject: [PATCH] ios log ssh cmds --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index f858735..199d5e1 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ * [`Hook refelaction`](#hook-refelaction) * [`Device properties`](#device-properties) * [`Take screenshot`](#take-screenshot) +* [`Log SSH commands`](#log-ssh-commands) @@ -2227,6 +2228,26 @@ TODO
[⬆ Back to top](#table-of-contents) +#### Log SSH Commands + +```js +Interceptor.attach(ObjC.classes.NMSSHChannel['- execute:error:timeout:'].implementation, { + onEnter: function(args) { + this.cmd = ObjC.Object(args[2]).toString(); + this.timeout = args[4]; + }, + onLeave: function(retv) { + console.log(`CMD: ${ObjC.Object(args[2]).toString()} Timeout: ${args[4]} Ret: ${retv}`); + } +}); +``` + +
+Output example +TODO +
+ +
[⬆ Back to top](#table-of-contents) #### TODOs - Add GIFs & examples