[bug] frida_commands.py read a utf-8 encoding error
- Please, fill in all of the sections in this template.
- Please read each section carefully. Each has a description of what information will help.
- Windows support is limited. There is a good chance that a pull request would help!
- The more information you give, the better.
- Remove this section when you are done.
Describe the bug
UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 761: illegal multibyte sequence`
To Reproduce Steps to reproduce the behavior:
com.dianping.v1 on (vivo: 7.1.2) [usb] # import change_network.js
An unexpected internal exception has occurred. If this looks like a code related error, please file a bug report!
'gbk' codec can't decode byte 0x80 in position 761: illegal multibyte sequence
Python stack trace: Traceback (most recent call last):
File "C:\Program Files (x86)\python37\lib\site-packages\objection\console\repl.py", line 371, in start_repl
self.run_command(document)
File "C:\Program Files (x86)\python37\lib\site-packages\objection\console\repl.py", line 185, in run_command
exec_method(arguments)
File "C:\Program Files (x86)\python37\lib\site-packages\objection\commands\frida_commands.py", line 83, in load_background
hook = ''.join(f.read())
UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 761: illegal multibyte sequence`
in https://github.com/sensepost/objection/blob/master/objection/commands/frida_commands.py Line 81 should set encoding
with open(source, 'r',encoding="utf-8") as f:
Similar issues Please link the issues in this repository that is similar to yours.
For example: #358, #229 etc.
Expected behavior A clear and concise description of what you expected to happen.
Evidence / Logs / Screenshots
Any output from objection, such as stack traces or errors that occurred. Be sure to run objection with the --debug flag so that errors from the agent are verbose enough to debug. For example:
objection --debug explore
Environment (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Frida Version [e.g. 22]
- Objection Version [e.g. 1.6.2]
Application If possible, please attach the target application where you can reproduce this bug to the issue.
Additional context Add any other context about the problem here.
Thanks for the report. Curious, what does your source script contain that is tripping this up? Non-ascii comments or something else?
<p title=”
.qmbox .qmbox .qmbox *{color:#f78fb3;}
<p title=” <style onload= alert(document.domain)//"> *{/all/color/all/:/all/#f78fb3/all/;} .qmbox .qmbox .qmbox *{color:#f78fb3;}
Is this the source of the Frida script you are trying to import?
sorry this my email auto reply~I will try closed this function~Thanks
I think this bug can fix buy compatible utf-8 and gbk18030 and ascii