Security analysis tool for EVM bytecode. Supports smart contracts built for Ethereum, Hedera, Quorum, Vechain, Roostock, Tron and other EVM-compatible blockchains.
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.
 
 
 
 
 
 
mythril/tests/testdata/outputs/metacoin.sol.graph.html

150 lines
15 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: '215', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '76 JUMPDEST\n77 PUSH1 0x00\n79 DUP1\n80 REVERT\n', 'fullLabel': '76 JUMPDEST\n77 PUSH1 0x00\n79 DUP1\n80 REVERT\n', 'truncLabel': '76 JUMPDEST\n77 PUSH1 0x00\n79 DUP1\n80 REVERT\n', 'isExpanded': false},
{id: '220', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '136 JUMPDEST\n137 PUSH1 0x40\n139 MLOAD\n140 DUP1\n141 DUP3\n142 DUP2\n(click to expand +)', 'fullLabel': '136 JUMPDEST\n137 PUSH1 0x40\n139 MLOAD\n140 DUP1\n141 DUP3\n142 DUP2\n143 MSTORE\n144 PUSH1 0x20\n146 ADD\n147 SWAP2\n148 POP\n149 POP\n150 PUSH1 0x40\n152 MLOAD\n153 DUP1\n154 SWAP2\n155 SUB\n156 SWAP1\n157 RETURN\n', 'truncLabel': '136 JUMPDEST\n137 PUSH1 0x40\n139 MLOAD\n140 DUP1\n141 DUP3\n142 DUP2\n(click to expand +)', 'isExpanded': false},
{id: '219', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '248 JUMPDEST\n249 PUSH1 0x00\n251 PUSH1 0x20\n253 MSTORE\n254 DUP1\n255 PUSH1 0x00\n(click to expand +)', 'fullLabel': '248 JUMPDEST\n249 PUSH1 0x00\n251 PUSH1 0x20\n253 MSTORE\n254 DUP1\n255 PUSH1 0x00\n257 MSTORE\n258 PUSH1 0x40\n260 PUSH1 0x00\n262 SHA3\n263 PUSH1 0x00\n265 SWAP2\n266 POP\n267 SWAP1\n268 POP\n269 SLOAD\n270 DUP2\n271 JUMP\n', 'truncLabel': '248 JUMPDEST\n249 PUSH1 0x00\n251 PUSH1 0x20\n253 MSTORE\n254 DUP1\n255 PUSH1 0x00\n(click to expand +)', 'isExpanded': false},
{id: '218', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '92 JUMPDEST\n93 PUSH2 0x0088\n96 PUSH1 0x04\n98 DUP1\n99 DUP1\n100 CALLDATALOAD\n(click to expand +)', 'fullLabel': '92 JUMPDEST\n93 PUSH2 0x0088\n96 PUSH1 0x04\n98 DUP1\n99 DUP1\n100 CALLDATALOAD\n101 PUSH20 0xffffffff(...)\n122 AND\n123 SWAP1\n124 PUSH1 0x20\n126 ADD\n127 SWAP1\n128 SWAP2\n129 SWAP1\n130 POP\n131 POP\n132 PUSH2 0x00f8\n135 JUMP\n', 'truncLabel': '92 JUMPDEST\n93 PUSH2 0x0088\n96 PUSH1 0x04\n98 DUP1\n99 DUP1\n100 CALLDATALOAD\n(click to expand +)', 'isExpanded': false},
{id: '221', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '88 PUSH1 0x00\n90 DUP1\n91 REVERT\n', 'fullLabel': '88 PUSH1 0x00\n90 DUP1\n91 REVERT\n', 'truncLabel': '88 PUSH1 0x00\n90 DUP1\n91 REVERT\n', 'isExpanded': false},
{id: '217', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '81 _function_0x27e235e3\n82 CALLVALUE\n83 ISZERO\n84 PUSH2 0x005c\n87 JUMPI\n', 'fullLabel': '81 _function_0x27e235e3\n82 CALLVALUE\n83 ISZERO\n84 PUSH2 0x005c\n87 JUMPI\n', 'truncLabel': '81 _function_0x27e235e3\n82 CALLVALUE\n83 ISZERO\n84 PUSH2 0x005c\n87 JUMPI\n', 'isExpanded': false},
{id: '227', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '222 JUMPDEST\n223 PUSH1 0x40\n225 MLOAD\n226 DUP1\n227 DUP3\n228 ISZERO\n(click to expand +)', 'fullLabel': '222 JUMPDEST\n223 PUSH1 0x40\n225 MLOAD\n226 DUP1\n227 DUP3\n228 ISZERO\n229 ISZERO\n230 ISZERO\n231 ISZERO\n232 DUP2\n233 MSTORE\n234 PUSH1 0x20\n236 ADD\n237 SWAP2\n238 POP\n239 POP\n240 PUSH1 0x40\n242 MLOAD\n243 DUP1\n244 SWAP2\n245 SUB\n246 SWAP1\n247 RETURN\n', 'truncLabel': '222 JUMPDEST\n223 PUSH1 0x40\n225 MLOAD\n226 DUP1\n227 DUP3\n228 ISZERO\n(click to expand +)', 'isExpanded': false},
{id: '226', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '353 JUMPDEST\n354 DUP2\n355 PUSH1 0x00\n357 DUP1\n358 CALLER\n359 PUSH20 0xffffffff(...)\n(click to expand +)', 'fullLabel': '353 JUMPDEST\n354 DUP2\n355 PUSH1 0x00\n357 DUP1\n358 CALLER\n359 PUSH20 0xffffffff(...)\n380 AND\n381 PUSH20 0xffffffff(...)\n402 AND\n403 DUP2\n404 MSTORE\n405 PUSH1 0x20\n407 ADD\n408 SWAP1\n409 DUP2\n410 MSTORE\n411 PUSH1 0x20\n413 ADD\n414 PUSH1 0x00\n416 SHA3\n417 PUSH1 0x00\n419 DUP3\n420 DUP3\n421 SLOAD\n422 SUB\n423 SWAP3\n424 POP\n425 POP\n426 DUP2\n427 SWAP1\n428 SSTORE\n429 POP\n430 DUP2\n431 PUSH1 0x00\n433 DUP1\n434 DUP6\n435 PUSH20 0xffffffff(...)\n456 AND\n457 PUSH20 0xffffffff(...)\n478 AND\n479 DUP2\n480 MSTORE\n481 PUSH1 0x20\n483 ADD\n484 SWAP1\n485 DUP2\n486 MSTORE\n487 PUSH1 0x20\n489 ADD\n490 PUSH1 0x00\n492 SHA3\n493 PUSH1 0x00\n495 DUP3\n496 DUP3\n497 SLOAD\n498 ADD\n499 SWAP3\n500 POP\n501 POP\n502 DUP2\n503 SWAP1\n504 SSTORE\n505 POP\n506 PUSH1 0x00\n508 SWAP1\n509 POP\n510 JUMPDEST\n511 SWAP3\n512 SWAP2\n513 POP\n514 POP\n515 JUMP\n', 'truncLabel': '353 JUMPDEST\n354 DUP2\n355 PUSH1 0x00\n357 DUP1\n358 CALLER\n359 PUSH20 0xffffffff(...)\n(click to expand +)', 'isExpanded': false},
{id: '230', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '222 JUMPDEST\n223 PUSH1 0x40\n225 MLOAD\n226 DUP1\n227 DUP3\n228 ISZERO\n(click to expand +)', 'fullLabel': '222 JUMPDEST\n223 PUSH1 0x40\n225 MLOAD\n226 DUP1\n227 DUP3\n228 ISZERO\n229 ISZERO\n230 ISZERO\n231 ISZERO\n232 DUP2\n233 MSTORE\n234 PUSH1 0x20\n236 ADD\n237 SWAP2\n238 POP\n239 POP\n240 PUSH1 0x40\n242 MLOAD\n243 DUP1\n244 SWAP2\n245 SUB\n246 SWAP1\n247 RETURN\n', 'truncLabel': '222 JUMPDEST\n223 PUSH1 0x40\n225 MLOAD\n226 DUP1\n227 DUP3\n228 ISZERO\n(click to expand +)', 'isExpanded': false},
{id: '229', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '510 JUMPDEST\n511 SWAP3\n512 SWAP2\n513 POP\n514 POP\n515 JUMP\n(click to expand +)', 'fullLabel': '510 JUMPDEST\n511 SWAP3\n512 SWAP2\n513 POP\n514 POP\n515 JUMP\n', 'truncLabel': '510 JUMPDEST\n511 SWAP3\n512 SWAP2\n513 POP\n514 POP\n515 JUMP\n(click to expand +)', 'isExpanded': false},
{id: '228', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '345 PUSH1 0x00\n347 SWAP1\n348 POP\n349 PUSH2 0x01fe\n352 JUMP\n', 'fullLabel': '345 PUSH1 0x00\n347 SWAP1\n348 POP\n349 PUSH2 0x01fe\n352 JUMP\n', 'truncLabel': '345 PUSH1 0x00\n347 SWAP1\n348 POP\n349 PUSH2 0x01fe\n352 JUMP\n', 'isExpanded': false},
{id: '225', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '272 JUMPDEST\n273 PUSH1 0x00\n275 DUP2\n276 PUSH1 0x00\n278 DUP1\n279 CALLER\n(click to expand +)', 'fullLabel': '272 JUMPDEST\n273 PUSH1 0x00\n275 DUP2\n276 PUSH1 0x00\n278 DUP1\n279 CALLER\n280 PUSH20 0xffffffff(...)\n301 AND\n302 PUSH20 0xffffffff(...)\n323 AND\n324 DUP2\n325 MSTORE\n326 PUSH1 0x20\n328 ADD\n329 SWAP1\n330 DUP2\n331 MSTORE\n332 PUSH1 0x20\n334 ADD\n335 PUSH1 0x00\n337 SHA3\n338 SLOAD\n339 LT\n340 ISZERO\n341 PUSH2 0x0161\n344 JUMPI\n', 'truncLabel': '272 JUMPDEST\n273 PUSH1 0x00\n275 DUP2\n276 PUSH1 0x00\n278 DUP1\n279 CALLER\n(click to expand +)', 'isExpanded': false},
{id: '224', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '169 JUMPDEST\n170 PUSH2 0x00de\n173 PUSH1 0x04\n175 DUP1\n176 DUP1\n177 CALLDATALOAD\n(click to expand +)', 'fullLabel': '169 JUMPDEST\n170 PUSH2 0x00de\n173 PUSH1 0x04\n175 DUP1\n176 DUP1\n177 CALLDATALOAD\n178 PUSH20 0xffffffff(...)\n199 AND\n200 SWAP1\n201 PUSH1 0x20\n203 ADD\n204 SWAP1\n205 SWAP2\n206 SWAP1\n207 DUP1\n208 CALLDATALOAD\n209 SWAP1\n210 PUSH1 0x20\n212 ADD\n213 SWAP1\n214 SWAP2\n215 SWAP1\n216 POP\n217 POP\n218 PUSH2 0x0110\n221 JUMP\n', 'truncLabel': '169 JUMPDEST\n170 PUSH2 0x00de\n173 PUSH1 0x04\n175 DUP1\n176 DUP1\n177 CALLDATALOAD\n(click to expand +)', 'isExpanded': false},
{id: '231', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '165 PUSH1 0x00\n167 DUP1\n168 REVERT\n', 'fullLabel': '165 PUSH1 0x00\n167 DUP1\n168 REVERT\n', 'truncLabel': '165 PUSH1 0x00\n167 DUP1\n168 REVERT\n', 'isExpanded': false},
{id: '223', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '158 sendToken(address,uint256)\n159 CALLVALUE\n160 ISZERO\n161 PUSH2 0x00a9\n164 JUMPI\n', 'fullLabel': '158 sendToken(address,uint256)\n159 CALLVALUE\n160 ISZERO\n161 PUSH2 0x00a9\n164 JUMPI\n', 'truncLabel': '158 sendToken(address,uint256)\n159 CALLVALUE\n160 ISZERO\n161 PUSH2 0x00a9\n164 JUMPI\n', 'isExpanded': false},
{id: '232', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '76 JUMPDEST\n77 PUSH1 0x00\n79 DUP1\n80 REVERT\n', 'fullLabel': '76 JUMPDEST\n77 PUSH1 0x00\n79 DUP1\n80 REVERT\n', 'truncLabel': '76 JUMPDEST\n77 PUSH1 0x00\n79 DUP1\n80 REVERT\n', 'isExpanded': false},
{id: '222', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '65 DUP1\n66 PUSH4 0x412664ae\n71 EQ\n72 PUSH2 0x009e\n75 JUMPI\n', 'fullLabel': '65 DUP1\n66 PUSH4 0x412664ae\n71 EQ\n72 PUSH2 0x009e\n75 JUMPI\n', 'truncLabel': '65 DUP1\n66 PUSH4 0x412664ae\n71 EQ\n72 PUSH2 0x009e\n75 JUMPI\n', 'isExpanded': false},
{id: '216', color: {border: '#26996f', background: '#2f7e5b', highlight: {border: '#26996f', background: '#28a16f'}}, size: 150, 'label': '13 PUSH1 0x00\n15 CALLDATALOAD\n16 PUSH29 0x01000000(...)\n46 SWAP1\n47 DIV\n48 PUSH4 0xffffffff\n(click to expand +)', 'fullLabel': '13 PUSH1 0x00\n15 CALLDATALOAD\n16 PUSH29 0x01000000(...)\n46 SWAP1\n47 DIV\n48 PUSH4 0xffffffff\n53 AND\n54 DUP1\n55 PUSH4 0x27e235e3\n60 EQ\n61 PUSH2 0x0051\n64 JUMPI\n', 'truncLabel': '13 PUSH1 0x00\n15 CALLDATALOAD\n16 PUSH29 0x01000000(...)\n46 SWAP1\n47 DIV\n48 PUSH4 0xffffffff\n(click to expand +)', 'isExpanded': false},
{id: '214', 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 PUSH2 0x004c\n12 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: '214', to: '215', 'arrows': 'to', 'label': 'Not(ULE(4, calldatasize_metaCoin))', 'smooth': {'type': 'cubicBezier'}},
{from: '219', to: '220', 'arrows': 'to', 'label': '', 'smooth': {'type': 'cubicBezier'}},
{from: '218', to: '219', 'arrows': 'to', 'label': '', 'smooth': {'type': 'cubicBezier'}},
{from: '217', to: '218', 'arrows': 'to', 'label': 'callvalue == 0', 'smooth': {'type': 'cubicBezier'}},
{from: '217', to: '221', 'arrows': 'to', 'label': 'Not(callvalue == 0)', 'smooth': {'type': 'cubicBezier'}},
{from: '216', to: '217', 'arrows': 'to', 'label': 'Extract(0xff, 0xe0, calldata_metaCoin_0) == 0x27e235e3', 'smooth': {'type': 'cubicBezier'}},
{from: '226', to: '227', 'arrows': 'to', 'label': '', 'smooth': {'type': 'cubicBezier'}},
{from: '225', to: '226', 'arrows': 'to', 'label': 'ULE(calldata_metaCoin_32 + 4, storage_keccac_10x50d672faf1bc6a29698f4ed480beffffffffffff_&0xffffffffffffffffffffffffffffffffffffffff_&caller)', 'smooth': {'type': 'cubicBezier'}},
{from: '229', to: '230', 'arrows': 'to', 'label': '', 'smooth': {'type': 'cubicBezier'}},
{from: '228', to: '229', 'arrows': 'to', 'label': '', 'smooth': {'type': 'cubicBezier'}},
{from: '225', to: '228', 'arrows': 'to', 'label': 'Not(ULE(calldata_metaCoin_32 + 4, storage_keccac_10x50d672faf1bc6a29698f4ed480beffffffffffff_&0xffffffffffffffffffffffffffffffffffffffff_&caller))', 'smooth': {'type': 'cubicBezier'}},
{from: '224', to: '225', 'arrows': 'to', 'label': '', 'smooth': {'type': 'cubicBezier'}},
{from: '223', to: '224', 'arrows': 'to', 'label': 'callvalue == 0', 'smooth': {'type': 'cubicBezier'}},
{from: '223', to: '231', 'arrows': 'to', 'label': 'Not(callvalue == 0)', 'smooth': {'type': 'cubicBezier'}},
{from: '222', to: '223', 'arrows': 'to', 'label': 'Extract(0xff, 0xe0, calldata_metaCoin_0) == 0x412664ae', 'smooth': {'type': 'cubicBezier'}},
{from: '222', to: '232', 'arrows': 'to', 'label': 'Not(Extract(0xff, 0xe0, calldata_metaCoin_0) == 0x412664ae)', 'smooth': {'type': 'cubicBezier'}},
{from: '216', to: '222', 'arrows': 'to', 'label': 'Not(Extract(0xff, 0xe0, calldata_metaCoin_0) == 0x27e235e3)', 'smooth': {'type': 'cubicBezier'}},
{from: '214', to: '216', 'arrows': 'to', 'label': 'ULE(4, calldatasize_metaCoin)', '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>