Skip to content

Commit

Permalink
v1.8.1
Browse files Browse the repository at this point in the history
Proc manager bugfix
  • Loading branch information
FuzzySecurity committed Nov 22, 2021
1 parent 117d02d commit 2375e5c
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 53 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,8 @@
* Added Frida JS API docs into Fermion
* Added an app-native CALL tracer into Fermion
* Got rid of Electron remote due to deprecation
* Some preparation to migrate to Electron v15.x though currently still on v13.x
* Some preparation to migrate to Electron v15.x though currently still on v13.x

-= Fermion v1.8.1 =-

* Minor release to bugfix #15
2 changes: 1 addition & 1 deletion Fermion/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fermion",
"version": "1.8.0",
"version": "1.8.1",
"description": "Fermion is a stand-alone Frida electron tool.",
"main": "core.js",
"scripts": {
Expand Down
75 changes: 31 additions & 44 deletions Fermion/pages/proc.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@
return Applications;
}
getProcList().then(data => {
// Insert separator
// Get table reff
var table = document.getElementById("ProcSet");

// Sort array
data.sort((a, b) => (a.pid > b.pid) ? 1 : -1)

Expand All @@ -148,51 +149,31 @@

// Populate table
for (var i = 0; i < data.length; i++) {
var table = document.getElementById("ProcSet");

// Do we have icons to render?
if (!data[i].parameters.hasOwnProperty("icons")) {
if (!rewroteTable) {
// We don't so re-write table
var rows = table.rows;
rows[0].deleteCell(0);
rows[1].deleteCell(0);

// Mark as finished
rewroteTable = true;
}
} else {
// Do we support the icon?
if (data[i].parameters.icons[0].format != "rgba") {
// We don't so re-write table
var rows = table.rows;
rows[0].deleteCell(0);
rows[1].deleteCell(0);

// Mark as finished
rewroteTable = true;
}
}

var row = table.insertRow(table.length);

if (!rewroteTable) {
var icon = row.insertCell(0);
icon.innerHTML = '<canvas id="CANVAS-Ico-' + data[i].pid + '" width="32" height="18"></canvas>';
icon.setAttribute('data-label','Icon');
var user = row.insertCell(1);
var pid = row.insertCell(2);
var ppid = row.insertCell(3);
var name = row.insertCell(4);
var attach = row.insertCell(5);
makeIconCanvas(data[i]);
// Create cells
var icon = row.insertCell(0);
var user = row.insertCell(1);
var pid = row.insertCell(2);
var ppid = row.insertCell(3);
var name = row.insertCell(4);
var attach = row.insertCell(5);

// Do we render an icon
if (data[i].parameters.hasOwnProperty("icons")) {
if (data[i].parameters.icons[0].format == "rgba") {
icon.innerHTML = '<canvas id="CANVAS-Ico-' + data[i].pid + '" width="20" height="20"></canvas>';
makeIconCanvas(data[i]);
} else if (data[i].parameters.icons[0].format == "png") {
var sPNG = makeb64PNG(data[i]);
icon.innerHTML = '<img src="data:image/png;base64, ' + sPNG + '" width="20" height="20"/>';
} else {
icon.innerHTML = 'None';
}
} else {
var user = row.insertCell(0);
var pid = row.insertCell(1);
var ppid = row.insertCell(2);
var name = row.insertCell(3);
var attach = row.insertCell(4);
icon.innerHTML = 'None';
}
icon.setAttribute('data-label','Icon');

user.innerHTML = data[i].parameters.user;
user.setAttribute('data-label','User');
Expand All @@ -202,7 +183,7 @@
pid.setAttribute('data-label','PID');
name.innerHTML = data[i].name;
name.setAttribute('data-label','Process');
name.setAttribute('style', 'word-wrap: break-word; max-width: 240px;');
name.setAttribute('style', 'word-wrap: break-word; max-width: 200px;');
attach.innerHTML = '<button onclick="attachProcess(' + data[i].pid + ')" class="tiny ui grey button">Attach</button>';
}

Expand All @@ -217,7 +198,13 @@
document.getElementById("DataContainer").appendChild(node);
});

// Canvas generator
// PNG b64 generator
function makeb64PNG(data) {
var uint8PNG = data.parameters.icons[0].image;
return btoa(String.fromCharCode.apply(null, uint8PNG));
}

// RGBA Canvas generator
function makeIconCanvas(data) {
try {
var uint8RGBA = data.parameters.icons[0].image;
Expand Down
15 changes: 8 additions & 7 deletions Fermion/src/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -735,23 +735,24 @@ document.getElementById("FermionSave").onclick = function () {
document.getElementById("getDeviceDetail").onclick = function () {
appendFridaLog("\n[>] Device --> " + deviceId);
frida.getDevice(deviceId).then(dev => {
appendFridaLog(" |_ Device Name : " + dev.name);
dev.querySystemParameters().then(result => {
if (result.hasOwnProperty("platform")) {
appendFridaLog(" |_ Platform : " + result.platform);
}
if (result.hasOwnProperty("os")) {
if (result.os.hasOwnProperty("name")) {
appendFridaLog(" |_ Platform : " + result.os.name);
}
if (result.os.hasOwnProperty("version")) {
appendFridaLog(" |_ Version : " + result.os.version);
appendFridaLog(" |_ Version : " + result.os.version);
}
}
if (result.hasOwnProperty("arch")) {
appendFridaLog(" |_ Arch : " + result.arch);
appendFridaLog(" |_ Arch : " + result.arch);
}
if (result.hasOwnProperty("access")) {
appendFridaLog(" |_ Access : " + result.access);
appendFridaLog(" |_ Access : " + result.access);
}
if (result.hasOwnProperty("name")) {
appendFridaLog(" |_ Host Name : " + result.name + "\n");
appendFridaLog(" |_ Host Name : " + result.name + "\n");
}
}).catch(err =>{
appendFridaLog("[!] Failed to enumerate device properties: " + err + "\n");
Expand Down

0 comments on commit 2375e5c

Please sign in to comment.