Removed old web graph view

This commit is contained in:
xarkes 2017-10-02 00:25:33 +02:00
parent 0550acd4fd
commit 5bd79506ac
16 changed files with 163 additions and 12690 deletions

View File

@ -1,33 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<meta name="language" content="en" />
<title>radare2</title>
<link rel="stylesheet" type="text/css" href="qrc:/graph/html/graph/lib/css/graph.css" />
<link rel="stylesheet" type="text/css" href="qrc:/graph/html/graph/lib/css/graph_dark.css" id="dark_theme"/>
<link rel="stylesheet" type="text/css" href="qrc:/graph/html/graph/lib/css/graph_light.css" id="light_theme"/>
<link rel="stylesheet" type="text/css" href="qrc:/graph/html/graph/lib/css/joint.min.css" />
<script type="text/javascript" src="qrc:/graph/html/graph/lib/js/joint.js"></script>
<script type="text/javascript" src="qrc:/graph/html/graph/lib/js/joint.layout.DirectedGraph.js"></script>
<script type="text/javascript" src="qrc:/graph/html/graph/lib/js/r2.js"></script>
<script type="text/javascript" src="qrc:/graph/html/graph/lib/js/r2ui.js"></script>
<script type="text/javascript" src="qrc:/graph/html/graph/lib/js/disasm.js"></script>
<script type="text/javascript" src="qrc:/graph/html/graph/lib/js/jquery-1.9.0.js"></script>
<script type="text/javascript" src="qrc:/graph/html/graph/lib/js/graph_panel.js"></script>
</head>
<body style="margin: 0px">
<div id="main_panel" class="ec_gui_alt_background">
<div id="center_panel" style="width: 100%; height: 100%; border-top: 0; padding-bottom: 1em;">
<div id="disasm_tab" style="width: 100%; height: 1000px; border-top: 0; padding-bottom: 1em;"></div>
</div>
</div>
</body>
</html>

View File

@ -1,365 +0,0 @@
/* Basic Block graph */
.bbcanvas { float: left; }
.flatcanvas { float: left; }
.insaddr {
min-width: 7em;
display: inline-block;
}
#outergbox {
position: absolute;
height: 100%;
width: 100%;
}
.instruction {
font-family: monospace;
white-space: nowrap;
}
.instructiondesc {
display: inline-block;
}
.data {
text-align: right;
min-width: 18px;
padding-top: 0px;
padding-bottom: 0px;
}
.instructionbox {
position: absolute;
}
#gbox {
position: relative;
/*margin: 10px;*/
}
.bytes {
display: inline-block;
width: 170px;
}
input:focus {outline: none; }
.hidden {display:none;}
.lines {margin-left: 100px;}
.basicblock {
border: 1px solid;
padding: 5px;
position: absolute;
pointer-events: none;
-webkit-user-select: none;
box-sizing: border-box;
z-index: 2;
}
.basicblock .instruction,
.basicblock input {
pointer-events: auto;
}
#canvas {
position: relative;
display: inline-block;
background: transparent;
width:100%;
height:100%;
margin:10px;
}
#canvas svg,
#minimap svg {
background: transparent;
}
#minimap svg .link,
#canvas svg .link {
pointer-events: none;
}
#minimap svg .connection {
stroke-width: 5;
}
#minimap {
position:absolute;
width:200px;
height:200px;
z-index: +10;
opacity: 0.8;
filter: alpha(opacity=80); /* For IE8 and earlier */
}
#minimap .basicblock {
display: none;
}
#canvas #minimap_area {
display: none;
z-index: 0;
}
#canvas #minimap_area svg {
stroke: transparent;
}
#minimap_area {
border: 1px solid black;
position:absolute;
background: black;
opacity: 0.2;
filter: alpha(opacity=20); /* For IE8 and earlier */
}
#main_panel {
overflow: auto;
}
.right_label {
float: right;
}
/* CUSTOMIZE/OVERRIDE THE DEFAULT CSS */
/* remove padding and scrolling from elements that contain an Accordion OR a content-div */
.ui-layout-center , /* has content-div */
.ui-layout-west , /* has Accordion */
.ui-layout-east , /* has content-div ... */
.ui-layout-east .ui-layout-content { /* content-div has Accordion */
padding: 0;
overflow: hidden;
}
.ui-layout-center P.ui-layout-content {
line-height: 1.4em;
margin: 0; /* remove top/bottom margins from <P> used as content-div */
}
.ui-layout-resizer {
background-color: #373737 !important;
}
.ui-layout-east h4 { /* Footer in East-pane */
font-size: 0.9em;
font-weight: normal;
/*border-width: 1px 0 0;*/
}
.ui-layout-pane {
border: none !important;
}
.ui-layout-toggler {
background-color: #797979 !important;
border: none !important;
}
.ui-layout-center {
/* remove default padding on center-pane so tabs widget fills it */
padding: 0;
}
.ui-helper-clearfix:before,
.ui-helper-clearfix:after {
content: "";
display: table;
}
.ui-helper-clearfix:after {
clear: both;
}
.ui-helper-clearfix {
min-height: 0;
support: IE7
}
.ui-tabs .ui-tabs-nav {
font-size: 0.8em;
background: #c0c0c0;
border: 1px solid #797979;
color: rgb(89, 89, 89);
border-width: 0 0 1px;
padding: 7px 10px;
height: 17px;
margin: 0;
}
.ui-tabs .ui-tabs-nav li {
list-style: none;
float: left;
position: relative;
top: 0;
margin: 1px .2em 0 0;
border-bottom: 0;
padding: 0px 25px;
white-space: nowrap;
text-decoration: none;
background-color: #c0c0c0;
height: 20px;
}
.ui-tabs .ui-tabs-nav li a {
float: left;
padding: 0px;
text-decoration: none;
outline: none;
font-weight: normal;
}
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited {
color: #555555;
text-decoration: none;
outline: none;
}
.ui-widget-header {
border: 1px solid #aaaaaa;
background: #cccccc;
font-weight: bold;
}
.ui-tabs-nav li.ui-tabs-active a {
/*color: rgb(107, 105, 9);*/
color:white;
font-weight: normal;
}
.ui-tabs-nav li.ui-tabs-active {
background-color: rgb(127,127,127);
border-bottom: 10px solid rgb(127,127,127);
border-top: 10px solid rgb(127,127,127);
height: 14px;
margin-top: -10px;
}
.ui-tabs .ui-tabs-panel {
padding: 1em 0em;
}
.entry {
font-size: 0.8em;
padding: 0px 0px 0px 10px;
}
.jqtree-tree {
margin-top: 5px;
}
.jqtree-tree .jqtree-element {
margin: -0.2em 0;
font-family: monospace;
cursor: auto;
padding: 0px 5px;
}
.jqtree-tree .jqtree-folder {
margin-left: 5px;
}
.jqtree-tree .jqtree-title {
color: rgb(127,127,127);
margin-left: 1em;
}
.jqtree-tree .jqtree-toggler {
color: rgb(127,127,127);
font-size: 0.8em;
cursor: pointer;
}
.jqtree-tree .autohighlighti {
background-color: rgb(127, 127, 127);
color: rgb(20,20,20);
}
.history.autohighlighti {
background-color: transparent;
}
.hex .autohighlighti {
background-color: yellow;
color: rgb(20,20,20);
}
.history_idx {
background-color: rgb(127,127,127) !important;
border-bottom: 6px solid rgb(127,127,127);
border-top: 4px solid rgb(127,127,127);
border-right: 3px solid rgb(127,127,127);
border-left: 3px solid rgb(127,127,127);
height: 14px;
margin-top: -10px;
color: white;
}
h3, h4 { /* Headers & Footer in Center & East panes */
font-size: 0.8em;
background: #c0c0c0;
border: 1px solid #797979;
color: rgb(89, 89, 89);
border-width: 0 0 1px;
padding: 7px 10px;
margin: 0;
cursor: pointer;
font-weight: normal;
}
p {
margin: 0 !important;
}
#center_panel {
padding: 0px;
margin: 0px;
}
#command {
background: #c0c0c0;
border: 1px solid #797979;
font-family: Geneva, Arial, Helvetica, sans-serif;
/*font-size: 0.4em;*/
padding: 5px;
width: 99%;
margin: 2px;
}
#cmd_output {
/*font-size: 0.8em;*/
color: rgb(127,127,127);
margin-top: 0px;
}
#cmd_output > p {
padding: 0px;
margin: 0px;
}
#history {
background: #c0c0c0;
padding: 3px 5px;
/*font-size: 0.4em;*/
}
#information {
margin-left: 10px;
}
#cmd_input {
position: relative;
}
#cmd_input > label {
position: absolute;
top: 5px;
bottom: 0;
right: 30px;
width: 0%;
}

View File

@ -1,51 +0,0 @@
.ec_fline {color: rgb(0,127,127);}
.ec_help {color: rgb(0,127,127);}
.ec_args {color: rgb(0,127,127);}
.ec_label {color: rgb(0,127,127);}
.ec_flow {color: rgb(0,127,127);}
.ec_prompt {color: rgb(0,127,127);}
.ec_input {color: rgb(0,127,127);}
.ec_btext {color: rgb(0,127,127);}
.ec_swi {color: rgb(0,127,127);}
.ec_comment {color: rgb(0,127,127);}
.ec_fname {color: rgb(127,0,0);}
.ec_flag {color: rgb(0,127,127);}
.ec_offset {color: #0661FF;}
.ec_other {color: rgb(127,127,127);} /* byte color bu default */
.ec_b0x00 {color: rgb(0,127,0);}
.ec_b0x7f {color: rgb(0,127,127);}
.ec_b0xff {color: rgb(127,0,0);}
.ec_math {color: rgb(127,127,0);}
.ec_bin {color: rgb(127,127,0);}
.ec_push {color: rgb(127,0,127);}
.ec_pop {color: rgb(255,0,255);}
.ec_jmp {color: rgb(0,127,0);}
.ec_cjmp {color: rgb(0,127,0);}
.ec_call {color: #EC0000;}
.ec_nop {color: rgb(0,0,127);}
.ec_ret {color: rgb(127,0,0);}
.ec_trap {color: rgb(255,0,0);}
.ec_invalid {color: rgb(255,0,0);}
.ec_cmp {color: rgb(0,127,127);}
.ec_reg {color: rgb(0,127,127);} /* (also applies to qword, brackets, etc) */
.ec_creg {color: rgb(0,127,127);}
.ec_mov {color: #5C5C5C;}
.ec_num {color: #7B03B0;}
.ec_gui_cflow {color: rgb(255,255,0);}
.ec_gui_dataoffset {color: rgb(127,127,0);}
.ec_gui_background {background-color: rgb(255,255,255); }
.ec_gui_alt_background {background-color: rgb(64, 64, 64); }
.ec_gui_border {border-color: rgb(0, 0, 0); }
.autohighlight { background-color: #8AFF77 !important; }
.autohighlighti { background-color: #8AFF77; }
#minimap {
background: #E9EAEA;
border: 1px solid black;
}
#minimap_area {
border: 1px solid black;
background: black;
}

View File

@ -1,50 +0,0 @@
.ec_fline {color: rgb(0,127,127);}
.ec_help {color: rgb(0,127,127);}
.ec_args {color: rgb(0,127,127);}
.ec_label {color: rgb(0,127,127);}
.ec_flow {color: rgb(0,127,127);}
.ec_prompt {color: rgb(0,127,127);}
.ec_input {color: rgb(0,127,127);}
.ec_btext {color: rgb(0,127,127);}
.ec_swi {color: rgb(0,127,127);}
.ec_comment {color: rgb(0,127,127);}
.ec_fname {color: rgb(127,0,0);}
.ec_flag {color: rgb(0,127,127);}
.ec_offset {color: #0661FF;}
.ec_other {color: rgb(127,127,127);} /* byte color bu default */
.ec_b0x00 {color: rgb(0,127,0);}
.ec_b0x7f {color: rgb(0,127,127);}
.ec_b0xff {color: rgb(127,0,0);}
.ec_math {color: rgb(127,127,0);}
.ec_bin {color: rgb(127,127,0);}
.ec_push {color: rgb(127,0,127);}
.ec_pop {color: rgb(255,0,255);}
.ec_jmp {color: rgb(0,127,0);}
.ec_cjmp {color: rgb(0,127,0);}
.ec_call {color: #EC0000;}
.ec_nop {color: rgb(0,0,127);}
.ec_ret {color: rgb(127,0,0);}
.ec_trap {color: rgb(255,0,0);}
.ec_invalid {color: rgb(255,0,0);}
.ec_cmp {color: rgb(0,127,127);}
.ec_reg {color: rgb(0,127,127);} /* (also applies to qword, brackets, etc) */
.ec_creg {color: rgb(0,127,127);}
.ec_mov {color: #5C5C5C;}
.ec_num {color: #7B03B0;}
.ec_gui_cflow {color: rgb(255,255,0);}
.ec_gui_dataoffset {color: rgb(127,127,0);}
.ec_gui_background {background-color: rgb(255,255,255); }
.ec_gui_alt_background {background-color: rgb(234, 249, 255); }
.ec_gui_border {border-color: rgb(0, 0, 0); }
.autohighlight { background-color: #8AFF77 !important; }
.autohighlighti { background-color: #8AFF77; }
#minimap {
background: #A4C5D2;
}
#minimap_area {
border: 1px solid black;
background: black;
}

View File

@ -1,9 +0,0 @@
/*! JointJS v0.9.2 - JavaScript diagramming library 2014-09-17
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
.viewport{-webkit-user-select:none;-moz-user-select:none;user-select:none}[magnet=true]:not(.element){cursor:crosshair}[magnet=true]:not(.element):hover{opacity:.7}.element{cursor:move}.element *{vector-effect:non-scaling-stroke;-moz-user-select:none;user-drag:none}.connection-wrap{fill:none;stroke:#000;stroke-width:15;stroke-linecap:round;stroke-linejoin:round;opacity:0;cursor:move}.connection-wrap:hover{opacity:.4;stroke-opacity:.4}.connection{fill:none;stroke-linejoin:round}.marker-source,.marker-target{vector-effect:non-scaling-stroke}.marker-vertices{opacity:0;cursor:move}.marker-arrowheads{opacity:0;cursor:move;cursor:-webkit-grab;cursor:-moz-grab}.link-tools{opacity:0;cursor:pointer}.link-tools .tool-options{display:none}.link-tools .tool-remove circle{fill:red}.link-tools .tool-remove path{fill:#fff}.link:hover .marker-vertices,.link:hover .marker-arrowheads,.link:hover .link-tools{opacity:1}.marker-vertex{fill:#1ABC9C}.marker-vertex:hover{fill:#34495E;stroke:none}.marker-arrowhead{fill:#1ABC9C}.marker-arrowhead:hover{fill:#F39C12;stroke:none}.marker-vertex-remove{cursor:pointer;opacity:.1;fill:#fff}.marker-vertex-group:hover .marker-vertex-remove{opacity:1}.marker-vertex-remove-area{opacity:.1;cursor:pointer}.marker-vertex-group:hover .marker-vertex-remove-area{opacity:1}.highlighted{opacity:.7}text.highlighted{fill:red}@media screen and (-webkit-min-device-pixel-ratio:0){.highlighted{outline:2px solid red;opacity:initial}}.element .fobj body{background-color:transparent;margin:0}.element .fobj div{text-align:center;vertical-align:middle;display:table-cell;padding:0 5px}

File diff suppressed because it is too large Load Diff

View File

@ -1,426 +0,0 @@
// Graph Panel
var GraphPanel = function () {
this.graph = null;
this.min = 0;
this.max = 0;
this.block = 512;
this.base = "entry0";
this.selected = null;
this.selected_offset = null;
this.tmp_address = null;
this.renaming = null;
this.renameOldValue = "";
this.rbox = null;
this.panel = $("#disasm_tab")[0];
this.minimap = true;
this.instructions = [];
//this.scroll_offset = null;
//this.scrolling = false;
};
GraphPanel.prototype.init_handlers = function() {
// Unbind mouse and key events from document
$("#center_panel").unbind("click");
$(document).unbind("keypress");
$(document).unbind("click");
$(document).unbind("dblclick");
// Bind custom functions to mouse and key events
//$(document).keypress(handleKeypress);
$(document).click(handleClick);
$(document).dblclick(handleDoubleClick);
};
GraphPanel.prototype.render = function(theme) {
// Set theme
if (theme === "dark") {
document.getElementById('dark_theme').disabled = false;
document.getElementById('light_theme').disabled = true;
} else if (theme === "light") {
document.getElementById('dark_theme').disabled = true;
document.getElementById('light_theme').disabled = false;
}
r2ui.load_colors();
// Show graph and seek to entrypoint
$("#main_panel").removeClass("ec_gui_background");
$("#main_panel").addClass("ec_gui_alt_background");
//if ($('#minimap').length) $('#minimap')[0].innerHTML = "";
var addr = null;
if (this.selected_offset !== null) {
addr = this.selected_offset;
} else {
addr = this.base;
}
r2ui.seek(addr,true);
if (addr.indexOf("0x") === 0) {
addr = address_canonicalize(addr);
} else {
addr = r2.get_flag_address(addr);
}
//scroll_to_address(addr);
};
GraphPanel.prototype.getElementsUnderCursor = function() {
var elements = document.querySelectorAll(':hover');
var index;
for (index = 0; index < elements.length; ++index) {
var element = elements[index];
// Look for an offset item
if (element.className.indexOf("addr") > 0 && element.className.indexOf("ec_offset") > 0) {
return "{'offset':'" + element.innerText + "'}";
}
}
return "{}";
}
GraphPanel.prototype.seek = function(addr, scroll) {
var panel = this.panel;
var error = false;
panel.innerHTML = "";
r2.cmd("agj " + addr, function(x) {
panel.innerHTML = "<div id='minimap'></div></div><div id='canvas' class='canvas enyo-selectable ec_gui_background'></div>";
if (render_graph(x) === false) error = true;
});
if (error) console.log("Render failed, probably address does not belong to function");
this.selected = get_element_by_address(addr);
this.selected_offset = addr;
rehighlight_iaddress(addr);
};
GraphPanel.prototype.goToAddress = function() {
if (this.renaming === null && this.selected !== null && (this.selected.className.indexOf(" addr ") > -1)) {
var address = get_address_from_class(this.selected);
if (this.selected.className.indexOf("ec_gui_dataoffset") > -1) {
return;
}
if (address !== undefined && address !== null) {
address = address_canonicalize(address);
do_jumpto(address);
}
}
};
GraphPanel.prototype.handleInputTextChange = function() {
if (this.renaming !== null && this.rbox.value.length > 0) {
if ($(this.selected).hasClass('insaddr')) {
var old_value = get_offset_flag(r2ui.graph_panel.selected_offset);
var type = "offsets";
r2.cmdj("afij @ " + r2ui.graph_panel.selected_offset, function(x) {
if (x !== null && x !== undefined) {
if ("0x" + x[0].offset.toString(16) === r2ui.graph_panel.selected_offset) {
type = "functions";
}
}
});
rename(r2ui.graph_panel.selected_offset, old_value, this.rbox.value, type);
} else if ($(this.selected).hasClass('faddr')) {
if ($(this.selected).hasClass('fvar'))
r2.cmd("afvn " + r2ui.graph_panel.renameOldValue + " " + r2ui.graph_panel.rbox.value + " @ " + r2ui.graph_panel.selected_offset, function(x){});
else if ($(this.selected).hasClass('farg'))
r2.cmd("afan " + r2ui.graph_panel.renameOldValue + " " + r2ui.graph_panel.rbox.value + " @ " + r2ui.graph_panel.selected_offset, function(x){});
} else {
// TODO, try to recognize other spaces
var old_value = r2ui.graph_panel.renameOldValue;
if (old_value.indexOf("0x") === 0) old_value = "";
rename(r2ui.graph_panel.selected_offset, old_value, r2ui.graph_panel.rbox.value, "*");
}
var instruction;
instruction = $(this.selected).closest(".instruction").find('.insaddr')[0];
this.renaming = null;
var address = get_address_from_class(instruction);
update_binary_details();
r2ui.seek(address, false);
//scroll_to_address(address);
}
};
// function scroll_to_address(address, pos) {
// if (address === undefined || address === null) return;
// var offset = 0;
// if (pos == "top") offset = $('#center_panel').height();
// else if (pos == "bottom") offset = 0;
// else offset = window.innerHeight / 2;
// var elements = $(".insaddr.addr_" + address);
// if (elements === undefined || elements === null) return;
// if (elements[0] === undefined || elements[0] === null) return;
// var top = elements[0].documentOffsetTop() - offset;
// top = Math.max(0,top);
// $('#center_panel').scrollTo(top, {axis: 'y'});
// r2ui.graph_panel.scroll_offset = top;
// }
function handleClick(inEvent) {
console.log("CLICK!")
if ($(inEvent.target).hasClass('addr')) {
if ($(inEvent.target).hasClass('history')) {
var idx = inEvent.target.className.split(" ").filter(function(x) { return x.substr(0,"history_idx_".length) == "history_idx_"; });
idx = String(idx).split("_")[2];
r2ui.history_idx = idx;
do_jumpto(r2ui.history[idx]);
} 
// If instruction address, add address to history
else if ($(inEvent.target).hasClass('insaddr')) {
var address = get_address_from_class(inEvent.target);
r2ui.graph_panel.selected = inEvent.target;
r2ui.graph_panel.selected_offset = address;
rehighlight_iaddress(address);
r2ui.history_push(address);
var get_more_instructions = false;
var next_instruction;
var prev_instruction;
next_instruction = $(r2ui.graph_panel.selected).closest(".instruction").next().find('.insaddr')[0];
if (next_instruction === undefined || next_instruction === null) {
next_instruction = $(r2ui.graph_panel.selected).closest(".basicblock").next().find('.insaddr')[0];
}
prev_instruction = $(r2ui.graph_panel.selected).closest(".instruction").prev().find('.insaddr')[0];
if (prev_instruction === undefined || prev_instruction === null) {
prev_instruction = $(r2ui.graph_panel.selected).closest(".basicblock").prev().find('.insaddr').last()[0];
}
if (get_more_instructions) {
r2ui.seek(address, false);
rehighlight_iaddress(address);
//scroll_to_address(address);
}
}
} else if ($(inEvent.target).hasClass('fvar') || $(inEvent.target).hasClass('farg')) {
var eid = null;
address = get_address_from_class(inEvent.target, "faddr");
r2ui.graph_panel.selected = inEvent.target;
r2ui.graph_panel.selected_offset = address;
var classes = inEvent.target.className.split(' ');
for (var j in classes) {
var klass = classes[j];
if (klass.indexOf("id_") === 0) eid = klass.substring(3);
}
if (eid !== null) rehighlight_iaddress(eid, "id");
}
}
function handleDoubleClick (inEvent) {
console.log("DOUBLE CLICK!")
if ($(inEvent.target).hasClass('addr') && !$(inEvent.target).hasClass('insaddr')) {
var address = get_address_from_class(inEvent.target);
do_jumpto(address);
}
}
// key handler
/*
function handleKeypress(inEvent) {
console.log("KEYPRESS!")
var keynum = inEvent.keyCode || inEvent.charCode || inEvent.which || 0;
var key = String.fromCharCode(keynum);
if (inEvent.ctrlKey||inEvent.metaKey) return;
if ($(inEvent.target).prop("tagName") === "INPUT" || $(inEvent.target).prop("tagName") === "TEXTAREA") return;
if (r2ui.graph_panel.renaming !== null) return;
if (key === 'm') toggle_minimap();
// h Seek to previous address in history
if (key === 'h') do_jumpto(r2ui.history_prev());
// l Seek to next address in history
if (key === 'l') do_jumpto(r2ui.history_next());
// j Seek to next Instruction
if (key === 'j') {
var get_more_instructions = false;
if ($(r2ui.graph_panel.selected).hasClass("insaddr")) {
var next_instruction;
next_instruction = $(r2ui.graph_panel.selected).closest(".instruction").next().find('.insaddr')[0];
if (next_instruction === undefined || next_instruction === null) {
next_instruction = $(r2ui.graph_panel.selected).closest(".basicblock").next().find('.insaddr')[0];
}
var address = get_address_from_class(next_instruction);
if (get_more_instructions) {
r2ui.seek(address, false);
} else {
r2ui.history_push(address);
r2ui.graph_panel.selected = next_instruction;
r2ui.graph_panel.selected_offset = address;
}
rehighlight_iaddress(address);
//scroll_to_address(address);
}
}
// k Seek to previous instruction
if (key === 'k') {
var get_more_instructions = false;
if ($(r2ui.graph_panel.selected).hasClass("insaddr")) {
var prev_instruction;
var prev_instruction = $(r2ui.graph_panel.selected).closest(".instruction").prev().find('.insaddr')[0];
if (prev_instruction === undefined || prev_instruction === null) {
prev_instruction = $(r2ui.graph_panel.selected).closest(".basicblock").prev().find('.insaddr').last()[0];
}
var address = get_address_from_class(prev_instruction);
if (get_more_instructions) {
r2ui.seek(address, false);
} else {
r2ui.history_push(address);
r2ui.graph_panel.selected = prev_instruction;
r2ui.graph_panel.selected_offset = address;
}
rehighlight_iaddress(address);
//scroll_to_address(address);
}
}
// c Define function
if (key === 'c') do_define(r2ui.graph_panel.selected);
// u Clear function metadata
if (key === 'u') do_undefine(r2ui.graph_panel.selected);
// g Go to address
if (key === 'g') {
var a = prompt('Go to');
if (a !== null) do_jumpto(a);
}
// ; Add comment
if (key === ';') do_comment(r2ui.graph_panel.selected);
// n Rename
if (key === 'n') do_rename(r2ui.graph_panel.selected, inEvent);
if (key === 'R') do_randomcolors();
// esc
if (keynum === 27) {
// Esc belongs to renaming
if(r2ui.graph_panel.renaming !== null) {
r2ui.graph_panel.renaming.innerHTML = r2ui.graph_panel.renameOldValue;
r2ui.graph_panel.renaming = null;
} else {
// go back in history
var addr = r2ui.history_prev();
if (addr !== undefined && addr !== null) r2ui.seek(addr, false);
//scroll_to_address(addr);
}
}
// enter
if (keynum === 13) {
r2ui.graph_panel.goToAddress();
}
}
function do_jumpto(address) {
var element = $('.insaddr.addr_' + address);
if (element.length > 0) {
r2ui.history_push(address);
r2ui.graph_panel.selected = element[0];
r2ui.graph_panel.selected_offset = address;
} else {
r2ui.seek(address, true);
}
rehighlight_iaddress(address);
//scroll_to_address(address);
}
function do_rename(element, inEvent) {
var address = get_address_from_class(element);
if ($(element).hasClass("addr") && $(element).hasClass("flag")) {
var space = "*";
if ($(element).hasClass("function")) space = "functions";
if ($(element).hasClass("import")) space = "functions";
if ($(element).hasClass("symbol")) space = "symbols";
if ($(element).hasClass("reloc")) space = "relocs";
if ($(element).hasClass("section")) space = "sections";
if ($(element).hasClass("string")) space = "strings";
var old_value = $(element).html();
var new_name = prompt('New name', old_value);
if (new_name !== null) {
rename(address, old_value, new_name, space);
//store_scroll_offset();
r2ui.seek("$$", false);
//scroll_to_last_offset();
}
} else if (r2ui.graph_panel.renaming === null && element !== null && $(element).hasClass("addr")) {
r2ui.graph_panel.selected = element;
r2ui.graph_panel.selected_offset = address;
r2ui.graph_panel.renaming = element;
r2ui.graph_panel.renameOldValue = element.innerHTML;
r2ui.graph_panel.rbox = document.createElement('input');
r2ui.graph_panel.rbox.setAttribute("type", "text");
r2ui.graph_panel.rbox.setAttribute("id", "rename");
r2ui.graph_panel.rbox.setAttribute("style", "border-width: 0;padding: 0;");
r2ui.graph_panel.rbox.setAttribute("onChange", "handleInputTextChange()");
if ($(element).hasClass('insaddr')) {
var value = get_offset_flag(address);
r2ui.graph_panel.rbox.setAttribute("value",value);
r2ui.graph_panel.rbox.setSelectionRange(value.length, value.length);
} else {
r2ui.graph_panel.rbox.setAttribute("value", r2ui.graph_panel.renameOldValue);
r2ui.graph_panel.rbox.setSelectionRange(r2ui.graph_panel.renameOldValue.length, r2ui.graph_panel.renameOldValue.length);
}
r2ui.graph_panel.renaming.innerHTML = "";
r2ui.graph_panel.renaming.appendChild(r2ui.graph_panel.rbox);
setTimeout('r2ui.graph_panel.rbox.focus();', 200);
inEvent.returnValue=false;
inEvent.preventDefault();
} else if (r2ui.graph_panel.renaming === null && element !== null && $(element).hasClass("faddr")) {
address = get_address_from_class(element, "faddr");
r2ui.graph_panel.selected = element;
r2ui.graph_panel.selected_offset = address;
r2ui.graph_panel.renaming = element;
r2ui.graph_panel.renameOldValue = element.innerText;
r2ui.graph_panel.rbox = document.createElement('input');
r2ui.graph_panel.rbox.setAttribute("type", "text");
r2ui.graph_panel.rbox.setAttribute("id", "rename");
r2ui.graph_panel.rbox.setAttribute("style", "border-width: 0;padding: 0;");
r2ui.graph_panel.rbox.setAttribute("onChange", "handleInputTextChange()");
r2ui.graph_panel.rbox.setAttribute("value", r2ui.graph_panel.renameOldValue);
r2ui.graph_panel.rbox.setSelectionRange(r2ui.graph_panel.renameOldValue.length, r2ui.graph_panel.renameOldValue.length);
r2ui.graph_panel.renaming.innerHTML = "";
r2ui.graph_panel.renaming.appendChild(r2ui.graph_panel.rbox);
setTimeout('r2ui.graph_panel.rbox.focus();', 200);
inEvent.returnValue=false;
inEvent.preventDefault();
}
update_binary_details();
}
function do_comment(element) {
var address = get_address_from_class(element);
var c = prompt('Comment');
if (c !== null) {
r2.cmd('CC ' + c + " @ " + address);
r2ui.seek(address, false);
//scroll_to_address(address);
}
}
function do_undefine(element) {
var address = get_address_from_class(element);
r2.cmd("af-");
r2.update_flags();
update_binary_details();
r2ui.seek(address, false);
//scroll_to_address(address);
}
function do_define(element) {
var address = get_address_from_class(element);
var msg = prompt ('Function name?');
if (msg !== null) {
r2.cmd("af " + msg + " @ " + address);
r2.update_flags();
update_binary_details();
r2ui.seek(address, false);
//scroll_to_address(address);
}
}
*/

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1,591 +0,0 @@
/* radare2 Copyleft 2013-2014 pancake */
var r2 = {};
// TODO: avoid globals
var backward = false;
var next_curoff = 0;
var next_lastoff = 0;
var prev_curoff = 0;
var prev_lastoff = 0;
var hascmd = false;
// async helper
function asyncLoop(iterations, func, callback) {
var index = 0;
var done = false;
var loop = {
next: function() {
if (done) {
return;
}
if (index < iterations) {
index++;
func(loop);
} else {
done = true;
callback();
}
},
iteration: function() {
return index - 1;
},
break: function() {
done = true;
callback();
}
};
loop.next();
return loop;
}
if (typeof (module) !== 'undefined') {
module.exports = function(r) {
if (typeof (r) == 'function') {
hascmd = r;
} else {
hascmd = r.cmd;
}
return r2;
}
}
r2.project_name = "";
r2.plugin = function() {
console.error ("r2.plugin is not available in this environment");
}
try {
if (r2plugin) {
r2.plugin = r2plugin
}
} catch ( e ) {}
r2.root = "http://localhost:9090"; // prefix path
/* helpers */
function dump(obj) {
var x = "";
for (var a in obj) x += a + "\n";
if (typeof ('alert') != 'undefined') {
alert (x);
} else {
console.log (x);
}
}
r2.analAll = function() {
r2.cmd ("aa", function() {});
}
r2.analOp = function(addr, cb) {
r2.cmd ("aoj 1 @ " + addr, function(txt) {
try {
cb(JSON.parse (txt)[0]);
} catch ( e ) {
console.error (e)
cb (txt);
}
});
}
r2.varMap = [];
r2.argMap = [];
function objtostr(obj) {
var str = "";
for (var a in obj)
str += a + ": " + obj[a] + ",\n";
return str;
}
function Ajax(method, uri, body, fn) {
if (typeof (XMLHttpRequest) == "undefined")
return false;
var x = new XMLHttpRequest ();
if (!x)
return false;
x.open (method, uri, false);
x.setRequestHeader ('Accept', 'text/plain');
x.setRequestHeader ('Accept', 'text/html');
x.setRequestHeader ("Content-Type", "application/x-ww-form-urlencoded; charset=UTF-8");
x.onreadystatechange = function(y) {
if (x.status == 200) {
if (fn) {
fn (x.responseText);
}
} else {
console.error ("ajax " + x.status)
}
}
x.send (body);
return true;
}
r2.assemble = function(offset, opcode, fn) {
var off = offset ? "@" + offset : '';
r2.cmd ('"pa ' + opcode + '"' + off, fn);
}
r2.disassemble = function(offset, bytes, fn) {
var off = offset ? "@" + offset : '';
var str = 'pi @b:' + bytes + off;
r2.cmd (str, fn);
}
r2.get_hexdump = function(offset, length, cb) {
r2.cmd ("px " + length + "@" + offset, cb);
}
r2.get_disasm = function(offset, length, cb) {
// TODO: honor offset and length
r2.cmd ("pD " + length + "@" + offset, cb);
}
r2.get_disasm_before = function(offset, start, cb) {
var before = [];
r2.cmd("pdj -" + start + "@" + offset, function(x) {
before = JSON.parse(x);
});
cb(before);
}
r2.get_disasm_after = function(offset, end, cb) {
var after = [];
r2.cmd("pdj " + end + "@" + offset, function(x) {
after = JSON.parse(x);
});
cb(after);
}
r2.get_disasm_before_after = function(offset, start, end, cb) {
var before = [];
var after = [];
r2.cmd("pdj " + start + " @" + offset, function(x) {
before = JSON.parse(x);
});
r2.cmd("pdj " + end + "@" + offset, function(x) {
after = JSON.parse(x);
});
var opcodes = before.concat(after);
cb(opcodes);
}
r2.Config = function(k, v, fn) {
if (typeof v == 'function' || !v) { // get
r2.cmd ("e " + k, fn || v);
} else { // set
r2.cmd ("e " + k + "=" + v, fn);
}
return r2;
}
r2.sections = {};
r2.load_mmap = function() {
r2.cmdj("iSj", function(x) {
if (x !== undefined && x !== null) {
r2.sections = x;
}
});
}
r2.get_address_type = function(address) {
var offset = parseInt(address, 16);
for (var i in r2.sections) {
if (offset >= r2.sections[i].addr && offset < r2.sections[i].addr + r2.sections[i].size) {
if (r2.sections[i].flags.indexOf("x") > -1) {
return "instruction";
}
else {
return "memory";
}
}
}
return "";
}
r2.settings = {};
r2.load_settings = function() {
r2.cmd ("e asm.arch", function(x) {r2.settings['asm.arch'] = x.trim();});
r2.cmd ("e asm.bits", function(x) {r2.settings['asm.bits'] = x.trim();});
r2.cmd ("e asm.bytes", function(x) {r2.settings['asm.bytes'] = toBoolean(x.trim());});
r2.cmd ("e asm.flags", function(x) {r2.settings['asm.flags'] = toBoolean(x.trim());});
r2.cmd ("e asm.offset", function(x) {r2.settings['asm.offset'] = toBoolean(x.trim());});
r2.cmd ("e asm.lines", function(x) {r2.settings['asm.lines'] = toBoolean(x.trim());});
r2.cmd ("e asm.xrefs", function(x) {r2.settings['asm.xrefs'] = toBoolean(x.trim());});
r2.cmd ("e asm.cmtright", function(x) {r2.settings['asm.cmtright'] = toBoolean(x.trim());});
r2.cmd ("e asm.pseudo", function(x) {r2.settings['asm.pseudo'] = toBoolean(x.trim());});
}
r2.flags = {};
r2.update_flags = function() {
r2.cmd ("fs *;fj", function(x) {
var fs = JSON.parse (x);
if (fs !== undefined && fs !== null) {
r2.flags = {};
for (var f in fs) {
var addr = "0x" + fs[f].offset.toString(16);
addr = address_canonicalize(addr);
if (addr in r2.flags) {
var fl = r2.flags[addr];
fl[fl.length] = { name: fs[f].name, size: fs[f].size};
r2.flags[addr] = fl;
} else {
r2.flags[addr] = [{ name: fs[f].name, size: fs[f].size}];
}
}
}
});
}
r2.get_flag_address = function(name) {
for (var f in r2.flags) {
for (var v in r2.flags[f]) {
if (name == r2.flags[f][v].name) return f;
}
}
return null;
}
r2.get_flag_names = function(offset) {
var names = [];
for (var i in r2.flags[offset]) {
names[names.length] = r2.flags[offset][i].name;
}
return names;
}
r2.set_flag_space = function(ns, fn) {
r2.cmd ("fs " + ns, fn);
}
r2.get_flags = function(fn) {
r2.cmd ("fj", function(x) {
fn (x ? JSON.parse (x) : []);
});
}
r2.get_opcodes = function(off, n, cb) {
r2.cmd ("pdj @" + off + "!" + n, function(json) {
cb (JSON.parse (json));
});
}
r2.get_bytes = function(off, n, cb) {
r2.cmd ("pcj @" + off + "!" + n, function(json) {
cb (JSON.parse (json));
});
}
r2.asm_config = {};
r2.store_asm_config = function() {
config = {};
r2.cmd ("e", function(x) {
conf = x.split("\n");
for (var prop in conf) {
var fields = conf[prop].split(" ");
if (fields.length == 3) {
// TODO: Dont know why byt e~asm. is not working so filtering here
if (fields[0].trim().indexOf("asm.") == 0) config[fields[0].trim()] = fields[2].trim();
}
}
r2.asm_config = config;
});
}
r2.restore_asm_config = function() {
cmd = "";
for (var prop in r2.asm_config) {
cmd += "e " + prop + "=" + r2.asm_config[prop] + ";";
}
r2.cmd (cmd, function(x) {});
}
r2.get_info = function(cb) {
r2.cmd ("ij", function(json) {
cb (JSON.parse (json));
});
}
r2.bin_relocs = function(cb) {
r2.cmd ("irj", function(json) {
cb (JSON.parse (json));
});
}
r2.bin_imports = function(cb) {
r2.cmd ("iij", function(json) {
cb (JSON.parse (json));
});
}
r2.bin_symbols = function(cb) {
r2.cmd ("isj", function(json) {
cb (JSON.parse (json));
});
}
r2.bin_sections = function(cb) {
r2.cmd ("iSj", function(json) {
cb (JSON.parse (json));
});
}
r2.cmds = function(cmds, cb) {
if (cmds.length == 0) return;
var cmd = cmds[0];
cmds = cmds.splice (1);
function lala() {
if (cmd == undefined || cmds.length == 0) {
return;
}
cmd = cmds[0];
cmds = cmds.splice (1);
r2.cmd (cmd, lala);
if (cb) {
cb ();
}
return;
}
r2.cmd (cmd, lala);
}
function _internal_cmd(c, cb) {
if (typeof (r2cmd) != 'undefined') {
hascmd = r2cmd;
}
if (hascmd) {
// TODO: use setTimeout for async?
if (typeof (r2plugin) != "undefined") {
// duktape
cb (r2cmd(c));
} else {
// node
return hascmd (c, cb);
}
} else {
Ajax ('GET', r2.root + "/cmd/" + encodeURI(c), '', function(x) {
if (cb) {
cb (x);
}
});
}
}
r2.cmd = function(c, cb) {
if (Array.isArray (c)) {
var res = [];
var idx = 0;
asyncLoop (c.length, function(loop) {
_internal_cmd (c[idx], function(result) {
idx = loop.iteration();
res[idx] = result.replace(/\n$/, "");
idx++;
loop.next ();
});
}, function() {
// all iterations done
cb (res);
});
} else {
_internal_cmd (c, cb);
}
}
r2.cmdj = function(c, cb) {
r2.cmd (c, function(x) {
try {
cb (JSON.parse(x));
} catch ( e ) {
cb (null);
}
});
}
r2.alive = function(cb) {
r2.cmd ("b", function(o) {
var ret = false;
if (o && o.length () > 0) {
ret = true;
}
if (cb) {
cb (o);
}
});
}
r2.getTextLogger = function(obj) {
if (typeof (obj) != "object") {
obj = {};
}
obj.last = 0;
obj.events = {};
obj.interval = null;
r2.cmd ("Tl", function(x) {
obj.last = +x;
});
obj.load = function(cb) {
r2.cmd ("Tj " + (obj.last + 1), function(ret) {
if (cb) {
cb (JSON.parse (ret));
}
});
}
obj.clear = function(cb) {
// XXX: fix l-N
r2.cmd ("T-", cb); //+obj.last, cb);
}
obj.send = function(msg, cb) {
r2.cmd ("T " + msg, cb);
}
obj.refresh = function(cb) {
obj.load (function(ret) {
//obj.last = 0;
for (var i = 0; i < ret.length; i++) {
var message = ret[i];
obj.events["message"] ({
"id": message[0],
"text": message[1]
});
if (message[0] > obj.last) {
obj.last = message[0];
}
}
if (cb) {
cb ();
}
});
}
obj.autorefresh = function(n) {
if (!n) {
if (obj.interval) {
obj.interval.stop ();
}
return;
}
function to() {
obj.refresh (function() {
//obj.clear ();
});
return true;
}
obj.interval = setTimeout (to, n * 1000);
}
obj.on = function(ev, cb) {
obj.events[ev] = cb;
return obj;
}
return obj;
}
r2.filter_asm = function(x, display) {
var curoff = backward ? prev_curoff : next_curoff;
;
var lastoff = backward ? prev_lastoff : next_lastoff;
;
var lines = x.split (/\n/g);
r2.cmd ("s", function(x) {
curoff = x;
});
for (var i = lines.length - 1; i > 0; i--) {
var a = lines[i].match (/0x([a-fA-F0-9]+)/);
if (a && a.length > 0) {
lastoff = a[0].replace (/:/g, "");
break;
}
}
if (display == "afl") {
//hasmore (false);
var z = "";
for (var i = 0; i < lines.length; i++) {
var row = lines[i].replace (/\ +/g, " ").split (/ /g);
z += row[0] + " " + row[3] + "\n";
}
x = z;
} else if (display[0] == 'f') {
//hasmore (false);
if (display[1] == 's') {
var z = "";
for (var i = 0; i < lines.length; i++) {
var row = lines[i].replace (/\ +/g, " ").split (/ /g);
var mark = row[1] == '*' ? '*' : ' ';
var space = row[2] ? row[2] : row[1];
if (!space) continue;
z += row[0] + " " + mark + " <a href=\"javascript:runcmd('fs " +
space + "')\">" + space + "</a>\n";
}
x = z;
} else {
}
} else if (display[0] == "i") {
//hasmore (false);
if (display[1]) {
var z = "";
for (var i = 0; i < lines.length; i++) {
var elems = lines[i].split (/ /g);
var name = "";
var addr = "";
for (var j = 0; j < elems.length; j++) {
var kv = elems[j].split (/=/);
if (kv[0] == "addr") {
addr = kv[1];
}
if (kv[0] == "name") {
name = kv[1];
}
if (kv[0] == "string") {
name = kv[1];
}
}
z += addr + " " + name + "\n";
}
x = z;
}
} //else hasmore (true);
function haveDisasm(x) {
if (x[0] == 'p' && x[1] == 'd') return true;
if (x.indexOf (";pd") != -1) return true;
return false;
}
if (haveDisasm (display)) {
x = x.replace (/function:/g, "<span style=color:green>function:</span>");
x = x.replace (/;(\s+)/g, ";");
x = x.replace (/;(.*)/g, "// <span style='color:#209020'>$1</span>");
x = x.replace (/(bl|goto|call)/g, "<b style='color:green'>call</b>");
x = x.replace (/(jmp|bne|beq|js|jnz|jae|jge|jbe|jg|je|jl|jz|jb|ja|jne)/g, "<b style='color:green'>$1</b>");
x = x.replace (/(dword|qword|word|byte|movzx|movsxd|cmovz|mov\ |lea\ )/g, "<b style='color:#1070d0'>$1</b>");
x = x.replace (/(hlt|leave|iretd|retn|ret)/g, "<b style='color:red'>$1</b>");
x = x.replace (/(add|sbb|sub|mul|div|shl|shr|and|not|xor|inc|dec|sar|sal)/g, "<b style='color:#d06010'>$1</b>");
x = x.replace (/(push|pop)/g, "<b style='color:#40a010'>$1</b>");
x = x.replace (/(test|cmp)/g, "<b style='color:#c04080'>$1</b>");
x = x.replace (/(outsd|out|string|invalid|int |int3|trap|main|in)/g, "<b style='color:red'>$1</b>");
x = x.replace (/nop/g, "<b style='color:blue'>nop</b>");
x = x.replace (/(sym|fcn|str|imp|loc)\.([^:<(\\\/ \|)\->]+)/g, "<a href='javascript:r2ui.seek(\"$1.$2\")'>$1.$2</a>");
}
x = x.replace (/0x([a-zA-Z0-9]+)/g, "<a href='javascript:r2ui.seek(\"0x$1\")'>0x$1</a>");
// registers
if (backward) {
prev_curoff = curoff;
prev_lastoff = lastoff;
} else {
next_curoff = curoff;
next_lastoff = lastoff;
if (!prev_curoff) {
prev_curoff = next_curoff;
}
}
return x;
}

View File

@ -1,199 +0,0 @@
var r2ui = {};
// Colors
r2ui.colors = {};
r2ui.load_colors = function () {
// Load colors from r2
// r2.cmdj("ecj", function(x) {
// for (var i in x) {
// r2ui.colors[".ec_" + i.replace("gui.","gui_")] = "rgb(" + String(x[i]) + ")";
// }
// });
// Load colors fro CSS file
for (var k in document.styleSheets) {
var mysheet = document.styleSheets[k];
var myrules = mysheet.cssRules? mysheet.cssRules: mysheet.rules;
var targetrule;
for (var j in myrules) {
if (myrules[j].selectorText !== undefined && myrules[j].selectorText !== null) {
if (myrules[j].selectorText.toLowerCase().indexOf(".ec_") === 0) {
var sel = myrules[j].selectorText;
if (myrules[j].style.color !== "")
r2ui.colors[sel] = myrules[j].style.color;
else if (myrules[j].style.backgroundColor !== "")
r2ui.colors[sel] = myrules[j].style.backgroundColor
else if (myrules[j].style.borderColor !== "")
r2ui.colors[sel] = myrules[j].style.borderColor
}
}
}
}
};
// Basic Blocks
r2ui.current_fcn_offset = null;
r2ui.graph_panel = null;
r2ui.basic_blocks = {};
r2ui.use_sdb = false;
r2ui.get_fcn_BB = function(fcn_offset, bb_offset) {
if (r2ui.use_sdb) {
var path = "webui/graph/" + fcn_offset + "/" + bb_offset;
var bb = null;
r2.cmd("k " + path, function(x) {
var lines = decodeURIComponent(x).split("\n");
for (var l in lines) {
var line = lines[l];
if (line !== "") {
bb = {};
var props = line.split(",");
bb.x = props[0];
bb.y = props[1];
if (props[2] === "" || props[2] === undefined) props[2] = "transparent";
bb.color = props[2].replace(/\*\*/g, ",");
}
}
});
return bb;
} else {
return r2ui.basic_blocks[bb_offset];
}
};
r2ui.get_fcn_BBs = function(fcn_offset) {
if (r2ui.use_sdb) {
var path = "webui/graph/" + fcn_offset + "/*";
var BBs = {};
r2.cmd("k " + path, function(x) {
var lines = decodeURIComponent(x).split("\n");
for (var l in lines) {
var line = lines[l];
if (line !== "") {
offset = line.split("=")[0];
line = line.split("=")[1];
var bb = {};
var props = line.split(",");
bb.x = props[0];
bb.y = props[1];
if (props[2] === "" || props[2] === undefined) props[2] = "transparent";
bb.color = props[2].replace(/\*\*/g, ",");
BBs[offset] = bb;
}
}
});
return BBs;
} else {
return r2ui.basic_blocks;
}
};
r2ui.update_fcn_BB = function(fcn_offset, bb_offset, bbinfo) {
if (r2ui.use_sdb) {
var path = "webui/graph/" + fcn_offset + "/" + bb_offset;
if (bbinfo.color === undefined) bbinfo.color = "transparent";
var value = bbinfo.x + "," + bbinfo.y + "," + bbinfo.color.replace(/,/g, "**");
r2.cmd("k " + path + "=" + encodeURIComponent(value), function(x) { });
} else {
r2ui.basic_blocks[bb_offset] = bbinfo;
}
};
// History
r2ui.history = [];
r2ui.history_idx = 0;
r2ui.history_push = function (x) {
if (x != r2ui.history_last()) {
if (r2ui.history_idx != r2ui.history.length)
r2ui.history = r2ui.history.splice (0,r2ui.history_idx);
r2ui.history_idx++;
r2ui.history.push (x);
}
};
r2ui.history_pop = function () {
if (r2ui.history_idx == r2ui.history.length) r2ui.history_idx--;
return r2ui.history.pop();
};
r2ui.history_last = function () {
if (r2ui.history.length > 0) {
return r2ui.history[r2ui.history_idx - 1];
}
};
r2ui.history_prev = function () {
if (r2ui.history_idx > 1) r2ui.history_idx--;
return r2ui.history[r2ui.history_idx - 1];
};
r2ui.history_next = function () {
var ret = r2ui.history[r2ui.history_idx];
if (r2ui.history_idx < r2ui.history.length) r2ui.history_idx++;
return ret;
};
// Seek
r2ui.next_instruction = function() {
var offset = parseInt(r2ui.history_last(), 16);
r2.cmd ("pdl 1", function (x) {
offset += parseInt(x.trim());
});
return "0x" + offset.toString(16);
};
r2ui.prev_instruction = function() {
var offset = parseInt(r2ui.history_last(), 16);
r2.cmdj("pdfj", function (x) {
if (x !== undefined && x !== null) {
for (var i in x.ops) {
if (i === 0) continue;
var opcode = x.ops[i];
if (opcode.offset == offset) {
offset = x.ops[i-1].offset;
break;
}
}
}
});
return "0x" + offset.toString(16);
};
r2ui.seek = function (addr, push, scroll) {
if (addr === undefined) return;
if (addr.indexOf("0x") === 0) {
addr = address_canonicalize(addr);
} else {
var a = r2.get_flag_address(addr);
if (a !== null) {
addr = address_canonicalize(a);
} else {
r2.cmd("ss " + addr + ";s", function(x) {
addr = address_canonicalize(x.replace('\n',''));
});
}
}
if (push) r2ui.history_push(addr);
r2.cmd ("ss " + addr, function () {
r2ui.graph_panel.seek(addr, scroll);
});
};
r2ui.seek_in_graph = function (addr, push) {
if (push) r2ui.history_push (addr);
r2.cmd ("ss "+addr, function () {
rehighlight_iaddress(addr);
});
};
r2ui.seek_prev = function () {
var addr = r2ui.history.pop ();
r2.cmd("ss "+addr, function () {
r2ui.graph_panel.seek(addr);
r2ui.graph_panel.scrollTo(0, 0);
});
};

View File

@ -72,18 +72,4 @@
<file>html/utils.js</file> <file>html/utils.js</file>
<file>html/radar.html</file> <file>html/radar.html</file>
</qresource> </qresource>
<qresource prefix="/graph">
<file>html/graph/index.html</file>
<file>html/graph/lib/css/graph.css</file>
<file>html/graph/lib/css/graph_light.css</file>
<file>html/graph/lib/css/graph_dark.css</file>
<file>html/graph/lib/css/joint.min.css</file>
<file>html/graph/lib/js/graph_panel.js</file>
<file>html/graph/lib/js/disasm.js</file>
<file>html/graph/lib/js/joint.js</file>
<file>html/graph/lib/js/joint.layout.DirectedGraph.js</file>
<file>html/graph/lib/js/jquery-1.9.0.js</file>
<file>html/graph/lib/js/r2.js</file>
<file>html/graph/lib/js/r2ui.js</file>
</qresource>
</RCC> </RCC>

View File

@ -78,15 +78,6 @@ MemoryWidget::MemoryWidget(MainWindow *main) :
QTabBar *graph_bar = ui->fcnGraphTabWidget->tabBar(); QTabBar *graph_bar = ui->fcnGraphTabWidget->tabBar();
graph_bar->setVisible(false); graph_bar->setVisible(false);
// Hide graph webview scrollbars
ui->graphWebView->page()->runJavaScript("document.body.style.overflow='hidden';");
// Allows the local resources (qrc://) to access http content
if (!ui->graphWebView->settings()->testAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls))
{
ui->graphWebView->settings()->setAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls, true);
}
// Debug console // Debug console
// For QWebEngine debugging see: https://doc.qt.io/qt-5/qtwebengine-debugging.html // For QWebEngine debugging see: https://doc.qt.io/qt-5/qtwebengine-debugging.html
//QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); //QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
@ -182,8 +173,6 @@ MemoryWidget::MemoryWidget(MainWindow *main) :
connect(this->disasTextEdit->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(disasmScrolled())); connect(this->disasTextEdit->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(disasmScrolled()));
connect(this->hexASCIIText->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(hexScrolled())); connect(this->hexASCIIText->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(hexScrolled()));
connect(ui->graphWebView->page(), SIGNAL(loadFinished(bool)), this, SLOT(frameLoadFinished(bool)));
connect(main, SIGNAL(globalSeekTo(RVA)), this, SLOT(on_globalSeekTo(RVA))); connect(main, SIGNAL(globalSeekTo(RVA)), this, SLOT(on_globalSeekTo(RVA)));
connect(main, SIGNAL(cursorAddressChanged(RVA)), this, SLOT(on_cursorAddressChanged(RVA))); connect(main, SIGNAL(cursorAddressChanged(RVA)), this, SLOT(on_cursorAddressChanged(RVA)));
connect(main->core, SIGNAL(flagsChanged()), this, SLOT(updateViews())); connect(main->core, SIGNAL(flagsChanged()), this, SLOT(updateViews()));
@ -1095,21 +1084,18 @@ void MemoryWidget::cycleViews()
{ {
case 0: case 0:
// Show graph // Show graph
ui->graphButton_2->setChecked(true); ui->graphButton->setChecked(true);
ui->memTabWidget->setCurrentIndex(2); on_graphButton_clicked();
ui->memSideTabWidget_2->setCurrentIndex(0); break;
case 1:
// Show hexdump
ui->hexButton->setChecked(true);
on_hexButton_clicked();
break; break;
case 2: case 2:
// Show hexdump
ui->hexButton_2->setChecked(true);
ui->memTabWidget->setCurrentIndex(1);
ui->memSideTabWidget_2->setCurrentIndex(1);
break;
default:
// Show disasm // Show disasm
ui->disButton_2->setChecked(true); ui->disasButton->setChecked(true);
ui->memTabWidget->setCurrentIndex(0); on_disasButton_clicked();
ui->memSideTabWidget_2->setCurrentIndex(0);
break; break;
} }
} }
@ -1185,28 +1171,22 @@ void MemoryWidget::on_actionHideGraph_side_panel_triggered()
* Buttons callback functions * Buttons callback functions
*/ */
void MemoryWidget::on_disButton_2_clicked() void MemoryWidget::on_disasButton_clicked()
{ {
ui->memTabWidget->setCurrentIndex(0); ui->memTabWidget->setCurrentIndex(0);
ui->memSideTabWidget_2->setCurrentIndex(0); ui->memSideTabWidget_2->setCurrentIndex(0);
} }
void MemoryWidget::on_hexButton_2_clicked() void MemoryWidget::on_graphButton_clicked()
{ {
ui->memTabWidget->setCurrentIndex(1); ui->memTabWidget->setCurrentIndex(1);
ui->memSideTabWidget_2->setCurrentIndex(1); ui->memSideTabWidget_2->setCurrentIndex(1);
} }
void MemoryWidget::on_graphButton_2_clicked() void MemoryWidget::on_hexButton_clicked()
{ {
ui->memTabWidget->setCurrentIndex(2); ui->memTabWidget->setCurrentIndex(2);
ui->memSideTabWidget_2->setCurrentIndex(0); ui->memSideTabWidget_2->setCurrentIndex(2);
}
void MemoryWidget::on_graphButton_clicked()
{
ui->memTabWidget->setCurrentIndex(3);
ui->memSideTabWidget_2->setCurrentIndex(3);
} }
void MemoryWidget::on_actionSend_to_Notepad_triggered() void MemoryWidget::on_actionSend_to_Notepad_triggered()
@ -1508,30 +1488,6 @@ void MemoryWidget::fillOffsetInfo(QString off)
} }
} }
void MemoryWidget::create_graph(QString off)
{
ui->graphWebView->setZoomFactor(0.85);
this->main->addDebugOutput("Graph Offset: '" + off + "'");
if (off == "")
{
off = "0x0" + this->main->core->cmd("s").split("0x")[1].trimmed();
}
//QString fcn = this->main->core->cmdFunctionAt(off);
//this->main->add_debug_output("Graph Fcn: " + fcn);
ui->graphWebView->setUrl(QUrl("qrc:/graph/html/graph/index.html#" + off));
QString port = this->main->core->getConfig("http.port");
ui->graphWebView->page()->runJavaScript(QString("r2.root=\"http://localhost:%1\"").arg(port));
QSettings settings;
if (settings.value("dark").toBool())
{
ui->graphWebView->page()->runJavaScript(QString("init_panel('dark');"));
}
else
{
ui->graphWebView->page()->runJavaScript(QString("init_panel('light');"));
}
}
QString MemoryWidget::normalize_addr(QString addr) QString MemoryWidget::normalize_addr(QString addr)
{ {
QString base = this->main->core->cmd("s").split("0x")[1].trimmed(); QString base = this->main->core->cmd("s").split("0x")[1].trimmed();
@ -1838,12 +1794,10 @@ void MemoryWidget::switchTheme(bool dark)
if (dark) if (dark)
{ {
ui->webSimpleGraph->page()->setBackgroundColor(QColor(64, 64, 64)); ui->webSimpleGraph->page()->setBackgroundColor(QColor(64, 64, 64));
ui->graphWebView->page()->runJavaScript("r2ui.graph_panel.render('dark');");
} }
else else
{ {
ui->webSimpleGraph->page()->setBackgroundColor(QColor(255, 255, 255)); ui->webSimpleGraph->page()->setBackgroundColor(QColor(255, 255, 255));
ui->graphWebView->page()->runJavaScript("r2ui.graph_panel.render('light');");
} }
} }
@ -1872,20 +1826,6 @@ void MemoryWidget::seek_back()
this->main->backButton_clicked(); this->main->backButton_clicked();
} }
void MemoryWidget::frameLoadFinished(bool ok)
{
//qDebug() << "LOAD FRAME: " << ok;
if (ok)
{
QSettings settings;
if (settings.value("dark").toBool())
{
QString js = "r2ui.graph_panel.render('dark');";
ui->graphWebView->page()->runJavaScript(js);
}
}
}
void MemoryWidget::on_memTabWidget_currentChanged(int /*index*/) void MemoryWidget::on_memTabWidget_currentChanged(int /*index*/)
{ {
/*this->main->add_debug_output("Update index: " + QString::number(index) + " to function: " + RAddressString(main->getCursorAddress())); /*this->main->add_debug_output("Update index: " + QString::number(index) + " to function: " + RAddressString(main->getCursorAddress()));
@ -1922,15 +1862,7 @@ void MemoryWidget::updateViews(RVA offset)
this->last_hexdump_fcn = cursor_addr; this->last_hexdump_fcn = cursor_addr;
} }
} }
else if (index == 2) // TODO WTF
{
// Graph
if (this->last_graph_fcn != cursor_addr)
{
this->create_graph(cursor_addr_string);
this->last_graph_fcn = cursor_addr;
}
}
} }
void MemoryWidget::showOffsets(bool show) void MemoryWidget::showOffsets(bool show)

View File

@ -45,7 +45,6 @@ public:
QTreeWidget *xrefToTreeWidget_2; QTreeWidget *xrefToTreeWidget_2;
QTreeWidget *xreFromTreeWidget_2; QTreeWidget *xreFromTreeWidget_2;
QTabWidget *memTabWidget; QTabWidget *memTabWidget;
QWebEngineView *graphWebView;
QWebEngineView *histoWebView; QWebEngineView *histoWebView;
DisassemblerGraphView *mGraphView; DisassemblerGraphView *mGraphView;
@ -76,8 +75,6 @@ public slots:
void seek_to(const QString &offset); void seek_to(const QString &offset);
void create_graph(QString off);
QString normalize_addr(QString addr); QString normalize_addr(QString addr);
QString normalizeAddr(QString addr); QString normalizeAddr(QString addr);
@ -90,8 +87,6 @@ public slots:
void selectHexPreview(); void selectHexPreview();
void frameLoadFinished(bool ok);
void updateViews(RVA offset = RVA_INVALID); void updateViews(RVA offset = RVA_INVALID);
void showOffsets(bool show); void showOffsets(bool show);
@ -138,10 +133,9 @@ private slots:
void on_actionHideDisasm_side_panel_triggered(); void on_actionHideDisasm_side_panel_triggered();
void on_actionHideHexdump_side_panel_triggered(); void on_actionHideHexdump_side_panel_triggered();
void on_actionHideGraph_side_panel_triggered(); void on_actionHideGraph_side_panel_triggered();
void on_disButton_2_clicked(); void on_disasButton_clicked();
void on_hexButton_2_clicked();
void on_graphButton_2_clicked();
void on_graphButton_clicked(); void on_graphButton_clicked();
void on_hexButton_clicked();
void showDisasContextMenu(const QPoint &pt); void showDisasContextMenu(const QPoint &pt);
void showHexdumpContextMenu(const QPoint &pt); void showHexdumpContextMenu(const QPoint &pt);
void showHexASCIIContextMenu(const QPoint &pt); void showHexASCIIContextMenu(const QPoint &pt);

View File

@ -79,7 +79,7 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QToolButton" name="disButton_2"> <widget class="QToolButton" name="disasButton">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -139,122 +139,6 @@ QToolTip {
</attribute> </attribute>
</widget> </widget>
</item> </item>
<item>
<widget class="QToolButton" name="graphButton_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string notr="true">Graph</string>
</property>
<property name="styleSheet">
<string notr="true">QToolButton { /* all types of tool button */
border: 5px solid #333;
border-left: 10px solid #333;
border-right: 10px solid #333;
border-radius: 0px;
background-color: #333;
}
QToolButton:hover {
border: 5px solid #444;
border-radius: 0px;
background-color: #444;
}
QToolButton:checked {
border: 5px solid #2180a9;
border-radius: 0px;
background-color: #2180a9;
}
QToolTip {
background-color: #444;
border: 3px solid #444;
color: rgb(232, 232, 232);
}</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/img/icons/graph_light.svg</normaloff>
<normalon>:/img/icons/graph_white.svg</normalon>
<activeon>:/img/icons/graph_white.svg</activeon>:/img/icons/graph_light.svg</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoExclusive">
<bool>false</bool>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup</string>
</attribute>
</widget>
</item>
<item>
<widget class="QToolButton" name="hexButton_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string notr="true">Hexdump</string>
</property>
<property name="styleSheet">
<string notr="true">QToolButton { /* all types of tool button */
border: 5px solid #333;
border-left: 10px solid #333;
border-right: 10px solid #333;
border-radius: 0px;
background-color: #333;
}
QToolButton:hover {
border: 5px solid #444;
border-radius: 0px;
background-color: #444;
}
QToolButton:checked {
border: 5px solid #2180a9;
border-radius: 0px;
background-color: #2180a9;
}
QToolTip {
background-color: #444;
border: 3px solid #444;
color: rgb(232, 232, 232);
}</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/img/icons/hexdump_light.svg</normaloff>
<normalon>:/img/icons/hexdump_white.svg</normalon>
<activeon>:/img/icons/hexdump_white.svg</activeon>:/img/icons/hexdump_light.svg</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoExclusive">
<bool>false</bool>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup</string>
</attribute>
</widget>
</item>
<item> <item>
<widget class="QToolButton" name="graphButton"> <widget class="QToolButton" name="graphButton">
<property name="sizePolicy"> <property name="sizePolicy">
@ -312,6 +196,64 @@ QToolTip {
</attribute> </attribute>
</widget> </widget>
</item> </item>
<item>
<widget class="QToolButton" name="hexButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string notr="true">Hexdump</string>
</property>
<property name="styleSheet">
<string notr="true">QToolButton { /* all types of tool button */
border: 5px solid #333;
border-left: 10px solid #333;
border-right: 10px solid #333;
border-radius: 0px;
background-color: #333;
}
QToolButton:hover {
border: 5px solid #444;
border-radius: 0px;
background-color: #444;
}
QToolButton:checked {
border: 5px solid #2180a9;
border-radius: 0px;
background-color: #2180a9;
}
QToolTip {
background-color: #444;
border: 3px solid #444;
color: rgb(232, 232, 232);
}</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/img/icons/hexdump_light.svg</normaloff>
<normalon>:/img/icons/hexdump_white.svg</normalon>
<activeon>:/img/icons/hexdump_white.svg</activeon>:/img/icons/hexdump_light.svg</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoExclusive">
<bool>false</bool>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup</string>
</attribute>
</widget>
</item>
<item> <item>
<spacer name="verticalSpacer_6"> <spacer name="verticalSpacer_6">
<property name="orientation"> <property name="orientation">
@ -513,12 +455,12 @@ border-top: 0px;
<enum>QTabWidget::South</enum> <enum>QTabWidget::South</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>3</number> <number>0</number>
</property> </property>
<property name="documentMode"> <property name="documentMode">
<bool>false</bool> <bool>false</bool>
</property> </property>
<widget class="QWidget" name="tabDisasm_2"> <widget class="QWidget" name="tabDisasm">
<attribute name="title"> <attribute name="title">
<string>Disassembly</string> <string>Disassembly</string>
</attribute> </attribute>
@ -994,7 +936,7 @@ QToolTip {
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QWebEngineView" name="webSimpleGraph"> <widget class="QWebEngineView" name="webSimpleGraph" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding"> <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -1015,7 +957,7 @@ QToolTip {
font: 11pt &quot;Monaco&quot;; font: 11pt &quot;Monaco&quot;;
}</string> }</string>
</property> </property>
<property name="url"> <property name="url" stdset="0">
<url> <url>
<string>about:blank</string> <string>about:blank</string>
</url> </url>
@ -1032,7 +974,13 @@ QToolTip {
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tabHexdump_2"> <widget class="QWidget" name="tabGraph">
<attribute name="title">
<string>Graph</string>
</attribute>
<layout class="QHBoxLayout" name="horizontalLayout_19"/>
</widget>
<widget class="QWidget" name="tabHexdump">
<attribute name="title"> <attribute name="title">
<string>Hexdump</string> <string>Hexdump</string>
</attribute> </attribute>
@ -1272,47 +1220,7 @@ p, li { white-space: pre-wrap; }
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tabGraph_2"> </widget>
<attribute name="title">
<string>Graph</string>
</attribute>
<layout class="QHBoxLayout" name="horizontalLayout_12">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QWebEngineView" name="graphWebView">
<property name="contextMenuPolicy">
<enum>Qt::DefaultContextMenu</enum>
</property>
<property name="url">
<url>
<string>about:blank</string>
</url>
</property>
<property name="zoomFactor">
<double>1.000000000000000</double>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabGraph">
<attribute name="title">
<string>Page</string>
</attribute>
<layout class="QHBoxLayout" name="horizontalLayout_19"/>
</widget>
</widget>
</item> </item>
<item> <item>
<widget class="QTabWidget" name="memSideTabWidget_2"> <widget class="QTabWidget" name="memSideTabWidget_2">
@ -1337,7 +1245,7 @@ border-top: 0px;
<enum>QTabWidget::South</enum> <enum>QTabWidget::South</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>2</number>
</property> </property>
<widget class="QWidget" name="tab_3"> <widget class="QWidget" name="tab_3">
<attribute name="title"> <attribute name="title">
@ -1394,7 +1302,7 @@ border-top: 0px;
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>256</width> <width>256</width>
<height>878</height> <height>868</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -1698,7 +1606,7 @@ QToolTip {
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QWebEngineView" name="fcnWebView"> <widget class="QWebEngineView" name="fcnWebView" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -1717,7 +1625,7 @@ QToolTip {
<height>250</height> <height>250</height>
</size> </size>
</property> </property>
<property name="url"> <property name="url" stdset="0">
<url> <url>
<string>qrc:/html/fcn_graph.html</string> <string>qrc:/html/fcn_graph.html</string>
</url> </url>
@ -1747,7 +1655,7 @@ QToolTip {
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QWebEngineView" name="radarGraphWebView"> <widget class="QWebEngineView" name="radarGraphWebView" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -1766,7 +1674,7 @@ QToolTip {
<height>250</height> <height>250</height>
</size> </size>
</property> </property>
<property name="url"> <property name="url" stdset="0">
<url> <url>
<string>qrc:/html/fcn_radar.html</string> <string>qrc:/html/fcn_radar.html</string>
</url> </url>
@ -2180,6 +2088,75 @@ QToolTip {
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tab_7">
<attribute name="title">
<string notr="true">Graph</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_17">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QTreeWidget" name="graphTreeWidget_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="alternatingRowColors">
<bool>false</bool>
</property>
<property name="animated">
<bool>true</bool>
</property>
<column>
<property name="text">
<string>Basic blocks</string>
</property>
</column>
<item>
<property name="text">
<string>fcn.08040000</string>
</property>
<item>
<property name="text">
<string>0x08048e10</string>
</property>
</item>
<item>
<property name="text">
<string>0x08048e50</string>
</property>
</item>
<item>
<property name="text">
<string>0x080583FF</string>
</property>
</item>
</item>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_6"> <widget class="QWidget" name="tab_6">
<attribute name="title"> <attribute name="title">
<string notr="true">Hex</string> <string notr="true">Hex</string>
@ -2762,76 +2739,7 @@ QToolTip {
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tab_7"> </widget>
<attribute name="title">
<string notr="true">Graph</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_17">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QTreeWidget" name="graphTreeWidget_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="alternatingRowColors">
<bool>false</bool>
</property>
<property name="animated">
<bool>true</bool>
</property>
<column>
<property name="text">
<string>Basic blocks</string>
</property>
</column>
<item>
<property name="text">
<string>fcn.08040000</string>
</property>
<item>
<property name="text">
<string>0x08048e10</string>
</property>
</item>
<item>
<property name="text">
<string>0x08048e50</string>
</property>
</item>
<item>
<property name="text">
<string>0x080583FF</string>
</property>
</item>
</item>
</widget>
</item>
</layout>
</widget>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>