-
Notifications
You must be signed in to change notification settings - Fork 102
/
decryptlog.c
49 lines (40 loc) · 952 Bytes
/
decryptlog.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(int argc, char **argv[])
{
char Lala[1024];
if (argc < 2) {
printf("BLAH#!whats logfile?\n");
exit(0);
}
Decrypt(argv[1], "/tmp/.tempZz");
sprintf(Lala, "cat /tmp/.tempZz");
system(Lala);
}
int Decrypt (char *FILENAME, char *NEW_FILENAME)
{
FILE *inFile; //Declare inFile
FILE *outFile; //Declare outFile
char Byte;
char newByte;
char Lala[1024];
// int i=0;
inFile = fopen(FILENAME, "rb");
outFile = fopen(NEW_FILENAME, "w");
if (inFile == NULL || outFile == NULL) {
return 1;
} else {
while (1) {
printf(".");
while ( !feof( inFile ) ) {
Byte = fgetc(inFile);
newByte = Byte - 25;
fputc(newByte, outFile);
}
break;
}
fclose(inFile);
fclose(outFile);
}
}