let m_root=self.location.pathname.split("/").slice(0,-1).join("/");function extractOffset(e){e=e.match(/(0x[a-fA-F0-9]+)/);return null===e?null:e[1]}function extractFct(e){e=e.replace(/<[^>]*>/g,"").match(/\(fcn\) ([\S^]+)/);return null===e?null:e[1]}function extractVar(e){e=e.replace(/<[^>]*>/g,"").match(/; var ([a-zA-Z0-9]+) ([\S^]+)/);return null===e?null:e[2]}function prepareClickableOffsets(e){return e=(e=(e=(e=e.replace(/0x([a-zA-Z0-9]*)/g,"<a class='r2seek'>0x$1</a>")).replace(/sym\.([\.a-zA-Z0-9_]*)/g,"<a class='r2seek'>sym.$1</a>")).replace(/fcn\.([\.a-zA-Z0-9_]*)/g,"<a class='r2seek'>fcn.$1</a>")).replace(/str\.([\.a-zA-Z0-9_]*)/g,"<a class='r2seek'>str.$1</a>")}function getChunk(e,a){r2.cmd("pD "+a+"@e:scr.color=3@"+e+"|H",function(e){t=e});for(var t,s=(t=prepareClickableOffsets(t)).split("\n"),r=0;r<s.length;r++){var l=extractFct(s[r]),l=(null!==l&&(s[r]="<span class='fcn' id='"+l+"'>"+s[r]+"</span>"),extractVar(s[r])),l=(null!==l&&(s[r]="<span class='var' id='"+l+"'>"+s[r]+"</span>"),extractOffset(s[r]));null!==l&&(s[r]="<span class='offset' id='"+parseInt(l,16)+"'>"+s[r]+"</span>")}return'<pre style="border-bottom:1px dashed white;" title="'+e+'" id="block'+e+'">'+s.join("\n")+"</pre>"}importScripts(m_root+"/r2.js"),self.onmessage=function(e){e.data.offset<0?self.postMessage({offset:0,data:"before 0x00"}):(e={offset:e.data.offset,size:e.data.size,data:getChunk(e.data.offset,e.data.size)},self.postMessage(e))};