Skip to content

Migrate to newest libafl #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
libafl_targets = {git = "https://github.com/wtdcode/LibAFL", branch = "ucafl", features = ["pointer_maps"]}
libafl = {git = "https://github.com/wtdcode/LibAFL", branch = "ucafl"}
libafl_bolts = {git = "https://github.com/wtdcode/LibAFL", branch = "ucafl"}
libafl_targets = { git = "https://github.com/AFLplusplus/LibAFL", features = ["pointer_maps", "forkserver"] }
libafl = { git = "https://github.com/AFLplusplus/LibAFL" }
libafl_bolts = { git = "https://github.com/AFLplusplus/LibAFL" }

serde ={ version = "1.0", features = ["derive"] }
unicorn-engine = { git = "https://github.com/unicorn-engine/unicorn", branch = "dev"}
Expand Down
6 changes: 3 additions & 3 deletions examples/sample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn place_input_cb<'a, D: 'a>(
return false;
}
let cp_len = input.len().min(8);
buf[0..cp_len].copy_from_slice(input);
buf[0..cp_len].copy_from_slice(&input[0..cp_len]);
let rdx = u64::from_le_bytes(buf);
uc.reg_write(RegisterX86::RDX, rdx)
.expect("Fail to write reg");
Expand All @@ -23,7 +23,7 @@ fn place_input_cb<'a, D: 'a>(
}

fn main() {
let input_file = std::env::args().into_iter().skip(1).nth(0);
let input_file = std::env::args().nth(1);
let mut uc = Unicorn::new_with_data(Arch::X86, Mode::MODE_64, UnicornFuzzData::default())
.expect("fail to open uc");
// ks.asm("mov rax, rdx; cmp rax, 0x114514; je die; xor rax, rax; die: mov rax, [rax]; xor rax, rax")
Expand All @@ -33,7 +33,7 @@ fn main() {
let pc = 0x1000;
uc.reg_write(RegisterX86::RIP, pc)
.expect("fail to write pc");
let input_file = input_file.map(|t| PathBuf::from(t));
let input_file = input_file.map(PathBuf::from);
afl_fuzz(
uc,
input_file,
Expand Down
Loading