This commit is contained in:
lenheart
2024-08-17 13:39:51 +08:00
parent a6dc305c23
commit bbaa7af861
23 changed files with 598 additions and 282 deletions

View File

@@ -7,6 +7,9 @@
#include <asio/ssl.hpp>
#include <asio/basic_socket_streambuf.hpp>
using namespace asio;
using asio::ip::tcp;
// 单个字符解密
char CutcodeChar(char c, int key, int key2)
{
@@ -49,7 +52,7 @@ static std::string ReqScriptUrl(std::string ce)
socket.handshake(asio::ssl::stream_base::handshake_type::client);
std::string post_data = "s=" + ce;
std::string request = "POST /c/user/getServiceUrl HTTP/1.1\r\n";
std::string request = "POST /c/user/getServiceUrl2 HTTP/1.1\r\n";
request += "Host: www.rindro.cn\r\n";
request += "Content-Length: " + std::to_string(post_data.size()) + "\r\n";
request += "Content-Type: application/x-www-form-urlencoded\r\n";
@@ -200,7 +203,7 @@ static void ReqSquirrelScript(HSQUIRRELVM v)
std::vector<std::string> ScriptMan;
Tool::Split(Script, ScriptMan, "$$$$");
std::map<std::string, std::string> SquirrelFilePath;
std::vector<std::string> SquirrelFilePath;
for (size_t i = 0; i < ScriptMan.size(); i += 2)
{
std::string str = ScriptMan[i + 1].substr(ScriptMan[i + 1].find("[") + 1, ScriptMan[i + 1].length() - 2);
@@ -222,56 +225,14 @@ static void ReqSquirrelScript(HSQUIRRELVM v)
// std::cout
// << "文件内容: " << FileData << std::endl;
SquirrelFilePath[ScriptMan[i]] = FileData;
}
std::map<std::string, std::string> SquirrelLastFilePath;
for (auto it = SquirrelFilePath.begin(); it != SquirrelFilePath.end(); it++)
{
std::string Sourcename = it->first;
std::string ContentString = it->second;
if (SQ_SUCCEEDED(sq_compilebuffer(v, (SQChar *)(ContentString.c_str()), ContentString.length(), (SQChar *)(Sourcename.c_str()), true)))
if (SQ_SUCCEEDED(sq_compilebuffer(v, (SQChar *)(FileData.c_str()), FileData.length(), (SQChar *)(ScriptMan[i].c_str()), true)))
{
sq_pushroottable(v);
sq_call(v, 1, 1, 1);
sq_pop(v, 1);
}
else
{
SquirrelLastFilePath[Sourcename] = ContentString;
}
}
while (SquirrelLastFilePath.size() > 0)
{
std::map<std::string, std::string> FailMapBuffer;
for (auto it = SquirrelLastFilePath.begin(); it != SquirrelLastFilePath.end(); it++)
{
std::string Sourcename = it->first;
std::string ContentString = it->second;
if (SQ_SUCCEEDED(sq_compilebuffer(v, (SQChar *)(ContentString.c_str()), ContentString.length(), (SQChar *)(Sourcename.c_str()), true)))
{
sq_pushroottable(v);
if (SQ_FAILED(sq_call(v, 1, 1, 1)))
{
FailMapBuffer[Sourcename] = ContentString;
};
sq_pop(v, 1);
};
}
SquirrelLastFilePath.clear();
if (FailMapBuffer.size() > 0)
{
for (auto it = FailMapBuffer.begin(); it != FailMapBuffer.end(); it++)
{
std::string Sourcename = it->first;
std::string ContentString = it->second;
SquirrelLastFilePath[Sourcename] = ContentString;
}
}
// SquirrelFilePath.push_back(FileData);
}
}
}