Thanks to visit codestin.com
Credit goes to github.com

Skip to content

add afl-cmin.py #2413

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

Merged
merged 4 commits into from
May 9, 2025
Merged

add afl-cmin.py #2413

merged 4 commits into from
May 9, 2025

Conversation

kcwu
Copy link
Contributor

@kcwu kcwu commented May 4, 2025

I added afl-cmin.py first and didn't replace the awk and bash version yet. Maybe we can switch to python version after more positive feedback from users.

afl-cmin.py Outdated
metavar='file',
help='location read by the fuzzed program (stdin)')
group.add_argument(
'-m',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you run black to format the python?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah wait looks below like you used a formatter(?)
then why is this indentation so weird here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was formatted by yapf. Anyway, I reformatted it using black and the indent looks better.

afl-cmin.py Outdated
dest='memory_limit',
default='none',
metavar='megs',
type=lambda x: x if x == 'none' else int(x),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-m 0 should probably also be none (right?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both afl-cmin and afl-cmin.bash don't do so. I think it is not bad to keep the old behavior.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 and none is the same and it is the default

afl-cmin.py Outdated
p = subprocess.Popen(cmd,
stdout=subprocess.PIPE,
env=env,
bufsize=1048576)
Copy link
Member

@domenukk domenukk May 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the value should be a global/const, especially since you use it twice

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't do so because the value is not so important IMHO.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean you use it twice, it cries for a variable. That way you can also make clear, why you set it to that number

@vanhauser-thc
Copy link
Member

IMHO I would move directly for afl-cmin to call afl-cmin.py if afl-cmin.py can be executed successfully.
Testing is what the dev branch is for :-)

@kcwu
Copy link
Contributor Author

kcwu commented May 8, 2025

IMHO I would move directly for afl-cmin to call afl-cmin.py if afl-cmin.py can be executed successfully. Testing is what the dev branch is for :-)

done

@vanhauser-thc
Copy link
Member

thanks!

@vanhauser-thc vanhauser-thc merged commit c150d8e into AFLplusplus:dev May 9, 2025
9 of 11 checks passed
@vanhauser-thc
Copy link
Member

I will make some changes to afl-cmin and also actually install afl-cmin.py on make install ;-)

@vanhauser-thc
Copy link
Member

4d9d8aa

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 this pull request may close these issues.

3 participants