✨ Add source files and build script
This commit is contained in:
parent
9d3394d21d
commit
2e23e3b21c
5 changed files with 42 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
patcher-installer
|
1
build.sh
Normal file
1
build.sh
Normal file
|
@ -0,0 +1 @@
|
|||
gcc -m64 -o patcher-installer src/main.c && chmod +x patcher-installer
|
6
src/decrypt.c
Normal file
6
src/decrypt.c
Normal 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
4
src/decrypt.h
Normal 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
30
src/main.c
Normal 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;
|
||||
}
|
Loading…
Reference in a new issue