/usr/share/radare2/0.9.6/www/enyo/js/rightpanel.js is in libradare2-common 0.9.6-3.1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | function makelist(x) {
var z = "List of "+x.length+"\n\n";
for (var i = 0; i<x.length; i++)
z += "<a style='color:yellow' href='javascript:r2ui.opendis("+
x[i].offset+")'>0x"+x[i].offset.toString (16) + "</a> "+ x[i].name+"\n";
return z;
}
enyo.kind ({
name: "RightPanel",
style:"background-color:#404040;",
classes: "onyx-toolbar",
kind: "FittableRows",
ra: null,
components: [
{kind:"FittableColumns", style:"margin-bottom:5px", components:[
{kind: "onyx.Button", content: "[", ontap: "closeSidebar", style: "padding:8px;margin-right:8px"},
{onup:"toggleScroll", style:"position:absolute;left:40px;top:0px;", kind: "onyx.MenuDecorator", onSelect: "itemSelected", components: [
{content: "List elements" },
{kind: "onyx.Menu", showOnTop: true, maxHeight:290, name: "menu", style:"height:300px", components: [
{content: "flags", value: "2"},
{content: "flagspaces", value: "2"},
{classes: "onyx-menu-divider"},
{content: "strings", value: "1"},
{content: "symbols", value: "1"},
{content: "imports", value: "1"},
{content: "relocs", value: "1"},
{content: "functions", value: "1"},
{content: "comments", value: "1"},
{classes: "onyx-menu-divider"},
{content: "registers", value: "1"},
{content: "stack", value: "2"},
{content: "backtrace", value: "3"},
]},
]},
]},
{kind: "Scroller", animated: false, fit: true, horizontal: false, name: "scroll", components: [
/*
{kind: "FittableColumns",components:[
{kind: "List", name: "list", style:"height:400px", realtimeFit:true, onSetupItem: "setupItem", components: [
{kind: "onyx.Item", layoutKind: "HFlexLayout", style:"padding:0px", components: [
{name:"separator", tag: "hr", style:"height:1px;visibility:hidden"},
{kind: "onyx.Button", name: "msg", style: "width:100%", fit:true, active: true, ontap: "rowTap"}
]}
]},
]},
*/
{tag: "pre", style:"font-size:14px", allowHtml:true, name: "output", content:".." }
]}
],
toggleScroll: function() {
var is_visible = this.$.menu.getShowing ();
this.$.scroll.setShowing (is_visible);
},
rowTap: function () {
/* do something here */
},
create: function() {
this.inherited (arguments);
/*
this.$.list.setCount (3);
this.$.list.refresh();
*/
},
data: [],
setupItem: function (inSender, inIndex) {
var item = this.data[inIndex.index];
if (!item)
return false;
var msg = item.name + " "+item.offset;
console.log (msg);
this.$.msg.setContent (msg);
return true;
},
refresh: function () {
//this.$.list.setCount (this.data.length);
//this.$.list.refresh ();
},
itemSelected: function (inSender, inEvent) {
var self = this;
var selected = inEvent.originator.content;
var is_visible = this.$.menu.getShowing ();
r2ui.rp = self;
this.$.scroll.setShowing (!!! is_visible);
this.$.menu.setShowing (false);
this.$.scroll.scrollToTop();
//this.$.output.scrollToTop();
switch (selected) {
case "comments":
r2.cmd ("CC*", function(x) {
x = x.replace (/0x([a-zA-Z0-9]*)/g, "<a style='color:yellow' href='javascript:r2ui.seek(\"0x$1\")'>0x$1</a>");
self.$.output.setContent (x);
});
break;
case "functions":
r2.cmd ("afl", function(x) {
x = x.replace (/0x([a-zA-Z0-9]*)/g, "<a style='color:yellow' href='javascript:r2ui.seek(\"0x$1\")'>0x$1</a>");
self.$.output.setContent (x);
});
break;
case "flagspaces":
this.updateFlagspace ();
break;
case "strings":
r2.cmd ("izj", function(x) {
var s = JSON.parse (x);
var h = '';
for (var i in s) {
var off = (+s[i]['offset']).toString(16);
h += '<a style="color:yellow" href="javascript:r2ui.opendis(0x'+
off+')">0x'+off+'</a> '+s[i]['string']+'<br />';
}
self.$.output.setContent (h);
});
break;
case "sections":
r2.bin_sections(function (x) {
self.$.output.setContent (makelist (x));
});
break;
case "symbols":
r2.bin_symbols(function (x) {
self.$.output.setContent (makelist (x));
});
break;
case "relocs":
r2.bin_relocs (function (x) {
self.$.output.setContent (makelist (x));
});
break;
case "imports":
r2.bin_imports (function (x) {
self.$.output.setContent (makelist (x));
});
break;
case "flags":
r2.get_flags (function (flags) {
self.data = flags;
self.$.output.setContent (makelist (flags));
self.refresh();
});
break;
}
},
closeSidebar: function() {
this.ra.setIndex (1);
},
selectFlagspace: function (x) {
r2.cmd ('fs '+x, function(x) {
r2ui.rp.updateFlagspace();
});
},
updateFlagspace: function() {
var self = r2ui.rp;
r2.cmd ("fsj", function (x) {
var s = JSON.parse (x);
var h = '';
for (var i in s) {
var nam = s[i].name;
var sel = s[i].selected;
h += '<a style="color:yellow" href="javascript:r2ui.rp.selectFlagspace(\''+
nam+'\')">'+nam+'</a> '+(sel?" (selected)":"")+'<br />';
}
self.$.output.setContent (h);
});
}
});
|