igogo-x86 / HexRaysPyTools

IDA Pro plugin which improves work with HexRays decompiler and helps in process of reconstruction structures and classes
1.42k stars 226 forks source link

Fix 'Structures with this size' for numbers >= 0x40 #53

Closed p-state closed 4 years ago

p-state commented 4 years ago
Python>print(idaapi.create_numbered_type_name(0x40))
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Program Files\IDA Pro\python\3\ida_typeinf.py", line 4199, in create_numbered_type_name
    return _ida_typeinf.create_numbered_type_name(*args)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x81 in position 1: invalid start byte
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Program Files\IDA Pro\python\3\ida_typeinf.py", line 4199, in create_numbered_type_name
    return _ida_typeinf.create_numbered_type_name(*args)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x81 in position 1: invalid start byte

This bug comes from IDAPython for Python 3, as I see it. I am not sure that using get_numbered_type_name is identical, but in my testing this works as expected.