diff --git a/Cargo.toml b/Cargo.toml index f2168ab..a700097 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,10 @@ name = "dll2shell" version = "0.1.0" edition = "2021" +[lib] +name = "dll2shell" +path = "src/lib.rs" + # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..535afff --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,14 @@ +use std::fs::File; +use std::io::Write; +mod shellcode; + + pub fn gen_shellcode (args: Vec) { // create shellcode and output to file + + //println!("args: {:?}", args); + let link_shellcode = shellcode::shellcode_rdi(&args[1], &args[2], "".to_string()); + let mut output_file = File::create("shellcode.bin").expect("could not write file"); + output_file + .write_all(&link_shellcode) + .expect("could not write contents to output file"); + println!("output: shellcode.bin"); + } \ No newline at end of file