From 2e23e3b21ca1c957a616bc4946ee59b72c436a9b Mon Sep 17 00:00:00 2001 From: C-3PO Date: Tue, 17 Jul 2018 14:05:22 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20source=20files=20and=20build?= =?UTF-8?q?=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + build.sh | 1 + src/decrypt.c | 6 ++++++ src/decrypt.h | 4 ++++ src/main.c | 30 ++++++++++++++++++++++++++++++ 5 files changed, 42 insertions(+) create mode 100644 .gitignore create mode 100644 build.sh create mode 100644 src/decrypt.c create mode 100644 src/decrypt.h create mode 100644 src/main.c 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; +}