fn get_new_bp()

in src/windows/pdb.rs [115:146]


    fn get_new_bp(file_name: &str, mapping: Option<Arc<PathMappings>>) -> Vec<u8> {
        let path = PathBuf::from("./test_data/windows");
        let mut path = path.join(file_name);

        if !path.exists() {
            path.set_extension("exe");
        }

        let pe_buf = crate::utils::read_file(&path);
        let (pe, pdb_buf, pdb_name) = crate::windows::utils::get_pe_pdb_buf(
            &path,
            &pe_buf,
            crate::cache::get_sym_servers(Some(&format!("SRV*~/symcache*{MS}"))).as_ref(),
        )
        .unwrap_or_else(|| (PeObject::parse(&pe_buf).unwrap(), vec![], "".to_string()));

        let mut output = Vec::new();
        let cursor = Cursor::new(&mut output);

        if pdb_buf.is_empty() {
            let pe = ObjectInfo::from_pe(file_name, pe).unwrap();
            pe.dump(cursor).unwrap();
        } else {
            let pdb = PdbObject::parse(&pdb_buf).unwrap();
            let pdb =
                ObjectInfo::from_pdb(pdb, &pdb_name, Some(file_name), Some(pe), mapping, false)
                    .unwrap();
            pdb.dump(cursor).unwrap();
        }

        output
    }