Skip to content

Commit 10a9a30

Browse files
committed
Update to latest LibAFL, reduce default core count
1 parent f4ed89f commit 10a9a30

File tree

2 files changed

+18
-33
lines changed

2 files changed

+18
-33
lines changed

cargo-libafl/cargo-libafl-runtime/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ edition = "2021"
1313
[workspace]
1414

1515
[dependencies]
16-
libafl = { git = "https://github.com/AFLplusplus/LibAFL.git", rev = "4375206" }
17-
libafl_targets = { git = "https://github.com/AFLplusplus/LibAFL.git", rev = "4375206", features = ["sancov_8bit", "sancov_cmplog"] }
16+
libafl = { git = "https://github.com/AFLplusplus/LibAFL.git", rev = "7ed1ac9" }
17+
libafl_targets = { git = "https://github.com/AFLplusplus/LibAFL.git", rev = "7ed1ac9", features = ["sancov_8bit", "sancov_cmplog"] }
1818
mimalloc = { version = "*", default-features = false }
1919
portpicker = "0.1.1"
20-
clap = { version = "3.2", features = ["derive"] }
20+
clap = { version = "4.0", features = ["derive"] }
2121

2222
[profile.release]
2323
lto = true

cargo-libafl/cargo-libafl-runtime/runtime.rs

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -62,86 +62,71 @@ fn timeout_from_millis_str(time: &str) -> Result<Duration, Error> {
6262
}
6363

6464
#[derive(Parser, Debug)]
65-
#[clap(
65+
#[command(
6666
name = "cargo-libafl",
6767
about = "A `cargo` wrapper to fuzz Rust code with `LibAFL`",
6868
author = "Andrea Fioraldi <andreafioraldi@gmail.com> and the LibAFL team"
6969
)]
7070
struct Opt {
71-
#[clap(
71+
#[arg(
7272
short,
7373
long,
74-
parse(try_from_str = Cores::from_cmdline),
74+
value_parser = Cores::from_cmdline,
7575
help = "Spawn a client in each of the provided cores. Broker runs in the 0th core. 'all' to select all available cores. 'none' to run a client without binding to any core. eg: '1,2-4,6' selects the cores 1,2,3,4,6.",
76-
default_value = "all",
76+
default_value = "1",
7777
name = "CORES"
7878
)]
7979
cores: Cores,
8080

81-
#[clap(
81+
#[arg(
8282
short = 'p',
8383
long,
8484
help = "Choose the broker TCP port, otherwise pick one at random",
8585
name = "PORT"
8686
)]
8787
broker_port: Option<u16>,
8888

89-
#[clap(
90-
parse(try_from_str),
91-
short = 'a',
92-
long,
93-
help = "Specify a remote broker",
94-
name = "REMOTE"
95-
)]
89+
#[arg(short = 'a', long, help = "Specify a remote broker", name = "REMOTE")]
9690
remote_broker_addr: Option<SocketAddr>,
9791

98-
#[clap(
99-
parse(try_from_str),
100-
short,
101-
long,
102-
help = "Set an initial corpus directory",
103-
name = "INPUT"
104-
)]
92+
#[arg(short, long, help = "Set an initial corpus directory", name = "INPUT")]
10593
input: Vec<PathBuf>,
10694

107-
#[clap(
95+
#[arg(
10896
short,
10997
long,
110-
parse(try_from_str),
11198
help = "Set the output directory, default is ./out",
11299
name = "OUTPUT",
113100
default_value = "./out"
114101
)]
115102
output: PathBuf,
116103

117-
#[clap(
118-
parse(try_from_str = timeout_from_millis_str),
104+
#[arg(
105+
value_parser = timeout_from_millis_str,
119106
short,
120107
long,
121-
help = "Set the execuution timeout in milliseconds, default is 1000",
108+
help = "Set the execution timeout in milliseconds, default is 1000",
122109
name = "TIMEOUT",
123110
default_value = "1000"
124111
)]
125112
timeout: Duration,
126113

127-
#[clap(
128-
parse(from_os_str),
114+
#[arg(
129115
short = 'x',
130116
long,
131117
help = "Feed the fuzzer with an user-specified list of tokens (often called \"dictionary\")",
132-
name = "TOKENS",
133-
multiple = true
118+
name = "TOKENS"
134119
)]
135120
tokens: Vec<PathBuf>,
136121

137-
#[clap(
122+
#[arg(
138123
long,
139124
help = "Disable unicode in the UI (for old terminals)",
140125
name = "DISABLE_UNICODE"
141126
)]
142127
disable_unicode: bool,
143128

144-
#[clap(
129+
#[arg(
145130
short = 'g',
146131
long,
147132
help = "Use GRIMOIRE, a mutator for text-based inputs",

0 commit comments

Comments
 (0)