-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
73 lines (71 loc) · 3.52 KB
/
index.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
<!DOCTYPE html>
<html lang="en" ng-app="x86interpreter">
<head>
<title>Code Arcana</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0-wip/css/bootstrap.min.css">
<link rel="stylesheet" href="./main.css" type="text/css" />
<script src="./x86.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0rc1/angular.min.js"></script>
<script src="./ui-bootstrap-tpls-0.5.0.min.js"></script>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="./app.js"></script>
</head>
<body>
<div ng-controller="StateController" class="container">
<div class="row">
<div class="instructions col-xs-4">
<h2>Code</h2>
<div class="instruction" ng-repeat="address in state.codeAddrs">
<span class="register-markers" ng-repeat="register in all_registers">
<span class="text-primary register-marker" ng-show="state[register] == address">%{{register}}</span>
</span>
<span class="text-muted">{{hex(address)}}</span>
<span ng-dblclick="isEditing=(state.instructions[address].length==0||!isEditing)"
ng-init="isEditing=state.instructions[address].length==0">
<input ng-show="isEditing" type="text" ng-model="state.instructions[address]"
size="10" focus-on="state.eip==address"
ng-enter="isEditing=(state.instructions[address].length==0||!isEditing);state.step()">
<span ng-show="!isEditing">{{state.instructions[address]}}</span>
</span>
<button class="btn btn-primary" ng-show="address==state.eip" ng-dblclick="state.step()">Step</button>
</div>
</div>
<div class="stack col-xs-4">
<h2>Stack</h2>
<div class="memory" ng-repeat="address in state.stackAddrs.slice(0).reverse()">
<span class="register-markers" ng-repeat="register in all_registers">
<span class="text-primary register-marker" ng-show="state[register] == address">%{{register}}</span>
</span>
<span class="text-muted">{{hex(address)}}</span>
<span ng-dblclick="isEditing=!isEditing" ng-init="isEditing=false">
<input ng-show="isEditing" ng-enter="isEditing=false" type="text" ng-model="state.stack[address]" size="10" integer>
<span ng-show="!isEditing">{{hex(state.stack[address])}}</span>
</span>
</div>
</div>
<div class="registers col-xs-4">
<h2>Registers</h2>
<div class="register" ng-repeat="register in all_registers">
<span class="text-muted">%{{register}}</span>
<span ng-dblclick="isEditing=!isEditing" ng-init="isEditing=false">
<input ng-show="isEditing" ng-enter="isEditing=false" type="text" ng-model="state[register]" size="10" integer>
<span ng-show="!isEditing">{{hex(state[register])}}</span>
</span>
</div>
<div class="register">
<span class="text-muted">%eflags</span>
<span class="flag" ng-repeat="(flag, desc) in flag_descriptions"
ng-class="state[flag] ? 'text-primary' : 'text-muted'"
ng-dblclick="state[flag] = !state[flag]">
{{flag}}
</span>
</div>
</div>
</div>
</div>
</body>
</html>