【区块链】EVM反编译软件Porosity的使用-mac
来源:互联网 发布:无线摄像头破解软件 编辑:程序博客网 时间:2024/05/18 03:05
EVM反编译软件Porosity的使用-mac
首先给出 porosity 的 GitHub 地址: here
本文也是根据这个网址进行学习。
1. 创建和约
可以使用自己写的合约,也可以在etherscan 上面找一些合约, 给出例子如下:
//vulnerable.sol pragma solidity ^0.4.4;contract SendBalance { mapping ( address => uint ) userBalances; function SendBalance(){ } function getBalance (address u) constant returns ( uint ){ return userBalances [u]; } function addToBalance () payable{ userBalances[msg.sender] += msg.value ; } function withdrawBalance (){ if (!(msg.sender.call.gas(0x1111).value ( userBalances [msg . sender])())) { throw ; } userBalances [msg.sender ] = 0; }}
2. 下载porosity 并编译
下载之后,在终端进入porosity/porosity/porosity目录然后输入:make //编译你会看到生成了porosity(exec)
3. 使用porosity
a. 在porosity下创建文件夹 solidity-example (自己取得名字随意创),并将合约放在该目录下面。
b. 创建decompile.sh
#!/bin/bashsolc --abi -o output vulnerable.solsolc --bin -o output vulnerable.solsolc --bin-runtime -o output vulnerable.solabi=$(< output/SendBalance.abi)echo "This is abi variable: "echo $abibin=$(< output/SendBalance.bin)echo ""echo "This is bin variable: "echo $binbinRuntime=$(< output/SendBalance.bin-runtime)echo ""echo "This is binruntime variable: "echo $binRuntimeecho ""echo "Firstly listing functions: "#注意路径,指向的是前面编译之后生成的porosity文件../porosity/porosity/porosity --code $bin --abi $abi --list --verbose 0 echo "Now performing decompilation: " ../porosity/porosity/porosity --code $bin --abi $abi --decompile --verbose 0
c. 授权decompile.sh (只有第一次需要)
输入:chmod 777 decompile.sh
d.运行decompile.sh
输入:./decompile.sh
e. 结果,类似于
Porosity v0.1 (https://www.comae.io)Matt Suiche, Comae Technologies <support@comae.io>The Ethereum bytecode commandline decompiler.Decompiles the given Ethereum input bytecode and outputs the Solidity code.Attempting to parse ABI definition...Success.[+] Hash: 0x0A19B14A (trade) (1 references)[+] Hash: 0x0B927666 (order) (1 references)[+] Hash: 0x19774D43 (orderFills) (1 references)[+] Hash: 0x278B8C0E (cancelOrder) (1 references)[+] Hash: 0x2E1A7D4D (withdraw) (1 references)[+] Hash: 0x338B5DEA (depositToken) (1 references)[+] Hash: 0x46BE96C3 (amountFilled) (1 references)[+] Hash: 0x508493BC (tokens) (1 references)[+] Hash: 0x54D03B5C (changeFeeMake) (1 references)[+] Hash: 0x57786394 (feeMake) (1 references)[+] Hash: 0x5E1D7AE4 (changeFeeRebate) (1 references)[+] Hash: 0x65E17C9D (feeAccount) (1 references)[+] Hash: 0x6C86888B (testTrade) (1 references)[+] Hash: 0x71FFCB16 (changeFeeAccount) (1 references)[+] Hash: 0x731C2F81 (feeRebate) (1 references)[+] Hash: 0x8823A9C0 (changeFeeTake) (1 references)[+] Hash: 0x8F283970 (changeAdmin) (1 references)[+] Hash: 0x9E281A98 (withdrawToken) (1 references)[+] Hash: 0xBB5F4629 (orders) (1 references)[+] Hash: 0xC281309E (feeTake) (1 references)[+] Hash: 0xD0E30DB0 (deposit) (1 references)[+] Hash: 0xE8F6BC2E (changeAccountLevelsAddr) (1 references)[+] Hash: 0xF3412942 (accountLevelsAddr) (1 references)[+] Hash: 0xF7888AEC (balanceOf) (1 references)[+] Hash: 0xF851A440 (admin) (1 references)[+] Hash: 0xFB6E155F (availableVolume) (1 references)
阅读全文
0 0
- 【区块链】EVM反编译软件Porosity的使用-mac
- 【区块链】以太坊源码学习 -- EVM
- ILSpy反编译软件的使用
- Mac OS Xapk反编译工具包的使用
- mac环境的apk反编译工具使用
- 反编译Delphi软件DEDE的使用
- 我是如何使用Android反编译软件的?
- 反编译软件ILSpy的使用教程
- JADX反编译软件使用
- Mac 使用apktool反编译apk
- Mac 使用apktool反编译apk
- 使用EVM进行项目管理时的注意事项
- 使用EVM进行项目管理时的注意事项
- 区块链的区块结构
- apk反编译软件apktool使用
- AndroidKill反编译软件使用详解
- 如何使用反编译软件破解android的布局文件
- 使用ILSpy软件反编译.Net应用程序的方法及注意事项
- hdu 1166 敌兵布阵
- Win10中Docker下修改mysql配置(主要修改utf-8字符集)
- 详解vue之better-scroll实现轮播图和页面滚动
- [SDOI2009]学校食堂Dining(洛谷2157)
- NavigationView控件
- 【区块链】EVM反编译软件Porosity的使用-mac
- matlib与excel交互
- POJ_3468 A Simple Problem with Integers(线段树区间修改+附线段树模板)
- electron打包
- poj 3013 Big Christmas Tree 最短路 (转换思维,看点不看边)
- maven用变量的方法统一管理jar包版本
- LeetCode-83-Remove Duplicates from Sorted List 链表水题
- 马踏棋盘
- java远程连接数据库