-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhex.html
More file actions
62 lines (41 loc) · 2.04 KB
/
hex.html
File metadata and controls
62 lines (41 loc) · 2.04 KB
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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="UTF-8" />
<title>Color Computer web disassembler</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js" type="text/javascript"></script>
<script src="./src/view/hex0r.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="./src/view/hex0r.css" />
<link rel="stylesheet" type="text/css" href="./lib/bootstrap.min.css" />
</head>
<body>
<div id="navbar"></div>
<div id="hexviewer"></div>
<script type="module">
import { setupNavBar } from './src/view/setupNavBar.mjs';
import { Section, loadAllSections, getAllSections } from './src/model/section.mjs';
function onLoad() {
setupNavBar();
loadAllSections();
const sections = getAllSections();
let hexviewer = "";
for (let i = 0; i < sections.length; i++) {
let base64String = btoa(String.fromCharCode(...new Uint8Array(sections[i].buffer)));
//let base64String = sections[i].buffer;//.toString('base64');
console.log("testig hex.html");
console.log(btoa(String.fromCharCode(...new Uint8Array(sections[i].buffer))));
console.log(sections[i].buffer);
hexviewer += `<div id="hexv` + i + `" class="hex0rwindow" data-row-width="16" data-word-size="1" data-row-break="8"
data-trim="true" data-base64="true" data-caption="Section ` + sections[i].name + ` hex dump"
data-highlights=""
data-show-line-nums="true" data-offset="` + sections[i].virtualMemoryAddress + `" title="">` + base64String + `</div>`;
}
document.getElementById('hexviewer').innerHTML = hexviewer;
for (let i = 0; i < sections.length; i++) {
markup_hex0rwindow($("#hexv" + i));
}
}
window.addEventListener("load", onLoad);
</script>
</body>
</html>