-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
24 lines (22 loc) · 808 Bytes
/
Copy pathindex.html
File metadata and controls
24 lines (22 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<html>
<head>
<script src="node_modules/kaitai-struct/KaitaiStream.js"></script>
<script src="Elf.js"></script>
</head>
<body>
<pre id="dump">parsing in process...</pre>
<script>
var oReq = new XMLHttpRequest();
oReq.open("GET", "examples/elf_all_enabled", true);
oReq.responseType = "arraybuffer";
oReq.onload = function (oEvent) {
var arrayBuffer = oReq.response;
var parsedElf = new Elf(new KaitaiStream(arrayBuffer));
document.getElementById("dump").textContent =
"machineType: " + Elf.Machine[parsedElf.header.machine] + "\n" +
"program headers:\n" + parsedElf.header.sectionHeaders.map(x => " - " + x.name).join("\n");
};
oReq.send(null);
</script>
</body>
</html>