Skip to content

Commit

Permalink
blah
Browse files Browse the repository at this point in the history
  • Loading branch information
ragusaa committed Feb 27, 2024
1 parent 715946c commit beef30b
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions libclamav_rust/src/scanners.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,30 +38,6 @@ use crate::{
sys::{cl_error_t, cl_error_t_CL_ERROR, cl_error_t_CL_SUCCESS, cli_ctx, cli_magic_scan_buff},
};

// /* DELETEME*/
//use std::fs::create_dir_all;
//use std::fs::File;
//use std::io::Write;
//const DUMP_DIRECTORY: &str = "dump_files";
//fn dump_file(name: &str, buf: &[u8], ctx: *mut cli_ctx){
//
// let fmap = unsafe { ctx::current_fmap(ctx).expect("")};
//
// //let mut temp: String = String::from(out_dir);
// let mut temp: String = DUMP_DIRECTORY.to_string();
// temp.push('/');
// temp.push_str( fmap.name());
// temp.push('/');
// temp.push_str(name);
// temp = temp.replace('\\', "/");
//
// let p = Path::new(&temp);
// create_dir_all(p.parent().unwrap()).expect("");
//
// let mut out = File::create(&temp).expect("Error creating output file");
// out.write_all(buf).expect("Error writing to file");
//}
// /* END DELETEME*/
/// Rust wrapper of libclamav's cli_magic_scan_buff() function.
/// Use magic sigs to identify the file type and then scan it.
fn magic_scan(ctx: *mut cli_ctx, buf: &[u8], name: Option<String>) -> cl_error_t {
Expand Down Expand Up @@ -190,17 +166,6 @@ pub unsafe extern "C" fn extract_alz(ctx: *mut cli_ctx) -> cl_error_t {
}
};

// /* DELETE ME!!! */
// for i in 0..alz.embedded_files.len(){
// let name = match alz.embedded_files[i].name.clone() {
// Some(name) => name,
// None => String::from(""),
// };
//
// let buf: &[u8] = &alz.embedded_files[i].data;
// dump_file(&name, buf, ctx);
// }
// /* END DELETE ME!!! */
for i in 0..alz.embedded_files.len() {
let ret = magic_scan(
ctx,
Expand Down

0 comments on commit beef30b

Please sign in to comment.