Skip to content

kirkwood/solidity-disassembler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Quick and dirty disassembler for solidity contract binaries.

go build  -o disassemble *.go

Takes the filename:

$ ./disassemble SimpleStorage.bin
   0 0x00000000 0x60 PUSH1        0x60
   2 0x00000002 0x60 PUSH1        0x40
   4 0x00000004 0x52 MSTORE      
   5 0x00000005 0x34 CALLVALUE   
   6 0x00000006 0x15 ISZERO      
   7 0x00000007 0x61 PUSH2        0x000c
  10 0x0000000a 0x57 JUMPI       
  11 0x0000000b 0xfe INVALID     
  12 0x0000000c 0x5b JUMPDEST    
  13 0x0000000d 0x5b JUMPDEST    
  14 0x0000000e 0x60 PUSH1        0xc6
  16 0x00000010 0x80 DUP1        
  17 0x00000011 0x61 PUSH2        0x001b
  20 0x00000014 0x60 PUSH1        0x00
  22 0x00000016 0x39 CODECOPY    
  23 0x00000017 0x60 PUSH1        0x00
  25 0x00000019 0xf3 RETURN      
  26 0x0000001a 0x00 STOP        
  27 0x0000001b 0x60 PUSH1        0x60
  29 0x0000001d 0x60 PUSH1        0x40
  31 0x0000001f 0x52 MSTORE      
  32 0x00000020 0x60 PUSH1        0x00
  34 0x00000022 0x35 CALLDATALOAD
  35 0x00000023 0x7c PUSH29       0x0100000000000000000000000000000000000000000000000000000000
  65 0x00000041 0x90 SWAP1       
  66 0x00000042 0x04 DIV         
  67 0x00000043 0x63 PUSH4        0xffffffff
  72 0x00000048 0x16 AND         
  73 0x00000049 0x80 DUP1        
  74 0x0000004a 0x63 PUSH4        0x60fe47b1
  79 0x0000004f 0x14 EQ          
  80 0x00000050 0x60 PUSH1        0x44
  82 0x00000052 0x57 JUMPI       
  83 0x00000053 0x80 DUP1        
  84 0x00000054 0x63 PUSH4        0x6d4ce63c
  89 0x00000059 0x14 EQ          
  90 0x0000005a 0x60 PUSH1        0x61
  92 0x0000005c 0x57 JUMPI       
  93 0x0000005d 0x5b JUMPDEST    
  94 0x0000005e 0xfe INVALID     
  95 0x0000005f 0x5b JUMPDEST    
  96 0x00000060 0x34 CALLVALUE   
  97 0x00000061 0x15 ISZERO      
  98 0x00000062 0x60 PUSH1        0x4b
 100 0x00000064 0x57 JUMPI       
 101 0x00000065 0xfe INVALID     
 102 0x00000066 0x5b JUMPDEST    
 103 0x00000067 0x60 PUSH1        0x5f
 105 0x00000069 0x60 PUSH1        0x04
 107 0x0000006b 0x80 DUP1        
 108 0x0000006c 0x80 DUP1        
 109 0x0000006d 0x35 CALLDATALOAD
 110 0x0000006e 0x90 SWAP1       
 111 0x0000006f 0x60 PUSH1        0x20
 113 0x00000071 0x01 ADD         
 114 0x00000072 0x90 SWAP1       
 115 0x00000073 0x91 SWAP2       
 116 0x00000074 0x90 SWAP1       
 117 0x00000075 0x50 POP         
 118 0x00000076 0x50 POP         
 119 0x00000077 0x60 PUSH1        0x84
 121 0x00000079 0x56 JUMP        
 122 0x0000007a 0x5b JUMPDEST    
 123 0x0000007b 0x00 STOP        
 124 0x0000007c 0x5b JUMPDEST    
 125 0x0000007d 0x34 CALLVALUE   
 126 0x0000007e 0x15 ISZERO      
 127 0x0000007f 0x60 PUSH1        0x68
 129 0x00000081 0x57 JUMPI       
 130 0x00000082 0xfe INVALID     
 131 0x00000083 0x5b JUMPDEST    
 132 0x00000084 0x60 PUSH1        0x6e
 134 0x00000086 0x60 PUSH1        0x8f
 136 0x00000088 0x56 JUMP        
 137 0x00000089 0x5b JUMPDEST    
 138 0x0000008a 0x60 PUSH1        0x40
 140 0x0000008c 0x51 MLOAD       
 141 0x0000008d 0x80 DUP1        
 142 0x0000008e 0x82 DUP3        
 143 0x0000008f 0x81 DUP2        
 144 0x00000090 0x52 MSTORE      
 145 0x00000091 0x60 PUSH1        0x20
 147 0x00000093 0x01 ADD         
 148 0x00000094 0x91 SWAP2       
 149 0x00000095 0x50 POP         
 150 0x00000096 0x50 POP         
 151 0x00000097 0x60 PUSH1        0x40
 153 0x00000099 0x51 MLOAD       
 154 0x0000009a 0x80 DUP1        
 155 0x0000009b 0x91 SWAP2       
 156 0x0000009c 0x03 SUB         
 157 0x0000009d 0x90 SWAP1       
 158 0x0000009e 0xf3 RETURN      
 159 0x0000009f 0x5b JUMPDEST    
 160 0x000000a0 0x80 DUP1        
 161 0x000000a1 0x60 PUSH1        0x00
 163 0x000000a3 0x81 DUP2        
 164 0x000000a4 0x90 SWAP1       
 165 0x000000a5 0x55 SSTORE      
 166 0x000000a6 0x50 POP         
 167 0x000000a7 0x5b JUMPDEST    
 168 0x000000a8 0x50 POP         
 169 0x000000a9 0x56 JUMP        
 170 0x000000aa 0x5b JUMPDEST    
 171 0x000000ab 0x60 PUSH1        0x00
 173 0x000000ad 0x60 PUSH1        0x00
 175 0x000000af 0x54 SLOAD       
 176 0x000000b0 0x90 SWAP1       
 177 0x000000b1 0x50 POP         
 178 0x000000b2 0x5b JUMPDEST    
 179 0x000000b3 0x90 SWAP1       
 180 0x000000b4 0x56 JUMP        
 181 0x000000b5 0x00 STOP        
 182 0x000000b6 0xa1 LOG1        
 183 0x000000b7 0x65 PUSH6        0x627a7a723058
 190 0x000000be 0x20 SHA3        
 191 0x000000bf 0x0a EXP         
 192 0x000000c0 0x40 BLOCKHASH   
 193 0x000000c1 0x16 AND         
 194 0x000000c2 0xc3 INVALID     
 195 0x000000c3 0xa3 LOG3        
 196 0x000000c4 0x9e SWAP15      
 197 0x000000c5 0x4e INVALID     
 198 0x000000c6 0xc4 INVALID     
 199 0x000000c7 0x03 SUB         
 200 0x000000c8 0x06 MOD         
 201 0x000000c9 0xee INVALID     
 202 0x000000ca 0x3e INVALID     
 203 0x000000cb 0x0b SIGNEXTEND  
 204 0x000000cc 0x90 SWAP1       
 205 0x000000cd 0x98 SWAP9       
 206 0x000000ce 0x3b EXTCODESIZE 
 207 0x000000cf 0xec INVALID     
 208 0x000000d0 0xb8 INVALID     
 209 0x000000d1 0x02 MUL         
 210 0x000000d2 0xe8 INVALID     
 211 0x000000d3 0xa2 LOG2        
 212 0x000000d4 0xb6 INVALID     
 213 0x000000d5 0x5f INVALID     
 214 0x000000d6 0xa4 LOG4        
 215 0x000000d7 0x1e INVALID     
 216 0x000000d8 0x36 CALLDATASIZE
 217 0x000000d9 0x64 PUSH5        0x9f164396c6
 223 0x000000df 0x00 STOP        
 224 0x000000e0 0x29 INVALID     

About

Simple disassembler for solidity contract binaries.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages