Debug Modification

LIEF can create, modify, or delete PE debug information entries.

PE Debug Overview
This debug information is located in the IMAGE_DIRECTORY_ENTRY_DEBUG and is represented in LIEF through the class.
These entries can be modified using the API exposed by these structures. For example, the PDB path referenced in a entry can be changed as follows:
pe: lief.PE.Binary

assert isinstance(pe.codeview_pdb, lief.PE.CodeViewPDB)
pe.codeview_pdb.filename = r"C:\A\B\C\path.pdb"

pe.write("out.dll")
# Remove a single CodeViewPDB entry
assert pe.codeview_pdb is not None
pe.remove_debug(pe.codeview_pdb)

# Remove all entries
pe.clear_debug()

pe.write("out.dll")
cv = lief.PE.CodeViewPDB("MyCustom.pdb")

pe.add_debug_info(cv)

pe.write("out.dll")