mirror of https://github.com/ConsenSys/mythril
blockchainethereumsmart-contractssoliditysecurityprogram-analysissecurity-analysissymbolic-execution
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
134 lines
7.9 KiB
134 lines
7.9 KiB
<html>
|
|
<head>
|
|
|
|
|
|
<style type="text/css">
|
|
#mynetwork {
|
|
background-color: #232625;
|
|
}
|
|
|
|
body {
|
|
background-color: #232625;
|
|
color: #ffffff;
|
|
font-size: 10px;
|
|
}
|
|
</style>
|
|
|
|
|
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.21.0/vis.min.css" rel="stylesheet" type="text/css" />
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/vis/4.21.0/vis.min.js"></script>
|
|
<script>
|
|
|
|
|
|
var options = {
|
|
autoResize: true,
|
|
height: '100%',
|
|
width: '100%',
|
|
manipulation: false,
|
|
height: '90%',
|
|
layout: {
|
|
randomSeed: undefined,
|
|
improvedLayout:true,
|
|
hierarchical: {
|
|
enabled:true,
|
|
levelSeparation: 450,
|
|
nodeSpacing: 200,
|
|
treeSpacing: 100,
|
|
blockShifting: true,
|
|
edgeMinimization: true,
|
|
parentCentralization: false,
|
|
direction: 'LR', // UD, DU, LR, RL
|
|
sortMethod: 'directed' // hubsize, directed
|
|
}
|
|
},
|
|
nodes:{
|
|
borderWidth: 1,
|
|
borderWidthSelected: 2,
|
|
chosen: true,
|
|
shape: 'box',
|
|
font: {
|
|
align: 'left',
|
|
color: '#FFFFFF',
|
|
},
|
|
},
|
|
edges:{
|
|
font: {
|
|
color: '#ffffff',
|
|
size: 12, // px
|
|
face: 'arial',
|
|
background: 'none',
|
|
strokeWidth: 0, // px
|
|
strokeColor: '#ffffff',
|
|
align: 'horizontal',
|
|
multi: false,
|
|
vadjust: 0,
|
|
}
|
|
},
|
|
|
|
physics:{
|
|
enabled: false,
|
|
}
|
|
|
|
}
|
|
|
|
|
|
var nodes = [
|
|
{id: '18', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '63 JUMPDEST\n64 PUSH1 0x00\n66 DUP1\n67 REVERT\n', 'fullLabel': '63 JUMPDEST\n64 PUSH1 0x00\n66 DUP1\n67 REVERT\n', 'truncLabel': '63 JUMPDEST\n64 PUSH1 0x00\n66 DUP1\n67 REVERT\n', 'isExpanded': false},
|
|
{id: '24', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '84 JUMPDEST\n85 STOP\n', 'fullLabel': '84 JUMPDEST\n85 STOP\n', 'truncLabel': '84 JUMPDEST\n85 STOP\n', 'isExpanded': false},
|
|
{id: '23', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '157 JUMPDEST\n158 JUMP\n', 'fullLabel': '157 JUMPDEST\n158 JUMP\n', 'truncLabel': '157 JUMPDEST\n158 JUMP\n', 'isExpanded': false},
|
|
{id: '25', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '153 PUSH1 0x00\n155 DUP1\n156 REVERT\n', 'fullLabel': '153 PUSH1 0x00\n155 DUP1\n156 REVERT\n', 'truncLabel': '153 PUSH1 0x00\n155 DUP1\n156 REVERT\n', 'isExpanded': false},
|
|
{id: '22', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '86 JUMPDEST\n87 CALLER\n88 PUSH20 0xffffffff(...)\n109 AND\n110 PUSH2 0x08fc\n113 PUSH8 0x1bc16d67(...)\n(click to expand +)', 'fullLabel': '86 JUMPDEST\n87 CALLER\n88 PUSH20 0xffffffff(...)\n109 AND\n110 PUSH2 0x08fc\n113 PUSH8 0x1bc16d67(...)\n122 SWAP1\n123 DUP2\n124 ISZERO\n125 MUL\n126 SWAP1\n127 PUSH1 0x40\n129 MLOAD\n130 PUSH1 0x00\n132 PUSH1 0x40\n134 MLOAD\n135 DUP1\n136 DUP4\n137 SUB\n138 DUP2\n139 DUP6\n140 DUP9\n141 DUP9\n142 CALL\n143 SWAP4\n144 POP\n145 POP\n146 POP\n147 POP\n148 ISZERO\n149 ISZERO\n150 PUSH1 0x9d\n152 JUMPI\n', 'truncLabel': '86 JUMPDEST\n87 CALLER\n88 PUSH20 0xffffffff(...)\n109 AND\n110 PUSH2 0x08fc\n113 PUSH8 0x1bc16d67(...)\n(click to expand +)', 'isExpanded': false},
|
|
{id: '21', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '78 JUMPDEST\n79 PUSH1 0x54\n81 PUSH1 0x56\n83 JUMP\n', 'fullLabel': '78 JUMPDEST\n79 PUSH1 0x54\n81 PUSH1 0x56\n83 JUMP\n', 'truncLabel': '78 JUMPDEST\n79 PUSH1 0x54\n81 PUSH1 0x56\n83 JUMP\n', 'isExpanded': false},
|
|
{id: '26', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '74 PUSH1 0x00\n76 DUP1\n77 REVERT\n', 'fullLabel': '74 PUSH1 0x00\n76 DUP1\n77 REVERT\n', 'truncLabel': '74 PUSH1 0x00\n76 DUP1\n77 REVERT\n', 'isExpanded': false},
|
|
{id: '20', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '68 _function_0x8a4068dd\n69 CALLVALUE\n70 ISZERO\n71 PUSH1 0x4e\n73 JUMPI\n', 'fullLabel': '68 _function_0x8a4068dd\n69 CALLVALUE\n70 ISZERO\n71 PUSH1 0x4e\n73 JUMPI\n', 'truncLabel': '68 _function_0x8a4068dd\n69 CALLVALUE\n70 ISZERO\n71 PUSH1 0x4e\n73 JUMPI\n', 'isExpanded': false},
|
|
{id: '27', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '63 JUMPDEST\n64 PUSH1 0x00\n66 DUP1\n67 REVERT\n', 'fullLabel': '63 JUMPDEST\n64 PUSH1 0x00\n66 DUP1\n67 REVERT\n', 'truncLabel': '63 JUMPDEST\n64 PUSH1 0x00\n66 DUP1\n67 REVERT\n', 'isExpanded': false},
|
|
{id: '19', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '12 PUSH1 0x00\n14 CALLDATALOAD\n15 PUSH29 0x01000000(...)\n45 SWAP1\n46 DIV\n47 PUSH4 0xffffffff\n(click to expand +)', 'fullLabel': '12 PUSH1 0x00\n14 CALLDATALOAD\n15 PUSH29 0x01000000(...)\n45 SWAP1\n46 DIV\n47 PUSH4 0xffffffff\n52 AND\n53 DUP1\n54 PUSH4 0x8a4068dd\n59 EQ\n60 PUSH1 0x44\n62 JUMPI\n', 'truncLabel': '12 PUSH1 0x00\n14 CALLDATALOAD\n15 PUSH29 0x01000000(...)\n45 SWAP1\n46 DIV\n47 PUSH4 0xffffffff\n(click to expand +)', 'isExpanded': false},
|
|
{id: '17', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '0 PUSH1 0x60\n2 PUSH1 0x40\n4 MSTORE\n5 PUSH1 0x04\n7 CALLDATASIZE\n8 LT\n(click to expand +)', 'fullLabel': '0 PUSH1 0x60\n2 PUSH1 0x40\n4 MSTORE\n5 PUSH1 0x04\n7 CALLDATASIZE\n8 LT\n9 PUSH1 0x3f\n11 JUMPI\n', 'truncLabel': '0 PUSH1 0x60\n2 PUSH1 0x40\n4 MSTORE\n5 PUSH1 0x04\n7 CALLDATASIZE\n8 LT\n(click to expand +)', 'isExpanded': false}
|
|
];
|
|
var edges = [
|
|
{from: '17', to: '18', 'arrows': 'to', 'label': 'Not(ULE(4, calldatasize_Unknown))', 'smooth': {'type': 'cubicBezier'}},
|
|
{from: '23', to: '24', 'arrows': 'to', 'label': '', 'smooth': {'type': 'cubicBezier'}},
|
|
{from: '22', to: '23', 'arrows': 'to', 'label': 'Not(retval_142 == 0)', 'smooth': {'type': 'cubicBezier'}},
|
|
{from: '22', to: '25', 'arrows': 'to', 'label': 'retval_142 == 0', 'smooth': {'type': 'cubicBezier'}},
|
|
{from: '21', to: '22', 'arrows': 'to', 'label': '', 'smooth': {'type': 'cubicBezier'}},
|
|
{from: '20', to: '21', 'arrows': 'to', 'label': 'callvalue == 0', 'smooth': {'type': 'cubicBezier'}},
|
|
{from: '20', to: '26', 'arrows': 'to', 'label': 'Not(callvalue == 0)', 'smooth': {'type': 'cubicBezier'}},
|
|
{from: '19', to: '20', 'arrows': 'to', 'label': 'Extract(0xff, 0xe0, calldata_Unknown_0) == 0x8a4068dd', 'smooth': {'type': 'cubicBezier'}},
|
|
{from: '19', to: '27', 'arrows': 'to', 'label': 'Not(Extract(0xff, 0xe0, calldata_Unknown_0) == 0x8a4068dd)', 'smooth': {'type': 'cubicBezier'}},
|
|
{from: '17', to: '19', 'arrows': 'to', 'label': 'ULE(4, calldatasize_Unknown)', 'smooth': {'type': 'cubicBezier'}}
|
|
];
|
|
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<p>Mythril / LASER Symbolic VM</p>
|
|
<p><div id="mynetwork"></div><br/></p>
|
|
<script type="text/javascript">
|
|
var container = document.getElementById('mynetwork');
|
|
|
|
var nodesSet = new vis.DataSet(nodes);
|
|
var edgesSet = new vis.DataSet(edges);
|
|
var data = {'nodes': nodesSet, 'edges': edgesSet}
|
|
|
|
var gph = new vis.Network(container, data, options);
|
|
gph.on("click", function (params) {
|
|
// parse node id
|
|
var nodeID = params['nodes']['0'];
|
|
if (nodeID) {
|
|
var clickedNode = nodesSet.get(nodeID);
|
|
|
|
if(clickedNode.isExpanded) {
|
|
clickedNode.label = clickedNode.truncLabel;
|
|
}
|
|
else {
|
|
clickedNode.label = clickedNode.fullLabel;
|
|
}
|
|
|
|
clickedNode.isExpanded = !clickedNode.isExpanded;
|
|
|
|
nodesSet.update(clickedNode);
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|