This repository has been archived by the owner on May 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
78 lines (69 loc) · 2.09 KB
/
main.cpp
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
#include "main.h"
int main()
{
cout << "File name or path: ";
getline(std::cin, filename);
filename.erase(remove(filename.begin(), filename.end(), '"'), filename.end());//Removing "
if (strcmp(extension(filename).c_str(), "webm")==0 && strcmp(extension(filename).c_str(), "mp4")==0)
{
cout << "Please try again with a .webm/.mp4 video (You can use a online video converter)." << endl;
system("pause");
system("cls");
main();
}
fstream binaryFile(filename, ios::in | ios::out | ios::binary);
if (binaryFile.is_open())
{
while (!binaryFile.eof())
{
if (!strcmp(extension(filename).c_str(), "webm")) //Converter WEBM
{
if (search(input_iter_t(binaryFile), input_iter_t(), search_001, search_001 + SIZE_001) != input_iter_t())
{
cout << "Address Found!" << endl;
cout << "Applying exploit.." << endl;
binaryFile.seekp(-SIZE_001, ios::cur);
binaryFile.write(reinterpret_cast<const char*>(replace_001), SIZE_002);
cout << "Sucessfull!" << endl;
break;
}
else
{
cout << "Address not find. Make sure your file is not corrupted or try convert to .webm again." << endl;
}
}
else if (!strcmp(extension(filename).c_str(), "mp4")) //Converter MP4
{
if (search(input_iter_t(binaryFile), input_iter_t(), searchmp4_001, searchmp4_001 + SIZEMP4_001) != input_iter_t())
{
cout << "Address Found!" << endl;
cout << "Applying exploit.." << endl;
binaryFile.seekp(+11, ios::cur);
binaryFile.write(reinterpret_cast<const char*>(replacemp4_001), SIZEMP4_002);
cout << "Sucessfull!" << endl;
break;
}
else
{
cout << "Address not find. Make sure your file is not corrupted or try convert to .mp4 again." << endl;
}
}
}
}
else
{
cout << "File not find!" << endl;
system("pause");
return 0;
}
binaryFile.clear();
system("pause");
return 0;
return 0;
}
string extension(string file_name)
{
int position = file_name.find_last_of(".");
string result = file_name.substr(position + 1);
return result;
}