MCPcopy Create free account
hub / github.com/CCob/lsarelayx / SendCommand

Method SendCommand

plugin/relaycontext.cpp:51–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51MessageBuffer RelayContext::SendCommand(const Command& command){
52
53 MessageExchangePtr messageEx = _messageExFactory->Create();
54 bitsery::ext::InheritanceContext ctx;
55 MessageBuffer buffer;
56 size_t writtenSize = 0;
57
58 if(command.GetCommandId() == CommandType::RelayNTLM){
59 const NtlmRelayCommand& relayCommand = dynamic_cast<const NtlmRelayCommand&>(command);
60 writtenSize = bitsery::quickSerialization(ctx, Writer{buffer}, relayCommand);
61 }else if(command.GetCommandId() == CommandType::NegotiateRequest){
62 const NegotiateCommand& negCommand = dynamic_cast<const NegotiateCommand&>(command);
63 writtenSize = bitsery::quickSerialization(ctx, Writer{buffer}, negCommand);
64 }else{
65 writtenSize = bitsery::quickSerialization(ctx, Writer{buffer}, command);
66 }
67
68 messageEx->WriteAll(buffer.data(), writtenSize);
69 return messageEx->ReadAll();
70}

Callers 1

InitThreadFunction · 0.80

Calls 5

quickSerializationFunction · 0.85
CreateMethod · 0.80
WriteAllMethod · 0.80
ReadAllMethod · 0.80
GetCommandIdMethod · 0.45

Tested by

no test coverage detected