-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
add afl-cmin.py #2413
Conversation
afl-cmin.py
Outdated
metavar='file', | ||
help='location read by the fuzzed program (stdin)') | ||
group.add_argument( | ||
'-m', |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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), |
There was a problem hiding this comment.
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?)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
IMHO I would move directly for afl-cmin to call afl-cmin.py if afl-cmin.py can be executed successfully. |
done |
thanks! |
I will make some changes to afl-cmin and also actually install afl-cmin.py on make install ;-) |
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.