patois / abyss

abyss - augmentation of Hexrays decompiler output

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UnicodeDecodeError

patois opened this issue · comments

Traceback (most recent call last):
File "G:/IDA75/plugins/abyss.py", line 152, in text_ready
obj.process_text(vu)
File "G:/IDA75/plugins\abyss_filters\ctopy.py", line 1331, in process_text
lines = "\n".join([ida_lines.tag_remove(sl.line) for sl in pc])
File "G:/IDA75/plugins\abyss_filters\ctopy.py", line 1331, in
lines = "\n".join([ida_lines.tag_remove(sl.line) for sl in pc])
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xba in position 204: invalid start byte

Originally posted by @x64bugreport in #4 (comment)

@x64bugreport could you please attach a copy of the original pseudo-code before it is processed by the abyss plugin?

1111
addr:0x401000
The problem may be caused by a pseudo-code page that contains comments.

ConsoleApplication1.idb.zip

I hope to fix the #4 bug soon. The problem test of #8 may be caused by special character comments.
If the problem of #8 cannot be avoided, I hope you try to use the try-except in the script to catch the problem and prompt the user.

I am unable to reproduce this behavior since IDA refuses to open the IDB file you provided.

Could you run the following lines in IDA's Python CLI and let me know whether this reproduces the error?

from ida_lines import tag_remove
"\n".join([tag_remove(line) for line in ["syste\xbam", "test123\xba"]])

hello,it is new idb.
testidb.patched.zip

I am able to reproduce the issue and it happens as soon as the "line" field of a simpleline_t instance is accessed. Although it should be possible to work around this issue using exception handling, this is not a desirable solution that I would implement into the plugin. The behavior is caused by and should be handled/fixed by @idapython instead.

Thank you for your reply. It is recommended that you remind the user when the plugin is abnormal, instead of directly crashing. At the same time, I hope you can fix the problem #4. Thank you very much for writing the plugin, thank you!

Thank you for having reporting this issue, I will close it for now.