-
Notifications
You must be signed in to change notification settings - Fork 16
/
autoupd.cpp
37 lines (31 loc) · 954 Bytes
/
autoupd.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
/*
addon.cpp
DetExploit program file for loading external function file (addon).
DetExploit (https://github.com/moppoi5168/DetExploit)
Licensed by GPL License
*/
#define DEXP_ADDON_SIGN "SignStartDetExploitAddonPackage1.2SignEnd"
#include "detexploit.hpp"
std::vector<std::string> load_addon(const std::string& src, const char* delim) {
std::vector<std::string> vec;
std::string::size_type len = src.length();
for (std::string::size_type i = 0, n; i < len; i = n + 1) {
n = src.find_first_of(delim, i);
if (n == std::string::npos) {
n = len;
}
vec.push_back(src.substr(i, n - i));
}
return vec;
}
std::string insert_inst(const std::vector<std::string>& v, const char* delim) {
std::string s = "";
if (!v.empty()) {
s += v[0];
for (decltype(v.size()) i = 1, c = v.size(); i < c; ++i) {
if (delim) s += delim;
s += v[i];
}
}
return s;
}