evm_cfg_builder icon indicating copy to clipboard operation
evm_cfg_builder copied to clipboard

Create Gidhra plugin

Open montyly opened this issue 5 years ago • 12 comments

Task Description

We should have a Ghidra plugin for evm-cfg-builder.

Acceptance criteria

  • [ ] An evm file can be loaded in Ghidra
  • [ ] The CFG is shown
  • [ ] The function's name is shown (if recovered by evm-cfg-builder)

Required Skills

  • [ ] Reverse engineering experience
  • [ ] Ghidra or IDA experience
  • [ ] Experience with Python 3.6
  • [ ] Experience with Solidity smart contracts

Feel free to ask questions here, or join our slack (#ethereum)

montyly avatar Nov 06 '19 07:11 montyly

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 200.0 SAI (200.0 USD @ $1.0/SAI) attached to it.

gitcoinbot avatar Nov 21 '19 17:11 gitcoinbot

Issue Status: 1. Open 2. Cancelled


Work has been started.

These users each claimed they can complete the work by 6 days, 9 hours from now. Please review their action plans below:

1) igetgames has applied to start work (Funders only: approve worker | reject worker).

I've used IDA Pro for years and have recently been exploring Ghidra and it's rapidly growing ecosystem. This is a cool bounty and I'd love to give it a shot! 2) alagla has been approved to start work.

since Python is not supported for plugins in ghidra. I'll check how feasible is it implement a Java plugin. then build that in a separate repo maybe.

Learn more on the Gitcoin Issue Details page.

gitcoinbot avatar Nov 21 '19 20:11 gitcoinbot

Ghidra plugins are only built with java. there's no python plugin support.

hackphobic avatar Nov 21 '19 21:11 hackphobic

Hi @igetgames and @alagla, thank you for your interest in this bounty. Could you describe a bit more about your plan to solve this issue?

@alagla , my understanding is that Ghidra supports Jython, or alternatively ghidra-bridge can be used. If both solutions are not good, I am ok if the solution does something like:

  • evm-cfg-builder exports the CFG in a json (or another format)
  • the ghidra plugin loads the info, and displays it

montyly avatar Nov 22 '19 17:11 montyly

@montyly correct me if i'm wrong, it seems to me Ghidra won't be able to load and analyze an evm bytecode without building an internal representation of that first. neither Jython or ghidra_bridge has the functionality to do that.

I can attempt a Java plugin that consumes .dot files from evm-cfg-builder and process the data in natively.

hackphobic avatar Nov 24 '19 00:11 hackphobic

I'll start working when I get accepted on gitcoin. Thanks

hackphobic avatar Nov 26 '19 21:11 hackphobic

⚡️ A tip worth 250.00000 SAI (250.0 USD @ $1.0/SAI) has been granted to @alagla for this issue from @ceresstation. ⚡️

Nice work @alagla! To redeem your tip, login to Gitcoin at https://gitcoin.co/explorer and select 'Claim Tip' from dropdown menu in the top right, or check your email for a link to the tip redemption page.

  • $96771.66 in Funded OSS Work Available at: https://gitcoin.co/explorer
  • Incentivize contributions to your repo: Send a Tip or Fund a PR
  • No Email? Get help on the Gitcoin Slack

gitcoinbot avatar Dec 09 '19 17:12 gitcoinbot

@alagla Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • [x] reminder (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

gitcoinbot avatar Dec 13 '19 17:12 gitcoinbot

@alagla Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • [x] reminder (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

gitcoinbot avatar Dec 13 '19 17:12 gitcoinbot

Yes, I'm working on it.

hackphobic avatar Dec 13 '19 23:12 hackphobic

Issue Status: 1. Open 2. Cancelled


The funding of 200.0 SAI (200.0 USD @ $1.0/SAI) attached to this issue has been cancelled by the bounty submitter

gitcoinbot avatar Dec 15 '19 21:12 gitcoinbot

Hello, I wonder what is the status of this issue. I've built a Ghidra module for disassembling EVM bytecode and creating the CFG via evm_cfg_builder in https://github.com/adelapie/ghidra-evm. It would be great to receive feedback.

adelapie avatar Nov 09 '20 17:11 adelapie