IDA qiling plugin encounter an error.
Describe the bug
the log about this error:
[INFO][qilingida:2066] ['D:\Code_Files\ARM\Qiling-Lab\qilinglab-aarch64']
[INFO][qilingida:1032] Rootfs: D:\Code_Files\qiling\examples\rootfs\arm64_linux
[INFO][qilingida:1033] Custom user script: D:\Code_Files\IDA_DEV\IDA_QilingLab.py
[INFO][qilingida:1034] Custom env: {}
[INFO][qilingida:1042] Qiling is initialized successfully.
Traceback (most recent call last):
File "E:/Tools/IDA_Pro_7.7/plugins/qilingida.py", line 810, in activate
self.action_handler.ql_handle_menu_action(self.action_type)
File "E:/Tools/IDA_Pro_7.7/plugins/qilingida.py", line 2098, in ql_handle_menu_action
[x.handler() for x in self.menuitems if x.action == action]
File "E:/Tools/IDA_Pro_7.7/plugins/qilingida.py", line 2098, in
Sample Code I use the script is the official "custom_script.py"
pictrue of error
Additional context I try to modify the log.py to add a class named "StreamWrapper", but the error is not resloved. I need help to resolve this error.
Modify In log.py, I added an elif branch which successfully resolved the error related to the "StreamWrapper" device type. However, I am unsure where the device type of "StreamWrapper" comes from and whether this is the optimal solution for the problem.
for dev in logdevs:
if isinstance(dev, FileLike):
handler = StreamHandler(dev)
elif isinstance(dev, str):
handler = FileHandler(dev)
elif type(dev).__name__ == "StreamWrapper":
handler = StreamHandler(dev)
Now is OK!
Hi there..!
IDA Python keeps surprising all the time. This is essentially because its standard streams do not support the fileno method, and the default logging stream is set to sys.stderr. Then it fails to match to FileLike and this is how we get the error message.
Though your modification works around the problem, is it not the 'right' way to fix this. I'll assign myself to fix this later on.
Okay, I'm looking forward to the revised version, and I'll take a good look at it when it's ready.