b0VIM 9.0b_e‘Ó›QlyteLytes-Mac-mini.local~lyte/shared/hyperpom-upstream/examples/upng_fuzzer/src/upngzz.rsutf-8
U3210#"! Utpt	vQ~ad€«tÏ‘ª∫îÇnN5Ì’‘æΩoVN!Ò
Ÿ
≈
∞
ò
Å

~
`
C
3

Ï“—µänlkT8√í}|=—
∂
µ
ô
H

ˇ	˛	⁄	á	W	@	?			˙‡¿§ùàáC˙⁄Ÿúê{dG.˚Ù‡ﬁ›∆©Ö4ÓÌÆrB'&ˇ™yba:Î∫¶•h\G0˙«ø¬¿øôd}    usize::from_str_radix(hex_stripped, 16).expect("could not parse hex number")    let hex_stripped = hex.trim_start_matches("0x");pub fn from_hex(hex: &str) -> usize {                value_parser=clap_num::maybe_hex::<usize>,        required = true,        value_name = "SIZE",        long = "size",        short = 's',    #[clap(    /// Physical address space size available to the fuzzer.    trace: PathBuf,        value_hint = clap::ValueHint::FilePath)]    #[clap(short = 'o', long = "trace", value_name = "TRACE", required = true,    /// Path to the trace output file.    testcase: PathBuf,        value_hint = clap::ValueHint::FilePath)]    #[clap(short = 't', long = "testcase", value_name = "TESTCASE", required = true,    /// Path to the testcase to trace.    libs: Option<PathBuf>,        value_hint = clap::ValueHint::DirPath)]    #[clap(short = 'l', long = "libs", value_name = "LIBS",    /// Path to the directory containing the shared libraries.    binary: PathBuf,        value_hint = clap::ValueHint::FilePath)]    #[clap(short = 'b', long = "binary", value_name = "BINARY", required = true,    /// Path to the binary to fuzz.pub struct TraceSubCommand {#[derive(Debug, Args)]}    as_size: usize,    )]        value_parser=clap_num::maybe_hex::<usize>,        required = true,        value_name = "SIZE",        long = "size",        short = 's',    #[clap(    /// Physical address space size available to the fuzzer.    nb_iterations: Option<u64>,    #[clap(short = 'i', long = "iterations", value_name = "ITERATIONS")]    /// Number of testcases executed by the worker before stopping.    nb_workers: u32,    )]        default_value = "1"        value_name = "WORKERS",        long = "workers",        short = 'w',    #[clap(    /// Number of workers to spawn.    work_dir: PathBuf,        value_hint = clap::ValueHint::DirPath)]    #[clap(short = 'd', long = "workdir", value_name = "WORKDIR", required = true,    /// Path to the work directory.    corpus_dir: PathBuf,        value_hint = clap::ValueHint::DirPath)]    #[clap(short = 'c', long = "corpus", value_name = "CORPUS", required = true,    /// Path to the corpus.    libs: Option<PathBuf>,        value_hint = clap::ValueHint::DirPath)]    #[clap(short = 'l', long = "libs", value_name = "LIBS",    /// Path to the directory containing the shared libraries.    binary: PathBuf,        value_hint = clap::ValueHint::FilePath)]    #[clap(short = 'b', long = "binary", value_name = "BINARY", required = true,    /// Path to the binary to fuzz.pub struct FuzzSubCommand {#[derive(Debug, Args)]}    Trace(TraceSubCommand),    #[clap(arg_required_else_help = true)]    /// Tracing subcommand.    Fuzz(FuzzSubCommand),    #[clap(arg_required_else_help = true)]    /// Fuzzing subcommand.enum Commands {#[derive(Debug, Subcommand)]/// Fuzzer's CLI subcommands.}    command: Commands,    #[clap(subcommand)]    /// Subcommands.pub struct Config {    long_about = None)]    about = "upng fuzzer",    version = "1.0",    author = "lyte <hyperpom@impalabs.com>",#[clap(#[derive(Parser, Debug)]/// The configuration object created from the CLI arguments passed to upngzz.use crate::loader::*;use hyperpom::hooks::*;use hyperpom::crash::*;use hyperpom::corpus::*;use hyperpom::core::*;use hyperpom::config::*;use hyperpom::applevisor as av;use hyperpom as hp;use eyre::Result;use clap::{Args, Parser, Subcommand};use std::time::Duration;use std::path::PathBuf;use std::io::Write;ad"ÇQ”∏éb\ZY%˙øùn=÷
æ
•
ä
Ñ
a
C
&
ÒŒ®öp_˝Á◊Ã …ìj?	Á
¬
à
Y
(

≤	õ	t	W	A		
	„Ãt>(‘±j_]\∞ÜV@+Îÿƒ≠z0˝ßüÑÇÅ}    Ok(ExitKind::Continue)    });        writeln!(trace, "{}", insn).expect("could append instructions to the trace");        let insn = insns.as_ref().get(0).unwrap();            .expect("could not disassemble while adding coverage hooks");            .disasm_count(args.insn, args.addr, 1)        let insns = cs    CSE.with(|cs| {        .unwrap();        .open(&gd.path.as_ref().unwrap())        .append(true)        .write(true)        .create(true)    let mut trace = std::fs::OpenOptions::new()    let gd = args.gdata.write().unwrap();pub fn tracer_hook(args: &mut HookArgs<LocalData, GlobalData>) -> hp::error::Result<ExitKind> {/// Handles tracing hooks and displays the current instruction to `stdout`.}    Ok(())    println!("Testcase covered {:?} paths", executor.cdata.set.len());    println!("{}", executor.vcpu);    executor.run(Some(&testcase)).expect("execution failed");    executor.init()?;    // Start tracing!            .expect("could not create the executor");        Executor::<PngLoader, LocalData, GlobalData>::new(config, loader, ldata, gdata)    let mut executor =    // Creates an instance of the fuzzer.        .build();        .tracer_hook(tracer_hook)        .tracer(true)        .iterations(Some(1))        .timeout(Duration::new(60, 0))        .nb_workers(1)    let config = ExecConfig::<LocalData, GlobalData>::builder(config.as_size)    // Creates a config for the fuzzer.    let loader = PngLoader::new(config.binary)?;    // Creates a loader for the target binary.    let testcase = Testcase::from_file(config.testcase)?;    // Reads the testcase from disk.    let ldata = LocalData::new();    let gdata = GlobalData::new(Some(&config.trace));    // Instanciates global and local data.    let _vm = av::VirtualMachine::new();pub fn trace(config: TraceSubCommand) -> Result<()> {}    Ok(())    hp.fuzz()?;    // Start fuzzing!        HyperPom::<_, _, _>::new(config, loader, ldata, gdata).expect("could not create fuzzer");    let mut hp =    // Creates an instance of the fuzzer.    .build();    .iterations(config.nb_iterations)    .timeout(Duration::new(60, 0))    .max_testcase_size(PngLoader::TESTCASE_MAX_SIZE)    .max_nb_mutations(0x800)    .seed(0xdeadbeefdeadbeef)    .nb_workers(config.nb_workers)    )        config.corpus_dir,        config.work_dir,        config.as_size,    let config = FuzzConfig::<LocalData, GlobalData>::builder(    // Creates a config for the fuzzer.    let loader = PngLoader::new(config.binary)?;    // Creates a loader for the target binary.    let ldata = LocalData::new();    let gdata = GlobalData::new(None::<&std::path::Path>);    // Instanciates global and local data.pub fn fuzz(config: FuzzSubCommand) -> Result<()> {}    }        Commands::Trace(sub) => trace(sub),        Commands::Fuzz(sub) => fuzz(sub),    match config.command {pub fn entry(config: Config) -> Result<()> {adÛ3	˘Â„‚ºá643}    usize::from_str_radix(hex_stripped, 16).expect("could not parse hex number")    let hex_stripped = hex.trim_start_matches("0x");pub fn from_hex(hex: &str) -> usize {}    as_size: usize,    )]