annotate msvpvf.c @ 3:87c7d43b03ff

Add support for runtime inputs
author Paper <mrpapersonic@gmail.com>
date Thu, 20 Jan 2022 23:00:18 -0500
parents 528b95e1e24f
children 78a0ecd756da
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
1 /* Movie Studio / Vegas Pro version spoofer
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
2 * by Paper
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
3 */
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
4
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
5 #include <stdio.h>
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
6 #include <unistd.h>
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
7 #include <getopt.h>
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
8 #include <inttypes.h>
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
9 #include <string.h>
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
10 #include <stdlib.h>
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
11 #if __STDC_VERSION__ >= 199901L
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
12 #include <stdbool.h>
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
13 #else
3
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
14 typedef enum { false, true } bool; /* less than C99 */
1
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
15 #endif
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
16 #ifdef _MSC_VER
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
17 #define strdup(p) _strdup(p)
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
18 #endif
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
19
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
20 static struct option options_long[] = {
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
21 {"input", required_argument, NULL, 'i'},
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
22 {"output", required_argument, NULL, 'o'},
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
23 {"version", required_argument, NULL, 'v'},
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
24 {"type", required_argument, NULL, 't'},
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
25 {"help", 0, NULL, 'h'}
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
26 };
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
27
3
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
28 char* strremove(char* str, const char* sub) {
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
29 size_t len = strlen(sub);
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
30 if (len > 0) {
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
31 char *p = str;
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
32 while ((p = strstr(p, sub)) != NULL) {
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
33 memmove(p, p + len, strlen(p + len) + 1);
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
34 }
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
35 }
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
36 return str;
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
37 }
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
38
1
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
39 void set_data(unsigned char magic[], uint16_t version, FILE* target) {
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
40 int i;
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
41 fseek(target, 0x46, SEEK_SET);
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
42 fputc(version, target);
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
43 for (i=0; i<=sizeof(*magic); ++i) {
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
44 fseek(target, 0x18+i, SEEK_SET);
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
45 fputc(magic[i], target);
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
46 }
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
47 }
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
48
3
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
49 int copy_file(char* source_file, char* target_file) {
1
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
50 FILE *source, *target;
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
51
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
52 source = fopen(source_file, "rb");
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
53 if (source == NULL) {
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
54 return 1;
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
55 }
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
56 target = fopen(target_file, "wb");
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
57 if (target == NULL) {
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
58 return 1;
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
59 }
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
60
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
61 size_t n, m;
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
62 unsigned char buff[8192];
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
63 do {
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
64 n = fread(buff, 1, sizeof(buff), source);
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
65 if (n) m = fwrite(buff, 1, n, target);
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
66 else m = 0;
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
67 } while ((n > 0) && (n == m));
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
68
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
69 fclose(target);
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
70 fclose(source);
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
71 return 0;
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
72 }
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
73
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
74 int main(int argc, char *argv[]) {
3
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
75 int c, option_index = 0;
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
76 unsigned char magic[16];
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
77 FILE* outfile;
1
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
78 struct arguments {
3
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
79 char input[128];
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
80 char output[128];
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
81 int version;
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
82 char type[128];
1
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
83 } args;
3
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
84 strcpy(args.input, " ");
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
85 strcpy(args.output, " ");
1
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
86 args.version = -1;
3
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
87 strcpy(args.type, " ");
1
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
88
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
89 while ((c = getopt_long(argc, argv, "i:o:v:t:h", options_long, &option_index)) != -1)
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
90 switch(c) {
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
91 case 'i':
3
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
92 strncpy(args.input, optarg, sizeof(args.input)-1); /* subtract 1 to make sure it's "null-safe" */
1
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
93 break;
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
94 case 'o':
3
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
95 strncpy(args.output, optarg, sizeof(args.input)-1);
1
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
96 break;
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
97 case 'v':
3
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
98 args.version = abs(atoi(strdup(optarg))); /* abs() for possible negative inputs */
1
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
99 break;
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
100 case 't':
3
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
101 strncpy(args.type, optarg, sizeof(args.input)-1);
1
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
102 break;
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
103 case 'h':
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
104 default:
3
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
105 printf("msvpvf by Paper\nusage: %s (-i/--input) infile [(-o/--output) outfile] (-v/--version) version (-t/--type) [vf, veg]", argv[0]);
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
106 return 0;
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
107 }
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
108 int* ptr = &args.version;
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
109 if (argc <= 5) {
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
110 if (strcmp(args.input, " ") == 0) {
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
111 printf("Input file name?\n");
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
112 fflush(stdout);
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
113 fgets(args.input, sizeof(args.input)-1, stdin);
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
114 args.input[strcspn(args.input, "\r\n")] = 0;
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
115 }
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
116 if (strcmp(args.output, " ") == 0) {
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
117 char* temp;
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
118 temp = strncat(strncat("PRO_V", (char*)(intptr_t)args.version, 7), args.input, 127);
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
119 char* file_extension = strrchr(args.input, ('.')); /* this won't work if your path is /path.to/file but why would you do that in the first place */
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
120 strncpy(args.output, strncat(strncat(strremove(temp, file_extension), ".", 127), args.type, 127), 127);
1
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
121 }
3
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
122 if (args.version == -1) {
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
123 printf("What version would you like to convert to?\n");
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
124 fflush(stdout);
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
125 scanf("%d", ptr);
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
126 }
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
127 if (strcmp(args.type, " ") == 0) {
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
128 printf("Which type of project file would you like to use?[veg/vf]:\n");
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
129 fflush(stdout);
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
130 fgets(args.type, sizeof(args.input)-1, stdin);
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
131 args.type[strcspn(args.type, "\r\n")] = 0;
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
132 }
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
133 if (argc == 1) {
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
134 printf("msvpvf by Paper\nusage: %s -i infile [-o outfile] -v version -t [vf, veg]", argv[0]);
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
135 return 0;
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
136 }
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
137 }
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
138 if (access(args.input, F_OK) != 0) { /* input file doesn't exist */
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
139 fprintf(stderr, "Input file %s doesn't exist! Exiting.", args.input);
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
140 return 1;
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
141 }
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
142 if (fgetc(fopen(args.input, "r")) == EOF) { /* input file is empty */
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
143 fprintf(stderr, "Input file %s is empty.", args.input);
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
144 return 1;
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
145 }
1
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
146 if (strcmp(args.type, "veg") == 0) {
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
147 unsigned char T[] = {0xEF, 0x29, 0xC4, 0x46, 0x4A, 0x90, 0xD2, 0x11, 0x87, 0x22, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A};
3
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
148 for (option_index = 0; option_index <= 15; option_index++) {
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
149 magic[option_index] = T[option_index];
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
150 }
1
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
151 } else if (strcmp(args.type, "vf") == 0) {
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
152 unsigned char T[] = {0xF6, 0x1B, 0x3C, 0x53, 0x35, 0xD6, 0xF3, 0x43, 0x8A, 0x90, 0x64, 0xB8, 0x87, 0x23, 0x1F, 0x7F};
3
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
153 for (option_index = 0; option_index <= 15; option_index++) {
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
154 magic[option_index] = T[option_index];
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
155 }
1
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
156 } else {
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
157 fprintf(stderr, "Type %s is invalid!", args.type);
3
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
158 return 1;
1
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
159 }
3
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
160 copy_file(args.input, args.output);
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
161 outfile = fopen(args.output, "r+b");
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
162 set_data(magic, args.version, outfile);
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
163 fclose(outfile);
87c7d43b03ff Add support for runtime inputs
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
164 return 0;
1
528b95e1e24f Add source and makefile
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
165 }