Skip to content

Is there a way to remove a type definition from a type library? #2754

Answered by lwerdna
lwerdna asked this question in General
Discussion options

You must be logged in to vote

Type libraries are immutable, but you can effectively remove a definition by writing out a new type library using the API with everything except the type to be deleted.

Example script remove_type.py is at the end of this reply. To test:

  • run typelib_create.py from the API examples to create test.bntl
  • run typelib_dump.py from the API examples to see contents of test.bntl
  • run remove_type.py test.bntl Rectangle2
  • run typelib_dump.py to verify removal of type Rectangle2
#!/usr/bin/env pythonimport os, sys
import binaryninja
from binaryninja import typelibraryimport blacklistdef create_typelib(fname, name, arch, guid, dependency_name, alternate_names,
  platform_names, named_objects, n…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lwerdna
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment