LIEF can create, modify, or delete PE debug information entries.
IMAGE_DIRECTORY_ENTRY_DEBUG
and
are represented in LIEF through the class.import lief
pe: lief.PE.Binary = ...
pe.codeview_pdb.filename = r"C:\A\B\C\path.pdb"
pe.write("out.dll")
#include <LIEF/PE.hpp>
std::unique_ptr<LIEF::PE::Binary> pe;
pe->codeview_pdb("C:\\A\\B\\C\\path.pdb");
pe->write("out.dll");
let mut pe: lief::pe::Binary;
pe.codeview_pdb().unwrap().set_filename(r#"C:\A\B\C\path.pdb"#);
pe.write("out.exe");
import lief
pe: lief.PE.Binary = ...
# Remove a single CodeViewPDB entry
pe.remove_debug(pe.codeview_pdb)
# Remove all entries
pe.clear_debug()
pe.write("out.dll")
#include <LIEF/PE.hpp>
std::unique_ptr<LIEF::PE::Binary> pe;
// Remove a single CodeViewPDB entry
pe->remove_debug(*pe->codeview_pdb());
// Remove all entries
pe->clear_debug();
pe->write("out.dll");
let mut pe: lief::pe::Binary;
// Remove a single CodeViewPDB entry
pe.remove_debug(pe.codeview_pdb().unwrap());
// Remove all entries
pe.clear_debug();
pe.write("out.exe");
import lief
pe: lief.PE.Binary = ...
cv = lief.PE.CodeViewPDB("MyCustom.pdb")
pe.add_debug_info(cv)
pe.write("out.dll")
#include <LIEF/PE.hpp>
std::unique_ptr<LIEF::PE::Binary> pe;
LIEF::PE::CodeViewPDB cv("MyCustom.pdb");
pe->add_debug_info(cv);
pe->write("out.dll");
let mut pe: lief::pe::Binary;
let cv = lief::pe::debug::CodeViewPDB::with_filename("MyCustom.pdb");
pe.add_debug_info(&cv);
pe.write("out.exe");