diff --git a/doc/fortunes.tips b/doc/fortunes.tips
index 47d4d54941..64d00794cb 100644
--- a/doc/fortunes.tips
+++ b/doc/fortunes.tips
@@ -28,7 +28,7 @@ Add comments using the ';' key in visual mode or the 'CC' command from the radar
Assemble opcodes with the 'a' and 'A' keys in visual mode, which are bindings to the 'wa' and 'wA' commands
Find expanded AES keys in memory with '/Ca'
Find wide-char strings with the '/w ' command
-Enable ascii-art jump lines in disassembly by setting 'e asm.lines=true'. asm.linesout and asm.linestyle may interest you as well
+Enable ascii-art jump lines in disassembly by setting 'e asm.lines=true'. asm.lines.out and asm.linestyle may interest you as well
Control the signal handlers of the child process with the 'dk' command
Get a free shell with 'ragg2 -i exec -x'
Interpret radare2 scripts with '. '. Similar to the bash source alias command.
diff --git a/libr/core/cconfig.c b/libr/core/cconfig.c
index 6bb18bf4df..c91c5fbc6e 100644
--- a/libr/core/cconfig.c
+++ b/libr/core/cconfig.c
@@ -2478,10 +2478,10 @@ R_API int r_core_config_init(RCore *core) {
SETPREF ("asm.lines", "true", "Show ASCII-art lines at disassembly");
SETPREF ("asm.lines.call", "false", "Enable call lines");
SETPREF ("asm.lines.ret", "false", "Show separator lines after ret");
- SETPREF ("asm.linesout", "true", "Show out of block lines");
- SETPREF ("asm.linesright", "false", "Show lines before opcode instead of offset");
- SETPREF ("asm.lineswide", "false", "Put a space between lines");
- SETICB ("asm.lineswidth", 7, &cb_asmlineswidth, "Number of columns for program flow arrows");
+ SETPREF ("asm.lines.out", "true", "Show out of block lines");
+ SETPREF ("asm.lines.right", "false", "Show lines before opcode instead of offset");
+ SETPREF ("asm.lines.wide", "false", "Put a space between lines");
+ SETICB ("asm.lines.width", 7, &cb_asmlineswidth, "Number of columns for program flow arrows");
SETICB ("asm.var.submin", 0x100, &cb_asmvarsubmin, "Minimum value to substitute in instructions (asm.var.sub)");
SETPREF ("asm.middle", "false", "Allow disassembling jumps in the middle of an instruction");
SETPREF ("asm.noisy", "true", "Show comments considered noisy but possibly useful");
diff --git a/libr/core/disasm.c b/libr/core/disasm.c
index 2c85ea556f..f1da71e41f 100644
--- a/libr/core/disasm.c
+++ b/libr/core/disasm.c
@@ -599,7 +599,7 @@ static RDisasmState * ds_init(RCore *core) {
ds->show_varaccess = r_config_get_i (core->config, "asm.var.access");
ds->maxrefs = r_config_get_i (core->config, "asm.maxrefs");
ds->show_lines = r_config_get_i (core->config, "asm.lines");
- ds->linesright = r_config_get_i (core->config, "asm.linesright");
+ ds->linesright = r_config_get_i (core->config, "asm.lines.right");
ds->show_indent = r_config_get_i (core->config, "asm.indent");
ds->indent_space = r_config_get_i (core->config, "asm.indentspace");
ds->tracespace = r_config_get_i (core->config, "asm.tracespace");
@@ -611,7 +611,7 @@ static RDisasmState * ds_init(RCore *core) {
ds->show_lines_ret = r_config_get_i (core->config, "asm.lines.ret");
ds->show_size = r_config_get_i (core->config, "asm.size");
ds->show_trace = r_config_get_i (core->config, "asm.trace");
- ds->linesout = r_config_get_i (core->config, "asm.linesout");
+ ds->linesout = r_config_get_i (core->config, "asm.lines.out");
ds->adistrick = r_config_get_i (core->config, "asm.middle"); // TODO: find better name
ds->asm_demangle = r_config_get_i (core->config, "asm.demangle");
ds->asm_describe = r_config_get_i (core->config, "asm.describe");
@@ -716,7 +716,7 @@ static RDisasmState * ds_init(RCore *core) {
if (ds->show_flag_in_bytes) {
ds->show_flags = 0;
}
- if (r_config_get_i (core->config, "asm.lineswide")) {
+ if (r_config_get_i (core->config, "asm.lines.wide")) {
ds->linesopts |= R_ANAL_REFLINE_TYPE_WIDE;
}
if (core->cons->vline) {
@@ -751,7 +751,7 @@ static RDisasmState * ds_init(RCore *core) {
} else {
ds->cursor = -1;
}
- if (r_config_get_i (core->config, "asm.lineswide")) {
+ if (r_config_get_i (core->config, "asm.lines.wide")) {
ds->linesopts |= R_ANAL_REFLINE_TYPE_WIDE;
}
if (core->cons->vline) {
diff --git a/libr/core/visual.c b/libr/core/visual.c
index 2fb47b6977..3dc8e438b0 100644
--- a/libr/core/visual.c
+++ b/libr/core/visual.c
@@ -2882,14 +2882,14 @@ static int visual_responsive(RCore *core) {
r_config_set_i (core->config, "asm.offset", 1);
}
if (w > 80) {
- r_config_set_i (core->config, "asm.lineswidth", 14);
- r_config_set_i (core->config, "asm.lineswidth", w - (w / 1.2));
+ r_config_set_i (core->config, "asm.lines.width", 14);
+ r_config_set_i (core->config, "asm.lines.width", w - (w / 1.2));
r_config_set_i (core->config, "asm.cmt.col", w - (w / 2.5));
} else {
- r_config_set_i (core->config, "asm.lineswidth", 7);
+ r_config_set_i (core->config, "asm.lines.width", 7);
}
if (w < 70) {
- r_config_set_i (core->config, "asm.lineswidth", 1);
+ r_config_set_i (core->config, "asm.lines.width", 1);
r_config_set_i (core->config, "asm.bytes", 0);
} else {
r_config_set_i (core->config, "asm.bytes", 1);
diff --git a/shlr/www/enyo/disassembler_old.js b/shlr/www/enyo/disassembler_old.js
index 278b2e5fb1..d353e62133 100644
--- a/shlr/www/enyo/disassembler_old.js
+++ b/shlr/www/enyo/disassembler_old.js
@@ -1 +1 @@
-function docss(t){return""+t+""}enyo.kind({name:"DisassemblerOld",kind:"Scroller",tag:"div",style:"margin:0px;background-color:#c0c0c0",data:null,components:[{tag:"div",allowHtml:!0,classes:"colorbar",name:"colorbar"},{tag:"br"},{tag:"div",content:"^",classes:"moreless",ontap:"less"},{tag:"pre",allowHtml:!0,name:"text",content:"..",style:"margin-left:5px"},{tag:"div",content:"v",classes:"moreless",ontap:"more"}],min:0,max:0,block:512,base:"entry0",less:function(){var t=this.$.text;this.min+=this.block,r2.get_disasm(this.base+"-"+this.min,this.block,function(e){e=docss(r2.filter_asm(e,"pd"));var s=r2ui._dis.getScrollBounds().height;t.setContent(""+e+t.getContent()+"
");var i=r2ui._dis.getScrollBounds().height;r2ui._dis.scrollTo(0,i-s)})},more:function(){var t=this.$.text;this.max+=this.block,r2.get_disasm(this.base+"+"+this.max,this.block,function(e){e=docss(r2.filter_asm(e,"pd")),t.setContent(""+t.getContent()+e+"
")})},seek:function(t){var e=this.$.text;this.base=t,this.min=this.max=0,r2.get_disasm(t,this.block,function(t){t=docss(r2.filter_asm(t,"pd")),e.setContent(""+t+"
")}),this.scrollTo(0,0)},create:function(){this.inherited(arguments);this.$.text;r2.cmd("e asm.lineswidth = 20",function(t){}),this.seek("entry0"),r2ui._dis=this,r2ui.history_push("entry0")},colorbar_create:function(){var t=this;r2.cmd("p-j 24",function(e){try{var s=JSON.parse(e)}catch(i){return void alert(i)}console.log(s);for(var o="",r={flags:"#c0c0c0",comments:"yellow",functions:"#5050f0",strings:"orange"},n="",l=16,a=0;a____";if(c.offset){var d="",h=0;for(var b in r)c[b]&&h++;if(h++,1==h)break;var m=l/h;for(var b in r){r[b];c[b]&&(d+="____ |
")}d+="
",n="0x"+c.offset.toString(16)}else n="0x"+(s.from+s.blocksize*a).toString(16);o+=""+d+" | "}o+="
",t.$.colorbar.setContent(o)})}});
\ No newline at end of file
+function docss(t){return""+t+""}enyo.kind({name:"DisassemblerOld",kind:"Scroller",tag:"div",style:"margin:0px;background-color:#c0c0c0",data:null,components:[{tag:"div",allowHtml:!0,classes:"colorbar",name:"colorbar"},{tag:"br"},{tag:"div",content:"^",classes:"moreless",ontap:"less"},{tag:"pre",allowHtml:!0,name:"text",content:"..",style:"margin-left:5px"},{tag:"div",content:"v",classes:"moreless",ontap:"more"}],min:0,max:0,block:512,base:"entry0",less:function(){var t=this.$.text;this.min+=this.block,r2.get_disasm(this.base+"-"+this.min,this.block,function(e){e=docss(r2.filter_asm(e,"pd"));var s=r2ui._dis.getScrollBounds().height;t.setContent(""+e+t.getContent()+"
");var i=r2ui._dis.getScrollBounds().height;r2ui._dis.scrollTo(0,i-s)})},more:function(){var t=this.$.text;this.max+=this.block,r2.get_disasm(this.base+"+"+this.max,this.block,function(e){e=docss(r2.filter_asm(e,"pd")),t.setContent(""+t.getContent()+e+"
")})},seek:function(t){var e=this.$.text;this.base=t,this.min=this.max=0,r2.get_disasm(t,this.block,function(t){t=docss(r2.filter_asm(t,"pd")),e.setContent(""+t+"
")}),this.scrollTo(0,0)},create:function(){this.inherited(arguments);this.$.text;r2.cmd("e asm.lines.width = 20",function(t){}),this.seek("entry0"),r2ui._dis=this,r2ui.history_push("entry0")},colorbar_create:function(){var t=this;r2.cmd("p-j 24",function(e){try{var s=JSON.parse(e)}catch(i){return void alert(i)}console.log(s);for(var o="",r={flags:"#c0c0c0",comments:"yellow",functions:"#5050f0",strings:"orange"},n="",l=16,a=0;a____";if(c.offset){var d="",h=0;for(var b in r)c[b]&&h++;if(h++,1==h)break;var m=l/h;for(var b in r){r[b];c[b]&&(d+="____ |
")}d+="
",n="0x"+c.offset.toString(16)}else n="0x"+(s.from+s.blocksize*a).toString(16);o+=""+d+" | "}o+="
",t.$.colorbar.setContent(o)})}});
\ No newline at end of file
diff --git a/shlr/www/m/app.js b/shlr/www/m/app.js
index ba38efce01..b3ecca1378 100644
--- a/shlr/www/m/app.js
+++ b/shlr/www/m/app.js
@@ -1,5 +1,5 @@
-!function e(t,n,i){function r(a,s){if(!n[a]){if(!t[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[a]={exports:{}};t[a][0].call(u.exports,function(e){var n=t[a][1][e];return r(n||e)},u,u.exports,e,t,n,i)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a=0&&n=t}}]),e}()},{"./ChunkStatus":3,"./NavigatorDirection":4}],3:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.ChunkStatus={LAUNCHED:0,COMPLETED:1}},{}],4:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.NavigatorDirection={BEFORE:-1,CURRENT:0,AFTER:1}},{}],5:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0}),n.r2Settings=n.r2Wrapper=n.R2Actions=void 0;var r=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,i=e;void 0===e?i=prompt("address"):"number"==typeof e&&(i="0x"+e.toString(16)),i&&""!==i.trim()&&r2.cmd("s "+i,function(){n&&a.uiContext.navigateTo(n),t.notifyAction(s.SEEK)})}},{key:"registerListener",value:function(e,t){this.listeners[e].push(t)}},{key:"notifyAction",value:function(e){this.listeners[e].forEach(function(e){return e()})}}]),e}(),l=(n.r2Wrapper=new c,{PLATFORM:"platform",BITS:"bits",UTF8:"utf8",UCASE:"ucase",DESCRIBE:"describe",BYTES:"bytes",OS:"os",SIZE:"size",DECODING:"decoding",MODE:"mode",ANAL_HAS_NEXT:"analHasNext",ANAL_SKIP_NOPS:"analSkipNops",ANAL_NON_CODE:"analNonCode",COLORS:"colors",USE_TTS:"useTTS",THEME:"theme",ASMEMU:"asmemu",ASMEMUSTR:"asmemustr"}),u={};u[l.PLATFORM]={name:"platform",defVal:"x86",apply:function(e){r2.cmd("e asm.arch="+e)}},u[l.BITS]={name:"bits",defVal:"32",apply:function(e){r2.cmd("e asm.bits="+e)}},u[l.UTF8]={name:"utf8",defVal:"true",apply:function(e){r2.cmd("e scr.utf8="+e)}},u[l.UCASE]={name:"ucase",defVal:"false",apply:function(e){r2.cmd("e asm.ucase="+e)}},u[l.DESCRIBE]={name:"describe",defVal:"false",apply:function(e){r2.cmd("e asm.describe="+e)}},u[l.BYTES]={name:"bytes",defVal:"false",apply:function(e){r2.cmd("e asm.bytes="+e)}},u[l.OS]={name:"os",defVal:"Linux",apply:function(e){console.log("OS is now: "+e)}},u[l.ASMEMU]={name:"asmemu",defVal:"false",apply:function(e){r2.cmd("e asm.emu="+e)}},u[l.ASMEMUSTR]={name:"asmemustr",defVal:"false",apply:function(e){r2.cmd("e emu.str="+e)}},u[l.SIZE]={name:"size",defVal:"S",apply:function(e){switch(e){case"S":r2.cmd("e asm.bytes=false"),r2.cmd("e asm.lines=false"),r2.cmd("e asm.cmt.right=false");break;case"M":r2.cmd("e asm.bytes=false"),r2.cmd("e asm.lines=true"),r2.cmd("e asm.lineswidth=8"),r2.cmd("e asm.cmt.right=false");break;case"L":r2.cmd("e asm.bytes=true"),r2.cmd("e asm.lines=true"),r2.cmd("e asm.lineswidth=12"),r2.cmd("e asm.cmt.right=true")}}},u[l.DECODING]={name:"decoding",defVal:"Pseudo",apply:function(e){switch(e){case"Pseudo":r2.cmd("e asm.pseudo=1"),r2.cmd("e asm.syntax=intel");break;case"Opcodes":r2.cmd("e asm.pseudo=0"),r2.cmd("e asm.syntax=intel");break;case"ATT":r2.cmd("e asm.pseudo=0"),r2.cmd("e asm.syntax=att")}}},u[l.MODE]={name:"mode",defVal:"PA",apply:function(e){switch(e){case"PA":r2.cmd("e io.va=false"),r2.cmd("e io.pava=false");break;case"VA":r2.cmd("e io.va=true"),r2.cmd("e io.pava=false");break;case"PAVA":r2.cmd("e io.pava=true");break;case"Debug":r2.cmd("e io.va=true"),r2.cmd("e io.debug=true"),r2.cmd("e io.pava=false")}}},u[l.ANAL_HAS_NEXT]={name:"analHasNext",defVal:!0,apply:function(e){console.log("analHasNext is "+e)}},u[l.ANAL_SKIP_NOPS]={name:"analSkipNops",defVal:!0,apply:function(e){console.log("analSkipNops is "+e)}},u[l.ANAL_NON_CODE]={name:"analNonCode",defVal:!1,apply:function(e){console.log("analNonCode is "+e)}},u[l.COLORS]={name:"colors",defVal:!0,apply:function(e){inColor=e,r2.cmd("e scr.color="+e)}},u[l.THEME]={name:"theme",defVal:"none",apply:function(e){r2.cmd("eco "+e)}},u[l.USE_TTS]={name:"tts",defVal:!0,apply:function(){}};n.r2Settings=new o.SettingsManager(l,u)},{"./SettingsManager":6,"./UIContext":7}],6:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0];for(var t in this.conf){var n=this.getItem(t),i=this.getItemDefaultValue(t);(!e&&n!==i||e)&&this.conf[t].apply(n)}}},{key:"resetAll",value:function(){for(var e in this.conf)localStorage.removeItem(e);this.loadAll(!0)}},{key:"getItem",value:function(e){if(!this.keyExists(e))throw new Error("ConfKey "+e+" doesn't exist!");var t=localStorage.getItem(e);return null!==t?("false"===t?t=!1:"true"===t&&(t=!0),t):this.getItemDefaultValue(e)}},{key:"setItem",value:function(e,t){if(!this.keyExists(e))throw new Error("ConfKey "+e+" doesn't exist!");localStorage.setItem(e,t),this.conf[e].apply(t)}},{key:"getItemDefaultValue",value:function(e){if(!this.keyExists(e))throw new Error("ConfKey "+e+" doesn't exist!");return this.conf[e].defVal}},{key:"keyExists",value:function(e){return void 0!==this.conf[e]}}]),e}()},{}],7:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0}),n.uiContext=void 0;var r=function(){function e(e,t){for(var n=0;n1?i-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:" & ";this.titleNode.innerHTML="";for(var n=0;n1,o=document.createElement(r?"strong":"span");o.textContent=e.widgetFactory.get(i).name,o.addEventListener("click",function(){return e.setFocusAt(n)}),0!==n&&e.titleNode.appendChild(document.createTextNode(t)),e.titleNode.appendChild(o)}(n)}},{key:"applyLayout",value:function(e){this.currentLayout===o.Layouts.VERTICAL&&e.classList.add("vertical")}},{key:"resizeTo",value:function(e){this.isSplitted&&(this.contentNode.children[0].style.width=100*(e-.001)+"%",this.contentNode.children[1].style.width=100*(1-e-.001)+"%")}},{key:"split",value:function(e){if(!this.isSplitted){e!==o.Layouts.VERTICAL&&console.error("Not supported layout."),this.currentLayout=e,this.ruler.show();var t=!0,n=!1,i=void 0;try{for(var r,a=this.contentNode.children[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var s=r.value;this.applyLayout(s)}}catch(e){n=!0,i=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw i}}}}},{key:"merge",value:function(){if(this.isSplitted){this.ruler.reset(),this.ruler.hide(),this.currentLayout=o.Layouts.FULL;var e=this.isFirstWidgetFocused?this.contentNode.children[0]:this.contentNode.children[1],t=this.isFirstWidgetFocused?this.contentNode.children[1]:this.contentNode.children[0];t.className="rwidget",e.classList.remove("vertical"),e.classList.remove("horizontal"),e.classList.add("full"),e!==this.contentNode.children[0]&&e.parentNode.insertBefore(t,e)}}}]),e}();n.uiContext=new s},{"../layout/Layouts":17,"../layout/Ruler":19}],8:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0}),n.Autocompletion=void 0;var r=function(){function e(e,t){for(var n=0;n=t.minChar_&&t.show()}),this.form_.addEventListener("blur",function(){t.hide()}),this.flags_,this.activeChoice_=0,this.prevLength_=0,this.list_,this.completions_,this.populate_()}},{key:"populate_",value:function(){var e=this;r2.cmdj(this.cmd_,function(t){e.flags_=t})}},{key:"process_",value:function(e){for(var t=[],n=0,i=0;i0&&(console.log("UP"),this.setActiveChoice(this.activeChoice_-1)),e===s.DOWN&&this.activeChoice_=2){if(this.show(),this.completions_=this.process_(t),this.prevLength_!==t.length&&(this.activeChoice_=0),0===this.completions_.length)this.addNode_(c.EMPTY,!1);else for(var n in this.completions_)this.addNode_(this.completions_[n],n===this.activeChoice_);this.prevLength_=t.length}else this.hide()}},{key:"setPrepareView",value:function(e){this.preparationCallback=e}},{key:"prepareView",value:function(){void 0!==this.preparationCallback&&this.preparationCallback()}}]),e}()},{"../core/R2Wrapper":5,"../widgets/Widgets":52}],9:[function(e,t,n){"use strict";function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e.split(s),i=document.createElement("span"),o=!0,a=!1,c=void 0;try{for(var l,u=n[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){var d=l.value;i.appendChild(r(d,t))}}catch(e){a=!0,c=e}finally{try{!o&&u.return&&u.return()}finally{if(a)throw c}}return i}function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=void 0;return s.test(e)?(n=document.createElement("a"),n.innerHTML=e,o(n,e,t)):(n=document.createElement("span"),n.innerHTML=e),n}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t=t||e.textContent,e.addEventListener("click",function(){return a.r2Wrapper.seek(t,n)}),e.title="Seek "+t,e.href="#"+t}Object.defineProperty(n,"__esModule",{value:!0}),n.formatOffsets=i,n.formatOffset=r,n.applySeek=o;var a=e("../core/R2Wrapper"),s=new RegExp(/(0x[a-zA-Z0-9]+|(?:sym|fcn|str)\.[\.a-zA-Z0-9_]+)/,"g")},{"../core/R2Wrapper":5}],10:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;ni){this.pauseScrollEvent=!0;var r=Math.floor((this.limit+(i-this.limit)+this.screenProportion)*n);this.ontop(r,function(e){t.pauseScrollEvent=!1})}if(i>1-this.limit&&this.prevScroll2&&void 0!==arguments[2]?arguments[2]:null,i=document.createElement("a");i.className="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect",i.style.margin=s;var r=document.createElement("i");return r.className="material-icons",r.innerHTML=e,i.appendChild(r),i.appendChild(document.createTextNode(t)),null!==n&&i.addEventListener("click",n),i}function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=document.createElement("a");return n.className="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect",n.style.margin=s,n.textContent=e,null!==t&&n.addEventListener("click",t),n}function o(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=document.createElement("button");i.className="mdl-button mdl-js-button mdl-button--fab mdl-js-ripple-effect",i.style.margin=s,i.title=t;var r=document.createElement("i");return r.className="material-icons",r.textContent=e,i.appendChild(r),null!==n&&i.addEventListener("click",n),i}function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=document.createElement("button");i.className="mdl-button mdl-js-button mdl-button--fab mdl-button--mini-fab mdl-js-ripple-effect",i.style.margin=s,i.title=t;var r=document.createElement("i");return r.className="material-icons md-dark",r.innerHTML=e,i.appendChild(r),null!==n&&i.addEventListener("click",n),i}Object.defineProperty(n,"__esModule",{value:!0});var s="3px";n.Inputs={button:r,imgButton:o,iconButton:a,pictogramInputButton:i}},{}],12:[function(e,t,n){"use strict";function i(e,t){if(r.r2Settings.getItem(r.r2Settings.keys.USE_TTS)&&"undefined"!=typeof SpeechSynthesisUtterance){var n=new SpeechSynthesisUtterance;n.text=e,n.lang="en-US",n.onend=function(){t&&t()},n.onerror=function(e){t&&t(e)},speechSynthesis.speak(n)}}Object.defineProperty(n,"__esModule",{value:!0}),n.speak=i;var r=e("../core/R2Wrapper")},{"../core/R2Wrapper":5}],13:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0}),n.Table=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var n=0;n4&&void 0!==arguments[4]?arguments[4]:null;i(this,e),this.cols=t,this.nonum=n,this.clickableOffset=new Array(t.length),this.clickableOffset.fill(!1),this.contentEditable=new Array(t.length),this.contentEditable.fill(!1),this.onChange=o,this.seekNavigation=a,this.id=r||!1,this.init()}return o(e,[{key:"init",value:function(){this.root=document.createElement("table"),this.root.className="mdl-data-table mdl-data-table--selectable mdl-shadow--2dp",!1!==this.root.id&&(this.root.id=this.id),this.thead=document.createElement("thead"),this.root.appendChild(this.thead),this.tbody=document.createElement("tbody"),this.root.appendChild(this.tbody);var e=document.createElement("tr");this.thead.appendChild(e);for(var t in this.cols){"+"==this.cols[t][0]?(this.clickableOffset[t]=!0,this.cols[t]=this.cols[t].substr(1)):"~"==this.cols[t][0]&&(this.contentEditable[t]=!0);var n=document.createElement("th");n.appendChild(document.createTextNode(this.cols[t])),this.nonum[t]&&(n.className="mdl-data-table__cell--non-numeric"),e.appendChild(n)}}},{key:"getRows",value:function(){return Array.prototype.slice.call(this.tbody.children)}},{key:"addRow",value:function(e){var t=document.createElement("tr");this.tbody.appendChild(t);for(var n=0;nReady !
'),s.add(e)},this.updateManagers={},this.updateManagers.updates=new o.UpdateManager,this.updateManagers.lastViews=new o.UpdateManager,this.addFocusListener(this.updateManagers.updates),this.addFocusListener(this.updateManagers.lastViews)}return r(e,[{key:"fallbackWidget",value:function(e){this.fallback=e}},{key:"initRuler",value:function(){var e={},t=this;this.rulerProp={gap:.005,pos:.5};var n=function(n){e={startX:n.clientX,startWidth:parseInt(document.defaultView.getComputedStyle(t.ruler).width,10),interval:n.clientX-t.ruler.offsetLeft},document.documentElement.addEventListener("mousemove",i,!1),document.documentElement.addEventListener("mouseup",r,!1),n.preventDefault()},i=function(n){var i=(n.clientX-e.interval)/t.container.offsetWidth;t.rulerProp.pos=i,t.container.children[0].style.width=100*(i-t.rulerProp.gap)+"%",t.container.children[1].style.width=100*(1-i-t.rulerProp.gap)+"%",t.ruler.style.marginLeft=100*i+"%"},r=function e(){document.documentElement.removeEventListener("mousemove",i,!1),document.documentElement.removeEventListener("mouseup",e,!1)};this.ruler.addEventListener("mousedown",n)}},{key:"setFocus",value:function(e){this.focus_=e;for(var t=0;t=0&&n=t}}]),e}()},{"./ChunkStatus":3,"./NavigatorDirection":4}],3:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.ChunkStatus={LAUNCHED:0,COMPLETED:1}},{}],4:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.NavigatorDirection={BEFORE:-1,CURRENT:0,AFTER:1}},{}],5:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0}),n.r2Settings=n.r2Wrapper=n.R2Actions=void 0;var r=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,i=e;void 0===e?i=prompt("address"):"number"==typeof e&&(i="0x"+e.toString(16)),i&&""!==i.trim()&&r2.cmd("s "+i,function(){n&&a.uiContext.navigateTo(n),t.notifyAction(s.SEEK)})}},{key:"registerListener",value:function(e,t){this.listeners[e].push(t)}},{key:"notifyAction",value:function(e){this.listeners[e].forEach(function(e){return e()})}}]),e}(),l=(n.r2Wrapper=new c,{PLATFORM:"platform",BITS:"bits",UTF8:"utf8",UCASE:"ucase",DESCRIBE:"describe",BYTES:"bytes",OS:"os",SIZE:"size",DECODING:"decoding",MODE:"mode",ANAL_HAS_NEXT:"analHasNext",ANAL_SKIP_NOPS:"analSkipNops",ANAL_NON_CODE:"analNonCode",COLORS:"colors",USE_TTS:"useTTS",THEME:"theme",ASMEMU:"asmemu",ASMEMUSTR:"asmemustr"}),u={};u[l.PLATFORM]={name:"platform",defVal:"x86",apply:function(e){r2.cmd("e asm.arch="+e)}},u[l.BITS]={name:"bits",defVal:"32",apply:function(e){r2.cmd("e asm.bits="+e)}},u[l.UTF8]={name:"utf8",defVal:"true",apply:function(e){r2.cmd("e scr.utf8="+e)}},u[l.UCASE]={name:"ucase",defVal:"false",apply:function(e){r2.cmd("e asm.ucase="+e)}},u[l.DESCRIBE]={name:"describe",defVal:"false",apply:function(e){r2.cmd("e asm.describe="+e)}},u[l.BYTES]={name:"bytes",defVal:"false",apply:function(e){r2.cmd("e asm.bytes="+e)}},u[l.OS]={name:"os",defVal:"Linux",apply:function(e){console.log("OS is now: "+e)}},u[l.ASMEMU]={name:"asmemu",defVal:"false",apply:function(e){r2.cmd("e asm.emu="+e)}},u[l.ASMEMUSTR]={name:"asmemustr",defVal:"false",apply:function(e){r2.cmd("e emu.str="+e)}},u[l.SIZE]={name:"size",defVal:"S",apply:function(e){switch(e){case"S":r2.cmd("e asm.bytes=false"),r2.cmd("e asm.lines=false"),r2.cmd("e asm.cmt.right=false");break;case"M":r2.cmd("e asm.bytes=false"),r2.cmd("e asm.lines=true"),r2.cmd("e asm.lines.width=8"),r2.cmd("e asm.cmt.right=false");break;case"L":r2.cmd("e asm.bytes=true"),r2.cmd("e asm.lines=true"),r2.cmd("e asm.lines.width=12"),r2.cmd("e asm.cmt.right=true")}}},u[l.DECODING]={name:"decoding",defVal:"Pseudo",apply:function(e){switch(e){case"Pseudo":r2.cmd("e asm.pseudo=1"),r2.cmd("e asm.syntax=intel");break;case"Opcodes":r2.cmd("e asm.pseudo=0"),r2.cmd("e asm.syntax=intel");break;case"ATT":r2.cmd("e asm.pseudo=0"),r2.cmd("e asm.syntax=att")}}},u[l.MODE]={name:"mode",defVal:"PA",apply:function(e){switch(e){case"PA":r2.cmd("e io.va=false"),r2.cmd("e io.pava=false");break;case"VA":r2.cmd("e io.va=true"),r2.cmd("e io.pava=false");break;case"PAVA":r2.cmd("e io.pava=true");break;case"Debug":r2.cmd("e io.va=true"),r2.cmd("e io.debug=true"),r2.cmd("e io.pava=false")}}},u[l.ANAL_HAS_NEXT]={name:"analHasNext",defVal:!0,apply:function(e){console.log("analHasNext is "+e)}},u[l.ANAL_SKIP_NOPS]={name:"analSkipNops",defVal:!0,apply:function(e){console.log("analSkipNops is "+e)}},u[l.ANAL_NON_CODE]={name:"analNonCode",defVal:!1,apply:function(e){console.log("analNonCode is "+e)}},u[l.COLORS]={name:"colors",defVal:!0,apply:function(e){inColor=e,r2.cmd("e scr.color="+e)}},u[l.THEME]={name:"theme",defVal:"none",apply:function(e){r2.cmd("eco "+e)}},u[l.USE_TTS]={name:"tts",defVal:!0,apply:function(){}};n.r2Settings=new o.SettingsManager(l,u)},{"./SettingsManager":6,"./UIContext":7}],6:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0];for(var t in this.conf){var n=this.getItem(t),i=this.getItemDefaultValue(t);(!e&&n!==i||e)&&this.conf[t].apply(n)}}},{key:"resetAll",value:function(){for(var e in this.conf)localStorage.removeItem(e);this.loadAll(!0)}},{key:"getItem",value:function(e){if(!this.keyExists(e))throw new Error("ConfKey "+e+" doesn't exist!");var t=localStorage.getItem(e);return null!==t?("false"===t?t=!1:"true"===t&&(t=!0),t):this.getItemDefaultValue(e)}},{key:"setItem",value:function(e,t){if(!this.keyExists(e))throw new Error("ConfKey "+e+" doesn't exist!");localStorage.setItem(e,t),this.conf[e].apply(t)}},{key:"getItemDefaultValue",value:function(e){if(!this.keyExists(e))throw new Error("ConfKey "+e+" doesn't exist!");return this.conf[e].defVal}},{key:"keyExists",value:function(e){return void 0!==this.conf[e]}}]),e}()},{}],7:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0}),n.uiContext=void 0;var r=function(){function e(e,t){for(var n=0;n1?i-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:" & ";this.titleNode.innerHTML="";for(var n=0;n1,o=document.createElement(r?"strong":"span");o.textContent=e.widgetFactory.get(i).name,o.addEventListener("click",function(){return e.setFocusAt(n)}),0!==n&&e.titleNode.appendChild(document.createTextNode(t)),e.titleNode.appendChild(o)}(n)}},{key:"applyLayout",value:function(e){this.currentLayout===o.Layouts.VERTICAL&&e.classList.add("vertical")}},{key:"resizeTo",value:function(e){this.isSplitted&&(this.contentNode.children[0].style.width=100*(e-.001)+"%",this.contentNode.children[1].style.width=100*(1-e-.001)+"%")}},{key:"split",value:function(e){if(!this.isSplitted){e!==o.Layouts.VERTICAL&&console.error("Not supported layout."),this.currentLayout=e,this.ruler.show();var t=!0,n=!1,i=void 0;try{for(var r,a=this.contentNode.children[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var s=r.value;this.applyLayout(s)}}catch(e){n=!0,i=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw i}}}}},{key:"merge",value:function(){if(this.isSplitted){this.ruler.reset(),this.ruler.hide(),this.currentLayout=o.Layouts.FULL;var e=this.isFirstWidgetFocused?this.contentNode.children[0]:this.contentNode.children[1],t=this.isFirstWidgetFocused?this.contentNode.children[1]:this.contentNode.children[0];t.className="rwidget",e.classList.remove("vertical"),e.classList.remove("horizontal"),e.classList.add("full"),e!==this.contentNode.children[0]&&e.parentNode.insertBefore(t,e)}}}]),e}();n.uiContext=new s},{"../layout/Layouts":17,"../layout/Ruler":19}],8:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0}),n.Autocompletion=void 0;var r=function(){function e(e,t){for(var n=0;n=t.minChar_&&t.show()}),this.form_.addEventListener("blur",function(){t.hide()}),this.flags_,this.activeChoice_=0,this.prevLength_=0,this.list_,this.completions_,this.populate_()}},{key:"populate_",value:function(){var e=this;r2.cmdj(this.cmd_,function(t){e.flags_=t})}},{key:"process_",value:function(e){for(var t=[],n=0,i=0;i0&&(console.log("UP"),this.setActiveChoice(this.activeChoice_-1)),e===s.DOWN&&this.activeChoice_=2){if(this.show(),this.completions_=this.process_(t),this.prevLength_!==t.length&&(this.activeChoice_=0),0===this.completions_.length)this.addNode_(c.EMPTY,!1);else for(var n in this.completions_)this.addNode_(this.completions_[n],n===this.activeChoice_);this.prevLength_=t.length}else this.hide()}},{key:"setPrepareView",value:function(e){this.preparationCallback=e}},{key:"prepareView",value:function(){void 0!==this.preparationCallback&&this.preparationCallback()}}]),e}()},{"../core/R2Wrapper":5,"../widgets/Widgets":52}],9:[function(e,t,n){"use strict";function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e.split(s),i=document.createElement("span"),o=!0,a=!1,c=void 0;try{for(var l,u=n[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){var d=l.value;i.appendChild(r(d,t))}}catch(e){a=!0,c=e}finally{try{!o&&u.return&&u.return()}finally{if(a)throw c}}return i}function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=void 0;return s.test(e)?(n=document.createElement("a"),n.innerHTML=e,o(n,e,t)):(n=document.createElement("span"),n.innerHTML=e),n}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t=t||e.textContent,e.addEventListener("click",function(){return a.r2Wrapper.seek(t,n)}),e.title="Seek "+t,e.href="#"+t}Object.defineProperty(n,"__esModule",{value:!0}),n.formatOffsets=i,n.formatOffset=r,n.applySeek=o;var a=e("../core/R2Wrapper"),s=new RegExp(/(0x[a-zA-Z0-9]+|(?:sym|fcn|str)\.[\.a-zA-Z0-9_]+)/,"g")},{"../core/R2Wrapper":5}],10:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;ni){this.pauseScrollEvent=!0;var r=Math.floor((this.limit+(i-this.limit)+this.screenProportion)*n);this.ontop(r,function(e){t.pauseScrollEvent=!1})}if(i>1-this.limit&&this.prevScroll2&&void 0!==arguments[2]?arguments[2]:null,i=document.createElement("a");i.className="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect",i.style.margin=s;var r=document.createElement("i");return r.className="material-icons",r.innerHTML=e,i.appendChild(r),i.appendChild(document.createTextNode(t)),null!==n&&i.addEventListener("click",n),i}function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=document.createElement("a");return n.className="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect",n.style.margin=s,n.textContent=e,null!==t&&n.addEventListener("click",t),n}function o(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=document.createElement("button");i.className="mdl-button mdl-js-button mdl-button--fab mdl-js-ripple-effect",i.style.margin=s,i.title=t;var r=document.createElement("i");return r.className="material-icons",r.textContent=e,i.appendChild(r),null!==n&&i.addEventListener("click",n),i}function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=document.createElement("button");i.className="mdl-button mdl-js-button mdl-button--fab mdl-button--mini-fab mdl-js-ripple-effect",i.style.margin=s,i.title=t;var r=document.createElement("i");return r.className="material-icons md-dark",r.innerHTML=e,i.appendChild(r),null!==n&&i.addEventListener("click",n),i}Object.defineProperty(n,"__esModule",{value:!0});var s="3px";n.Inputs={button:r,imgButton:o,iconButton:a,pictogramInputButton:i}},{}],12:[function(e,t,n){"use strict";function i(e,t){if(r.r2Settings.getItem(r.r2Settings.keys.USE_TTS)&&"undefined"!=typeof SpeechSynthesisUtterance){var n=new SpeechSynthesisUtterance;n.text=e,n.lang="en-US",n.onend=function(){t&&t()},n.onerror=function(e){t&&t(e)},speechSynthesis.speak(n)}}Object.defineProperty(n,"__esModule",{value:!0}),n.speak=i;var r=e("../core/R2Wrapper")},{"../core/R2Wrapper":5}],13:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0}),n.Table=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var n=0;n4&&void 0!==arguments[4]?arguments[4]:null;i(this,e),this.cols=t,this.nonum=n,this.clickableOffset=new Array(t.length),this.clickableOffset.fill(!1),this.contentEditable=new Array(t.length),this.contentEditable.fill(!1),this.onChange=o,this.seekNavigation=a,this.id=r||!1,this.init()}return o(e,[{key:"init",value:function(){this.root=document.createElement("table"),this.root.className="mdl-data-table mdl-data-table--selectable mdl-shadow--2dp",!1!==this.root.id&&(this.root.id=this.id),this.thead=document.createElement("thead"),this.root.appendChild(this.thead),this.tbody=document.createElement("tbody"),this.root.appendChild(this.tbody);var e=document.createElement("tr");this.thead.appendChild(e);for(var t in this.cols){"+"==this.cols[t][0]?(this.clickableOffset[t]=!0,this.cols[t]=this.cols[t].substr(1)):"~"==this.cols[t][0]&&(this.contentEditable[t]=!0);var n=document.createElement("th");n.appendChild(document.createTextNode(this.cols[t])),this.nonum[t]&&(n.className="mdl-data-table__cell--non-numeric"),e.appendChild(n)}}},{key:"getRows",value:function(){return Array.prototype.slice.call(this.tbody.children)}},{key:"addRow",value:function(e){var t=document.createElement("tr");this.tbody.appendChild(t);for(var n=0;nReady !'),s.add(e)},this.updateManagers={},this.updateManagers.updates=new o.UpdateManager,this.updateManagers.lastViews=new o.UpdateManager,this.addFocusListener(this.updateManagers.updates),this.addFocusListener(this.updateManagers.lastViews)}return r(e,[{key:"fallbackWidget",value:function(e){this.fallback=e}},{key:"initRuler",value:function(){var e={},t=this;this.rulerProp={gap:.005,pos:.5};var n=function(n){e={startX:n.clientX,startWidth:parseInt(document.defaultView.getComputedStyle(t.ruler).width,10),interval:n.clientX-t.ruler.offsetLeft},document.documentElement.addEventListener("mousemove",i,!1),document.documentElement.addEventListener("mouseup",r,!1),n.preventDefault()},i=function(n){var i=(n.clientX-e.interval)/t.container.offsetWidth;t.rulerProp.pos=i,t.container.children[0].style.width=100*(i-t.rulerProp.gap)+"%",t.container.children[1].style.width=100*(1-i-t.rulerProp.gap)+"%",t.ruler.style.marginLeft=100*i+"%"},r=function e(){document.documentElement.removeEventListener("mousemove",i,!1),document.documentElement.removeEventListener("mouseup",e,!1)};this.ruler.addEventListener("mousedown",n)}},{key:"setFocus",value:function(e){this.focus_=e;for(var t=0;t=2;n&&(this.container.removeChild(this.container.children[this.getFocus()]),this.populatedWidgets.splice(this.getFocus(),1)),0===this.getFocus()&&n?(this.populatedWidgets.unshift(e),e.isAlreadyThere()||(this.container.insertBefore(t,this.container.children[0]),this.container.children[0].style.width=100*(this.rulerProp.pos-this.rulerProp.gap)+"%")):(this.populatedWidgets.push(e),e.isAlreadyThere()||(this.container.appendChild(t),this.container.children[1].style.width=100*(1-this.rulerProp.pos-this.rulerProp.gap)+"%"))}else this.populatedWidgets.length>=1&&this.container.removeChild(this.container.children[this.getFocus()]),this.populatedWidgets=[e],e.isAlreadyThere()||(this.container.appendChild(t),this.container.children[0].style.width="auto");this.moveFocusOnWidget(e),this.applyFocusEvent_(e),e.setOffset(this.getFocus()),this.drawTitle()}}},{key:"moveFocusOnWidget",value:function(e){this.setFocus(this.populatedWidgets.indexOf(e)),this.container.children[this.getFocus()].classList.add("focus"),this.isSplitted()&&this.container.children[(this.getFocus()+1)%2].classList.remove("focus"),this.drawTitle()}},{key:"drawTitle",value:function(){if(this.currentLayout===a.Layouts.FULL||1===this.populatedWidgets.length)this.title.innerHTML=this.populatedWidgets[0].getName();else{for(var e=[],t=0;t"+this.populatedWidgets[t].getName()+""):e.push(this.populatedWidgets[t].getName());this.title.innerHTML=e.join(" & ")}}},{key:"applyFocusEvent_",value:function(e){var t=this;this.getWidgetDOMWrapper(e).addEventListener("mousedown",function(){t.moveFocusOnWidget(e)})}},{key:"addFocusListener",value:function(e){this.focusListeners.push(e)}}]),e}()},{"../helpers/UpdateManager":14,"./Layouts":17}],16:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:s;i(this,e),this.heightProvisioning=t}return r(e,[{key:"getCurChunk",value:function(){return this.curChunk}},{key:"getFirstElement",value:function(){return this.firstElement}},{key:"refreshInitialOffset",value:function(){var e=this;r2.cmd("s",function(t){e.initialOffset=parseInt(t,16)})}},{key:"defineInfiniteParams",value:function(e){var t=this,n=0===this.container.getBody().offsetHeight?800:this.container.getBody().offsetHeight;this.howManyLines=Math.floor(n/this.lineHeight*this.heightProvisioning);var i=new a.InfiniteScrolling(this.container.getBody(),3,void 0!==e?e:.2);i.setTopEvent(function(e,n){t.nav.go(o.NavigatorDirection.BEFORE),t.infiniteDrawingContent(o.NavigatorDirection.BEFORE,e,n)}),i.setBottomEvent(function(e,n){t.nav.go(o.NavigatorDirection.AFTER),t.infiniteDrawingContent(o.NavigatorDirection.AFTER,e,n)})}}]),e}()},{"../core/NavigatorDirection":4,"../helpers/InfiniteScrolling":10}],19:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;ne){t-=o;break}i=n[r]}var a=t-e,s=i.getBoundingClientRect().height-a;return this.extractOffset_(i.children[0].id)+Math.ceil(s/this.lineHeight)}}},{key:"replaceScrollPosition",value:function(e){if(void 0!==e){var t=this.nav.getChunkPositionFor(e);if(-1===t)return void console.log("Chunk position from offset not found");for(var n=this.container.getBody().children[t],i=0;void 0===n.children[i].id;)i++;var r=this.extractOffset_(n.children[i].id),o=n.offsetTop,a=n.getBoundingClientRect().height,s=(e-r)/this.nav.getSize(r),c=Math.floor(s*a),l=o+c;this.container.getBody().scrollTop=l}}},{key:"drawContextualMenu",value:function(e){var t=this,n=function(e,n){var i,r=n+" @"+e;if(r2.cmdj(r,function(e){i=e}),null===i||i.constructor!==Array)return void alert("No available ouput!");t.addLongListDialog(i)},i=function(e,n,i){var r="";void 0!==i&&""===(r=prompt(i+"?"))||(""!==r&&(n+=" "+r),r2.cmd(n+" @"+e),t.nav.cleanOldData(),t.draw())},r=[{aoj:!1,name:"view graph",shortcut:"G",fct:function(){return d.uiContext.navigateTo(f.Widgets.DISASSEMBLY_GRAPH)}},{aoj:!1,name:"analyze function",shortcut:"F",fct:function(e,t){return i(t,"af")}},{aoj:!0,name:"immediate base...",shortcut:"i",expand:[{name:"binary",fct:function(e,t){return i(t,"ahi b")}},{name:"octal",fct:function(e,t){return i(t,"ahi o")}},{name:"decimal",fct:function(e,t){return i(t,"ahi d")}},{name:"hexadecimal",fct:function(e,t){return i(t,"ahi h")}},{name:"string",fct:function(e,t){return i(t,"ahi s")}}]},{aoj:!1,name:"add comment",shortcut:";",fct:function(e,t){return i(t,"CC","Name")}},{aoj:!1,name:"set flag",shortcut:"f",fct:function(e,t){return i(t,"f","Name")}},{aoj:!0,name:"rename flag",shortcut:"n",fct:function(e,t){return i(t,"fr","Name")}},{aoj:!0,name:"set string",shortcut:"s",fct:function(e,t){return i(t,"Cs")}},{aoj:!1,name:"find xrefs",shortcut:"x",fct:function(e,t){return n(t,"axtj")}},{aoj:!1,name:"as data",shortcut:"D",fct:function(e,t){return i(t,"Cd ","Size")}},{aoj:!1,name:"as code",shortcut:"F",fct:function(e,t){return i(t,"C-")}},{aoj:!1,name:"as string",shortcut:"S",fct:function(e,t){return i(t,"Cs")}}],o=document.getElementById("contextmenuDisasm");if(null===o){var o=document.createElement("nav");o.id="contextmenuDisasm",o.classList.add("context-menu")}else o.innerHTML="";var a=document.createElement("ul");o.appendChild(a);for(var t=this,s=function(e,n){e.addEventListener("mousedown",function(e){return function(n){e(n,t.getCurrentOffset())}}(n))},c=0;c=t||r<=e&&o>=e||r<=t&&o>=t||r>=e&&o<=t)&&n.push(i)}return n}},{key:"populateFirst",value:function(){return this.populateFrom(this.currentOffset)}},{key:"fillGap",value:function(e,t,n){var i=t-e;return[{offset:e,size:i,artifical:n}]}},{key:"populateFrom",value:function(e){for(var t=e-a(this.howManyLines),n=t+3*a(this.howManyLines),i=this.getOverlappingIntervals(t,n),r=[],o=0;o0){r[0].offset!==t&&(r=r.concat(this.fillGap(t,r[0].offset)));var u=r[r.length-1],d=u.offset+u.size;d!==n&&(r=r.concat(this.fillGap(d+1,n)));for(var o=0;o1&&(r=r.concat(this.fillGap(s+1,c)))}}else r=this.fillGap(t,n,!0);this.currentlyShown=r}},{key:"getShownOffset",value:function(){return this.currentlyShown}},{key:"getSize",value:function(e){for(var t=0;t=this.currentlyShown[t].offset&&e-1}},{key:"getFlags",value:function(e,t){var n=function(t){for(var n=[],i=0;i=e&&n.push({name:t[i].name,start:t[i].offset,end:t[i].offset+t[i].size});return n.sort(function(e,t){return e.size>t.size?-1:1}),n},i=[],r=0,o=function(){
++r<3||t(n(i))};this.get(c.NavigatorDirection.CURRENT,function(e){i=i.concat(e.flags),o()}),this.get(c.NavigatorDirection.BEFORE,function(e){i=i.concat(e.flags),o()}),this.get(c.NavigatorDirection.AFTER,function(e){i=i.concat(e.flags),o()})}},{key:"getBytes",value:function(e){var t;return r2.cmdj("p8j "+(e.to-e.from+1)+" @"+e.from,function(e){t=e}),t}},{key:"refreshChunk",value:function(e,t){var n=[],i=this;this.get(e,function(r){r.callback=[],n=r.modified,i.get(e,function(e){e.modified.concat(n),t(e)},!0)})}},{key:"refreshCurrent",value:function(e){var t=0,n=function(){++t<3||e()};this.refreshChunk(c.NavigatorDirection.CURRENT,function(){n()}),this.refreshChunk(c.NavigatorDirection.BEFORE,function(){n()}),this.refreshChunk(c.NavigatorDirection.AFTER,function(){n()})}}]),t}(s.BlockNavigator)},{"../../core/BlockNavigator":2,"../../core/NavigatorDirection":4}],23:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0}),n.Hexdump=void 0;var a=function(){function e(e,t){for(var n=0;n0)}},{key:"processSelection",value:function(e){e&&this.cleanSelection(!0),this.selectionFirst===this.selectionEnd&&(this.selectionFirst.classList.add("selected"),this.currentSelection={from:this.selectionFirst.offset,to:this.selectionFirst.offset});var t=this.selectionFirst.offset0&&(i.isTopMax=!1)}),0!==r.offset||0!==r.hex.length){var o;o=e===c.NavigatorDirection.BEFORE?i.listContent.lastChild.className:i.listContent.firstChild.className;for(var a=Array.prototype.slice.call(document.getElementsByClassName(o)),s=0;s0?8*d.WordSizes[u]+" bits":"pairs",d.WordSizes[u]===this.hexLength&&(f.selected=!0),l.appendChild(f)}l.addEventListener("change",function(e){t.hexLength=parseInt(e.target.value),t.draw()},!1);var h=document.createElement("input");h.className="mdl-textfield__input",h.style.width="26px",h.style.display="inline",h.pattern="[0-9]+",h.value=this.nbColumns;var p=function(e){t.nbColumns=h,t.nav.changeNbCols(h),t.draw(),e.value=h},m=document.createElement("span");m.title="Number of columns per line";var g=document.createElement("button");g.className="mdl-button mdl-js-button mdl-button--icon",g.appendChild(document.createTextNode("-")),g.addEventListener("click",function(){return p(t.nbColumns-1)});var v=document.createElement("button");v.className="mdl-button mdl-js-button mdl-button--icon",v.appendChild(document.createTextNode("+")),v.addEventListener("click",function(){return p(t.nbColumns+1)}),h.addEventListener("change",function(e){var t=parseInt(e.target.value);p(t)}),m.appendChild(g),m.appendChild(document.createTextNode(" ")),m.appendChild(h),m.appendChild(document.createTextNode(" ")),m.appendChild(v);var y=document.createElement("input");y.classList.add("mdl-checkbox__input"),y.type="checkbox",y.checked=this.bigEndian;var b=document.createElement("span");b.classList.add("mdl-checkbox__label"),b.appendChild(document.createTextNode("bigEndian"));var C=document.createElement("label");C.classList.add("mdl-checkbox"),C.classList.add("mdl-js-checkbox"),C.classList.add("mdl-js-ripple-effect"),C.appendChild(y),C.appendChild(b),y.addEventListener("change",function(){t.bigEndian=!t.bigEndian,t.draw()});var w=document.createElement("input");w.classList.add("mdl-checkbox__input"),w.type="checkbox",w.checked=this.isWritable();var E=document.createElement("span");E.classList.add("mdl-checkbox__label"),E.appendChild(document.createTextNode("isEditable"));var k=document.createElement("label");k.classList.add("mdl-checkbox"),k.classList.add("mdl-js-checkbox"),k.classList.add("mdl-js-ripple-effect"),k.appendChild(w),k.appendChild(E),this.writable||(w.disabled=!0),w.addEventListener("change",function(){t.selectionMode=!t.selectionMode,t.draw()});var S=document.createElement("input");S.classList.add("mdl-checkbox__input"),S.type="checkbox",S.checked=this.showFlags;var _=document.createElement("span");_.classList.add("mdl-checkbox__label"),_.appendChild(document.createTextNode("showFlags"));var O=document.createElement("label");O.classList.add("mdl-checkbox"),O.classList.add("mdl-js-checkbox"),O.classList.add("mdl-js-ripple-effect"),O.appendChild(S),O.appendChild(_),S.addEventListener("change",function(){t.showFlags=!t.showFlags,t.draw()}),i.appendChild(c),r.appendChild(m),o.appendChild(C),a.appendChild(k),s.appendChild(O),componentHandler.upgradeDom()}},{key:"getFlagColor",value:function(e){for(var t=0;t=a.offset){o=e[s];break}if(void 0===o)return"continue";var c=document.createElement("li"),l=int2fixedHex(a.offset,8);c.classList.add("block"+t),c.classList.add("flag"),c.offset=l,c.appendChild(document.createTextNode("["+l+"] "+a.name)),c.title="Go to Disassembly",c.style.cursor="pointer",c.addEventListener("click",function(){return p.r2Wrapper.seek(l,f.Widgets.DISASSEMBLY)}),c.title="("+a.size+" bytes) Seek "+l+" on disassembly widget",c.style.color=i.getFlagColor(a.name),i.listContent.insertBefore(c,o)})()}}}},{key:"indexOfLine_",value:function(e){for(var t=[].slice.call(this.listContent.children),n=0;n=e)return n;return-1}},{key:"colorizeFlag",value:function(e){var t=this;if(this.showFlags){void 0===e&&(e=!1);var n=[].slice.call(this.listContent.children);if(e)for(var i=0;iAnalysis Options',this.card.appendChild(t);var n=document.createElement("div");n.className="mdl-card__supporting-text mdl-color-grey-600",this.card.appendChild(n);var i=document.createElement("ul");n.appendChild(i);var r=document.createElement("div");r.className="mdl-card__actions mdl-card--border",this.card.appendChild(r);var o=document.createElement("a");o.className="mdl-button mdl-js-button mdl-js-ripple-effect mdl-color--blue-grey-50 mdl-color-text--blue-greu-50",o.textContent="Analyse",o.addEventListener("click",function(){return e.analyse()}),r.appendChild(o);var a=document.createElement("div");a.className="mdl-layout-spacer",r.appendChild(a);var s=document.createElement("i");s.className="material-icons",s.textContent="room",r.appendChild(s),this.addAnalysisOptions(i)}},{key:"addAnalysisOptions",value:function(e){for(var t in this.analysisMethods){var n=this.analysisMethods[t],i="anal_"+n.id,r=document.createElement("li");e.appendChild(r);var o=document.createElement("label");o.className="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect",o.for=i,r.appendChild(o);var a=document.createElement("input");a.className="mdl-checkbox__input",a.id=i,a.type="checkbox",o.appendChild(a);var s=document.createElement("span");s.className="mdl-checkbox__label",s.innerHTML=n.name,o.appendChild(s)}}},{key:"refresh",value:function(){[].slice.call(this.card.getElementsByTagName("input")).forEach(function(e){return e.checked=!1})}},{key:"analyse",value:function(){var e=!1;for(var t in this.analysisMethods){var n=this.analysisMethods[t],i="anal_"+n.id;document.getElementById(i).checked?(r2.cmd(n.cmd),e=!0):void 0!==n.disabledCmd&&r2.cmd(n.cmd)}e&&void 0!==this.analysisCallback&&this.analysisCallback()}}]),e}()},{}],26:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0}),n.EntropyCard=void 0;var r=function(){function e(e,t){for(var n=0;nt.value?e:t}).value,r=this.width/t,c=this.height;this.svg.innerHTML="";for(var l in this.entropy)!function(t){var l=e.entropy[t],u=.1+(l.value-n)/(i-n)*.9,d=document.createElementNS(s,"g");d.addEventListener("click",function(){o.r2Wrapper.seek(l.addr,a.Widgets.DISASSEMBLY)}),e.svg.appendChild(d);var f=document.createElementNS(s,"title");f.textContent="0x"+l.addr.toString(16),d.appendChild(f);var h=document.createElementNS(s,"rect");h.setAttribute("x",r*t),h.setAttribute("y",0),h.setAttribute("width",r),h.setAttribute("height",c),h.setAttribute("fill","#000"),h.setAttribute("fill-opacity",u);var p=document.createElementNS(s,"text"),m=u>.4?"#EEEEEE":"black";p.setAttribute("x",r*t+2),p.setAttribute("y",c+10),p.setAttribute("fill",m),p.setAttribute("font-family","Roboto"),p.setAttribute("font-size",12),p.setAttribute("transform","rotate(-90, "+r*t+", "+c+")"),p.textContent="0x"+l.addr.toString(16),d.appendChild(h),d.appendChild(p)}(l)}}},{key:"refresh",value:function(){this.refreshEntropy(),this.draw()}}]),e}()},{"../../core/R2Wrapper":5,"../../widgets/Widgets":52}],27:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0}),n.FortunesCard=void 0;var r=function(){function e(e,t){for(var n=0;nFortunes',this.fortuneBlock=document.createElement("div"),this.fortuneBlock.className="mdl-card__supporting-text mdl-color-text--grey-600",this.fortuneBlock.innerHTML=this.currentFortune;var n=document.createElement("div");n.className="mdl-card__actions mdl-card--border";var i=document.createElement("a");i.className="mdl-button mdl-js-button mdl-js-ripple-effect",i.innerHTML="Next",i.addEventListener("click",function(){return e.refresh()}),n.appendChild(i),this.card.appendChild(t),this.card.appendChild(this.fortuneBlock),this.card.appendChild(n)}},{key:"refresh",value:function(){this.currentFortune=this.getNewFortune(),this.fortuneBlock.innerHTML=this.currentFortune,(0,o.speak)(this.currentFortune)}},{key:"getNewFortune",value:function(){var e=void 0;return r2.cmd("fo",function(t){e=t}),e}}]),e}()},{"../../helpers/Speak.js":12}],28:[function(e,t,n){"use strict";function i(e,t){
-if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0}),n.GraphCard=void 0;var r=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:1;i(this,e),this.headersCmd=[{name:"HDR",title:"Headers",format:this.formatAsKeyValue,cmd:"i|",grep:null,ready:!1},{name:"SYM",title:"Symbols",format:this.fromatAsCode,cmd:"isq",grep:"!imp",ready:!1},{name:"IMP",title:"Imports",format:this.fromatAsCode,cmd:"isq",grep:"imp.",ready:!1},{name:"REL",title:"Relocations",format:this.fromatAsCode,cmd:"ir",grep:null,ready:!1},{name:"SEC",title:"Sections",format:this.fromatAsCode,cmd:"iSq",grep:null,ready:!1},{name:"STR",title:"Strings",format:this.fromatAsCode,cmd:"izq",grep:null,ready:!1},{name:"SDB",title:"Sdb",format:this.fromatAsCode,cmd:"k bin/cur/***",grep:null,ready:!1}],this.build(),this.preloadTabs(t)}return r(e,[{key:"DOM",get:function(){return this.card}},{key:"nbTabs",get:function(){return this.headersCmd.length}}]),r(e,[{key:"build",value:function(){this.card=document.createElement("div"),this.card.className="demo-graphs mdl-shadow--2dp mdl-color--white mdl-cell mdl-cell--8-col";var e=document.createElement("div");e.className="mdl-tabs mdl-js-tabs",this.card.appendChild(e),this.tabs=document.createElement("div"),this.tabs.className="mdl-tabs__tab-bar overview-tabs",this.content=document.createElement("div"),e.appendChild(this.tabs),e.appendChild(this.content),this.createTabs(this.headersCmd,this.tabs,this.content)}},{key:"createTabs",value:function(e,t,n){var i=this,r=!0;for(var o in e)!function(o){var a=e[o],s="tab-"+a.name,c=document.createElement("a");c.classList.add("mdl-tabs__tab"),c.href="#"+s,c.title=a.title,c.innerHTML=a.name;var l=document.createElement("div");l.classList.add("mdl-tabs__panel"),l.id=s,r&&(l.classList.add("is-active"),c.classList.add("is-active"),r=!1),c.addEventListener("click",function(){return i.loadTab(l,a)}),t.appendChild(c),n.appendChild(l)}(o)}},{key:"fixHeight",value:function(e){this.content.style.height="0px";var t=this.card.getBoundingClientRect().height,n=this.tabs.getBoundingClientRect().height,i=t-n-32;this.content.style.height=(ithis.nbTabs?this.nbTabs:e;for(var t=0;t1&&(e.style["-webkit-column-count"]=t.cols,e.style["-moz-column-count"]=t.cols,e.style["column-count"]=t.cols),t.ready=!0}}},{key:"refresh",value:function(){for(var e in this.headersCmd)this.headersCmd[e].ready=!1;var t=[].slice.call(this.content.children);for(var n in t)if(t[n].className.indexOf("is-active")>-1){this.loadTab(t[n],this.headersCmd[n]);break}}},{key:"fromatAsCode",value:function(e){var t=document.createElement("pre");return t.style.marge="1.2em",t.appendChild((0,o.formatOffsets)(e,a.Widgets.DISASSEMBLY)),t}},{key:"formatAsKeyValue",value:function(e){var t=document.createElement("dl");t.classList.add("infocard");var n=e.split(/\n/g);for(var i in n){var r=n[i].split(/ (.+)?/);if(r.length>=2){var o=document.createElement("dt");o.textContent=r[0],t.appendChild(o);var a=document.createElement("dd");a.textContent=r[1],t.appendChild(a)}}return t}}]),e}()},{"../../helpers/Format":9,"../../widgets/Widgets":52}],30:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0}),n.Overview=void 0;var r=function(){function e(e,t){for(var n=0;n3&&void 0!==arguments[3]?arguments[3]:null;i(this,t);var s=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,"dark"));return s.formatFunc=n,s.r2cmd=o,null!==a&&(s.backButton=a),s}return o(t,e),a(t,[{key:"init",value:function(){var e=this;void 0!==this.backButton&&(this.backButton.style.position="absolute",this.backButton.style.top="1em",this.backButton.style.left="1em",c.r2Wrapper.registerListener(c.R2Actions.SEEK,function(){e.displayed&&e.draw()}))}},{key:"draw",value:function(){void 0!==this.backButton&&this.node.appendChild(this.backButton),this.node.appendChild(this.getPre())}},{key:"getPre",value:function(){var e=this,t=document.createElement("pre");return r2.cmd(this.r2cmd,function(n){t.appendChild(e.formatFunc(n))}),t}}]),t}(s.BaseWidget)},{"../core/R2Wrapper":5,"../helpers/Inputs":11,"./BaseWidget":32}],32:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n1?n-1:0),o=1;o1?n-1:0),r=1;r=2&&n.addRow([a[0],a[1]])}n.insertInto(i)}),t}}]),t}(s.BaseWidget)},{"../core/R2Wrapper":5,"../core/UIContext":7,"../helpers/Inputs":11,"../helpers/Table":13,"./BaseWidget":32,"./Widgets":52}],34:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0}),n.DebuggerWidget=void 0;var a=function(){function e(e,t){for(var n=0;n=4&&function(){var t=a[3],i=-1===a[2].indexOf("."),r=document.createElement("a");r.innerHTML=t,i&&(r.style.color="red"),r.addEventListener("click",function(){r2.cmd("fs "+t),e.draw()});var o=n.addRow([a[1],r]);o.addEventListener("click",function(){n.getRows().forEach(function(e){e.classList.remove("active")}),o.classList.add("active"),e.current=t})}()}n.insertInto(i)}),t}},{key:"setFlagspace",value:function(){var e=this,t=this.current;t||(t=prompt("name")),t&&r2.cmd("fs "+t,function(){e.draw()})}},{key:"renameFlagspace",value:function(){var e=this,t=this.current;t||(t=prompt("name")),t&&r2.cmd("fsr "+t,function(){e.draw()})}},{key:"delFlagspace",value:function(){var e=this,t=this.current;t||(t="."),t&&r2.cmd("fs-"+t,function(){e.draw()})}}]),t}(s.BaseWidget)},{"../core/R2Wrapper":5,"../core/UIContext":7,"../helpers/Inputs":11,"../helpers/Table":13,"./BaseWidget":32,"./Widgets":52}],43:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0}),n.FlagsWidget=void 0;var a=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:1;i(this,e),this.headersCmd=[{name:"HDR",title:"Headers",format:this.formatAsKeyValue,cmd:"i|",grep:null,ready:!1},{name:"SYM",title:"Symbols",format:this.fromatAsCode,cmd:"isq",grep:"!imp",ready:!1},{name:"IMP",title:"Imports",format:this.fromatAsCode,cmd:"isq",grep:"imp.",ready:!1},{name:"REL",title:"Relocations",format:this.fromatAsCode,cmd:"ir",grep:null,ready:!1},{name:"SEC",title:"Sections",format:this.fromatAsCode,cmd:"iSq",grep:null,ready:!1},{name:"STR",title:"Strings",format:this.fromatAsCode,cmd:"izq",grep:null,ready:!1},{name:"SDB",title:"Sdb",format:this.fromatAsCode,cmd:"k bin/cur/***",grep:null,ready:!1}],this.build(),this.preloadTabs(t)}return r(e,[{key:"DOM",get:function(){return this.card}},{key:"nbTabs",get:function(){return this.headersCmd.length}}]),r(e,[{key:"build",value:function(){this.card=document.createElement("div"),this.card.className="demo-graphs mdl-shadow--2dp mdl-color--white mdl-cell mdl-cell--8-col";var e=document.createElement("div");e.className="mdl-tabs mdl-js-tabs",this.card.appendChild(e),this.tabs=document.createElement("div"),this.tabs.className="mdl-tabs__tab-bar overview-tabs",this.content=document.createElement("div"),e.appendChild(this.tabs),e.appendChild(this.content),this.createTabs(this.headersCmd,this.tabs,this.content)}},{key:"createTabs",value:function(e,t,n){var i=this,r=!0;for(var o in e)!function(o){var a=e[o],s="tab-"+a.name,c=document.createElement("a");c.classList.add("mdl-tabs__tab"),c.href="#"+s,c.title=a.title,c.innerHTML=a.name;var l=document.createElement("div");l.classList.add("mdl-tabs__panel"),l.id=s,r&&(l.classList.add("is-active"),c.classList.add("is-active"),r=!1),c.addEventListener("click",function(){return i.loadTab(l,a)}),t.appendChild(c),n.appendChild(l)}(o)}},{key:"fixHeight",value:function(e){this.content.style.height="0px";var t=this.card.getBoundingClientRect().height,n=this.tabs.getBoundingClientRect().height,i=t-n-32;this.content.style.height=(ithis.nbTabs?this.nbTabs:e;for(var t=0;t1&&(e.style["-webkit-column-count"]=t.cols,e.style["-moz-column-count"]=t.cols,e.style["column-count"]=t.cols),t.ready=!0}}},{key:"refresh",value:function(){for(var e in this.headersCmd)this.headersCmd[e].ready=!1;var t=[].slice.call(this.content.children);for(var n in t)if(t[n].className.indexOf("is-active")>-1){this.loadTab(t[n],this.headersCmd[n]);break}}},{key:"fromatAsCode",value:function(e){var t=document.createElement("pre");return t.style.marge="1.2em",t.appendChild((0,o.formatOffsets)(e,a.Widgets.DISASSEMBLY)),t}},{key:"formatAsKeyValue",value:function(e){var t=document.createElement("dl");t.classList.add("infocard");var n=e.split(/\n/g);for(var i in n){var r=n[i].split(/ (.+)?/);if(r.length>=2){var o=document.createElement("dt");o.textContent=r[0],t.appendChild(o);var a=document.createElement("dd");a.textContent=r[1],t.appendChild(a)}}return t}}]),e}()},{"../../helpers/Format":9,"../../widgets/Widgets":52}],30:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0}),n.Overview=void 0;var r=function(){function e(e,t){for(var n=0;n3&&void 0!==arguments[3]?arguments[3]:null;i(this,t);var s=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,"dark"));return s.formatFunc=n,s.r2cmd=o,null!==a&&(s.backButton=a),s}return o(t,e),a(t,[{key:"init",value:function(){var e=this;void 0!==this.backButton&&(this.backButton.style.position="absolute",this.backButton.style.top="1em",this.backButton.style.left="1em",c.r2Wrapper.registerListener(c.R2Actions.SEEK,function(){e.displayed&&e.draw()}))}},{key:"draw",value:function(){void 0!==this.backButton&&this.node.appendChild(this.backButton),this.node.appendChild(this.getPre())}},{key:"getPre",value:function(){var e=this,t=document.createElement("pre");return r2.cmd(this.r2cmd,function(n){t.appendChild(e.formatFunc(n))}),t}}]),t}(s.BaseWidget)},{"../core/R2Wrapper":5,"../helpers/Inputs":11,"./BaseWidget":32}],32:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n1?n-1:0),o=1;o1?n-1:0),r=1;r=2&&n.addRow([a[0],a[1]])}n.insertInto(i)}),t}}]),t}(s.BaseWidget)},{"../core/R2Wrapper":5,"../core/UIContext":7,"../helpers/Inputs":11,"../helpers/Table":13,"./BaseWidget":32,"./Widgets":52}],34:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0}),n.DebuggerWidget=void 0;var a=function(){function e(e,t){for(var n=0;n=4&&function(){var t=a[3],i=-1===a[2].indexOf("."),r=document.createElement("a");r.innerHTML=t,i&&(r.style.color="red"),r.addEventListener("click",function(){r2.cmd("fs "+t),e.draw()});var o=n.addRow([a[1],r]);o.addEventListener("click",function(){n.getRows().forEach(function(e){e.classList.remove("active")}),o.classList.add("active"),e.current=t})}()}n.insertInto(i)}),t}},{key:"setFlagspace",value:function(){var e=this,t=this.current;t||(t=prompt("name")),t&&r2.cmd("fs "+t,function(){e.draw()})}},{key:"renameFlagspace",value:function(){var e=this,t=this.current;t||(t=prompt("name")),t&&r2.cmd("fsr "+t,function(){e.draw()})}},{key:"delFlagspace",value:function(){var e=this,t=this.current;t||(t="."),t&&r2.cmd("fs-"+t,function(){e.draw()})}}]),t}(s.BaseWidget)},{"../core/R2Wrapper":5,"../core/UIContext":7,"../helpers/Inputs":11,"../helpers/Table":13,"./BaseWidget":32,"./Widgets":52}],43:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0}),n.FlagsWidget=void 0;var a=function(){function e(e,t){for(var n=0;n=3&&t.addRow([o[0],o[1],o[2]])}t.insertInto(i)}),t}}]),t}(s.BaseWidget)},{"../core/R2Wrapper":5,"../core/UIContext":7,"../helpers/Inputs":11,"../helpers/Table":13,"./BaseWidget":32,"./Widgets":52}],44:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0}),n.FunctionsWidget=void 0;var a=function(){function e(e,t){for(var n=0;n',e.appendChild(n),e}}]),t}(s.BaseWidget)},{"../core/R2Wrapper":5,"../core/UIContext":7,"../helpers/Inputs":11,"./BaseWidget":32,"./Widgets":52}],47:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0}),n.OverviewWidget=void 0;var a=function(){function e(e,t){for(var n=0;n