Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Communicate with the remote agent

  • Loading branch information...
commit 065cbc55231391719657b16718cb64a6a0d89d35 1 parent 424e2bc
Ole André Vadla Ravnås oleavr authored
Showing with 62 additions and 15 deletions.
  1. +25 0 agent.js
  2. +37 15 geoshark.qml
25 agent.js
View
@@ -1,2 +1,27 @@
console.log("Hello from thread ID " +
Process.getCurrentThreadId());
+
+function onStanza(stanza) {
+ if (stanza.name === "request-status") {
+ var threads = [];
+ Process.enumerateThreads({
+ onMatch: function (thread) {
+ threads.push(thread);
+ },
+ onComplete: function () {
+ send({
+ name: "status",
+ payload: threads
+ });
+ }
+ });
+ }
+ recv(onStanza);
+}
+recv(onStanza);
+send({
+ name: "hello",
+ payload: {
+ threadId: Process.getCurrentThreadId()
+ }
+});
52 geoshark.qml
View
@@ -1,6 +1,7 @@
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Window 2.0
+import QtQuick.Layouts 1.1
import Frida 1.0
@@ -19,23 +20,41 @@ ApplicationWindow {
}
}
- TableView {
- id: processes
- height: parent.height
- TableViewColumn {
- role: "smallIcon"
- width: 16
- delegate: Image {
- source: styleData.value
- fillMode: Image.Pad
+ RowLayout {
+ anchors.fill: parent
+ spacing: 0
+ TableView {
+ id: processes
+ Layout.fillHeight: true
+ TableViewColumn {
+ role: "smallIcon"
+ width: 16
+ delegate: Image {
+ source: styleData.value
+ fillMode: Image.Pad
+ }
}
+ TableViewColumn { role: "pid"; title: "Pid"; width: 50 }
+ TableViewColumn { role: "name"; title: "Name";
+ width: 100 }
+ model: processModel
+ onActivated: {
+ Frida.localSystem.inject(script,
+ processModel.get(currentRow).pid);
+ }
+ }
+ TextArea {
+ id: messages
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ readOnly: true
}
- TableViewColumn { role: "pid"; title: "Pid"; width: 50 }
- TableViewColumn { role: "name"; title: "Name"; width: 100 }
- model: processModel
- onActivated: {
- Frida.localSystem.inject(script,
- processModel.get(currentRow).pid);
+ Button {
+ Layout.alignment: Qt.AlignBottom
+ text: "Request Status"
+ onClicked: {
+ script.post({name: "request-status"});
+ }
}
}
@@ -47,5 +66,8 @@ ApplicationWindow {
Script {
id: script
url: Qt.resolvedUrl("./agent.js")
+ onMessage: {
+ messages.append(JSON.stringify(object) + "\n");
+ }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.