-
I have a type definition for example: >>> old_t = [t for t in bv.types if "std::__cxx11::string" == '::'.join(t[0].name)][0]
>>> old_t
('std::__cxx11::string', <type: immutable:NamedTypeReferenceClass 'typedef std::__cxx11::string'>) Yes, it's a cycle type ( I tried to change the type definition: >>> t = [t for t in bv.types if "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >" == '::'.join(t[0].name)][0]
>>> t
('std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >', <type: immutable:StructureTypeClass 'class'>)
>>> new_t = NamedTypeReferenceType.create_from_type("std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >", type = t[1])
>>> new_t
<type: immutable:NamedTypeReferenceClass 'class std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >'>
>>> bv.define_type(old_t[1].type_id, "std::__cxx11::string", new_t)
'std::__cxx11::string' But nothing happens. If I will undefine How I can change a type definition using API? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Here's the documentation for that: https://docs.binary.ninja/guide/type.html#type-modification But, you should never get a crash from undefining a type. I'm going to turn this into an issue to track that crash. |
Beta Was this translation helpful? Give feedback.
Here's the documentation for that: https://docs.binary.ninja/guide/type.html#type-modification
But, you should never get a crash from undefining a type. I'm going to turn this into an issue to track that crash.