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

Improve afl_fuzz wrapper #1330

Merged
merged 2 commits into from Apr 9, 2023
Merged

Improve afl_fuzz wrapper #1330

merged 2 commits into from Apr 9, 2023

Conversation

gnbon
Copy link
Contributor

@gnbon gnbon commented Mar 29, 2023

The current ql_afl_fuzz wrapper in Qiling supports setting exit addresses using the exits parameter. It sets the exit addresses at the start and calls the ql_afl_fuzz_custom wrapper with a dummy fuzz callback.

Although both ql_afl_fuzz and ql_afl_fuzz_custom wrappers have almost the same API, it is impossible to set exit addresses if ql_afl_fuzz_custom is called directly.

To address this issue, I passed the exits parameter seamlessly to ql_afl_fuzz_custom for both wrappers to support setting exit addresses.

Checklist

Which kind of PR do you create?

  • This PR only contains minor fixes.
  • This PR contains major feature update.
  • This PR introduces a new function/api for Qiling Framework.

Coding convention?

  • The new code conforms to Qiling Framework naming convention.
  • The imports are arranged properly.
  • Essential comments are added.
  • The reference of the new code is pointed out.

Extra tests?

  • No extra tests are needed for this PR.
  • I have added enough tests for this PR.
  • Tests will be added after some discussion and review.

Changelog?

  • This PR doesn't need to update Changelog.
  • Changelog will be updated after some proper review.
  • Changelog has been updated in my PR.

Target branch?

  • The target branch is dev branch.

One last thing


@xwings
Copy link
Member

xwings commented Mar 29, 2023

@wtdcode can u take a look?

@wtdcode
Copy link
Member

wtdcode commented Mar 29, 2023

LGTM but I think you have to update samples.

@gnbon
Copy link
Contributor Author

gnbon commented Mar 30, 2023

Thanks. I have tested some sample scripts in the examples/fuzzing/ directory to ensure that they run smoothly without modifications.

For the stm32f429 using the ql_afl_fuzz_custom function, I updated the necessary modifications to comply with the updated API.
For the linux_x8664 and qnx_arm using the ql_afl_fuzz function, I confirmed that they run seamlessly.

@gnbon
Copy link
Contributor Author

gnbon commented Apr 3, 2023

@wtdcode are these commits ready to be merged?

@wtdcode
Copy link
Member

wtdcode commented Apr 4, 2023

Yes, LGTM now. Let's wait for CI.

@gnbon
Copy link
Contributor Author

gnbon commented Apr 5, 2023

@xwings can u help review this request?

@xwings
Copy link
Member

xwings commented Apr 6, 2023

Thanks for the PR. Need to wait for one more approve before we are good to merge. @wtdcode

@elicn elicn merged commit bb0c5f3 into qilingframework:dev Apr 9, 2023
5 checks passed
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.

None yet

5 participants