-
Notifications
You must be signed in to change notification settings - Fork 0
/
hide_text.c
80 lines (68 loc) · 2.04 KB
/
hide_text.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include "./include/wingetopt.h"
#include "./include/stego_proccessor.h"
void print_help();
int main(int argc, char** argv)
{
uint32 bitsOffset, fSize;
uint32 c;
char *bmpFileName = NULL, *targetFileName = NULL, *outFileName = NULL;
byte mode;
while ((c = getopt(argc, argv, "i:t:o:puh")) != -1)
{
switch(c)
{
case 'i':
{
bmpFileName = optarg;
break;
}
case 't':
{
targetFileName = optarg;
break;
}
case 'o':
{
outFileName = optarg;
break;
}
case 'p':
{
mode = MODE_PACK;
break;
}
case 'u':
{
mode = MODE_UNPACK;
break;
}
case 'h':
default:
{
print_help();
return STATUS_SUCCESS;
}
}
}
if (mode == 0)
{
printf("Program mode is not specified\n");
ERR(STATUS_INVALID_PARAMETERS);
}
else return stego_proccess(bmpFileName, targetFileName, outFileName, mode);
}
void print_help()
{
printf("\n*********************************\n");
printf("** Simple Steganografy program **\n");
printf("*********************************\n\n");
printf("-i <filename> -> input bmp file name\n");
printf("-t <filename> -> name of file which should be pack into picture\n");
printf("-o <filename> -> output file name (*.bmp)\n\n");
printf("-h -> show this manual info\n");
printf("-p -> pack information\n");
printf("-u -> unpack information\n\n");
printf("Example:\n\n");
printf("> program_name.exe -i test.bmp -t secret.txt -o test-out.bmp -p\n\n");
printf("> program_name.exe -i test-out.bmp -o secret.txt -u\n\n");
}