diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..812878b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +patcher-installer diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..ab6bd7c --- /dev/null +++ b/build.sh @@ -0,0 +1 @@ +gcc -m64 -o patcher-installer src/main.c && chmod +x patcher-installer diff --git a/src/decrypt.c b/src/decrypt.c new file mode 100644 index 0000000..628aef1 --- /dev/null +++ b/src/decrypt.c @@ -0,0 +1,6 @@ +#include "decrypt.h" + +/** Decrypts the given input in-place. The input buffer will be modified. */ +void decrypt(unsigned char chunk[], unsigned long length) { + //... +} diff --git a/src/decrypt.h b/src/decrypt.h new file mode 100644 index 0000000..b368470 --- /dev/null +++ b/src/decrypt.h @@ -0,0 +1,4 @@ +#pragma once + +/** Decrypts the given input in-place. The input buffer will be modified. */ +void decrypt(unsigned char chunk[], unsigned long length); diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..dadd269 --- /dev/null +++ b/src/main.c @@ -0,0 +1,30 @@ +//for printf() +#include +//for errno +#include +//for strerror() +#include + +//Import our code +#include "decrypt.h" + +void getFileReader(unsigned char path[], unsigned long offset, unsigned long length) { + //Opens the given file at the given address + //Returns a function that will read into memory and return that memory. + + FILE *fileFrom = NULL; + char* fileName = path; + + fileFrom = fopen(fileName, "r"); + if (fileFrom == NULL) { + fprintf(stderr, "Could not open file %s for reading: %s\n", fileName, strerror(errno)); + //error(); + } +} + +int main(int argc, unsigned char *argv[]) { + printf("Hello World!\n"); + + getFileReader("1234", 0, 10); + return 0; +}