41 lines
750 B
C
41 lines
750 B
C
#include <getopt.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <strings.h>
|
|
#include <unistd.h>
|
|
|
|
#include "getSize.h"
|
|
#include "readFile.h"
|
|
#include "modifyUID.h"
|
|
|
|
int main(int argc, char *argv[]) {
|
|
|
|
if (argc <= 1) {
|
|
puts("Please, specify a file next to the executable\n");
|
|
printf("Example:\n\t%s [file]\n", argv[0]);
|
|
exit(EXIT_SUCCESS);
|
|
}
|
|
|
|
FILE *file;
|
|
char *binfile = malloc(64 * sizeof(char));
|
|
if (binfile == NULL) {
|
|
puts("Failed to allocate memory");
|
|
exit(EXIT_FAILURE);
|
|
}
|
|
|
|
file = fopen(argv[argc - 1], "r+b");
|
|
if (file == NULL) {
|
|
perror("Error while opening the file");
|
|
exit(EXIT_FAILURE);
|
|
}
|
|
|
|
// readFile(file);
|
|
// getSize(file, argc, argv);
|
|
modifyUID(file);
|
|
|
|
|
|
fclose(file);
|
|
free(binfile);
|
|
exit(EXIT_SUCCESS);
|
|
}
|