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

[Need Fix]Is there any possible to change set the txn data from bytes to args (i.e., BoxedABI)? #91

Closed
Kenun99 opened this issue Jun 28, 2023 · 1 comment · Fixed by #121
Assignees

Comments

@Kenun99
Copy link
Contributor

Kenun99 commented Jun 28, 2023

I failed to update the txn data (ABI) in the EVMInput using the method set_bytes.

pub fn set_bytes(&mut self, bytes: Vec<u8>) {

It seems that the concolic engine also needs to update the abi data of the current input.

// .set_bytes(str_to_bytes(&s));

However, although I have activated the code after removing the annotations, fn set_bytes() still failed to change the input data.
I was wondering whether it is possible to let me ask for any suggestions?
Does the set_bytes in ABI work well?

The concrete example is shown here. The below code is inserted into the entry of fn evaluate_input_events in ityfuzz/src/fuzzer.rs. However, the two print commands output the sample.

tx_bytes = [0, 0, 0, 0] // example data
let mut cu_input = input.clone();
println!("got it: {:02x?}", cu_input.get_data_abi());
cu_input
    .get_data_abi_mut()
    .as_mut()
    .unwrap()
    .set_bytes(tx_bytes.to_vec());
println!("got it: {:02x?}", cu_input.get_data_abi());
@shouc
Copy link
Contributor

shouc commented Jun 29, 2023

It works for simple types (uint256, address, bytes, etc.) but does not work for tuples / arrays. We are still working on supporting them.

This should work

        let mut abi = get_abi_type_boxed(&String::from("int256"));
        abi.set_bytes(vec![0xff; 32]);
        println!("abi: {:?}", abi);

@Kenun99 Kenun99 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 29, 2023
@Kenun99 Kenun99 reopened this Jun 29, 2023
@Kenun99 Kenun99 changed the title Is there any possible to change set the txn data from bytes to args (i.e., BoxedABI)? [Need Fix]Is there any possible to change set the txn data from bytes to args (i.e., BoxedABI)? Jul 8, 2023
@ByteSecurity ByteSecurity linked a pull request Jul 13, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

3 participants