Giter Site home page Giter Site logo

jon-becker / heimdall-rs Goto Github PK

View Code? Open in Web Editor NEW
1.1K 15.0 108.0 5.76 MB

Heimdall is an advanced EVM smart contract toolkit specializing in bytecode analysis and extracting information from unverified contracts.

Home Page: http://heimdall.rs

License: MIT License

Shell 0.94% Rust 99.06%
ethereum decompiler eth evm toolkit rust decoder disassembler cfg security

heimdall-rs's Introduction

heimdall-rs

splash preview

GitHub Workflow Status (with event) GitHub release (with filter)

Overview

Heimdall is an advanced EVM smart contract toolkit specializing in bytecode analysis. Heimdall is written in Rust and is designed to be fast, modular, and more accurate than other existing tools.

Currently, Heimdall supports the following operations:

  • EVM Bytecode Disassembly
  • EVM Smart-Contract Control Flow Graph Generation
  • EVM Smart-Contract Decompilation
  • Smart-Contract Storage Dumping
  • Transaction Calldata Decoding

Installation & Usage

Ensure that Rust & Cargo are installed:

curl https://sh.rustup.rs -sSf | sh

Heimdall's update and installation manager, bifrost, can be installed using the following command:

curl -L http://get.heimdall.rs | bash

If you want to manually install bifrost, you can download the latest release from here.

Once you have installed bifrost, you can use it to install Heimdall using the following command from a new terminal:

bifrost

After compilation, the heimdall command will be available to use from a new terminal. For advanced options, see the bifrost documentation.

Having trouble? Check out the Troubleshooting section in the wiki.

Documentation

Documentation for all of heimdall-rs is available in the wiki.

Examples

Examples for heimdall-rs modules are available in the wiki.

Contributing

If you'd like to contribute to Heimdall or add a module, please open a pull-request with your changes, as well as detailed information on what is changed, added, or improved.

For more detailed information, see the contributing guide.

Issues

If you've found an issue or have a question, please open an issue here. All issues must follow their respective templates.

Credits

A list of all contributors can be found in the wiki.

heimdall-rs's People

Contributors

davideaimar avatar github-actions[bot] avatar iankressin avatar jeffchen006 avatar jmcph4 avatar jon-becker avatar junomonster avatar krakovia-evm avatar lidarbtc avatar mattsse avatar nodauf avatar perama-v avatar praneshasp avatar qd-qd avatar solidoracle avatar sslivkoff avatar xiaoxianboy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

heimdall-rs's Issues

[Question]: Can you generate an accurate solidity contract from bytecode if you already have the ABI?

Version

0.4.5

Please check the following

  • This is not a duplicate question
  • I have checked the wiki beforehand

Operating System

Linux

Ask your question here

Can you generate a more accurate solidity contract if you already have the ABI (and the bytecode)? My problem is I want to decompile a few contracts, I already have the ABI (+bytecode) for them, but don't have access to the contracts. Maybe this could be a potential new feature if not implemented, perhaps by adding an --abi flag with an abi input to the heimdall compile command.

Thank you for your time and for the awesome tool!

Improvement: refactor to allow use as library w/o IO dependency

Please check the following

  • This is not a duplicate request
  • I have checked that this is not in development

Type a detailed explanation of your improvement request here.

Ensure all modules return a type like: DecompileResult which can be ingested by a dependent or output to IO (in the case of the CLI)

[Question]: Solidity output includes storage mapping access, causes compilation error "Expected primary expression"

Version

Version 0.4.2:

Please check the following

  • This is not a duplicate question
  • I have checked the wiki beforehand

Operating System

macOS (Apple Silicon)

Ask your question here

Hi, I am asking this as a question, not a bug, as it is most likely me misunderstanding some aspect of the project.

I have decompiled a solidity contract and it has accesses to a global storage map, to access storage variables, and my solidity compiler won't compile this and complains with the error "Expected primary expression".

Can this be changed so an equivalent solidity output is generated, which can compiler, or is the solidity output not meant to able to be compiled and is just for illustration?

Thanks,
Pepperstepper.

[Bug]: Decompilation output is not written to decompiled.sol

Component

Heimdall Modules

Version

0.1.5

Please check the following

  • This is not a duplicate issue
  • I have checked the wiki and tried troubleshooting the issue

Operating System

Linux

Describe the issue you are facing

Should these lines in output.rs be uncommented to make it work?

// write_lines_to_file(
//     &decompiled_output_path,
//     decompiled_output
// );
//
// logger.info(&format!("wrote decompiled solidity to '{}' .", decompiled_output_path).to_string());

[Feature]: CSV output for Snapshot Module

Please check the following

  • This is not a duplicate request
  • I have checked that this is not in development

Type a detailed explanation of your feature request here.

Will allow for the snapshot module to output a CSV containing relevant information.

The TUI may eventually depend on this CSV rather than what it is now.

[Bug]: Disassemble Module Structuring

Component

Disassemble Library

Version

0.6.3

Please check the following

  • This is not a duplicate issue
  • I have checked the wiki and tried troubleshooting the issue

Operating System

macOS (Apple Silicon)

Command used to produce the issue

No response

Describe the issue you are facing

All libraries are exposed under the format use heimdall_core::{{module}}::{{Module}}ArgsBuilder;, except for disassemble which lives in heimdall_common::ether::evm::ext::disassemble.

TODO: add builder pattern and relocate disassembly code.

[Bug]: Transaction Decode Issue

Component

Decode Module

Version

heimdall 0.5.2

Please check the following

  • This is not a duplicate issue
  • I have checked the wiki and tried troubleshooting the issue

Operating System

None

Command used to produce the issue

heimdall decode 0x33b0a98f16e4741bb0869b02481c1cb418bef6c144d6de44515c83c975678e5e -vvv -r https://ethereum.publicnode.com

Describe the issue you are facing

Unable to decode the function name.
Etherscan: https://etherscan.io/tx/0x33b0a98f16e4741bb0869b02481c1cb418bef6c144d6de44515c83c975678e5e
Output:

trace:
  [217] heimdall::decode(0x33b0a98f16e4741bb0869b02481c1cb418bef6c144d6de44515c83c975678e5e)
    │
    ├─ selector: 0x6a761202
    ├─ calldata: 644 bytes
    │
    ├─ input 0:  000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
    │        1:  0000000000000000000000000000000000000000000000000000000000000000
    │        2:  0000000000000000000000000000000000000000000000000000000000000140
    │        3:  0000000000000000000000000000000000000000000000000000000000000000
    │        4:  0000000000000000000000000000000000000000000000000000000000000000
    │        5:  0000000000000000000000000000000000000000000000000000000000000000
    │        6:  0000000000000000000000000000000000000000000000000000000000000000
    │        7:  0000000000000000000000000000000000000000000000000000000000000000
    │        8:  0000000000000000000000000000000000000000000000000000000000000000
    │        9:  00000000000000000000000000000000000000000000000000000000000001c0
    │        10: 0000000000000000000000000000000000000000000000000000000000000044
    │        11: a9059cbb0000000000000000000000007efcdafe0b6f609b4f8cd54617872f87
    │        12: ca0ea5ab00000000000000000000000000000000000000000000000000000000
    │        13: 448b9b8000000000000000000000000000000000000000000000000000000000
    │        14: 0000000000000000000000000000000000000000000000000000000000000082
    │        15: 958fd83b551d854e5756b9ed62883c2698d8ec597e753079fbc86d62bb38d2e5
    │        16: 3308edc03374741d80707a90afb01236e86f99071ebb480f28ed82ff8e0463ed
    │        17: 1b000000000000000000000000e3abcd85aa20279297ae52552758d6c4878c5d
    │        18: 0c00000000000000000000000000000000000000000000000000000000000000
    │        19: 0001000000000000000000000000000000000000000000000000000000000000
    └─ ← ()

[Bug]: Block forever while decompiling some contract

Component

Decompile Module

Version

heimdall 0.4.4

Please check the following

  • This is not a duplicate issue
  • I have checked the wiki and tried troubleshooting the issue

Operating System

Linux

Command used to produce the issue

eth chain contract address 0xE8c060F8052E07423f71D445277c61AC5138A2e5
heimdall decompile 0xE8c060F8052E07423f71D445277c61AC5138A2e5 --skip-resolving --rpc-url http://1.168.0.1:8545

Describe the issue you are facing

It seems that heimdall entered a deadloop

[Feature]: Change the Disassembler's Code Indices

Please check the following

  • This is not a duplicate request
  • I have checked that this is not in development

Type a detailed explanation of your feature request here.

The code indices in the disassembler output are in decimal format, however, the push instructions use hexadecimal. Changing the disassembler's code indices to hexadecimal would allow for easier debugging of jump destinations.

Below is an example where using hexadecimal in the code indices would make finding the jump destination more intuitive at a glance.

// ...
10 JUMPDEST
11 PUSH 0a
12 JUMP
// ...

[Bug]: function parameters amount error

Component

Decompile Module

Version

0.6.4

Please check the following

  • This is not a duplicate issue
  • I have checked the wiki and tried troubleshooting the issue

Operating System

Linux

Command used to produce the issue

heimdall decompile 0x05f016765c6C601fd05a10dBa1AbE21a04F924A5 -vvv -d --include-sol --skip-resolving

Describe the issue you are facing

this is heimdall decompiled result which is wrong

/// @Custom:selector 0xf6ebebbb
/// @Custom:name Unresolved_f6ebebbb
/// @param arg0 ["bytes", "uint256", "int256", "string", "bytes32", "uint", "int"]
/// @param arg1 ["bytes", "uint256", "int256", "string", "bytes32", "uint", "int"]
/// @param arg2 ["address", "bytes", "bytes20", "bytes32", "int", "int160", "int256", "string", "uint", "uint160", "uint256"]
/// @param arg3 ["address", "bytes", "bytes20", "bytes32", "int", "int160", "int256", "string", "uint", "uint160", "uint256"]
function Unresolved_f6ebebbb(bytes memory arg0, bytes memory arg1, address arg2, address arg3) public pure {
require(arg2 == (address(arg2)));
if (arg3 == (address(arg3))) {
}
}

this is from https://contract-library.com/ethereum/address/0x05f016765c6c601fd05a10dba1abe21a04f924a5/decompiled which is correct:

function 0xf6ebebbb(uint256 varg0, uint256 varg1, address varg2, address varg3, address varg4, uint32 varg5, uint128 varg6) public nonPayable {
require(msg.data.length - 4 >= 224);
require(varg2 == varg2);
require(varg3 == varg3);
require(varg4 == varg4);
require(varg5 == varg5);
require(varg6 == varg6);
v0 = 0x1ed2(varg6, varg5, varg4, varg3, varg2, varg1, varg0);
return v0;
}

[Feature]: update core vm to accurately calculate gas

Please check the following

  • This is not a duplicate request
  • I have checked that this is not in development

Type a detailed explanation of your feature request here.

Update heimdall_common::ether::evm::core::vm execution to accurately calculate gas consumption for dynamic consumers, such as MSTORE, SSTORE, etc.

investigate loop breakout

Component

Decompile Library, CFG Module

Version

0.4.8

Please check the following

  • This is not a duplicate issue
  • I have checked the wiki and tried troubleshooting the issue

Operating System

macOS (Apple Silicon)

Command used to produce the issue

No response

Describe the issue you are facing

Contract: 0x18703a4fd7b3688607abf25424b6ab304def2512
Chain ID: 56

mhm not sure about this one

pub enum Subcommands {
#[clap(name = "decompile", about = "Decompile EVM bytecode to Solidity")]
Decompile(decompile::DecompilerArgs),
#[clap(name = "disassemble", about = "Disassemble EVM bytecode to assembly")]
Disassemble(DisassemblerArgs),
#[clap(name = "config", about = "Display and edit the current configuration")]
Config(ConfigArgs),
#[clap(name = "cache", about = "Manage cached files for Heimdall.")]
Cache(decompile::DecompilerArgs),
}

[Bug]: Failure To Decompile And Dissasemble Bytecode In File Despite Valid Bytecode

Component

Heimdall CLI

Version

version: heimdall 0.3.2

Please check the following

  • This is not a duplicate issue
  • I have checked the wiki and tried troubleshooting the issue

Operating System

Linux

Command used to produce the issue

heimdall disassemble

Describe the issue you are facing

Using the latest release of heimdall, im running into an issue when trying to dissasemble/decompile bytecode stored in a file. It gets reported as being invalid, however it is valid because using the bytecode on the CLI itself correct dissasembles the code.

For example consider this bytecode from a random contract i found on etherscan:

$> heimdall disassemble 0x608060405234801561001057600080fd5b50600436106101da5760003560e01c806370a0823111610104578063b88d4fde116100a2578063e985e9c511610071578063e985e9c51461041c578063f2fde38b14610432578063f8004d3114610445578063fd4fe8a81461045857600080fd5b8063b88d4fde146103d5578063c87b56dd146103e3578063d1f5c33b146103f6578063d66fe70e1461040957600080fd5b80638da5cb5b116100de5780638da5cb5b1461038e57806395d89b41146103ac578063a22cb465146103b4578063b510391f146103c257600080fd5b806370a0823114610353578063715018a6146103665780638325c62f1461036e57600080fd5b806324bbd0491161017c5780636352211e1161014b5780636352211e146102fa5780636ba253fd1461030d5780636c19e78314610320578063703199701461033357600080fd5b806324bbd049146102ad5780633f2a5540146102d257806341006605146102f257806342842e0e1461029f57600080fd5b8063095ea7b3116101b8578063095ea7b31461025457806318160ddd14610269578063238ac9331461027f57806323b872dd1461029f57600080fd5b806301ffc9a7146101df57806306fdde0314610207578063081812fc1461021c575b600080fd5b6101f26101ed366004611130565b61046b565b60405190151581526020015b60405180910390f35b61020f61057b565b6040516101fe9190611196565b61022f61022a3660046111e7565b610609565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101fe565b610267610262366004611229565b61063d565b005b61027161066f565b6040519081526020016101fe565b600a5461022f9073ffffffffffffffffffffffffffffffffffffffff1681565b610267610262366004611253565b600a546101f29074010000000000000000000000000000000000000000900460ff1681565b60085461022f9073ffffffffffffffffffffffffffffffffffffffff1681565b610267610692565b61022f6103083660046111e7565b610764565b61026761031b36600461128f565b6107c0565b61026761032e36600461128f565b61080f565b60075461022f9073ffffffffffffffffffffffffffffffffffffffff1681565b61027161036136600461128f565b61085e565b6102676108ea565b60095461022f9073ffffffffffffffffffffffffffffffffffffffff1681565b60065473ffffffffffffffffffffffffffffffffffffffff1661022f565b61020f6108fe565b6102676102623660046112ba565b6102676103d0366004611336565b61090b565b610267610262366004611389565b61020f6103f13660046111e7565b610a8c565b61026761040436600461128f565b610b9f565b6102676104173660046113f8565b610bee565b6101f261042a36600461146d565b600092915050565b61026761044036600461128f565b610c39565b610267610453366004611497565b610cf5565b61026761046636600461128f565b610d47565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a70000000000000000000000000000000000000000000000000000000014806104fe57507fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd00000000000000000000000000000000000000000000000000000000145b8061052957507fffffffff000000000000000000000000000000000000000000000000000000008216155b8061057557507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b92915050565b60008054610588906114b2565b80601f01602080910402602001604051908101604052809291908181526020018280546105b4906114b2565b80156106015780601f106105d657610100808354040283529160200191610601565b820191906000526020600020905b8154815290600101906020018083116105e457829003601f168201915b505050505081565b60006040517fbf9e1a7500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517fbf9e1a7500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060055460016004546106839190611534565b61068d9190611534565b905090565b60095473ffffffffffffffffffffffffffffffffffffffff1633148015906106d2575060065473ffffffffffffffffffffffffffffffffffffffff163314155b15610709576040517f0707164200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408051600081527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60208201527f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c910160405180910390a1565b60008181526002602052604081205473ffffffffffffffffffffffffffffffffffffffff1680610575576040517f3f6cc76800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6107c8610d97565b600980547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610817610d97565b600a80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600073ffffffffffffffffffffffffffffffffffffffff82166108ad576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166000908152600360205260409020546108de5760006108e1565b60015b60ff1692915050565b6108f2610d97565b6108fc6000610e18565b565b60018054610588906114b2565b600a5474010000000000000000000000000000000000000000900460ff1661095f576040517f589ed34b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517fffffffffffffffffffffffffffffffffffffffff00000000000000000000000033606090811b8216602084015285901b1660348201526000906109c090604801604051602081830303815290604052805190602001208484610e8f565b600a5490915073ffffffffffffffffffffffffffffffffffffffff808316911614610a17576040517f8baa579f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff841615610a7d5760405173ffffffffffffffffffffffffffffffffffffffff851681527fcecb5f5b62b88dc819e81f535d3c431ec78987ab181067baac5d532dde7ee38a9060200160405180910390a15b610a8633610eff565b50505050565b60008181526002602052604090205460609073ffffffffffffffffffffffffffffffffffffffff16610aea576040517f3f6cc76800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6007546040517fc87b56dd0000000000000000000000000000000000000000000000000000000081526004810184905273ffffffffffffffffffffffffffffffffffffffff9091169063c87b56dd90602401600060405180830381865afa158015610b59573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526105759190810190611576565b610ba7610d97565b600880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610bf6610d97565b60005b81811015610c3457610c22838383818110610c1657610c16611641565b90506020020135611041565b80610c2c81611670565b915050610bf9565b505050565b610c41610d97565b73ffffffffffffffffffffffffffffffffffffffff8116610ce9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b610cf281610e18565b50565b610cfd610d97565b600a805491151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff909216919091179055565b610d4f610d97565b600780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316179055610cf2610692565b60065473ffffffffffffffffffffffffffffffffffffffff1633146108fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ce0565b6006805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600060418218610ef8576040516040846040377f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a060605111610ef45784600052604084013560001a602052602060406080600060015afa5060006060523d6060185191505b6040525b9392505050565b73ffffffffffffffffffffffffffffffffffffffff8116610f4c576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff811660009081526003602052604090205415610fa9576040517fddefae2800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004805460018101909155600081815260026020908152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff87169081179091558084526003909252808320849055518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60008181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff168061109d576040517f3f6cc76800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815260026020908152604080832080547fffffffffffffffffffffffff000000000000000000000000000000000000000016905573ffffffffffffffffffffffffffffffffffffffff8416808452600390925280832083905560058054600101905551849291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60006020828403121561114257600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610ef857600080fd5b60005b8381101561118d578181015183820152602001611175565b50506000910152565b60208152600082518060208401526111b5816040850160208701611172565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6000602082840312156111f957600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461122457600080fd5b919050565b6000806040838503121561123c57600080fd5b61124583611200565b946020939093013593505050565b60008060006060848603121561126857600080fd5b61127184611200565b925061127f60208501611200565b9150604084013590509250925092565b6000602082840312156112a157600080fd5b610ef882611200565b8035801515811461122457600080fd5b600080604083850312156112cd57600080fd5b6112d683611200565b91506112e4602084016112aa565b90509250929050565b60008083601f8401126112ff57600080fd5b50813567ffffffffffffffff81111561131757600080fd5b60208301915083602082850101111561132f57600080fd5b9250929050565b60008060006040848603121561134b57600080fd5b61135484611200565b9250602084013567ffffffffffffffff81111561137057600080fd5b61137c868287016112ed565b9497909650939450505050565b6000806000806000608086880312156113a157600080fd5b6113aa86611200565b94506113b860208701611200565b935060408601359250606086013567ffffffffffffffff8111156113db57600080fd5b6113e7888289016112ed565b969995985093965092949392505050565b6000806020838503121561140b57600080fd5b823567ffffffffffffffff8082111561142357600080fd5b818501915085601f83011261143757600080fd5b81358181111561144657600080fd5b8660208260051b850101111561145b57600080fd5b60209290920196919550909350505050565b6000806040838503121561148057600080fd5b61148983611200565b91506112e460208401611200565b6000602082840312156114a957600080fd5b610ef8826112aa565b600181811c908216806114c657607f821691505b6020821081036114ff577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561057557610575611505565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561158857600080fd5b815167ffffffffffffffff808211156115a057600080fd5b818401915084601f8301126115b457600080fd5b8151818111156115c6576115c6611547565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561160c5761160c611547565b8160405282815287602084870101111561162557600080fd5b611636836020830160208801611172565b979650505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036116a1576116a1611505565b506001019056fea2646970667358221220df1432e10b439c47c2222cb54563bde482d7a3e8ac331e8e9d23e76a42d80ed664736f6c63430008130033

The above works, but if you place that into a file it does not work anymore:

$> heimdall disassemble data.bin                                                                                                              
error: file 'data.bin' doesn't contain valid bytecode.

[Question]: How to add custom function name to resolver?

Version

gitt

Please check the following

  • This is not a duplicate question
  • I have checked the wiki beforehand

Operating System

None

Ask your question here

while decompiling a smart contract, I've noticed heimdall-rs uses Unresolved_XXXX for functions it does not resolve,
e.g. Unresolved_2eb2c2d6, I've searched 2eb2c2d6 on internet and it may be safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)
(but I've just looked at the number of args and heimdall-rs says (address, address)) whatever

Ho add custom function to heimdall-rs resolver?

[Feature]: Quiet support for heimdall modules

Component

Heimdall Modules

Version

e3f7f9d

Please check the following

  • This is not a duplicate issue
  • I have checked the wiki and tried troubleshooting the issue

Operating System

Linux

Describe the issue you are facing

when called with -q args.verbose.log_level() is None, stack trace:

fatal: thread 'main' encountered a fatal error: 'panicked at 'called `Option::unwrap()` on a `None` value', heimdall/src/decompile/mod.rs:80:67'!
fatal: Stack Trace:

   0:     0x55d03fb4119a - backtrace::backtrace::libunwind::trace::h51f9e3e45311db78
                               at /home/sherpya/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.67/src/backtrace/libunwind.rs:93:5
                           backtrace::backtrace::trace_unsynchronized::h62db8a327a87a81f
                               at /home/sherpya/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.67/src/backtrace/mod.rs:66:5
   1:     0x55d03fb41112 - backtrace::backtrace::trace::h3e89ae4ab8ec64c1
                               at /home/sherpya/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.67/src/backtrace/mod.rs:53:14
   2:     0x55d03fb4813e - backtrace::capture::Backtrace::create::h31bebae4fcade94e
                               at /home/sherpya/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.67/src/capture.rs:176:9
   3:     0x55d03fb4807d - backtrace::capture::Backtrace::new::he2714da285845d1d
                               at /home/sherpya/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.67/src/capture.rs:140:22
   4:     0x55d03ef7ebaa - heimdall::main::{{closure}}::h68885b65f7c3644c
                               at /home/sherpya/workspace/rust/heimdall-rs/heimdall/src/heimdall.rs:58:29
   5:     0x55d03fc33b0a - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h597f484af91b69d8
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/alloc/src/boxed.rs:2002:9
                           std::panicking::rust_panic_with_hook::h32591b11d4f9c8c2
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/panicking.rs:692:13
   6:     0x55d03fc33842 - std::panicking::begin_panic_handler::{{closure}}::hb2b75e52ec6963d4
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/panicking.rs:577:13
   7:     0x55d03fc3210c - std::sys_common::backtrace::__rust_end_short_backtrace::ha859a147e693367c
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/sys_common/backtrace.rs:137:18
   8:     0x55d03fc33592 - rust_begin_unwind
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/panicking.rs:575:5
   9:     0x55d03eeae183 - core::panicking::panic_fmt::hb9e85c5c10f5beb5
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/core/src/panicking.rs:64:14
  10:     0x55d03eeae21d - core::panicking::panic::h20c75b9d7f5b6222
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/core/src/panicking.rs:114:5
  11:     0x55d03f6b970d - core::option::Option<T>::unwrap::he946c47f6d448ac8
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/core/src/option.rs:823:21
  12:     0x55d03ef1e1ac - heimdall::decompile::decompile::hc991c507e11b8dca
                               at /home/sherpya/workspace/rust/heimdall-rs/heimdall/src/decompile/mod.rs:80:42
  13:     0x55d03ef32f43 - heimdall::main::h82f8501c72f5dd69
                               at /home/sherpya/workspace/rust/heimdall-rs/heimdall/src/heimdall.rs:96:13
  14:     0x55d03eec091b - core::ops::function::FnOnce::call_once::hae9ad323ca5e4c1d
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/core/src/ops/function.rs:250:5
  15:     0x55d03ef7db7e - std::sys_common::backtrace::__rust_begin_short_backtrace::hb2c35e84ae59a486
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/sys_common/backtrace.rs:121:18
  16:     0x55d03ef86761 - std::rt::lang_start::{{closure}}::h64b7839ad27f15e4
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/rt.rs:166:18
  17:     0x55d03fc265bc - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hd01415ab94029b94
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/core/src/ops/function.rs:287:13
                           std::panicking::try::do_call::hd7382995764d66b7
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/panicking.rs:483:40
                           std::panicking::try::h902b02812c411c4f
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/panicking.rs:447:19
                           std::panic::catch_unwind::h50ca06a253a6a5eb
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/panic.rs:140:14
                           std::rt::lang_start_internal::{{closure}}::h46023df963196917
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/rt.rs:148:48
                           std::panicking::try::do_call::h47f19c47f3eee146
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/panicking.rs:483:40
                           std::panicking::try::h6dbd690a35c5661c
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/panicking.rs:447:19
                           std::panic::catch_unwind::h71db3d987815ddc7
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/panic.rs:140:14
                           std::rt::lang_start_internal::h7b103af9fb527e07
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/rt.rs:148:20
  18:     0x55d03ef8673a - std::rt::lang_start::hf86b06309b3f933e
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/rt.rs:165:17
  19:     0x55d03ef3496e - main
  20:     0x7f37a956718a - __libc_start_call_main
                               at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  21:     0x7f37a9567245 - __libc_start_main_impl
                               at ./csu/../csu/libc-start.c:381:3
  22:     0x55d03eeae811 - _start
  23:                0x0 - <unknown>

I suppose there is similar problem with analyze command (and possibily other)

[Bug]: Cannot Install Heimdall - "could not compile ethers-contract"

Component

Installing heimdall

Version

Latest bifrost.

Please check the following

  • This is not a duplicate issue
  • I have checked the wiki and tried troubleshooting the issue

Operating System

Linux

Describe the issue you are facing

Compilation error of ethers-contract.

Error log below:

error[E0658]: use of unstable library feature 'into_future'
  --> /home/caleb/.cargo/registry/src/github.com-1ecc6299db9ec823/ethers-contract-1.0.2/src/call.rs:20:22
   |
20 |     future::{Future, IntoFuture},
   |                      ^^^^^^^^^^
   |
   = note: see issue #67644 <https://github.com/rust-lang/rust/issues/67644> for more information

error[E0658]: use of unstable library feature 'into_future'
   --> /home/caleb/.cargo/registry/src/github.com-1ecc6299db9ec823/ethers-contract-1.0.2/src/call.rs:230:5
    |
230 |     type Output = Result<D, ContractError<M>>;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #67644 <https://github.com/rust-lang/rust/issues/67644> for more information

error[E0658]: use of unstable library feature 'into_future'
   --> /home/caleb/.cargo/registry/src/github.com-1ecc6299db9ec823/ethers-contract-1.0.2/src/call.rs:231:5
    |
231 |     type IntoFuture = Pin<Box<dyn Future<Output = Self::Output>>>;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #67644 <https://github.com/rust-lang/rust/issues/67644> for more information

error[E0658]: use of unstable library feature 'into_future'
   --> /home/caleb/.cargo/registry/src/github.com-1ecc6299db9ec823/ethers-contract-1.0.2/src/call.rs:233:5
    |
233 | /     fn into_future(self) -> Self::IntoFuture {
234 | |         Box::pin(async move { self.call().await })
235 | |     }
    | |_____^
    |
    = note: see issue #67644 <https://github.com/rust-lang/rust/issues/67644> for more information

error[E0658]: use of unstable library feature 'into_future'
   --> /home/caleb/.cargo/registry/src/github.com-1ecc6299db9ec823/ethers-contract-1.0.2/src/call.rs:224:12
    |
224 | impl<M, D> IntoFuture for ContractCall<M, D>
    |            ^^^^^^^^^^
    |
    = note: see issue #67644 <https://github.com/rust-lang/rust/issues/67644> for more information

error[E0658]: use of unstable library feature 'into_future'
   --> /home/caleb/.cargo/registry/src/github.com-1ecc6299db9ec823/ethers-contract-1.0.2/src/call.rs:231:51
    |
231 |     type IntoFuture = Pin<Box<dyn Future<Output = Self::Output>>>;
    |                                                   ^^^^^^^^^^^^
    |
    = note: see issue #67644 <https://github.com/rust-lang/rust/issues/67644> for more information

error[E0658]: use of unstable library feature 'into_future'
   --> /home/caleb/.cargo/registry/src/github.com-1ecc6299db9ec823/ethers-contract-1.0.2/src/call.rs:233:29
    |
233 |     fn into_future(self) -> Self::IntoFuture {
    |                             ^^^^^^^^^^^^^^^^
    |
    = note: see issue #67644 <https://github.com/rust-lang/rust/issues/67644> for more information

For more information about this error, try `rustc --explain E0658`.
error: could not compile `ethers-contract` due to 7 previous errors
error: failed to compile `heimdall v0.3.0 (/home/caleb/.bifrost/build/heimdall-rs/heimdall)`, intermediate artifacts can be found at `/home/caleb/.bifrost/build/heimdall-rs/target`
bifrost: required command 'cargo install --path ./heimdall --bins --locked --force --root /home/caleb/.bifrost' failed.

[Bug]: Functions decompiled as empty

Component

Decompile Library

Version

0.3.2

Please check the following

  • This is not a duplicate issue
  • I have checked the wiki and tried troubleshooting the issue

Operating System

macOS (Intel)

Command used to produce the issue

heimdall decompile -r https://polygon-rpc.com/ --include-sol 0xaa3ccffac657cac79dc06226b8d7fcc38e5dd300

Describe the issue you are facing

cc @sherpya

Certain function bodies have no decompiled code, leading to failing to resolve a matching signature for said functions.

Unresolved_2eb2c2d6 should be safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)
and
Unresolved_f242432a should be safeTransferFrom(address,address,uint256,uint256,bytes).

[Bug]: Unable To Use Heimdall From Asynchronous Contexts

Component

Decompile Library

Version

master, revision 6e6f051e373f7c098ee55c3eab70acc24cb77fa8

Please check the following

  • This is not a duplicate issue
  • I have checked the wiki and tried troubleshooting the issue

Operating System

Linux

Command used to produce the issue

Using decode_calldata(tx.input.clone().encode_hex())

Describe the issue you are facing

Usage within an asynchronous context results in the following error

thread '<unnamed>' panicked at 'Cannot drop a runtime in a context where blocking is not allowed. This happens when a runtime is dropped from within an asynchronous context.', /home/solidity/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.25.0/src/runtime/blocking/shutdown.rs:51:21

[Feature]: Integration Module Tests

Please check the following

  • This is not a duplicate request
  • I have checked that this is not in development

Type a detailed explanation of your feature request here.

  • In-depth, assumption based testing on a large number of popular contracts. Might assume things like:
    • Balanced indentation
    • Balanced parentheses
    • Balanced brackets
    • ABI validation
    • Revert logic checks
    • etc

[Bug]: failed to open file

Component

Heimdall CLI

Version

heimdall 0.1.0

Please check the following

  • This is not a duplicate issue
  • I have checked the wiki and tried troubleshooting the issue

Operating System

macOS (Intel)

Describe the issue you are facing

when I run

heimdall disassemble 0x0b061f45000000000000000000000000627a22ff70cb84e74c9c70e2d5b0b75af5a1dcb90000000000000000000000005992f10a5b284be845947a1ae1694f8560a89fa8000000000000000000000000ebe72cdafebc1abf26517dd64b28762df77912a90000000000000000000000008a90cab2b38dba80c64b7734e58ee1db38b8992e0000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000012a900000000000000000000000000000000000000000000000000000000000012b00000000000000000000000000000000000000000000000000000000000000b8c0000000000000000000000000000000000000000000000000000000000001e7e00000000000000000000000000000000000000000000000000000000000010da0000000000000000000000000000000000000000000000000000000000001ed6000000000000000000000000000000000000000000000000000000000000256e0000000000000000000000000000000000000000000000000000000000000643000000000000000000000000000000000000000000000000000000000000119e0000000000000000000000000000000000000000000000000000000000001b1400000000000000000000000000000000000000000000000000000000000004e50000000000000000000000000000000000000000000000000000000000001a6800000000000000000000000000000000000000000000000000000000000024bb000000000000000000000000000000000000000000000000000000000000042b00000000000000000000000000000000000000000000000000000000000000b30000000000000000000000000000000000000000000000000000000000000fb10000000000000000000000000000000000000000000000000000000000001bfd00000000000000000000000000000000000000000000000000000000000002d000000000000000000000000000000000000000000000000000000000000014830000000000000000000000000000000000000000000000000000000000001d01 

I get this error

error: failed to open file '0x0b061f45000000000000000000000000627a22ff70cb84e74c9c70e2d5b0b75af5a1dcb90000000000000000000000005992f10a5b284be845947a1ae1694f8560a89fa8000000000000000000000000ebe72cdafebc1abf26517dd64b28762df77912a90000000000000000000000008a90cab2b38dba80c64b7734e58ee1db38b8992e0000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000012a900000000000000000000000000000000000000000000000000000000000012b00000000000000000000000000000000000000000000000000000000000000b8c0000000000000000000000000000000000000000000000000000000000001e7e00000000000000000000000000000000000000000000000000000000000010da0000000000000000000000000000000000000000000000000000000000001ed6000000000000000000000000000000000000000000000000000000000000256e0000000000000000000000000000000000000000000000000000000000000643000000000000000000000000000000000000000000000000000000000000119e0000000000000000000000000000000000000000000000000000000000001b1400000000000000000000000000000000000000000000000000000000000004e50000000000000000000000000000000000000000000000000000000000001a6800000000000000000000000000000000000000000000000000000000000024bb000000000000000000000000000000000000000000000000000000000000042b00000000000000000000000000000000000000000000000000000000000000b30000000000000000000000000000000000000000000000000000000000000fb10000000000000000000000000000000000000000000000000000000000001bfd00000000000000000000000000000000000000000000000000000000000002d000000000000000000000000000000000000000000000000000000000000014830000000000000000000000000000000000000000000000000000000000001d01' .

[Bug]: BacktrackLimitExceeded

Component

Heimdall CLI

Version

0.2.0

Please check the following

  • This is not a duplicate issue
  • I have checked the wiki and tried troubleshooting the issue

Operating System

Linux

Describe the issue you are facing

on mainnet:

heimdall decompile 0x66AB180c5c9F01b2B78C29a201C7efbD9192ECe5 --include-sol

produces following error:

fatal: thread 'main' encountered a fatal error: 'panicked at 'called `Result::unwrap()` on an `Err` value: BacktrackLimitExceeded', src/decompile/util.rs:377:57'!

[Bug]: heimdall cfg produces empty cfg.dot file

Component

Heimdall Modules

Version

heimdall 0.3.0

Please check the following

  • This is not a duplicate issue
  • I have checked the wiki and tried troubleshooting the issue

Operating System

Windows

Describe the issue you are facing

I have been trying to generate a CFG file from a bytecode directly but cfg.dot file is empty. bytecode.evm file is generated as well as a disassembled.asm file. What am I doing wrong?

I run:

heimdall cfg "608060405234801561001057600080fd5b5060405160208061021783398101604090815290516000818155338152600160205291909120556101d1806100466000396000f3006080604052600436106100565763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166318160ddd811461005b57806370a0823114610082578063a9059cbb146100b0575b600080fd5b34801561006757600080fd5b506100706100f5565b60408051918252519081900360200190f35b34801561008e57600080fd5b5061007073ffffffffffffffffffffffffffffffffffffffff600435166100fb565b3480156100bc57600080fd5b506100e173ffffffffffffffffffffffffffffffffffffffff60043516602435610123565b604080519115158252519081900360200190f35b60005490565b73ffffffffffffffffffffffffffffffffffffffff1660009081526001602052604090205490565b600073ffffffffffffffffffffffffffffffffffffffff8316151561014757600080fd5b3360009081526001602052604090205482111561016357600080fd5b503360009081526001602081905260408083208054859003905573ffffffffffffffffffffffffffffffffffffffff85168352909120805483019055929150505600a165627a7a723058200a524f675439c5c0b2c59c531c7791e0eba97dcd3ab5afd2ca878971b0a7a96600290000000000000000000000000000000000000000000000000000000000002710" -vvv

I get:

info: disassembled 567 bytes successfully.
success: wrote disassembled bytecode to '/home/haraslub/output/disassembled.asm' .
debug: disassembly completed in 0 ms.
debug: detected compiler solc 0.4.22+.
info: found 4 possible function selectors.
info: performing symbolic execution on '608060405234801561001057600080fd5b5060405160208061021783398101604090815290516000818155338152600160205291909120556101d1806100466000396000f3006080604052600436106100565763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166318160ddd811461005b57806370a0823114610082578063a9059cbb146100b0575b600080fd5b34801561006757600080fd5b506100706100f5565b60408051918252519081900360200190f35b34801561008e57600080fd5b5061007073ffffffffffffffffffffffffffffffffffffffff600435166100fb565b3480156100bc57600080fd5b506100e173ffffffffffffffffffffffffffffffffffffffff60043516602435610123565b604080519115158252519081900360200190f35b60005490565b73ffffffffffffffffffffffffffffffffffffffff1660009081526001602052604090205490565b600073ffffffffffffffffffffffffffffffffffffffff8316151561014757600080fd5b3360009081526001602052604090205482111561016357600080fd5b503360009081526001602081905260408083208054859003905573ffffffffffffffffffffffffffffffffffffffff85168352909120805483019055929150505600a165627a7a723058200a524f675439c5c0b2c59c531c7791e0eba97dcd3ab5afd2ca878971b0a7a96600290000000000000000000000000000000000000000000000000000000000002710' .
info: symbolic execution completed.
success: wrote generated dot to '/home/haraslub/output/cfg.dot' .
success: wrote generated svg to '/home/haraslub/output/cfg.svg' .
debug: Control flow graph generated in 71.276253ms.
trace:
  [83] heimdall::cfg(608060405234801561001057600080fd5b50604051602080610217833981016040...0000000000002710)
    ├─ [200] heimdall::disassemble(567 bytes)
    │   └─ ← ()
    ├─ [211] heimdall::detect_compiler(567 bytes)
    │   └─ ← (solc, 0.4.22+)
    ├─ [241] create → contract@608060405234801561001057600080fd5b50604051602080610217833981016040...0000000000002710
    │   └─ ← 567 bytes
    └─ ← ()

I am on WIN 11, WSL2, Ubuntu 20.4;

Thanks is advance!

[Feature]: Snapshot module

Please check the following

  • This is not a duplicate request
  • I have checked that this is not in development

Type a detailed explanation of your feature request here.

MVP

A minimum viable product for the snapshot module would include:

  • infer function information from bytecode
    • access control
    • storage accesses
    • event emissions
    • custom errors
    • gas metrics

[Bug]: error: failed to resolve any function selectors

Component

Decompile Module

Version

heimdall -V
heimdall 0.6.3

Please check the following

  • This is not a duplicate issue
  • I have checked the wiki and tried troubleshooting the issue

Operating System

None

Command used to produce the issue

heimdall decompile 0x608060405234801561001057600080fd5b50600436106100365760003560e01c80632ae3594a1461003b578063c2304e5c14610059575b600080fd5b610043610075565b6040516100509190610248565b60405180910390f35b610073600480360381019061006e91906102a0565b6101b9565b005b60008060009054906101000a900460ff1661008f57600080fd5b60018060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546100de91906102fc565b925050819055503373ffffffffffffffffffffffffffffffffffffffff167fd000df79faa8b0dfa56bea983e1be296528d42b31663d98e989c4db27d3d294e600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544260405161016c929190610330565b60405180910390a2600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905090565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461021357600080fd5b806000806101000a81548160ff02191690831515021790555050565b6000819050919050565b6102428161022f565b82525050565b600060208201905061025d6000830184610239565b92915050565b600080fd5b60008115159050919050565b61027d81610268565b811461028857600080fd5b50565b60008135905061029a81610274565b92915050565b6000602082840312156102b6576102b5610263565b5b60006102c48482850161028b565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006103078261022f565b91506103128361022f565b925082820190508082111561032a576103296102cd565b5b92915050565b60006040820190506103456000830185610239565b6103526020830184610239565b939250505056fea2646970667358221220b790c7477091cf0d823aa24c72def58a773aa5cf0385af994873968c4743530864736f6c63430008130033
error: failed to resolve any function selectors from '608060405234801561001057600080fd5b50600436106100365760003560e01c80...6c63430008130033' .

Describe the issue you are facing

It seems that the old version of heimdall can work.

Recommend a reasonable installation method first

Component

Installing bifrost

Version

0

Please check the following

  • This is not a duplicate issue
  • I have checked the wiki and tried troubleshooting the issue

Operating System

Windows

Describe the issue you are facing

This is a product designed for security researchers to study smart contracts, and you instal it by... piping curl to bash lol

[Bug]: stuck on "executing '0xf637731d'"

Component

Heimdall CLI

Version

heimdall 0.5.3

Please check the following

  • This is not a duplicate issue
  • I have checked the wiki and tried troubleshooting the issue

Operating System

macOS (Apple Silicon)

Command used to produce the issue

heimdall decompile 0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640 -vvvvv

Describe the issue you are facing

stuck on

"info: ⠙ executing '0xf637731d'"
or
info: ⠹ executing '0x128acb08'

for more than 10 minutes in my MacStudio with M2 Ultra.

[Bug]: cached bytecode is invalid when decompile the same address with different chain

Component

Decompile Module

Version

heimdall 0.6.1

Please check the following

  • This is not a duplicate issue
  • I have checked the wiki and tried troubleshooting the issue

Operating System

Linux

Command used to produce the issue

bsc chain
x@x:/tmp/a$ /home/user/.bifrost/bin/heimdall disassemble 0xa88d48a4c6d8dd6a166a71cc159a2c588fa882bb --rpc-url http://192.168.0.x:8546 -vv
debug: found cached bytecode for '0xa88d48a4c6d8dd6a166a71cc159a2c588fa882bb' .
info: disassembled 20210 bytes successfully.
debug: disassembly completed in 3 ms.

eth chain
x@x:/tmp/a$ /home/user/.bifrost/bin/heimdall disassemble 0xa88d48a4c6d8dd6a166a71cc159a2c588fa882bb --rpc-url http://192.168.0.x:8545 -vv
debug: found cached bytecode for '0xa88d48a4c6d8dd6a166a71cc159a2c588fa882bb' .
info: disassembled 20210 bytes successfully.
debug: disassembly completed in 2 ms.

the about cmd will produce the same result.

I don't think it's necessary to use cache ,because the bytecode can be redeployed once the contract destructed.

by the way ,I think it's very usefull to have an output dir option as with older version.

Describe the issue you are facing

the about cmd will produce the same result.

I don't think it's necessary to use cache ,because the bytecode can be redeployed once the contract destructed.

by the way ,I think it's very usefull to have an output dir option as with older version.

[Bug]: Bump or loosen ethers-rs version

Please check the following

  • This is not a duplicate request
  • I have checked that this is not in development

Type a detailed explanation of your feature request here.

I'm working on a contract verification tool (https://github.com/ScopeLift/cove-backend), and for unverified contracts the /contracts endpoint will fall back to using heimdall to return a best guess at the ABI and solidity from heimdall. I'm trying to bump ethers-rs to v2.0.4 for Paris/Shanghai support, but cargo won't let me since heimdall is pinned to v2.0.0. Specifically:

$ cargo build
    Updating crates.io index
    Updating git repository `https://github.com/Jon-Becker/heimdall-rs.git`
error: failed to select a version for `ethers`.
    ... required by package `heimdall v0.4.4 (https://github.com/Jon-Becker/heimdall-rs.git#eecc59f3)`
    ... which satisfies git dependency `heimdall` of package `cove v0.1.0 (/Users/mds/Documents/projects/cove-backend)`
versions that meet the requirements `=2.0.0` are: 2.0.0

all possible versions conflict with previously selected packages.

  previously selected package `ethers v2.0.4`
    ... which satisfies dependency `ethers = "^2.0.4"` of package `cove v0.1.0 (/Users/mds/Documents/projects/cove-backend)`

failed to select a version for `ethers` which could resolve this conflict

Improvement: Arbitrary TX Trace Decoding

Please check the following

  • This is not a duplicate request
  • I have checked that this is not in development

Type a detailed explanation of your improvement request here.

As part of roadmap, decode arbitrary traces given a transaction using 4byte directory.

[Bug]: Contract overflows stack

Component

Heimdall Modules

Version

0.3.2

Please check the following

  • This is not a duplicate issue
  • I have checked the wiki and tried troubleshooting the issue

Operating System

macOS (Apple Silicon)

Describe the issue you are facing

cc @davideaimar

Contract 0x4cce413f565f8a9e2a25d9d270a9a36061f4439d overflows stack

heimdall decompile 0x4cce413f565f8a9e2a25d9d270a9a36061f4439d -vvv -d --include-sol

[Feature]: Postprocessing Improvements

Please check the following

  • This is not a duplicate request
  • I have checked that this is not in development

Type a detailed explanation of your feature request here.

  • Improve test coverage for postprocessing
  • Production-ready postprocessing

[Bug]: panic at integer overflow when decompiling 0x000000000000df8c944e775bde7af50300999283 on x86

Component

Heimdall Modules

Version

v0.3.2

Please check the following

  • This is not a duplicate issue
  • I have checked the wiki and tried troubleshooting the issue

Operating System

Linux

Describe the issue you are facing

When executing: heimdall decompile 0x000000000000df8c944e775bde7af50300999283 -vvv -d --include-sol --rpc-url <url>, I get an integer overflow exception, full stack trace below:

info: disassembled 2014 bytes successfully.
success: wrote disassembled bytecode to '/home/nodeuser/output/0x000000000000df8c944e775bde7af50300999283/disassembled.asm' .
debug: disassembly completed in 46 ms.
debug: detected compiler solc 0.8.18.
info: resolved 3 possible functions from 4 detected selectors.
info: performing symbolic execution on '60806040523661000b57005b60003560e01c80156100d85763f04f270781146100...6c63430008120033' .
info: ⠹ executing '0xf04f2707'                                                                                                                                                                                     fatal: thread 'main' encountered a fatal error: 'panicked at 'Integer overflow when casting to usize', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/primitive-types-0.12.1/src/lib.rs:38:1'!
fatal: Stack Trace:

   0:     0x55bedb92df87 - backtrace::capture::Backtrace::new::h4a03f9cd77fe1519
   1:     0x55bedba3e724 - heimdall::main::{{closure}}::h9cbb639548398272
   2:     0x55bedbc9a81f - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h6e4950ba7c0fd82a
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/alloc/src/boxed.rs:2032:9
                           std::panicking::rust_panic_with_hook::h5cafdc4b3bfd5528
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:692:13
   3:     0x55bedbc9a494 - std::panicking::begin_panic_handler::{{closure}}::hf31c60f40775892c
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:577:13
   4:     0x55bedbc9a42e - std::sys_common::backtrace::__rust_end_short_backtrace::h28a5c7be595826cd
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/sys_common/backtrace.rs:137:18
   5:     0x55bedbc9a401 - rust_begin_unwind
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:575:5
   6:     0x55bedb8f7f42 - core::panicking::panic_fmt::h8fa27a0b37dd98b7
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/panicking.rs:64:14
   7:     0x55bedb9adf24 - <ethers_core::types::i256::I256 as core::ops::bit::Shr>::shr::hfeae6e796401a556
   8:     0x55bedba6b17b - heimdall_common::ether::evm::vm::VM::_step::hd2475aae302ea57c
   9:     0x55bedba686c9 - heimdall_common::ether::evm::vm::VM::step::h6cc67e431f364ac0
  10:     0x55bedba55b50 - heimdall::decompile::util::recursive_map::hbb1d48a8ae2029a2
  11:     0x55bedba56a41 - heimdall::decompile::util::recursive_map::hbb1d48a8ae2029a2
  12:     0x55bedba56ad3 - heimdall::decompile::util::recursive_map::hbb1d48a8ae2029a2
  13:     0x55bedba56ad3 - heimdall::decompile::util::recursive_map::hbb1d48a8ae2029a2
  14:     0x55bedba56ad3 - heimdall::decompile::util::recursive_map::hbb1d48a8ae2029a2
  15:     0x55bedba56ad3 - heimdall::decompile::util::recursive_map::hbb1d48a8ae2029a2
  16:     0x55bedba56ad3 - heimdall::decompile::util::recursive_map::hbb1d48a8ae2029a2
  17:     0x55bedba56ad3 - heimdall::decompile::util::recursive_map::hbb1d48a8ae2029a2
  18:     0x55bedba56ad3 - heimdall::decompile::util::recursive_map::hbb1d48a8ae2029a2
  19:     0x55bedba56ad3 - heimdall::decompile::util::recursive_map::hbb1d48a8ae2029a2
  20:     0x55bedba56ad3 - heimdall::decompile::util::recursive_map::hbb1d48a8ae2029a2
  21:     0x55bedba56ad3 - heimdall::decompile::util::recursive_map::hbb1d48a8ae2029a2
  22:     0x55bedba56ad3 - heimdall::decompile::util::recursive_map::hbb1d48a8ae2029a2
  23:     0x55bedba56ad3 - heimdall::decompile::util::recursive_map::hbb1d48a8ae2029a2
  24:     0x55bedba56ad3 - heimdall::decompile::util::recursive_map::hbb1d48a8ae2029a2
  25:     0x55bedba56ad3 - heimdall::decompile::util::recursive_map::hbb1d48a8ae2029a2
  26:     0x55bedba56ad3 - heimdall::decompile::util::recursive_map::hbb1d48a8ae2029a2
  27:     0x55bedba56ad3 - heimdall::decompile::util::recursive_map::hbb1d48a8ae2029a2
  28:     0x55bedba56ad3 - heimdall::decompile::util::recursive_map::hbb1d48a8ae2029a2
  29:     0x55bedba56ad3 - heimdall::decompile::util::recursive_map::hbb1d48a8ae2029a2
  30:     0x55bedba568d3 - heimdall::decompile::util::recursive_map::hbb1d48a8ae2029a2
  31:     0x55bedba56965 - heimdall::decompile::util::recursive_map::hbb1d48a8ae2029a2
  32:     0x55bedba56a41 - heimdall::decompile::util::recursive_map::hbb1d48a8ae2029a2
  33:     0x55bedba56ad3 - heimdall::decompile::util::recursive_map::hbb1d48a8ae2029a2
  34:     0x55bedba568d3 - heimdall::decompile::util::recursive_map::hbb1d48a8ae2029a2
  35:     0x55bedba568d3 - heimdall::decompile::util::recursive_map::hbb1d48a8ae2029a2
  36:     0x55bedba56a41 - heimdall::decompile::util::recursive_map::hbb1d48a8ae2029a2
  37:     0x55bedba45c68 - heimdall::decompile::decompile::hd123d0cc809a768b
  38:     0x55bedba3d30c - heimdall::main::h0eb0d70686be163d
  39:     0x55bedba523b3 - std::sys_common::backtrace::__rust_begin_short_backtrace::hf459c03191f0eeac
  40:     0x55bedba523a9 - std::rt::lang_start::{{closure}}::h2a2579911f63dbb9
  41:     0x55bedbc6c5c4 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hfa1c3687c9a20bb8
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/ops/function.rs:606:13
                           std::panicking::try::do_call::h0497133ebe1341e5
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:483:40
                           std::panicking::try::h6c3de05c7ca5d07f
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:447:19
                           std::panic::catch_unwind::h969058ecb5334b30
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panic.rs:137:14
                           std::rt::lang_start_internal::{{closure}}::h0de6d98cafb42a58
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/rt.rs:148:48
                           std::panicking::try::do_call::h77301dcf43953993
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:483:40
                           std::panicking::try::h45b05523a2fe135a
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:447:19
                           std::panic::catch_unwind::hd95cea544b2b9bd2
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panic.rs:137:14
                           std::rt::lang_start_internal::hd16e6ff7bf05a444
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/rt.rs:148:20
  42:     0x55bedba39db4 - main
  43:     0x7f835c5a9d90 - <unknown>
  44:     0x7f835c5a9e40 - __libc_start_main
  45:     0x55bedb917ba5 - _start
  46:                0x0 - <unknown>

info: ⠴ executing '0xf04f2707'

It's worth noting that I'm using heimdall v0.3.2, but I'm unable to reproduce this error on arm (M1 Max), only on x86-64 (AMD Ryzen).

feat: destructure input args even when selector is unknown

Version

heimdall 0.6.3

Please check the following

  • This is not a duplicate question
  • I have checked the wiki beforehand

Operating System

macOS (Apple Silicon)

Ask your question here

Suppose I have this transaction and we don't have the function selector in samczsun's selector library. Can I still use the decode command to at least decode all its input args? Should be possible to do this with heimdall imo, I can then use etherscan to reverse engineer what inputs are what exactly.

Sometimes the name is'nt as important as what's going in to a function. What do you think Jon?

At the moment I get the output below which could be a lot better if all the input args were destructed for me. I think I could then generate an ABI from this and destructure these function calls no?

⚡23% ➜  heimdall decode0x01015a19cc6287eb099da29efa33cd8a7b2b8a6d515731b03000b1dc821d82b9 -vvv
warn: couldn't find any matches for the given function signature.
trace:
  [262] heimdall::decode(0x01015a19cc6287eb099da29efa33cd8a7b2b8a6d515731b03000b1dc821d82b9)
    │
    ├─ selector: 0x70fef1da
    ├─ calldata: 484 bytes
    │
    ├─ input 0:  000000000000000000000000de47a2460e4b6c36b26919ef9255b4f3f86de0a0
    │        1:  000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
    │        2:  0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d
    │        3:  0000000000000000000000000a8e3f1dcf7b28896f5b4fd44430c9b66731647c
    │        4:  0000000000000000000000000000000000000000000000000000000000000000
    │        5:  0000000000000000000000000000000000000000000000000000000000000000
    │        6:  0000000000000000000000005200a0e9b161bc59feecb165fe2592bef3e1847a
    │        7:  0000000000000000000000000000000000000000000000000000000000000100
    │        8:  0000000000000000000000000000000000000000000000000000000000000006
    │        9:  0000000000000000000000000000000000000000000000000000000000000032
    │        10: 0000000000000000000000000000000000000000000000000000000000000001
    │        11: 0000000000000000000000000000000000000000000000000000000000000023
    │        12: 0000000000000000000000000000000000000000000000000000000000000000
    │        13: 00000000000000000000000000000000000000000000000000000000653c852f
    │        14: 0000000000000000000000000000000000000000000000000000000000000000
    └─ ← ()

[Bug]: Remove unnecessary inline type declarations

Component

Decompile Module

Version

<= 0.5.1

Please check the following

  • This is not a duplicate issue
  • I have checked the wiki and tried troubleshooting the issue

Operating System

macOS (Apple Silicon)

Command used to produce the issue

heimdall decompile 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 -d -vvv --include-sol --skip-resolving

Describe the issue you are facing

For example, var_a has its type declared many times.

image

[Bug]: Cannot install Heimdall

Component

Installing heimdall

Version

N/A

Please check the following

  • This is not a duplicate issue
  • I have checked the wiki and tried troubleshooting the issue

Operating System

macOS (Intel)

Describe the issue you are facing

After downloading bifrost ,

solidity $curl -L https://raw.githubusercontent.com/Jon-Becker/heimdall-rs/main/bifrost/install | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1115  100  1115    0     0   3323      0 --:--:-- --:--:-- --:--:--  3550
######################################################################## 100.0%

bifrost: Installation complete.
Open a new terminal and run 'bifrost' to install Heimdall.

I open a new terminal to install heimdall. unfortunately , it can't find the binary

solidity $bifrost
bash: bifrost: command not found

[Bug]: Contract slow to decompile and with duplicated events in ABI

Component

Decompile Module

Version

0.3.3

Please check the following

  • This is not a duplicate issue
  • I have checked the wiki and tried troubleshooting the issue

Operating System

Linux

Command used to produce the issue

heimdall decompile 0xce1f2c3139dae247bdd916056cb7c244defc8dd6 --rpc-url -vvvv

Describe the issue you are facing

The decompilation of the contract 0xce1f2c3139dae247bdd916056cb7c244defc8dd6 took 590.15 seconds, and the decompiled ABI contains duplicated events. You can check it here: gist.github.com (they're all present 9 times).

I suspect it has something to do with the recursive_map method not detecting loops, but I'm not sure. If you give me some hints, I can try to investigate further. Removing duplicates is probably an easy thing to do when building the output, but I think reducing the decompilation time is much harder.

[Bug]: panic when decompile

Component

Heimdall CLI

Version

0.2.1

Please check the following

  • This is not a duplicate issue
  • I have checked the wiki and tried troubleshooting the issue

Operating System

Linux

Describe the issue you are facing

I check #30 this issue and his contract is work well in 0.2.1 but my contract is not.

environment : klaytn mainnet (ether hardfork and other klaytn contract is work well)

Error contract : 0x4f5d9f3b17988aa047e6f1bc511fec0bf25691f4

command :

heimdall decompile 0x4f5d9f3b17988aa047e6f1bc511fec0bf25691f4 --include-sol -r https://public-node-api.klaytnapi.com/v1/cypress

error :

success: wrote disassembled bytecode to '/home/hj/output/0x4f5d9f3b17988aa047e6f1bc511fec0bf25691f4/disassembled.asm' .
info: ⠙ analyzing '0x4d49e87d'                                                  fatal: thread 'main' encountered a fatal error: 'panicked at 'called `Option::unwrap()` on a `None` value', src/decompile/analyze.rs:117:36'!
fatal: Stack Trace:

   0:     0x55a7754bf78f - backtrace::capture::Backtrace::new::hefe871ffee13979a
   1:     0x55a7755c1374 - heimdall::main::{{closure}}::h382a421ae6620b25
   2:     0x55a7758068b2 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h44df53ea2a13204b
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/alloc/src/boxed.rs:2001:9
                           std::panicking::rust_panic_with_hook::hfd45b6b6c12d9fa5
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:692:13
   3:     0x55a775806523 - std::panicking::begin_panic_handler::{{closure}}::hf591e8609a75bd4b
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:577:13
   4:     0x55a7758064be - std::sys_common::backtrace::__rust_end_short_backtrace::h81899558795e4ff7
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:137:18
   5:     0x55a775806491 - rust_begin_unwind
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:575:5
   6:     0x55a77547f7d2 - core::panicking::panic_fmt::h4235fa9b4675b332
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/panicking.rs:65:14
   7:     0x55a77547f8cc - core::panicking::panic::h9ced3cf2f605ba6a
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/panicking.rs:115:5
   8:     0x55a7755cc563 - heimdall::decompile::analyze::<impl heimdall::decompile::util::VMTrace>::analyze::h183fd40b5ac1e62a
   9:     0x55a7755cba57 - heimdall::decompile::analyze::<impl heimdall::decompile::util::VMTrace>::analyze::h183fd40b5ac1e62a
  10:     0x55a7755cba57 - heimdall::decompile::analyze::<impl heimdall::decompile::util::VMTrace>::analyze::h183fd40b5ac1e62a
  11:     0x55a7755cba57 - heimdall::decompile::analyze::<impl heimdall::decompile::util::VMTrace>::analyze::h183fd40b5ac1e62a
  12:     0x55a7755cba57 - heimdall::decompile::analyze::<impl heimdall::decompile::util::VMTrace>::analyze::h183fd40b5ac1e62a
  13:     0x55a7755cba57 - heimdall::decompile::analyze::<impl heimdall::decompile::util::VMTrace>::analyze::h183fd40b5ac1e62a
  14:     0x55a7755cba57 - heimdall::decompile::analyze::<impl heimdall::decompile::util::VMTrace>::analyze::h183fd40b5ac1e62a
  15:     0x55a7755cba57 - heimdall::decompile::analyze::<impl heimdall::decompile::util::VMTrace>::analyze::h183fd40b5ac1e62a
  16:     0x55a7755cba57 - heimdall::decompile::analyze::<impl heimdall::decompile::util::VMTrace>::analyze::h183fd40b5ac1e62a
  17:     0x55a7755cba57 - heimdall::decompile::analyze::<impl heimdall::decompile::util::VMTrace>::analyze::h183fd40b5ac1e62a
  18:     0x55a7755cba57 - heimdall::decompile::analyze::<impl heimdall::decompile::util::VMTrace>::analyze::h183fd40b5ac1e62a
  19:     0x55a7755cba57 - heimdall::decompile::analyze::<impl heimdall::decompile::util::VMTrace>::analyze::h183fd40b5ac1e62a
  20:     0x55a7755cba57 - heimdall::decompile::analyze::<impl heimdall::decompile::util::VMTrace>::analyze::h183fd40b5ac1e62a
  21:     0x55a7755cba57 - heimdall::decompile::analyze::<impl heimdall::decompile::util::VMTrace>::analyze::h183fd40b5ac1e62a
  22:     0x55a7755cba57 - heimdall::decompile::analyze::<impl heimdall::decompile::util::VMTrace>::analyze::h183fd40b5ac1e62a
  23:     0x55a7755cba57 - heimdall::decompile::analyze::<impl heimdall::decompile::util::VMTrace>::analyze::h183fd40b5ac1e62a
  24:     0x55a7755a79e0 - heimdall::decompile::decompile::hf40dc136b5a01837
  25:     0x55a7755bfe3e - heimdall::main::h874210b1c8a7d14f
  26:     0x55a7755d32e3 - std::sys_common::backtrace::__rust_begin_short_backtrace::h8c3b0cd6d4a8ed1f
  27:     0x55a7755b4369 - std::rt::lang_start::{{closure}}::h6c25724aac55ad68
  28:     0x55a7757dff44 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h072eb4cd8da964ba
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/ops/function.rs:286:13
                           std::panicking::try::do_call::h8eca204fe9266946
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:483:40
                           std::panicking::try::h12574e1b7b2cbacb
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:447:19
                           std::panic::catch_unwind::hf71522d4448329d6
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panic.rs:137:14
                           std::rt::lang_start_internal::{{closure}}::h65b66ac9bff580f8
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/rt.rs:148:48
                           std::panicking::try::do_call::hfff61e33ca3db9f1
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:483:40
                           std::panicking::try::he48c8ecead279cad
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:447:19
                           std::panic::catch_unwind::hd510a26bfc950ccc
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panic.rs:137:14
                           std::rt::lang_start_internal::hc680b25eab888da9
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/rt.rs:148:20
  29:     0x55a7755bce94 - main
  30:     0x7f08c5d24d90 - __libc_start_call_main
                               at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  31:     0x7f08c5d24e40 - __libc_start_main_impl
                               at ./csu/../csu/libc-start.c:392:3
  32:     0x55a77549d765 - _start
  33:                0x0 - <unknown>

[Feature]: Add snapshot library wrappers

Please check the following

  • This is not a duplicate request
  • I have checked that this is not in development

Type a detailed explanation of your feature request here.

title

[Question]: Add configuration option to set output directory

Version

heimdall 0.1.5

Please check the following

  • This is not a duplicate question
  • I have checked the wiki beforehand

Operating System

macOS (Apple Silicon)

Ask your question here

The decompile command writes to an output/ directory inside the current working directory.

It would be cool to be able to set the output directory in the configuration.

[Bug]: Memory consumption

Component

Heimdall CLI

Version

Heimdall Version: 0.3.0
System Configuration:
CPU: AMD Ryzen 7 5800X 8-Core Processor 3.80 GHz
RAM: 32.0 GB
System type: 64-bit
Rust Version: 1.66.1

Please check the following

  • This is not a duplicate issue
  • I have checked the wiki and tried troubleshooting the issue

Operating System

Windows

Describe the issue you are facing

image

Input used: heimdall decompile 0x100f0013372bf98f72fcb946883016958e59d1b0 --rpc-url https://polygon-rpc.com -vvv -d --include-sol --skip-resolving

After run for 40 minutes the program paused in this screen:

image

I have been tried the same input on a linux machine but resulted in out of memory in 3 seconds.

This contract already been verified on polygonscan: https://polygonscan.com/address/0x100f0013372bf98f72fcb946883016958e59d1b0#code

[Feature]: Support for multicall / nested calladata decoding

Please check the following

  • This is not a duplicate request
  • I have checked that this is not in development

Type a detailed explanation of your feature request here.

Allow multicall decoding as well as decoding calldata within calldata, for things such as uniswap.

[Feature]: Switch to etherface for signature lookup

Please check the following

  • This is not a duplicate request
  • I have checked that this is not in development

Type a detailed explanation of your feature request here.

I suggest to switch to etherface. As it's stated in the repository, they collect more signatures than 4bytes and openchain.xyz so it could resolve more of them. There are also error signatures.

[Improvement]: transition `ethers-rs` to `alloy-rs`

Please check the following

  • This is not a duplicate request
  • I have checked that this is not in development

Type a detailed explanation of your improvement request here.

Migrate uses of ethers-rs to the new and improved alloy-rs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.