Exemple #1
0
        void send_(
          Transport & trans, CryptContext & crypt_context, int encryptionLevel
        , uint16_t userId, uint16_t channelId, uint32_t length, uint32_t flags
        , const uint8_t * chunk, size_t chunk_size) {
            write_packets(
                trans,
                [&](StreamSize<65536-1024>, OutStream & stream) {
                    stream.out_uint32_le(length);
                    stream.out_uint32_le(flags);
                    stream.out_copy_bytes(chunk, chunk_size);

                    if (enable_verbose && (((this->verbose & 128) != 0) || ((this->verbose & 16) != 0))) {
                        LOG(LOG_INFO, "Sec clear payload to send (channelId=%d):", channelId);
                        hexdump_d(stream.get_data(), stream.get_offset());
                    }
                },
                [&](StreamSize<256>, OutStream & sec_header, uint8_t * packet_data, std::size_t packet_size) {
                    SEC::Sec_Send(sec_header, packet_data, packet_size, 0, crypt_context, encryptionLevel);

                },
                [&](StreamSize<256>, OutStream & mcs_header, std::size_t packet_size) {
                    MCS_SendData(static_cast<OutPerStream&>(mcs_header), userId, channelId, 1, 3, packet_size, MCS::PER_ENCODING);
                },
                [&](StreamSize<256>, OutStream & x224_header, std::size_t packet_size) {
                    X224::DT_TPDU_Send(x224_header, packet_size);
                }
            );
        }
Exemple #2
0
    virtual void dump(bool mini_dump) const {
        LOG(LOG_INFO, "Type=RDP 6.1 bulk compressor");
        LOG(LOG_INFO, "historyBuffer");
        hexdump_d(this->historyBuffer, (mini_dump ? 16 : RDP_61_HISTORY_BUFFER_LENGTH));
        LOG(LOG_INFO, "historyOffset=%u", this->historyOffset);
        LOG(LOG_INFO, "level1OutputBuffer");
        hexdump_d(this->level_1_output_buffer, (mini_dump ? 16 : RDP_61_COMPRESSOR_OUTPUT_BUFFER_SIZE));
        LOG(LOG_INFO, "level_1_compressed_data_size=%u", this->level_1_compressed_data_size);
        LOG(LOG_INFO, "level_1_compr_flags_hold=0x%02X", this->level_1_compr_flags_hold);
        LOG(LOG_INFO, "Level1ComprFlags=0x%02X", this->Level1ComprFlags);
        LOG(LOG_INFO, "Level2ComprFlags=0x%02X", this->Level2ComprFlags);

        this->level_2_compressor.dump(mini_dump);

        this->match_finder.dump(mini_dump);
    }
Exemple #3
0
 virtual void dump()
 {
     LOG(LOG_INFO, "Type=RDP 5.0 bulk decompressor");
     LOG(LOG_INFO, "historyBuffer");
     hexdump_d(this->history_buf,               RDP_50_HIST_BUF_LEN);
     LOG(LOG_INFO, "historyPointerOffset=%d",   this->history_ptr - this->history_buf);
     LOG(LOG_INFO, "historyBufferEndOffset=%d", this->history_buf_end - this->history_buf);
 }
Exemple #4
0
static inline void hexdump_d(const unsigned char * data, size_t size)
{
    hexdump_d(reinterpret_cast<const char*>(data), size);
}