forked from zigzig122468/securedorg.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathx86.html
90 lines (86 loc) · 3.09 KB
/
x86.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<link rel="stylesheet" href="/assets/css/style.css?v=5e63b4f7f8d5ec379a428172f4517e17cf6f662e">
</head>
<body>
<script language="JavaScript" type="text/javascript">
function loadXMLDoc(dname)
{
if (window.XMLHttpRequest)
{
xhttp=new XMLHttpRequest();
}
else
{
xhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.open("GET",dname,false);
xhttp.send();
return xhttp.responseXML;
}
function searchXML()
{
xmlDoc=loadXMLDoc("https://securedorg.github.io/x86.xml");
x=xmlDoc.getElementsByTagName("Instruction");
input = document.getElementById("input").value;
size = input.length;
if (input == null || input == "")
{
document.getElementById("results").innerHTML= "Please enter a character or name!";
return false;
}
for (i=0;i<x.length;i++)
{
Instruction = xmlDoc.getElementsByTagName("Instruction")[i].getAttribute("name");
startString = Instruction.substring(0,size);
if (startString.toLowerCase() == input.toLowerCase())
{
iname=x[i].getAttribute("name");
isummary=x[i].getAttribute("summary");
operandText = "<table><th>name</th><th>operands</th><th>opcode</th>";
ioperand=x[i].getElementsByTagName("InstructionForm");
for (y=0;y<ioperand.length;y++)
{
operandText += "<tr><td>" + ioperand[y].getAttribute("gas-name") + "</td>";
operand = ioperand[y].getElementsByTagName("Operand");
operandText += "<td>";
for (k=0;k<operand.length;k++)
{
operandText += operand[k].getAttribute("type") + " ";
}
operandText += "</td><td>";
if (ioperand[y].getElementsByTagName("Encoding")[0].getElementsByTagName("Prefix").length != 0)
{
operandText += ioperand[y].getElementsByTagName("Encoding")[0].getElementsByTagName("Prefix")[0].getAttribute("byte") + " ";
}
opcode = ioperand[y].getElementsByTagName("Encoding")[0].getElementsByTagName("Opcode");
for (m=0;m<opcode.length;m++)
{
operandText += opcode[m].getAttribute("byte") + " ";
}
operandText += "</td></tr>";
}
operandText += "</table>"
divText = "<h1>The instruction details are:</h1><br /><table border=1><tr><th>Instruction</th><th>Summary</th><th>Variations</th></tr>" + "<tr><td>" + iname + "</td><td>" + isummary + "</td><td>" + operandText + "</td></tr>" + "</table>";
break;
}
else
{
divText = "<h2>The contact does not exist.</h2>";
}
}
document.getElementById("results").innerHTML= divText;
}
</script>
Search Instruction: <input type="text" name="Instruction" id="input">
<br />
<input type="submit" value="Submit" onClick="searchXML()">
<br />
<br />
<div id="results">
</div>
</body>
</html>