feat: favicon & multisyntax, modal for uninmplemented menus
This commit is contained in:
parent
50c6e37098
commit
fdca504d20
Binary file not shown.
After Width: | Height: | Size: 549 B |
110
main.html
110
main.html
|
@ -39,13 +39,13 @@
|
|||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:openfile()">
|
||||
<a href="javascript:showmodal()">
|
||||
<span class="red-168-text">O</span>pen
|
||||
<span class="tui-shortcut">F5</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:savefile()">
|
||||
<a href="javascript:showmodal()">
|
||||
<span class="red-168-text">S</span>ave
|
||||
<span class="tui-shortcut">F6</span>
|
||||
</a>
|
||||
|
@ -76,48 +76,48 @@
|
|||
<div class="tui-dropdown-content">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="javascript:">
|
||||
<a href="javascript:showmodal();">
|
||||
<span class="red-168-text">C</span>ut
|
||||
<span class="tui-shortcut">Ctrl+X</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:">
|
||||
<a href="javascript:showmodal()">
|
||||
C<span class="red-168-text">o</span>py
|
||||
<span class="tui-shortcut">Ctrl+C</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:">
|
||||
<a href="javascript:showmodal()">
|
||||
<span class="red-168-text">P</span>aste
|
||||
<span class="tui-shortcut">Ctrl+P</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:">
|
||||
<a href="javascript:showmodal()">
|
||||
<span class="red-168-text">S</span>elect all
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:">
|
||||
<a href="javascript:showmodal()">
|
||||
<span class="red-168-text">D</span>elete
|
||||
</a>
|
||||
</li>
|
||||
<div class="tui-black-divider"></div>
|
||||
<li>
|
||||
<a href="/index.html">
|
||||
<a href="javascript:showmodal()">
|
||||
<span class="red-168-text">F</span>ind
|
||||
<span class="tui-shortcut">F3</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/index.html">
|
||||
<a href="javascript:showmodal()">
|
||||
<span class="red-168-text">R</span>eplace
|
||||
<span class="tui-shortcut">Alt+F3</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/index.html">
|
||||
<a href="javascript:showmodal()">
|
||||
<span class="red-168-text">G</span>oto
|
||||
<span class="tui-shortcut">Ctrl+G</span>
|
||||
</a>
|
||||
|
@ -159,12 +159,27 @@
|
|||
<div class="tui-dropdown-content">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="javascript:toSyntax('intel')">
|
||||
<span id="intel">√</span> <span class="red-168-text">I</span>ntel
|
||||
<a href="javascript:toSyntax('nasm')">
|
||||
<span id="nasm">√</span> <span class="red-168-text">N</span>asm
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:toSyntax('att')">
|
||||
<a href="javascript:toSyntax('intel')">
|
||||
<span id="intel"> </span> <span class="red-168-text">I</span>ntel
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:toSyntax('masm')">
|
||||
<span id="masm"> </span> <span class="red-168-text">M</span>asm
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:toSyntax('gas')">
|
||||
<span id="gas"> </span> <span class="red-168-text">G</span>as
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:toSyntax('att')">
|
||||
<span id="att"> </span> <span class="red-168-text">A</span>T&T
|
||||
</a>
|
||||
</li>
|
||||
|
@ -198,10 +213,28 @@
|
|||
</li>
|
||||
<li class="tui-dropdown">
|
||||
<span class="red-168-text">H</span>elp
|
||||
<div class="tui-dropdown-content">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="javascript:showmodal()">
|
||||
<span class="red-168-text">I</span>nterface
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<div id="modal" class="tui-window red-168 left-align" style="left: 40%; margin: 0px auto; top: 50%; z-index: 10; position: fixed; visibility:hidden">
|
||||
<fieldset class="tui-fieldset">
|
||||
<legend class="red-255 yellow-255-text">Alert</legend>
|
||||
Function not implemented<br><br>
|
||||
<div class="tui-divider"></div><br>
|
||||
<button class="tui-button cyan-168 white-255-text tui-modal-close-button right" data-modal="modal" onclick="javascript:closemodal()">close</button>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<!-- Edit panel -->
|
||||
<div class="tui-window full-width tui-no-shadow" style="margin-top: 23px;height:60%">
|
||||
<fieldset class="tui-fieldset" style="height:100%">
|
||||
|
@ -211,7 +244,7 @@
|
|||
<span class="tui-fieldset-text right" style="margin-bottom: -5px;" id="syntax"> Syntax:Intel </span>
|
||||
<textarea id="editor" class="tui-textarea full-width" style="overflow: scroll;height:100%;width:100%"></textarea></div>
|
||||
|
||||
<div class="tui-window tui-no-shadow" style="height:20%;width:1000px">
|
||||
<div class="tui-window tui-no-shadow" style="height:20%;width:940px">
|
||||
<fieldset class="tui-fieldset" style="height:100%">
|
||||
<legend class="center">Results</legend>
|
||||
<div class="" style="overflow: scroll;height:100%;width:100%"><pre id="result" style="margin-top: -5px;"></pre></div>
|
||||
|
@ -233,7 +266,7 @@
|
|||
</div>
|
||||
|
||||
<!-- Status bar -->
|
||||
<div class="tui-statusbar absolute">
|
||||
<div class="tui-statusbar relative">
|
||||
<ul>
|
||||
<li><a href="#!"><span class="red-168-text">F1</span> Help</a></li>
|
||||
<li><a href="javascript:exportfile()"><span class="red-168-text">F2</span> Save</a></li>
|
||||
|
@ -249,12 +282,22 @@
|
|||
</body>
|
||||
<script>
|
||||
var type='binary';
|
||||
var syntax='intel';
|
||||
var syntax='nasm';
|
||||
var filename='';
|
||||
var zones = [];
|
||||
|
||||
newfile();
|
||||
|
||||
function closemodal()
|
||||
{
|
||||
$("#modal").css("visibility","hidden");
|
||||
}
|
||||
|
||||
function showmodal()
|
||||
{
|
||||
$("#modal").css("visibility","visible");
|
||||
}
|
||||
|
||||
function setFilename(name){
|
||||
$("#filename").html(name);
|
||||
filename=name;
|
||||
|
@ -264,15 +307,33 @@ function toSyntax(atype)
|
|||
{
|
||||
$("#att").html(" ");
|
||||
$("#intel").html(" ");
|
||||
$("#nasm").html(" ");
|
||||
$("#masm").html(" ");
|
||||
$("#gas").html(" ");
|
||||
if (atype=="att")
|
||||
{
|
||||
$("#att").html("√");
|
||||
$("#syntax").html(" Syntax:AT&T ");
|
||||
}
|
||||
else
|
||||
else if (atype=="intel")
|
||||
{
|
||||
$("#intel").html("√");
|
||||
$("#syntax").html(" Syntax:Intel ");
|
||||
}
|
||||
else if (atype=="masm")
|
||||
{
|
||||
$("#masm").html("√");
|
||||
$("#syntax").html(" Syntax:Masm ");
|
||||
}
|
||||
else if (atype=="gas")
|
||||
{
|
||||
$("#gas").html("√");
|
||||
$("#syntax").html(" Syntax:Gas ");
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#nasm").html("√");
|
||||
$("#syntax").html(" Syntax:Nasm ");
|
||||
}
|
||||
syntax=atype;
|
||||
}
|
||||
|
@ -378,13 +439,13 @@ function makebin(allzones)
|
|||
function dumpall(allzones)
|
||||
{
|
||||
if (type=="binary")
|
||||
var output = '<table class="">';
|
||||
var output = '<table class="tui-table striped-purple"><thead><tr><th>Address</th><th>Hexadecimal</th><th>Ascii</th></thhead><tbody>';
|
||||
else
|
||||
var output = '';
|
||||
for (const zone of allzones)
|
||||
output+=dump(zone);
|
||||
if (type=="binary")
|
||||
output += '</table>';
|
||||
output += '</tbody></table>';
|
||||
showresult(output);
|
||||
}
|
||||
|
||||
|
@ -398,7 +459,7 @@ function dump(zone) {
|
|||
case 'binary':
|
||||
var address=zone.offset;
|
||||
for (var offset = 0; offset < mcLen; offset += 16) {
|
||||
output += "<td>"+toHex(address,zone.code)+"</td><td> | </td><td>";
|
||||
output += "<td>"+toHex(address,zone.code)+"</td><td>";
|
||||
var ascii='';
|
||||
for (var i = offset; i < offset + 16 && i < mcLen; i++) {
|
||||
if (zone.asm[i]>31)
|
||||
|
@ -407,7 +468,7 @@ function dump(zone) {
|
|||
ascii += '.';
|
||||
output += hexByte(zone.asm[i]) + " ";
|
||||
}
|
||||
output += "</td><td> | </td><td>"+ascii+"</td></tr>";
|
||||
output += "</td><td>"+ascii+"</td></tr>";
|
||||
address+=16;
|
||||
}
|
||||
break;
|
||||
|
@ -456,6 +517,7 @@ function make()
|
|||
var org=0;
|
||||
var type=32;
|
||||
var status=true;
|
||||
zones=[];
|
||||
showresult('');
|
||||
while (assembly.length!=0)
|
||||
{
|
||||
|
@ -553,6 +615,12 @@ function assemble(zone)
|
|||
a = new ks.Keystone(ks.ARCH_X86, realtype);
|
||||
if (syntax=="att")
|
||||
a.option(ks.OPT_SYNTAX, ks.OPT_SYNTAX_ATT);
|
||||
else if (syntax=="masm")
|
||||
a.option(ks.OPT_SYNTAX, ks.OPT_SYNTAX_MASM);
|
||||
else if (syntax=="intel")
|
||||
a.option(ks.OPT_SYNTAX, ks.OPT_SYNTAX_INTEL);
|
||||
else if (syntax=="gas")
|
||||
a.option(ks.OPT_SYNTAX, ks.OPT_SYNTAX_GAS);
|
||||
else
|
||||
a.option(ks.OPT_SYNTAX, ks.OPT_SYNTAX_NASM);
|
||||
try
|
||||
|
|
Loading…
Reference in New Issue