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

How to add APIs? #4

Open
xooxo opened this issue Apr 26, 2023 · 1 comment
Open

How to add APIs? #4

xooxo opened this issue Apr 26, 2023 · 1 comment

Comments

@xooxo
Copy link

xooxo commented Apr 26, 2023

Hello,

First of all, thank you for the project. I looked around a little bit but cannot find responsible snippet at the codebase for APIs. I want generator to only generate specific APIs or add some if there aren't any which I'm looking for. Could you point me in a direction?

Thanks,

@KlimMixer
Copy link

Hello,

I've just started researching this fuzzer, it looks pretty interesting, and thanks for the authors.
And it looks like I have an answer to your question. You may define your classes which must inherit the APITemplate and API classes. At your API child class you must define arguments, how to generate values for arguments for the function that you want to use, and how to generate js code from this class. Your APITemplate class must define a method to create an instance of API and check for satiable. For example, you can look at the js/misc.py file, there are some APIs already defined for example GC and SetTimeout. After creating your APIs you would need to register it in function initialize_misc_apis like this:
add_api(YourApiTemplate())

Hope it will be useful.

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

No branches or pull requests

2 participants