2023-06-19 15:52:21 -04:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Decompilation Status</title>
|
|
|
|
<style>
|
|
|
|
body {
|
|
|
|
background: #202020;
|
|
|
|
color: #f0f0f0;
|
|
|
|
font-family: sans-serif;
|
|
|
|
}
|
|
|
|
|
|
|
|
h1 {
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.main {
|
|
|
|
width: 800px;
|
|
|
|
max-width: 100%;
|
|
|
|
margin: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
#search {
|
|
|
|
width: 100%;
|
|
|
|
box-sizing: border-box;
|
|
|
|
background: #303030;
|
|
|
|
color: #f0f0f0;
|
|
|
|
border: 1px #f0f0f0 solid;
|
|
|
|
padding: 0.5em;
|
|
|
|
border-radius: 0.5em;
|
|
|
|
}
|
|
|
|
|
|
|
|
#search::placeholder {
|
|
|
|
color: #b0b0b0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#listing {
|
|
|
|
width: 100%;
|
|
|
|
border-collapse: collapse;
|
|
|
|
font-family: monospace;
|
|
|
|
}
|
|
|
|
|
|
|
|
.funcrow:hover {
|
|
|
|
background: #404040 !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
.funcrow:nth-child(odd), #listing th {
|
|
|
|
background: #282828;
|
|
|
|
}
|
|
|
|
|
|
|
|
.funcrow:nth-child(even) {
|
|
|
|
background: #383838;
|
|
|
|
}
|
|
|
|
|
|
|
|
#listing td, #listing th {
|
|
|
|
border: 1px #f0f0f0 solid;
|
|
|
|
padding: 0.5em;
|
|
|
|
}
|
|
|
|
|
|
|
|
.diffneg {
|
|
|
|
color: #FF8080;
|
|
|
|
}
|
|
|
|
|
|
|
|
.diffpos {
|
|
|
|
color: #80FF80;
|
|
|
|
}
|
|
|
|
|
|
|
|
#sortind {
|
|
|
|
margin: 0 0.5em;
|
|
|
|
}
|
2023-06-21 17:43:01 -04:00
|
|
|
|
|
|
|
.filters {
|
|
|
|
font-size: 10pt;
|
|
|
|
text-align: center;
|
|
|
|
margin: 0.5em 0 1em 0;
|
|
|
|
}
|
2023-06-19 15:52:21 -04:00
|
|
|
</style>
|
|
|
|
<script>
|
2023-11-19 07:55:01 -05:00
|
|
|
var data = [{{{data}}}];
|
2023-06-19 15:52:21 -04:00
|
|
|
|
|
|
|
function formatAsm(asm) {
|
|
|
|
var lines = asm.split('\n');
|
|
|
|
|
|
|
|
for (var i = 0; i < lines.length; i++) {
|
|
|
|
var l = lines[i];
|
|
|
|
if (l.length > 0) {
|
|
|
|
if (l[0] == '-') {
|
|
|
|
lines[i] = '<span class="diffneg">' + l + '</span>';
|
|
|
|
} else if (l[0] == '+') {
|
|
|
|
lines[i] = '<span class="diffpos">' + l + '</span>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return lines.join('<br>');
|
|
|
|
}
|
|
|
|
|
|
|
|
function rowClick() {
|
|
|
|
if (this.dataset.expanded === 'true') {
|
|
|
|
this.nextSibling.remove();
|
|
|
|
this.dataset.expanded = false;
|
|
|
|
} else {
|
|
|
|
var row = this.parentNode.insertBefore(document.createElement('tr'), this.nextSibling);
|
|
|
|
row.classList.add('diff');
|
|
|
|
var decCel = row.appendChild(document.createElement('td'));
|
|
|
|
decCel.colSpan = 3;
|
|
|
|
var diff = data[this.dataset.index].diff;
|
|
|
|
if (diff == '') {
|
|
|
|
diff = '<center><i>Identical function - no diff</i></center>';
|
|
|
|
} else {
|
|
|
|
diff = formatAsm(diff);
|
|
|
|
}
|
|
|
|
decCel.innerHTML = diff;
|
|
|
|
this.dataset.expanded = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function closeAllDiffs() {
|
|
|
|
const collection = document.getElementsByClassName("diff");
|
|
|
|
for (var ele of collection) {
|
|
|
|
ele.remove();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-21 17:43:01 -04:00
|
|
|
const filterOptions = { text: '', hidePerfect: false };
|
|
|
|
|
|
|
|
function filter() {
|
2023-06-19 15:52:21 -04:00
|
|
|
closeAllDiffs();
|
|
|
|
|
2023-06-21 17:43:01 -04:00
|
|
|
var ltext = filterOptions.text.toLowerCase();
|
2023-06-19 15:52:21 -04:00
|
|
|
|
|
|
|
const collection = document.getElementsByClassName("funcrow");
|
|
|
|
var searchCount = 0;
|
|
|
|
for (var ele of collection) {
|
|
|
|
var eledata = data[ele.dataset.index];
|
2023-06-21 17:43:01 -04:00
|
|
|
|
|
|
|
const textOk = (ltext == ''
|
2023-06-19 15:52:21 -04:00
|
|
|
|| eledata.address.toLowerCase().includes(ltext)
|
2023-06-21 17:43:01 -04:00
|
|
|
|| eledata.name.toLowerCase().includes(ltext));
|
|
|
|
|
|
|
|
const perfOk = (!filterOptions.hidePerfect || (eledata.matching < 1));
|
|
|
|
|
|
|
|
if (textOk && perfOk) {
|
2023-06-19 15:52:21 -04:00
|
|
|
ele.style.display = '';
|
|
|
|
searchCount++;
|
|
|
|
} else {
|
|
|
|
ele.style.display = 'none';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var lastSortedCol = -1;
|
|
|
|
var ascending = true;
|
|
|
|
|
|
|
|
function sortByColumn(column) {
|
|
|
|
closeAllDiffs();
|
|
|
|
|
|
|
|
if (column == lastSortedCol) {
|
|
|
|
ascending = !ascending;
|
|
|
|
}
|
|
|
|
lastSortedCol = column;
|
|
|
|
|
|
|
|
const collection = document.getElementsByClassName("funcrow");
|
|
|
|
|
|
|
|
var newOrder = [];
|
|
|
|
|
|
|
|
for (var ele of collection) {
|
|
|
|
var inserted = false;
|
|
|
|
|
|
|
|
for (var i = 0; i < newOrder.length; i++) {
|
|
|
|
var cmpEle = newOrder[i];
|
|
|
|
|
|
|
|
var ourCol = ele.childNodes[column];
|
|
|
|
var cmpCol = cmpEle.childNodes[column];
|
|
|
|
|
|
|
|
if ((cmpCol.dataset.value > ourCol.dataset.value) == ascending) {
|
|
|
|
newOrder.splice(i, 0, ele);
|
|
|
|
inserted = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!inserted) {
|
|
|
|
newOrder.push(ele);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (var i = 1; i < newOrder.length; i++) {
|
|
|
|
newOrder[i - 1].after(newOrder[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
var sortIndicator = document.getElementById('sortind');
|
|
|
|
if (!sortIndicator) {
|
|
|
|
sortIndicator = document.createElement('span');
|
|
|
|
sortIndicator.id = 'sortind';
|
|
|
|
}
|
|
|
|
sortIndicator.innerHTML = ascending ? '▲' : '▼';
|
|
|
|
|
|
|
|
var th = document.getElementById('listingheader').childNodes[column];
|
|
|
|
th.appendChild(sortIndicator);
|
|
|
|
}
|
|
|
|
|
|
|
|
document.addEventListener("DOMContentLoaded", () => {
|
|
|
|
var listing = document.getElementById('listing');
|
|
|
|
|
|
|
|
const headers = listing.getElementsByTagName('th');
|
|
|
|
var headerCount = 0;
|
|
|
|
for (const header of headers) {
|
|
|
|
header.addEventListener('click', function(){
|
|
|
|
sortByColumn(this.dataset.column, true);
|
|
|
|
});
|
|
|
|
|
|
|
|
header.dataset.column = headerCount;
|
|
|
|
headerCount++;
|
|
|
|
}
|
|
|
|
|
|
|
|
data.forEach((element, index) => {
|
|
|
|
var row = listing.appendChild(document.createElement('tr'));
|
|
|
|
var addrCel = row.appendChild(document.createElement('td'));
|
|
|
|
var nameCel = row.appendChild(document.createElement('td'));
|
|
|
|
var matchCel = row.appendChild(document.createElement('td'));
|
|
|
|
|
|
|
|
addrCel.innerHTML = addrCel.dataset.value = element.address;
|
|
|
|
nameCel.innerHTML = nameCel.dataset.value = element.name;
|
2023-07-16 02:13:34 -04:00
|
|
|
|
|
|
|
var effectiveNote = (element.matching == 1 && element.diff != '') ? '*' : '';
|
|
|
|
matchCel.innerHTML = (element.matching * 100).toFixed(2) + '%' + effectiveNote;
|
2023-06-19 15:52:21 -04:00
|
|
|
matchCel.dataset.value = element.matching;
|
|
|
|
|
|
|
|
row.classList.add('funcrow');
|
|
|
|
row.addEventListener('click', rowClick);
|
|
|
|
row.dataset.index = index;
|
|
|
|
row.dataset.expanded = false;
|
|
|
|
});
|
|
|
|
|
|
|
|
var search = document.getElementById('search');
|
|
|
|
search.addEventListener('input', function (evt) {
|
2023-06-21 17:43:01 -04:00
|
|
|
filterOptions.text = search.value;
|
|
|
|
filter();
|
2023-06-19 15:52:21 -04:00
|
|
|
});
|
|
|
|
|
2023-06-21 17:43:01 -04:00
|
|
|
const cbHidePerfect = document.getElementById('cbHidePerfect');
|
|
|
|
cbHidePerfect.addEventListener('change', evt => {
|
|
|
|
filterOptions.hidePerfect = evt.target.checked;
|
|
|
|
filter();
|
|
|
|
})
|
|
|
|
|
2023-06-19 15:52:21 -04:00
|
|
|
sortByColumn(0);
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div class="main">
|
|
|
|
<h1>Decompilation Status</h1>
|
|
|
|
<input id="search" type="search" placeholder="Search for offset or function name...">
|
2023-06-21 17:43:01 -04:00
|
|
|
<div class="filters">
|
|
|
|
<label for="cbHidePerfect">Hide 100% match</label>
|
|
|
|
<input type="checkbox" id="cbHidePerfect" />
|
|
|
|
</div>
|
2023-06-19 15:52:21 -04:00
|
|
|
<table id="listing">
|
|
|
|
<tr id='listingheader'><th style='width: 20%'>Address</th><th style="width:60%">Name</th><th style='width: 20%'>Matching</th></tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|