Open dpnishant opened 8 years ago
is this feature implemented yet?
No. This is not hard to implement though – Frida already provides the necessary APIs.
@H4oK3 did you just say "challenge accepted"? ;-)
@oleavr Right on, but i do need ask some pointers; how would you think it should be implemented and what API should be used here?
An easy coarse-grained draft implementation might be sth like this:
# ask for user command in on_message function
def on_message(message, data):
if message['type'] == 'send':
post_data = raw_input("-> ")
script.post({'type': 'repl', 'payload': post_data})
elif message['type'] == 'error':
print(message['stack'])
And in the frida script:
while (true) {
var op = recv('repl', function(value) {
recv_data = value.payload
console.log("[App Recv:] " + recv_data)
});
op.wait();
// get the result back
send(JSON.stringify(eval(recv_data)))
if (recv_data === "exit"){
break;
}
}
But of course nobody want sth like this; 2 things I need to figure out a way to achieve:
How to make the repl auto-complete; I took a quick look at frida.repl, I guess I might need to read more about it so I know how that works; like how frida gets the context to do the auto completion, maybe you can give me some tips on this?
Example above simply used eval()
; that would be stupid and buggy, it might need a better way to get the result of expressions that passed in, I do not know how Frida did it; I guess I might also need to read frida.repl code when I got time, and I'd love to ask for some pointers as well.
I am also on IRC as n0ps if you want to hit me up there, thanks!