radare2/doc/r2pipe.html
pancake 444e7b0685 Initial support for r2pipe.html ##r2pipe
$ r2 -i doc/r2pipe.html /bin/ls
2019-08-28 13:36:33 +02:00

36 lines
770 B
HTML

<html>
<body>
Hello World
<button type="button" id="buttonInfo">Info</button>
<button type="button" id="buttonFlags">Flags</button>
<div id="urls">Starting up...</div>
</body>
<script type="application/javascript" src="/m/r2.js">
</script>
<script>
r2.id=(x) => document.getElementById(x);
r2.onload=(x) => document.addEventListener('DOMContentLoaded', x);
function main() {
const urls = r2.id('urls');
r2.id('buttonInfo').addEventListener('click', () => {
r2.cmd('i', function(res) {
urls.innerHTML = '<pre>' + res + '</pre>';
});
});
r2.id('buttonFlags').addEventListener('click', () => {
r2.cmd('f', function(res) {
urls.innerHTML = '<pre>' + res + '</pre>';
});
});
urls.innerHTML = 'Press any button';
}
r2.onload(main);
</script>
</html>