fn make_stub(opts: &Opts) -> Result<String> {
    let templ = match &opts.template_path {
        Some(path) => {
            let data = fs::read(path).context(ReadError)?;
            String::from_utf8(data).context(Utf8Error)?
        }
        None => include_str!("template.py").to_string(),
    };

    let exe = match opts.bin.as_ref() {
        Some(b) => b.to_str().unwrap().to_string(),
        None => "".to_string(),
    };

    let libc = match opts.libc.as_ref() {
        Some(l) => l.to_str().unwrap().to_string(),
        None => "".to_string(),
    };

    let mut handlebars = Handlebars::new();
    handlebars.register_template_string("solve", templ.to_owned()).context(TmplError)?;

    let mapping = Bindings { exe, libc };

    Ok(handlebars.render("solve", &mapping).context(RenderError)?)
}
/// Fill in template pwntools solve script with (binary, libc, linker) paths
Fill in template pwntools solve script with (binary, libc, linker) paths
Fill in template pwntools solve script with ( binary libc linker ) paths
fn make_stub(opts: &Opts) -> Result<String> {
    let templ = match &opts.template_path {
        Some(path) => {
            let data = fs::read(path).context(ReadError)?;
            String::from_utf8(data).context(Utf8Error)?
        }
        None => include_str!("template.py").to_string(),
    };
    let exe = match opts.bin.as_ref() {
        Some(b) => b.to_str().unwrap().to_string(),
        None => "".to_string(),
    };
    let libc = match opts.libc.as_ref() {
        Some(l) => l.to_str().unwrap().to_string(),
        None => "".to_string(),
    };
    let mut handlebars = Handlebars::new();
    handlebars.register_template_string("solve", templ.to_owned()).context(TmplError)?;
    let mapping = Bindings { exe, libc };
    Ok(handlebars.render("solve", &mapping).context(RenderError)?)
}
fn make_stub ( opts : & Opts ) -> Result < String > { let templ = match & opts . template_path { Some ( path ) => { let data = fs :: read ( path ) . context ( ReadError ) ? ; String :: from_utf8 ( data ) . context ( Utf8Error ) ? } None => include_str ! ( " " ) . to_string ( ) , } ; let exe = match opts . bin . as_ref ( ) { Some ( b ) => b . to_str ( ) . unwrap ( ) . to_string ( ) , None => " " . to_string ( ) , } ; let libc = match opts . libc . as_ref ( ) { Some ( l ) => l . to_str ( ) . unwrap ( ) . to_string ( ) , None => " " . to_string ( ) , } ; let mut handlebars = Handlebars :: new ( ) ; handlebars . register_template_string ( " " , templ . to_owned ( ) ) . context ( TmplError ) ? ; let mapping = Bindings { exe , libc } ; Ok ( handlebars . render ( " " , & mapping ) . context ( RenderError ) ? ) }
Fill in template pwntools solve script with (binary, libc, linker) paths
Fill in template pwntools solve script with ( binary libc linker ) paths
opts
&Opts