-
Notifications
You must be signed in to change notification settings - Fork 1
/
interface.c
72 lines (64 loc) · 2 KB
/
interface.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
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <ctype.h>
#include <netdb.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <cstring>
#include <string>
#include <iostream>
#ifdef WINDOWS
#include <windows.h>
#endif
#include "interface.h"
#include "main.h"
#include "header.h"
void print (std::string text) {
std::cout << text;
return;
}
void printLine (std::string string) {
print ("[ ] " + string + "\n");
return;
}
void printTitle () {
print (" _ _ \n");
print (" | | | | \n");
print (" _ __ ___ ___| |_ __ _ _ __ ___ ___ _ __ _ __ | |__ \n");
print (" | '_ ` _ \\ / _ \\ __|/ _` | '_ ` _ \\ / _ \\| '__| '_ \\| '_ \\ \n");
print (" | | | | | | __/ |_| (_| | | | | | | (_) | | | |_) | | | |\n");
print (" |_| |_| |_|\\___|\\__|\\__,_|_| |_| |_|\\___/|_| | .__/|_| |_|\n");
print (" | | \n");
print (" |_| \n");
print ("\n");
printLine ("Metamorph " + itoa (VERSION_MAJOR) + "." + itoa (VERSION_MINOR) + "." + itoa (VERSION_BUILD));
printLine ("By Quetuo (http://www.quetuo.net)");
printLine ("For XtremeRoot.net");
return;
}
void printUsage () {
printLine ("Usage:");
printLine ("metamorph [-options]");
printLine ("\t-i\tInput file (must be readable)");
printLine ("\t-b\tBlock size (default 128 bits)");
printLine ("\t-v\tIncrease verbosity");
printLine ("Example: metamorph -i input.exe -b 256 -v -v");
return;
}
void printError (std::string error) {
#ifdef LINUX
std::cout << "\033[22;31m *** " << error << " *** \033[0m" << std::endl;
#endif
#ifdef WINDOWS
std::cout << " *** " << error << " *** " << std::endl;
#endif
return;
}
void printDebug (int level, std::string f, std::string debug) {
if (getVerbosity () >= level) {
std::cout << "\033[22;32m [" << f << "] " << debug << " \033[0m" << std::endl;
}
return;
}