Add source files and build script

This commit is contained in:
C-3PO 2018-07-17 14:05:22 +02:00
parent 9d3394d21d
commit 2e23e3b21c
Signed by: c3po
GPG key ID: 62993C4BB4D86F24
5 changed files with 42 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
patcher-installer

1
build.sh Normal file
View file

@ -0,0 +1 @@
gcc -m64 -o patcher-installer src/main.c && chmod +x patcher-installer

6
src/decrypt.c Normal file
View file

@ -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) {
//...
}

4
src/decrypt.h Normal file
View file

@ -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);

30
src/main.c Normal file
View file

@ -0,0 +1,30 @@
//for printf()
#include <stdio.h>
//for errno
#include <errno.h>
//for strerror()
#include <string.h>
//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;
}