Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Pattern-matching assembly #8

Open
fubuloubu opened this issue Mar 5, 2022 · 0 comments
Open

Support Pattern-matching assembly #8

fubuloubu opened this issue Mar 5, 2022 · 0 comments

Comments

@fubuloubu
Copy link
Member

For example, if we would want to detect that a particular code was an EIP-1167 proxy, it would be helpful to do a regex against the disassembled code with a wildcard in it:

^
CALLDATASIZE
RETURNDATASIZE
RETURNDATASIZE
CALLDATASIZE
RETURNDATASIZE
RETURNDATASIZE
RETURNDATASIZE
CALLDATASIZE
RETURNDATASIZE
PUSH20 * <--- wildcard here
GAS
DELEGATECALL
RETURNDATASIZE
DUP3
DUP1
RETURNDATACOPY
SWAP1
RETURNDATASIZE
SWAP2
PUSH1 0x2b
JUMPI
REVERT
JUMPDEST
RETURN
$

Could also do other types of checks like finding if a contact's code contains a particular address:

PUSH20 {address}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant