br0kej / faser Goto Github PK
View Code? Open in Web Editor NEWCross-Architecture Function Similarity Search Model - https://arxiv.org/abs/2310.03605
License: MIT License
Cross-Architecture Function Similarity Search Model - https://arxiv.org/abs/2310.03605
License: MIT License
Was getting some errors when generating esil and disasm from cfg.
Error creating file "test_file_cfg"-dis-singles.txt: No such file or directory (os error 2)
I looks like it was adding a "
to the text file.
I modified the code and it works now. I will continue to look at other features to make sure no other bugs are found.
/// Generates a file containing every instruction within each of the functions
/// within the AGFJFile.
///
/// This ignores control flow and simple iterates the JSON objects from the top to
/// the bottom.
pub fn generate_linear_bb_walk(mut self, esil: bool) {
//let fname_string: PathBuf = get_save_file_path(&self.filename, &self.output_path, None, None);
//let fname_string = if esil {format!("{:?}-esil-singles.txt", fname_string)} else {format!("{:?}-dis-singles.txt", fname_string)};
let fname_string: PathBuf = get_save_file_path(&self.filename, &self.output_path, None, None);
let fname_string = if esil {format!("{}-esil-singles.txt", fname_string.display())} else {format!("{}-dis-singles.txt", fname_string.display())};
if !Path::new(&fname_string).exists() {
self.load_and_deserialize()
.expect("Unable to load and desearlize JSON");
let (sender, receiver) = channel();
self.functions.unwrap().par_iter_mut().for_each_with(
sender,
|s, func: &mut Vec<AGFJFunc>| {
s.send(func[0].get_function_instructions(esil, &self.min_blocks, self.reg_norm))
.unwrap()
},
);
let res: Vec<Vec<String>> = receiver.iter().filter(|x| x.is_some()).flatten().collect();
//let write_file = File::create(fname_string).unwrap();
let write_file = match File::create(&fname_string) {
Ok(file) => file,
Err(e) => {
//eprintln!("Error creating file: {}", e);
eprintln!("Error creating file {}: {}", fname_string, e);
return;
}
};
let mut writer = BufWriter::new(&write_file);
for func in res {
for bb in func {
writer
.write_all(bb.as_bytes())
.expect("Unable to write bytes.");
writer.write_all(b"\n").expect("Unable to write bytes.");
}
}
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.