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

example.py:19: DeprecationWarning: Script.exports will become asynchronous in the future, use the explicit Script.exports_sync instead #267

Open
smcpeak opened this issue Jan 17, 2024 · 0 comments

Comments

@smcpeak
Copy link

smcpeak commented Jan 17, 2024

Following the instructions at https://frida.re/docs/installation/ , when I run example.py, it prints a mysterious deprecation warning:

$ python3 example.py
/home/scott/wrk/learn/frida/example/example.py:19: DeprecationWarning: Script.exports will become asynchronous in the future, use the explicit Script.exports_sync instead
  print([m["name"] for m in script.exports.enumerate_modules()])
['cat', 'linux-vdso.so.1', 'libc-2.31.so', 'ld-2.31.so', 'libpthread-2.31.so', 'libdl-2.31.so', 'librt-2.31.so', 'libm-2.31.so']

Googling the error message only yields one hit for that specific error, which is the source code at https://github.com/frida/frida-python/blob/main/frida/core.py that prints it.

Although not immediately obvious, I found I could fix the warning by changing exports to exports_sync:

print([m["name"] for m in script.exports_sync.enumerate_modules()])

I suggest updating the example on the website to do likewise.

I also suggest clarifying the warning to make it more obvious how to fix it, for example:

DeprecationWarning: The 'exports' method is deprecated, use 'exports_sync' instead.

I think this warning is clearer because it avoids the confusion of Script versus script, omits the unnecessary explanation about why it is deprecated (the user likely does not care, and the two names imply the rationale anyway), and omits unnecessarily saying "explicit", which at first I thought might be referring to some new Python syntax (like the explicit keyword in C++).

Frida version: 16.1.11
Python version: 3.9.13 (built from source)
OS: Linux Mint 20.1
Frida obtained via pip3 install frida-tools.

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

1 participant