diff --git a/libr/cons/grep.c b/libr/cons/grep.c index 28c423a5a0..13dec2ac05 100644 --- a/libr/cons/grep.c +++ b/libr/cons/grep.c @@ -279,24 +279,19 @@ while_end: // Finds and returns next intgerp expression, // unescapes escaped twiddles static char *find_next_intgrep(char *cmd, const char *quotes) { - const char *p; - + char *p; do { - p = r_str_firstbut (cmd, '~', quotes); - if (p == NULL) { - return NULL; + p = (char *)r_str_firstbut (cmd, '~', quotes); + if (!p) { + break; } - if (p == cmd || *(p - 1) != '\\') { return (char*)p; - } else { - //twiddle unescape - memmove (p - 1, p, strlen(p) + 1); } - + //twiddle unescape + memmove (p - 1, p, strlen(p) + 1); cmd = p + 1; } while (*cmd); - return NULL; } @@ -329,7 +324,7 @@ static char *preprocess_filter_expr(char *cmd, const char *quotes) { i = 0; // parse words between '~' - while (p2 = find_next_intgrep (p1 + 1, quotes)) { + while ((p2 = find_next_intgrep (p1 + 1, quotes))) { ns = r_str_append (ns, strsep); ns = r_str_appendlen (ns, p1 + 1, (int)(p2 - p1 - 1)); p1 = p2; diff --git a/libr/core/cmd_info.c b/libr/core/cmd_info.c index a228e4a775..b7ad288c3a 100644 --- a/libr/core/cmd_info.c +++ b/libr/core/cmd_info.c @@ -278,7 +278,6 @@ static int cmd_info(void *data, const char *input) { if (!strcmp (input, "*")) { input = "I*"; } - RBinObject *obj = r_bin_cur_object (core->bin); while (*input) { switch (*input) { case 'b': // "ib" diff --git a/shlr/www/m/app.js b/shlr/www/m/app.js index 857de66b85..c0cf1445e5 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"}),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.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.cmtright=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.cmtright=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.cmtright=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");break;case"VA":r2.cmd("e io.va=true");break;case"Debug":r2.cmd("e io.va=true"),r2.cmd("e io.debug=true")}}},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",this.root.id!==!1&&(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(t===-1)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:"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 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)});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)}),h.addEventListener("change",function(e){var t=parseInt(e.target.value);p(t)}),m.appendChild(v),m.appendChild(document.createTextNode(" ")),m.appendChild(h),m.appendChild(document.createTextNode(" ")),m.appendChild(g);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;it.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;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=a[2].indexOf(".")===-1,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=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 asm.emustr="+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.cmtright=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.cmtright=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.cmtright=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;it.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;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'"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})}function clickableOffsets(e){return console.error("Using clickableOffsets(str) no longer work"),console.trace(),e=e.replace(/0x([a-zA-Z0-9]*)/g,"0x$1"),e=e.replace(/sym\.([\.a-zA-Z0-9_]*)/g,"sym.$1"),e=e.replace(/fcn\.([\.a-zA-Z0-9_]*)/g,"fcn.$1"),e=e.replace(/str\.([\.a-zA-Z0-9_]*)/g,"str.$1")}function uiButton(e,t,a){var n="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect ";if("active"===a){return' '+t+""}return' '+t+""}function uiCheckList(e,t,a){var n="
  • ";return n+='
  • "}function uiCombo(d){var funName="combo"+ ++comboId,fun=funName+" = function(e) {";fun+=' var sel = document.getElementById("opt_'+funName+'");',fun+=" var opt = sel.options[sel.selectedIndex].value;",fun+=" switch (opt) {";for(var a in d)fun+='case "'+d[a].name+'": '+d[a].js+"("+d[a].name+");break;";fun+="}}",eval(fun);var out='"}function uiSwitch(e,t,a,n){var s="switch-"+ ++idSwitch,o=document.createElement("label");o.className="mdl-switch mdl-js-switch mdl-js-ripple-effect",o.for=s,e.appendChild(o);var l=document.createElement("input");l.type="checkbox",l.className="mdl-switch__input",l.checked=a,l.id=s,o.appendChild(l),l.addEventListener("change",function(e){n(t,e.target.checked)});var r=document.createElement("span");r.className="mdl-switch__label",r.innerHTML=t,o.appendChild(r);var c=document.createElement("br");o.appendChild(c)}function uiActionButton(e,t,a){var n=document.createElement("a");n.href="#",n.innerHTML=a,n.addEventListener("click",t),e.appendChild(n);var s="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect ";s+="mdl-color--accent mdl-color-text--accent-contrast",n.className=s,n.style.margin="3px"}function uiSelect(e,t,a,n,s){var o="select-"+ ++selectId,l=document.createElement("div");l.className="mdl-selectfield mdl-js-selectfield mdl-selectfield--floating-label",e.appendChild(l);var r=document.createElement("select");r.className="mdl-selectfield__select",r.id=o,r.name=o,l.appendChild(r);for(var c=0;c"+n.name+": ",t+=uiCombo(n.buttons)}return t}function uiRoundButton(e,t,a){var n="";return n+=""}function uiTableBegin(e,t){console.warn("Usage is deprecated: migrate to Table");var a="";a+='',a+=" ";var n;for(var s in e){var o=e[s];"+"===o[0]?(o=o.substring(1),n=""):n=' class="mdl-data-table__cell--non-numeric"',a+=""+o+""}return a+=""}function uiTableRow(e){var t="",a="";for(var n in e){var s=e[n];s&&("+"===s[0]?s=clickableOffsets(s.substring(1)):t=' class="mdl-data-table__cell--non-numeric"',a+=""+s+"")}return a+""}function uiTableEnd(){return"
    "}function console_submit(e){var t=(document.getElementById("console_terminal"),document.getElementById("console_output")),a=document.getElementById("console_input"),n=widgetContainer.getWidget("Console");widgetContainer.getWidgetDOMWrapper(n);if("clear"===e)return t.innerHTML="",void(a.value="");r2.cmd(e,function(n){t.innerHTML+=" > "+e+"\n"+n,a.value="",setTimeout(function(){window.scrollTo("console_input")},1e3)})}function console_ready(){var e=document.getElementById("console_input");null!==e&&(r2.cmd("e scr.color=true"),e.focus(),e.onkeypress=function(t){13===t.keyCode&&console_submit(e.value)})}function consoleKey(e){var t=document.getElementById("console_input");e?13===e.keyCode&&(runCommand(t.value),t.value=""):t.onkeypress=consoleKey}function panelConsole(){var e=widgetContainer.getWidget("Console"),t=widgetContainer.getWidgetDOMWrapper(e);updates.registerMethod(e.getOffset(),panelConsole);t.innerHTML='
     > 


    ',t.style.backgroundColor="#303030",t.style.height="100%",document.getElementById("console_output").innerHTML=lastConsoleOutput,console_ready()}function runCommand(e){e||(e=document.getElementById("input").value),r2.cmd(e,function(e){lastConsoleOutput="\n"+e,document.getElementById("output").innerHTML=lastConsoleOutput})}function setStatusbarBody(){function e(e,t){var a=document.createElement(e);return a.id=t,a.className=t,a}var t;try{var a=document.getElementById("tab_terminal");a.innerHTML="",a.parentNode.removeChild(a)}catch(e){}try{var a=document.getElementById("tab_logs");a.innerHTML="",a.parentNode.removeChild(a)}catch(e){}switch(statusTab){case Tab.LOGS:var n=new DOMParser,t=document.createElement("div");t.id="tab_logs";var s=statusLog.join("
    ");t.appendChild(n.parseFromString(s,"text/xml").documentElement);var a=document.getElementById("statusbar_body");try{a.parentNode.insertBefore(t,a)}catch(e){}return void console.log(a);case Tab.CONSOLE:var t=document.createElement("div");t.id="tab_terminal",t.appendChild(e("div","terminal")),t.appendChild(e("div","terminal_output"));var o=e("div","terminal_prompt");o.appendChild(e("input","terminal_input")),t.appendChild(o)}if(void 0!==t){var a=document.getElementById("statusbar");document.getElementById("terminal")||(a.parentNode.insertBefore(t,a),statusTab===Tab.CONSOLE&&terminal_ready())}}function statusMessage(e,t){var a=document.getElementById("statusbar");e&&statusLog.push(e),statusMode===Mode.LINE?(a.innerHTML=e,null!==statusTimeout&&(clearTimeout(statusTimeout),statusTimeout=null),void 0!==t&&(statusTimeout=setTimeout(function(){statusMessage(" ")},1e3*t))):setStatusbarBody()}function statusToggle(){var e=document.getElementById("statusbar"),t=document.getElementById("container");if(statusMode===Mode.HALF){statusTab=Tab.LOGS,statusMode=Mode.LINE,e.innerHTML=" ";try{e.parentNode.classList.remove("half"),e.parentNode.classList.remove("full"),t.classList.remove("sbIsHalf"),t.classList.remove("sbIsFull")}catch(e){}setStatusbarBody()}else{statusMode=Mode.HALF;try{e.parentNode.classList.remove("full"),t.classList.remove("sbIsFull")}catch(e){}e.parentNode.classList.add("half"),t.classList.add("sbIsHalf")}}function statusNext(){var e=document.getElementById("statusbar"),t=document.getElementById("container");switch(statusMode){case Mode.LINE:statusMode=Mode.HALF;try{e.parentNode.classList.remove("full"),t.classList.remove("sbIsFull")}catch(e){}e.parentNode.classList.add("half"),t.classList.add("sbIsHalf");break;case Mode.HALF:return statusMode=Mode.FULL,e.parentNode.classList.add("full"),void t.classList.add("sbIsFull");case Mode.FULL:statusMode=Mode.LINE,statusTab=Tab.LOGS,e.innerHTML="";try{var e=document.getElementById("statusbar"),t=document.getElementById("container");e.parentNode.classList.remove("half"),e.parentNode.classList.remove("full"),t.classList.remove("sbIsHalf"),t.classList.remove("sbIsFull")}catch(e){}}setStatusbarBody()}function statusConsole(){var e=document.getElementById("statusbar"),t=document.getElementById("container");if(statusTab===Tab.CONSOLE){if(statusMode!==Mode.LINE)return statusToggle(),void(statusMode=Mode.LINE);statusTab=Tab.CONSOLE}if(statusMode===Mode.HALF)statusMode=Mode.LINE;else if(statusMode===Mode.LINE){statusTab=Mode.CONSOLE,statusMode=Mode.HALF;try{e.parentNode.classList.remove("full"),t.classList.remove("sbIsFull")}catch(e){}try{e.parentNode.classList.add("half"),t.classList.add("sbIsHalf")}catch(e){}}statusTab=statusTab===Tab.CONSOLE?Tab.LOGS:Tab.CONSOLE,setStatusbarBody()}function statusFullscreen(){var e=document.getElementById("statusbar"),t=document.getElementById("container");if(statusMode===Mode.FULL){statusMode=Mode.HALF;try{e.parentNode.classList.remove("full"),t.classList.remove("sbIsFull")}catch(e){}e.parentNode.classList.add("half"),t.classList.add("sbIsHalf")}else{statusMode=Mode.FULL;try{e.parentNode.classList.remove("half"),t.classList.remove("sbIsHalf")}catch(e){}e.parentNode.classList.add("full"),t.classList.add("sbIsFull")}}function addButton(e,t){var a=document.createElement("a");return a.href="javascript:"+t+"()",a.innerHTML=e,a}function initializeStatusbarTitle(){return}function statusInitialize(){initializeStatusbarTitle();var e=document.getElementById("statusbar");e.innerHTML="",e.parentNode.addEventListener("click",function(){statusMode===Mode.LINE&&(statusTab=Tab.CONSOLE,statusToggle())}),statusMessage("Loading webui...",2)}function submit(e){var t=document.getElementById("terminal_output"),a=document.getElementById("terminal_input");return a&&t?"clear"===e?(t.innerHTML="",void(a.value="")):void r2.cmd(e,function(n){n+="\n",t.innerHTML+=" > "+e+"\n"+n,a.value="";var s=document.getElementById("statusbar_scroll");s.scrollTop=s.scrollHeight}):void console.error("No terminal_{input|output} found")}function terminal_ready(){r2.cmd("e scr.color=true");var e=document.getElementById("terminal_input");if(!e)return void console.error("Cannot find terminal_input");e.focus(),e.onkeypress=function(t){13===t.keyCode&&submit(e.value)}}function hexPairToASCII(e){var t=parseInt(e,16);return t>=33&&t<=126?String.fromCharCode(t):"."}function ASCIIToHexpair(e){var t=e.charCodeAt(0).toString(16);return t.length<2&&(t="0"+t),t}function isAsciiVisible(e){return e>=33&&e<=126}function basename(e){return e.split(/[\\\/]/).pop()}function int2fixedHex(e,t){for(var a=e.toString(16);a.length0){for(var e=document.getElementsByClassName("first-attempt"),t=0;t'"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})}function clickableOffsets(e){return console.error("Using clickableOffsets(str) no longer work"),console.trace(),e=e.replace(/0x([a-zA-Z0-9]*)/g,"0x$1"),e=e.replace(/sym\.([\.a-zA-Z0-9_]*)/g,"sym.$1"),e=e.replace(/fcn\.([\.a-zA-Z0-9_]*)/g,"fcn.$1"),e=e.replace(/str\.([\.a-zA-Z0-9_]*)/g,"str.$1")}function uiButton(e,t,a){var n="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect ";if("active"===a){return' '+t+""}return' '+t+""}function uiCheckList(e,t,a){var n="
  • ";return n+='
  • "}function uiCombo(d){var funName="combo"+ ++comboId,fun=funName+" = function(e) {";fun+=' var sel = document.getElementById("opt_'+funName+'");',fun+=" var opt = sel.options[sel.selectedIndex].value;",fun+=" switch (opt) {";for(var a in d)fun+='case "'+d[a].name+'": '+d[a].js+"("+d[a].name+");break;";fun+="}}",eval(fun);var out='"}function uiSwitch(e,t,a,n){var s="switch-"+ ++idSwitch,o=document.createElement("label");o.className="mdl-switch mdl-js-switch mdl-js-ripple-effect",o.for=s,e.appendChild(o);var l=document.createElement("input");l.type="checkbox",l.className="mdl-switch__input",l.checked=a,l.id=s,o.appendChild(l),l.addEventListener("change",function(e){n(t,e.target.checked)});var r=document.createElement("span");r.className="mdl-switch__label",r.innerHTML=t,o.appendChild(r);var c=document.createElement("br");o.appendChild(c)}function uiActionButton(e,t,a){var n=document.createElement("a");n.href="#",n.innerHTML=a,n.addEventListener("click",t),e.appendChild(n);var s="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect ";s+="mdl-color--accent mdl-color-text--accent-contrast",n.className=s,n.style.margin="3px"}function uiSelect(e,t,a,n,s){var o="select-"+ ++selectId,l=document.createElement("div");l.className="mdl-selectfield mdl-js-selectfield mdl-selectfield--floating-label",e.appendChild(l);var r=document.createElement("select");r.className="mdl-selectfield__select",r.id=o,r.name=o,l.appendChild(r);for(var c=0;c"+n.name+": ",t+=uiCombo(n.buttons)}return t}function uiRoundButton(e,t,a){var n="";return n+=""}function uiTableBegin(e,t){console.warn("Usage is deprecated: migrate to Table");var a="";a+='',a+=" ";var n;for(var s in e){var o=e[s];"+"===o[0]?(o=o.substring(1),n=""):n=' class="mdl-data-table__cell--non-numeric"',a+=""+o+""}return a+=""}function uiTableRow(e){var t="",a="";for(var n in e){var s=e[n];s&&("+"===s[0]?s=clickableOffsets(s.substring(1)):t=' class="mdl-data-table__cell--non-numeric"',a+=""+s+"")}return a+""}function uiTableEnd(){return"
    "}function hexPairToASCII(e){var t=parseInt(e,16);return t>=33&&t<=126?String.fromCharCode(t):"."}function ASCIIToHexpair(e){var t=e.charCodeAt(0).toString(16);return t.length<2&&(t="0"+t),t}function isAsciiVisible(e){return e>=33&&e<=126}function basename(e){return e.split(/[\\\/]/).pop()}function int2fixedHex(e,t){for(var a=e.toString(16);a.length
     > 


    ',t.style.backgroundColor="#303030",t.style.height="100%",document.getElementById("console_output").innerHTML=lastConsoleOutput,console_ready()}function runCommand(e){e||(e=document.getElementById("input").value),r2.cmd(e,function(e){lastConsoleOutput="\n"+e,document.getElementById("output").innerHTML=lastConsoleOutput})}function setStatusbarBody(){function e(e,t){var a=document.createElement(e);return a.id=t,a.className=t,a}var t;try{var a=document.getElementById("tab_terminal");a.innerHTML="",a.parentNode.removeChild(a)}catch(e){}try{var a=document.getElementById("tab_logs");a.innerHTML="",a.parentNode.removeChild(a)}catch(e){}switch(statusTab){case Tab.LOGS:var n=new DOMParser,t=document.createElement("div");t.id="tab_logs";var s=statusLog.join("
    ");t.appendChild(n.parseFromString(s,"text/xml").documentElement);var a=document.getElementById("statusbar_body");try{a.parentNode.insertBefore(t,a)}catch(e){}return void console.log(a);case Tab.CONSOLE:var t=document.createElement("div");t.id="tab_terminal",t.appendChild(e("div","terminal")),t.appendChild(e("div","terminal_output"));var o=e("div","terminal_prompt");o.appendChild(e("input","terminal_input")),t.appendChild(o)}if(void 0!==t){var a=document.getElementById("statusbar");document.getElementById("terminal")||(a.parentNode.insertBefore(t,a),statusTab===Tab.CONSOLE&&terminal_ready())}}function statusMessage(e,t){var a=document.getElementById("statusbar");e&&statusLog.push(e),statusMode===Mode.LINE?(a.innerHTML=e,null!==statusTimeout&&(clearTimeout(statusTimeout),statusTimeout=null),void 0!==t&&(statusTimeout=setTimeout(function(){statusMessage(" ")},1e3*t))):setStatusbarBody()}function statusToggle(){var e=document.getElementById("statusbar"),t=document.getElementById("container");if(statusMode===Mode.HALF){statusTab=Tab.LOGS,statusMode=Mode.LINE,e.innerHTML=" ";try{e.parentNode.classList.remove("half"),e.parentNode.classList.remove("full"),t.classList.remove("sbIsHalf"),t.classList.remove("sbIsFull")}catch(e){}setStatusbarBody()}else{statusMode=Mode.HALF;try{e.parentNode.classList.remove("full"),t.classList.remove("sbIsFull")}catch(e){}e.parentNode.classList.add("half"),t.classList.add("sbIsHalf")}}function statusNext(){var e=document.getElementById("statusbar"),t=document.getElementById("container");switch(statusMode){case Mode.LINE:statusMode=Mode.HALF;try{e.parentNode.classList.remove("full"),t.classList.remove("sbIsFull")}catch(e){}e.parentNode.classList.add("half"),t.classList.add("sbIsHalf");break;case Mode.HALF:return statusMode=Mode.FULL,e.parentNode.classList.add("full"),void t.classList.add("sbIsFull");case Mode.FULL:statusMode=Mode.LINE,statusTab=Tab.LOGS,e.innerHTML="";try{var e=document.getElementById("statusbar"),t=document.getElementById("container");e.parentNode.classList.remove("half"),e.parentNode.classList.remove("full"),t.classList.remove("sbIsHalf"),t.classList.remove("sbIsFull")}catch(e){}}setStatusbarBody()}function statusConsole(){var e=document.getElementById("statusbar"),t=document.getElementById("container");if(statusTab===Tab.CONSOLE){if(statusMode!==Mode.LINE)return statusToggle(),void(statusMode=Mode.LINE);statusTab=Tab.CONSOLE}if(statusMode===Mode.HALF)statusMode=Mode.LINE;else if(statusMode===Mode.LINE){statusTab=Mode.CONSOLE,statusMode=Mode.HALF;try{e.parentNode.classList.remove("full"),t.classList.remove("sbIsFull")}catch(e){}try{e.parentNode.classList.add("half"),t.classList.add("sbIsHalf")}catch(e){}}statusTab=statusTab===Tab.CONSOLE?Tab.LOGS:Tab.CONSOLE,setStatusbarBody()}function statusFullscreen(){var e=document.getElementById("statusbar"),t=document.getElementById("container");if(statusMode===Mode.FULL){statusMode=Mode.HALF;try{e.parentNode.classList.remove("full"),t.classList.remove("sbIsFull")}catch(e){}e.parentNode.classList.add("half"),t.classList.add("sbIsHalf")}else{statusMode=Mode.FULL;try{e.parentNode.classList.remove("half"),t.classList.remove("sbIsHalf")}catch(e){}e.parentNode.classList.add("full"),t.classList.add("sbIsFull")}}function addButton(e,t){var a=document.createElement("a");return a.href="javascript:"+t+"()",a.innerHTML=e,a}function initializeStatusbarTitle(){return}function statusInitialize(){initializeStatusbarTitle();var e=document.getElementById("statusbar");e.innerHTML="",e.parentNode.addEventListener("click",function(){statusMode===Mode.LINE&&(statusTab=Tab.CONSOLE,statusToggle())}),statusMessage("Loading webui...",2)}function submit(e){var t=document.getElementById("terminal_output"),a=document.getElementById("terminal_input");return a&&t?"clear"===e?(t.innerHTML="",void(a.value="")):void r2.cmd(e,function(n){n+="\n",t.innerHTML+=" > "+e+"\n"+n,a.value="";var s=document.getElementById("statusbar_scroll");s.scrollTop=s.scrollHeight}):void console.error("No terminal_{input|output} found")}function terminal_ready(){r2.cmd("e scr.color=true");var e=document.getElementById("terminal_input");if(!e)return void console.error("Cannot find terminal_input");e.focus(),e.onkeypress=function(t){13===t.keyCode&&submit(e.value)}}!function(){function e(){s++,r2.cmdj("?V",function(e){void 0!==e&&(s=0)})}function t(){if(s>0){for(var e=document.getElementsByClassName("first-attempt"),t=0;t-1&&navigator.userAgent.indexOf("Mobile")>-1&&"mozApps"in navigator}function asyncLoop(r,n,e){var t=0,o=!1,a={next:function(){o||(t=r2.sections[e].addr&&n-1?"instruction":"memory";return""},r2.settings={},r2.load_settings=function(){r2.cmd("e asm.arch",function(r){r2.settings["asm.arch"]=r.trim()}),r2.cmd("e asm.bits",function(r){r2.settings["asm.bits"]=r.trim()}),r2.cmd("e asm.bytes",function(r){r2.settings["asm.bytes"]=toBoolean(r.trim())}),r2.cmd("e asm.flags",function(r){r2.settings["asm.flags"]=toBoolean(r.trim())}),r2.cmd("e asm.offset",function(r){r2.settings["asm.offset"]=toBoolean(r.trim())}),r2.cmd("e asm.lines",function(r){r2.settings["asm.lines"]=toBoolean(r.trim())}),r2.cmd("e asm.xrefs",function(r){r2.settings["asm.xrefs"]=toBoolean(r.trim())}),r2.cmd("e asm.cmtright",function(r){r2.settings["asm.cmtright"]=toBoolean(r.trim())}),r2.cmd("e asm.pseudo",function(r){r2.settings["asm.pseudo"]=toBoolean(r.trim())})},r2.flags={},r2.update_flags=function(){r2.cmd("fs *;fj|",function(r){var n=JSON.parse(r);if(void 0!==n&&null!==n){r2.flags={};for(var e in n){var t="0x"+n[e].offset.toString(16);if((t=address_canonicalize(t))in r2.flags){var o=r2.flags[t];o[o.length]={name:n[e].name,size:n[e].size},r2.flags[t]=o}else r2.flags[t]=[{name:n[e].name,size:n[e].size}]}}})},r2.get_flag_address=function(r){for(var n in r2.flags)for(var e in r2.flags[n])if(r==r2.flags[n][e].name)return n;return null},r2.get_flag_names=function(r){var n=[];for(var e in r2.flags[r])n[n.length]=r2.flags[r][e].name;return n},r2.set_flag_space=function(r,n){r2.cmd("fs "+r,n)},r2.get_flags=function(r){r2.cmd("fj|",function(n){r(n?JSON.parse(n):[])})},r2.get_opcodes=function(r,n,e){r2.cmd("pdj @"+r+"!"+n+"|",function(r){e(JSON.parse(r))})},r2.get_bytes=function(r,n,e){r2.cmd("pcj @"+r+"!"+n+"|",function(r){e(JSON.parse(r))})},r2.asm_config={},r2.store_asm_config=function(){config={},r2.cmd("e",function(r){conf=r.split("\n");for(var n in conf){var e=conf[n].split(" ");3==e.length&&0==e[0].trim().indexOf("asm.")&&(config[e[0].trim()]=e[2].trim())}r2.asm_config=config})},r2.restore_asm_config=function(){cmd="";for(var r in r2.asm_config)cmd+="e "+r+"="+r2.asm_config[r]+";";r2.cmd(cmd,function(){})},r2.get_info=function(r){r2.cmd("ij|",function(n){r(JSON.parse(n))})},r2.bin_relocs=function(r){r2.cmd("irj|",function(n){r(JSON.parse(n))})},r2.bin_imports=function(r){r2.cmd("iij|",function(n){r(JSON.parse(n))})},r2.bin_symbols=function(r){r2.cmd("isj|",function(n){r(JSON.parse(n))})},r2.bin_sections=function(r){r2.cmd("iSj|",function(n){r(JSON.parse(n))})},r2.cmds=function(r,n){function e(){void 0!=t&&0!=r.length&&(t=r[0],r=r.splice(1),r2.cmd(t,e),n&&n())}if(0!=r.length){var t=r[0];r=r.splice(1),r2.cmd(t,e)}},r2.cmd=function(r,n,e){if(Array.isArray(r)){var t=[],o=0;asyncLoop(r.length,function(n){_internal_cmd(r[o],function(r){o=n.iteration(),t[o]=r.replace(/\n$/,""),o++,n.next()},e)},function(){n(t)})}else _internal_cmd(r,n,e)},r2.cmdj=function(r,n){r2.cmd(r,function(r){try{n(JSON.parse(r))}catch(r){n(null)}})},r2.alive=function(r){r2.cmd("b",function(n){n&&n.length(),r&&r(n)})},r2.getTextLogger=function(r){return"object"!=typeof r&&(r={}),r.last=0,r.events={},r.interval=null,r2.cmd("Tl",function(n){r.last=+n}),r.load=function(n){r2.cmd('"Tj '+(r.last+1)+'"',function(r){n&&n(JSON.parse(r))})},r.clear=function(r){r2.cmd("T-",r)},r.send=function(r,n){r2.cmd('"T '+r+'"',n)},r.refresh=function(n){r.load(function(e){for(var t=0;tr.last&&(r.last=o[0])}n&&n()})},r.autorefresh=function(n){function e(){return r.refresh(function(){}),"Logs"===r2ui.selected_panel?setTimeout(e,1e3*n):console.log("Not in logs :("),!0}if(!n)return void(r.interval&&r.interval.stop());r.interval=setTimeout(e,1e3*n)},r.on=function(n,e){return r.events[n]=e,r},r},r2.filter_asm=function(r,n){var e=backward?prev_curoff:next_curoff,t=backward?prev_lastoff:next_lastoff,o=r.split(/\n/g);r2.cmd("s",function(r){e=r});for(var a=o.length-1;a>0;a--){var i=o[a].match(/0x([a-fA-F0-9]+)/);if(i&&i.length>0){t=i[0].replace(/:/g,"");break}}if("afl"==n){for(var c="",a=0;a"+l+"\n")}r=c}}else if("i"==n[0]&&n[1]){for(var c="",a=0;afunction:"),r=r.replace(/;(\s+)/g,";"),r=r.replace(/;(.*)/g,"// $1"),r=r.replace(/(bl|goto|call)/g,"call"),r=r.replace(/(jmp|bne|beq|js|jnz|jae|jge|jbe|jg|je|jl|jz|jb|ja|jne)/g,"$1"),r=r.replace(/(dword|qword|word|byte|movzx|movsxd|cmovz|mov\ |lea\ )/g,"$1"),r=r.replace(/(hlt|leave|iretd|retn|ret)/g,"$1"),r=r.replace(/(add|sbb|sub|mul|div|shl|shr|and|not|xor|inc|dec|sar|sal)/g,"$1"),r=r.replace(/(push|pop)/g,"$1"),r=r.replace(/(test|cmp)/g,"$1"),r=r.replace(/(outsd|out|string|invalid|int |int3|trap|main|in)/g,"$1"),r=r.replace(/nop/g,"nop"),r=r.replace(/(sym|fcn|str|imp|loc)\.([^:<(\\\/ \|)\->]+)/g,"$1.$2")),r=r.replace(/0x([a-zA-Z0-9]+)/g,"0x$1"),backward?(prev_curoff=e,prev_lastoff=t):(next_curoff=e,next_lastoff=t,prev_curoff||(prev_curoff=next_curoff)),r}; \ No newline at end of file +function isFirefoxOS(){return"undefined"!=typeof locationbar&&!locationbar.visible&&navigator.userAgent.indexOf("Firefox")>-1&&navigator.userAgent.indexOf("Mobile")>-1&&"mozApps"in navigator}function asyncLoop(r,n,e){var t=0,o=!1,a={next:function(){o||(t=r2.sections[e].addr&&n-1?"instruction":"memory";return""},r2.settings={},r2.load_settings=function(){r2.cmd("e asm.arch",function(r){r2.settings["asm.arch"]=r.trim()}),r2.cmd("e asm.bits",function(r){r2.settings["asm.bits"]=r.trim()}),r2.cmd("e asm.bytes",function(r){r2.settings["asm.bytes"]=toBoolean(r.trim())}),r2.cmd("e asm.flags",function(r){r2.settings["asm.flags"]=toBoolean(r.trim())}),r2.cmd("e asm.offset",function(r){r2.settings["asm.offset"]=toBoolean(r.trim())}),r2.cmd("e asm.lines",function(r){r2.settings["asm.lines"]=toBoolean(r.trim())}),r2.cmd("e asm.xrefs",function(r){r2.settings["asm.xrefs"]=toBoolean(r.trim())}),r2.cmd("e asm.cmtright",function(r){r2.settings["asm.cmtright"]=toBoolean(r.trim())}),r2.cmd("e asm.pseudo",function(r){r2.settings["asm.pseudo"]=toBoolean(r.trim())})},r2.flags={},r2.update_flags=function(){r2.cmd("fs *;fj|",function(r){var n=JSON.parse(r);if(void 0!==n&&null!==n){r2.flags={};for(var e in n){var t="0x"+n[e].offset.toString(16);if((t=address_canonicalize(t))in r2.flags){var o=r2.flags[t];o[o.length]={name:n[e].name,size:n[e].size},r2.flags[t]=o}else r2.flags[t]=[{name:n[e].name,size:n[e].size}]}}})},r2.get_flag_address=function(r){for(var n in r2.flags)for(var e in r2.flags[n])if(r==r2.flags[n][e].name)return n;return null},r2.get_flag_names=function(r){var n=[];for(var e in r2.flags[r])n[n.length]=r2.flags[r][e].name;return n},r2.set_flag_space=function(r,n){r2.cmd("fs "+r,n)},r2.get_flags=function(r){r2.cmd("fj|",function(n){r(n?JSON.parse(n):[])})},r2.get_opcodes=function(r,n,e){r2.cmd("pdj @"+r+"!"+n+"|",function(r){e(JSON.parse(r))})},r2.get_bytes=function(r,n,e){r2.cmd("pcj @"+r+"!"+n+"|",function(r){e(JSON.parse(r))})},r2.asm_config={},r2.store_asm_config=function(){config={},r2.cmd("e",function(r){conf=r.split("\n");for(var n in conf){var e=conf[n].split(" ");3==e.length&&0==e[0].trim().indexOf("asm.")&&(config[e[0].trim()]=e[2].trim())}r2.asm_config=config})},r2.restore_asm_config=function(){cmd="";for(var r in r2.asm_config)cmd+="e "+r+"="+r2.asm_config[r]+";";r2.cmd(cmd,function(){})},r2.get_info=function(r){r2.cmd("ij|",function(n){r(JSON.parse(n))})},r2.bin_relocs=function(r){r2.cmd("irj|",function(n){r(JSON.parse(n))})},r2.bin_imports=function(r){r2.cmd("iij|",function(n){r(JSON.parse(n))})},r2.bin_symbols=function(r){r2.cmd("isj|",function(n){r(JSON.parse(n))})},r2.bin_sections=function(r){r2.cmd("iSj|",function(n){r(JSON.parse(n))})},r2.cmds=function(r,n){function e(){void 0!=t&&0!=r.length&&(t=r[0],r=r.splice(1),r2.cmd(t,e),n&&n())}if(0!=r.length){var t=r[0];r=r.splice(1),r2.cmd(t,e)}},r2.cmd=function(r,n,e){if(Array.isArray(r)){var t=[],o=0;asyncLoop(r.length,function(n){_internal_cmd(r[o],function(r){o=n.iteration(),t[o]=r.replace(/\n$/,""),o++,n.next()},e)},function(){n(t)})}else _internal_cmd(r,n,e)},r2.cmdj=function(r,n){r2.cmd(r,function(r){try{n(JSON.parse(r))}catch(r){n(null)}})},r2.alive=function(r){r2.cmd("b",function(n){n&&n.length(),r&&r(n)})},r2.getTextLogger=function(r){return"object"!=typeof r&&(r={}),r.last=0,r.events={},r.interval=null,r2.cmd("Tl",function(n){r.last=+n}),r.load=function(n){r2.cmd('"Tj '+(r.last+1)+'"',function(r){n&&n(JSON.parse(r))})},r.clear=function(r){r2.cmd("T-",r)},r.send=function(r,n){r2.cmd('"T '+r+'"',n)},r.refresh=function(n){r.load(function(e){for(var t=0;tr.last&&(r.last=o[0])}n&&n()})},r.autorefresh=function(n){function e(){return r.refresh(function(){}),"Logs"===r2ui.selected_panel?setTimeout(e,1e3*n):console.log("Not in logs :("),!0}if(!n)return void(r.interval&&r.interval.stop());r.interval=setTimeout(e,1e3*n)},r.on=function(n,e){return r.events[n]=e,r},r},r2.filter_asm=function(r,n){var e=backward?prev_curoff:next_curoff,t=backward?prev_lastoff:next_lastoff,o=r.split(/\n/g);r2.cmd("s",function(r){e=r});for(var a=o.length-1;a>0;a--){var i=o[a].match(/0x([a-fA-F0-9]+)/);if(i&&i.length>0){t=i[0].replace(/:/g,"");break}}if("afl"==n){for(var c="",a=0;a"+l+"\n")}r=c}}else if("i"==n[0]&&n[1]){for(var c="",a=0;afunction:"),r=r.replace(/;(\s+)/g,";"),r=r.replace(/;(.*)/g,"// $1"),r=r.replace(/(bl|goto|call)/g,"call"),r=r.replace(/(jmp|bne|beq|js|jnz|jae|jge|jbe|jg|je|jl|jz|jb|ja|jne)/g,"$1"),r=r.replace(/(dword|qword|word|byte|movzx|movsxd|cmovz|mov\ |lea\ )/g,"$1"),r=r.replace(/(hlt|leave|iretd|retn|ret)/g,"$1"),r=r.replace(/(add|sbb|sub|mul|div|shl|shr|and|not|xor|inc|dec|sar|sal)/g,"$1"),r=r.replace(/(push|pop)/g,"$1"),r=r.replace(/(test|cmp)/g,"$1"),r=r.replace(/(outsd|out|string|invalid|int |int3|trap|main|in)/g,"$1"),r=r.replace(/nop/g,"nop"),r=r.replace(/(sym|fcn|str|imp|loc)\.([^:<(\\\/ \|)\->]+)/g,"$1.$2")),r=r.replace(/0x([a-zA-Z0-9]+)/g,"0x$1"),backward?(prev_curoff=e,prev_lastoff=t):(next_curoff=e,next_lastoff=t,prev_curoff||(prev_curoff=next_curoff)),r}; \ No newline at end of file diff --git a/shlr/www/m/vendors/dialog-polyfill.js b/shlr/www/m/vendors/dialog-polyfill.js index 9e21fd3692..240eb43bac 100644 --- a/shlr/www/m/vendors/dialog-polyfill.js +++ b/shlr/www/m/vendors/dialog-polyfill.js @@ -1 +1 @@ -!function(){function e(e){for(;e&&e!==document.body;){var t=window.getComputedStyle(e),o=function(e,o){return!(void 0===t[e]||t[e]===o)};if(t.opacity<1||o("zIndex","auto")||o("transform","none")||o("mixBlendMode","normal")||o("filter","none")||o("perspective","none")||"isolate"===t.isolation||"fixed"===t.position||"touch"===t.webkitOverflowScrolling)return!0;e=e.parentElement}return!1}function t(e){for(;e;){if("dialog"===e.localName)return e;e=e.parentElement}return null}function o(e){e&&e.blur&&e!=document.body&&e.blur()}function i(e,t){for(var o=0;o=0&&(e=this.dialog_),!e){var t=["button","input","keygen","select","textarea"],i=t.map(function(e){return e+":not([disabled])"});i.push('[tabindex]:not([disabled]):not([tabindex=""])'),e=this.dialog_.querySelector(i.join(", "))}o(document.activeElement),e&&e.focus()},updateZIndex:function(e,t){if(e, the polyfill may not work correctly",e),"dialog"!==e.localName)throw new Error("Failed to register dialog: The element is not a dialog.");new n(e)},r.registerDialog=function(e){e.showModal||r.forceRegisterDialog(e)},r.DialogManager=function(){this.pendingDialogStack=[];var e=this.checkDOM_.bind(this);this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",function(t){this.forwardTab_=void 0,t.stopPropagation(),e([])}.bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=100150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver(function(t){var o=[];t.forEach(function(e){for(var t,i=0;t=e.removedNodes[i];++i)if(t instanceof Element)if("dialog"===t.localName)o.push(t);else{var n=t.querySelector("dialog");n&&o.push(n)}}),o.length&&e(o)}))},r.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0),document.addEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})},r.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},r.DialogManager.prototype.updateStacking=function(){for(var e,t=this.zIndexHigh_,o=0;e=this.pendingDialogStack[o];++o)e.updateZIndex(--t,--t),0===o&&(this.overlay.style.zIndex=--t);var i=this.pendingDialogStack[0];if(i){(i.dialog.parentNode||document.body).appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},r.DialogManager.prototype.containedByTopDialog_=function(e){for(;e=t(e);){for(var o,i=0;o=this.pendingDialogStack[i];++i)if(o.dialog===e)return 0===i;e=e.parentElement}return!1},r.DialogManager.prototype.handleFocus_=function(e){if(!this.containedByTopDialog_(e.target)&&(e.preventDefault(),e.stopPropagation(),o(e.target),void 0!==this.forwardTab_)){var t=this.pendingDialogStack[0];return t.dialog.compareDocumentPosition(e.target)&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?t.focus_():document.documentElement.focus()),!1}},r.DialogManager.prototype.handleKey_=function(e){if(this.forwardTab_=void 0,27===e.keyCode){e.preventDefault(),e.stopPropagation();var t=new a("cancel",{bubbles:!1,cancelable:!0}),o=this.pendingDialogStack[0];o&&o.dialog.dispatchEvent(t)&&o.dialog.close()}else 9===e.keyCode&&(this.forwardTab_=!e.shiftKey)},r.DialogManager.prototype.checkDOM_=function(e){this.pendingDialogStack.slice().forEach(function(t){e.indexOf(t.dialog)!==-1?t.downgradeModal():t.maybeHideModal()})},r.DialogManager.prototype.pushDialog=function(e){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return!(this.pendingDialogStack.length>=t)&&(1===this.pendingDialogStack.unshift(e)&&this.blockDocument(),this.updateStacking(),!0)},r.DialogManager.prototype.removeDialog=function(e){var t=this.pendingDialogStack.indexOf(e);t!=-1&&(this.pendingDialogStack.splice(t,1),0===this.pendingDialogStack.length&&this.unblockDocument(),this.updateStacking())},r.dm=new r.DialogManager,document.addEventListener("submit",function(e){var o=e.target;if(o&&o.hasAttribute("method")&&"dialog"===o.getAttribute("method").toLowerCase()){e.preventDefault();var i=t(e.target);if(i){var n,a=["BUTTON","INPUT"];[document.activeElement,e.explicitOriginalTarget].some(function(t){if(t&&t.form==e.target&&a.indexOf(t.nodeName.toUpperCase())!=-1)return n=t.value,!0}),i.close(n)}}},!0),r.forceRegisterDialog=r.forceRegisterDialog,r.registerDialog=r.registerDialog,"function"==typeof define&&"amd"in define?define(function(){return r}):"object"==typeof module&&"object"==typeof module.exports?module.exports=r:window.dialogPolyfill=r}(); \ No newline at end of file +!function(){function e(e){for(;e&&e!==document.body;){var t=window.getComputedStyle(e),o=function(e,o){return!(void 0===t[e]||t[e]===o)};if(t.opacity<1||o("zIndex","auto")||o("transform","none")||o("mixBlendMode","normal")||o("filter","none")||o("perspective","none")||"isolate"===t.isolation||"fixed"===t.position||"touch"===t.webkitOverflowScrolling)return!0;e=e.parentElement}return!1}function t(e){for(;e;){if("dialog"===e.localName)return e;e=e.parentElement}return null}function o(e){e&&e.blur&&e!=document.body&&e.blur()}function i(e,t){for(var o=0;o=0&&(e=this.dialog_),!e){var t=["button","input","keygen","select","textarea"],i=t.map(function(e){return e+":not([disabled])"});i.push('[tabindex]:not([disabled]):not([tabindex=""])'),e=this.dialog_.querySelector(i.join(", "))}o(document.activeElement),e&&e.focus()},updateZIndex:function(e,t){if(e, the polyfill may not work correctly",e),"dialog"!==e.localName)throw new Error("Failed to register dialog: The element is not a dialog.");new n(e)},r.registerDialog=function(e){e.showModal||r.forceRegisterDialog(e)},r.DialogManager=function(){this.pendingDialogStack=[];var e=this.checkDOM_.bind(this);this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",function(t){this.forwardTab_=void 0,t.stopPropagation(),e([])}.bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=100150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver(function(t){var o=[];t.forEach(function(e){for(var t,i=0;t=e.removedNodes[i];++i)if(t instanceof Element)if("dialog"===t.localName)o.push(t);else{var n=t.querySelector("dialog");n&&o.push(n)}}),o.length&&e(o)}))},r.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0),document.addEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})},r.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},r.DialogManager.prototype.updateStacking=function(){for(var e,t=this.zIndexHigh_,o=0;e=this.pendingDialogStack[o];++o)e.updateZIndex(--t,--t),0===o&&(this.overlay.style.zIndex=--t);var i=this.pendingDialogStack[0];if(i){(i.dialog.parentNode||document.body).appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},r.DialogManager.prototype.containedByTopDialog_=function(e){for(;e=t(e);){for(var o,i=0;o=this.pendingDialogStack[i];++i)if(o.dialog===e)return 0===i;e=e.parentElement}return!1},r.DialogManager.prototype.handleFocus_=function(e){if(!this.containedByTopDialog_(e.target)&&(e.preventDefault(),e.stopPropagation(),o(e.target),void 0!==this.forwardTab_)){var t=this.pendingDialogStack[0];return t.dialog.compareDocumentPosition(e.target)&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?t.focus_():document.documentElement.focus()),!1}},r.DialogManager.prototype.handleKey_=function(e){if(this.forwardTab_=void 0,27===e.keyCode){e.preventDefault(),e.stopPropagation();var t=new a("cancel",{bubbles:!1,cancelable:!0}),o=this.pendingDialogStack[0];o&&o.dialog.dispatchEvent(t)&&o.dialog.close()}else 9===e.keyCode&&(this.forwardTab_=!e.shiftKey)},r.DialogManager.prototype.checkDOM_=function(e){this.pendingDialogStack.slice().forEach(function(t){-1!==e.indexOf(t.dialog)?t.downgradeModal():t.maybeHideModal()})},r.DialogManager.prototype.pushDialog=function(e){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return!(this.pendingDialogStack.length>=t)&&(1===this.pendingDialogStack.unshift(e)&&this.blockDocument(),this.updateStacking(),!0)},r.DialogManager.prototype.removeDialog=function(e){var t=this.pendingDialogStack.indexOf(e);-1!=t&&(this.pendingDialogStack.splice(t,1),0===this.pendingDialogStack.length&&this.unblockDocument(),this.updateStacking())},r.dm=new r.DialogManager,document.addEventListener("submit",function(e){var o=e.target;if(o&&o.hasAttribute("method")&&"dialog"===o.getAttribute("method").toLowerCase()){e.preventDefault();var i=t(e.target);if(i){var n,a=["BUTTON","INPUT"];[document.activeElement,e.explicitOriginalTarget].some(function(t){if(t&&t.form==e.target&&-1!=a.indexOf(t.nodeName.toUpperCase()))return n=t.value,!0}),i.close(n)}}},!0),r.forceRegisterDialog=r.forceRegisterDialog,r.registerDialog=r.registerDialog,"function"==typeof define&&"amd"in define?define(function(){return r}):"object"==typeof module&&"object"==typeof module.exports?module.exports=r:window.dialogPolyfill=r}(); \ No newline at end of file diff --git a/shlr/www/m/vendors/fonts/Roboto-italic-400.woff b/shlr/www/m/vendors/fonts/Roboto-italic-400.woff index a2b7704818..c1a23d0d3a 100644 Binary files a/shlr/www/m/vendors/fonts/Roboto-italic-400.woff and b/shlr/www/m/vendors/fonts/Roboto-italic-400.woff differ diff --git a/shlr/www/m/vendors/fonts/Roboto-italic-700.woff b/shlr/www/m/vendors/fonts/Roboto-italic-700.woff index 101ff6e193..d6298c8e09 100644 Binary files a/shlr/www/m/vendors/fonts/Roboto-italic-700.woff and b/shlr/www/m/vendors/fonts/Roboto-italic-700.woff differ diff --git a/shlr/www/m/vendors/fonts/Roboto-normal-100.woff b/shlr/www/m/vendors/fonts/Roboto-normal-100.woff index 06d40fa6e7..d5145eca39 100644 Binary files a/shlr/www/m/vendors/fonts/Roboto-normal-100.woff and b/shlr/www/m/vendors/fonts/Roboto-normal-100.woff differ diff --git a/shlr/www/m/vendors/fonts/Roboto-normal-300.woff b/shlr/www/m/vendors/fonts/Roboto-normal-300.woff index 7e6c479f2c..d246758f73 100644 Binary files a/shlr/www/m/vendors/fonts/Roboto-normal-300.woff and b/shlr/www/m/vendors/fonts/Roboto-normal-300.woff differ diff --git a/shlr/www/m/vendors/fonts/Roboto-normal-400.woff b/shlr/www/m/vendors/fonts/Roboto-normal-400.woff index 941dfa4bae..296609e049 100644 Binary files a/shlr/www/m/vendors/fonts/Roboto-normal-400.woff and b/shlr/www/m/vendors/fonts/Roboto-normal-400.woff differ diff --git a/shlr/www/m/vendors/fonts/Roboto-normal-500.woff b/shlr/www/m/vendors/fonts/Roboto-normal-500.woff index a1b91769f9..1c13b8c26f 100644 Binary files a/shlr/www/m/vendors/fonts/Roboto-normal-500.woff and b/shlr/www/m/vendors/fonts/Roboto-normal-500.woff differ diff --git a/shlr/www/m/vendors/fonts/Roboto-normal-700.woff b/shlr/www/m/vendors/fonts/Roboto-normal-700.woff index bf737c1c39..7b1c76baff 100644 Binary files a/shlr/www/m/vendors/fonts/Roboto-normal-700.woff and b/shlr/www/m/vendors/fonts/Roboto-normal-700.woff differ diff --git a/shlr/www/m/vendors/fonts/Roboto-normal-900.woff b/shlr/www/m/vendors/fonts/Roboto-normal-900.woff index 883990f252..d3e20cd1cf 100644 Binary files a/shlr/www/m/vendors/fonts/Roboto-normal-900.woff and b/shlr/www/m/vendors/fonts/Roboto-normal-900.woff differ