工具:

  1. 在线decompile:https://www.ethervm.io/decompile
  2. 命令行decompile:https://github.com/Arachnid/evmdis
  3. python decompile:https://github.com/crytic/pyevmasm
  4. 图形化decompile:https://github.com/crytic/ethersplay
  5. 其他:https://www.pnfsoftware.com/blog/ethereum-smart-contract-decompiler/
  6. signature查询:https://www.4byte.directory/

反汇编系列文章

  1. Reversing and debugging EVM Smart contracts: First steps in assembly\ (part 1️⃣)
  2. Reversing and debugging EVM Smart contracts: Deployment of a smart contract (Part\ 2️⃣)\
  3. Reversing and debugging EVM Smart contracts: How the storage layout works? (part\ 3️⃣)\
  4. Reversing and Debugging EVM Smart contracts: 5 Instructions to end/abort the Execution (part\ 4️⃣)\
  5. Reversing and debugging EVM Smart contracts: The Execution flow if/else/for/functions (part\ 5️⃣)\
  6. Reversing and debugging EVM Smart contracts: Full Smart Contract layout (part\ 6️⃣)\
  7. Reversing and debugging EVM Smart contracts: External Calls and contract deployment (part 7️⃣)

计算方法的sig

https://web3playground.io/

 async function main() {
   let transferEvent = "Transfer(address,address,uint256)"
   let sig1 = web3.eth.abi.encodeEventSignature(transferEvent)
   let sig2 = web3.eth.abi.encodeFunctionSignature(transferEvent)

   //should be: 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
   console.log('event sig1:', sig1)
   console.log('event sig2:', sig2)

   let transferFun = "test()"
   let sig3 = web3.eth.abi.encodeFunctionSignature(transferFun)
   console.log('Function sig:', sig3)
 }