예제 #1
0
 void emit(OutStream & stream) override {
     stream.out_uint16_le(this->capabilityType);
     stream.out_uint16_le(this->len);
     stream.out_uint32_le(this->drawNineGridSupportLevel);
     stream.out_uint16_le(this->drawNineGridCacheSize);
     stream.out_uint16_le(this->drawNineGridCacheEntries);
 }
예제 #2
0
 void emit(OutStream & stream)override {
     stream.out_uint16_le(this->capabilityType);
     stream.out_uint16_le(this->len);
     stream.out_uint32_le(this->offscreenSupportLevel);
     stream.out_uint16_le(this->offscreenCacheSize);
     stream.out_uint16_le(this->offscreenCacheEntries);
 }
예제 #3
0
 void emit(OutStream & stream) const
 {
     stream.out_uint16_le(this->userDataType);
     stream.out_uint16_le(this->length);
     stream.out_uint32_le(this->encryptionMethods);
     stream.out_uint32_le(this->extEncryptionMethods);
 }
예제 #4
0
 void emit(OutStream & stream) const
 {
     stream.out_uint16_le(this->capabilityType);
     stream.out_uint16_le(this->len);
     stream.out_uint16_le(this->flags);
     stream.out_uint16_le(this->VCChunkSize);
 }
예제 #5
0
 void emit(OutStream & stream) const
 {
     stream.out_uint16_le(this->capabilityType);
     stream.out_uint16_le(this->len);
     stream.out_uint32_le(this->cmdFlags);
     stream.out_uint32_le(this->reserved);
 }
예제 #6
0
    void emit(OutStream & stream)override {
        stream.out_uint16_le(this->capabilityType);
        stream.out_uint16_le(this->len);
        stream.out_uint16_le(this->fontSupportFlags);
        stream.out_uint16_le(this->pad2octets);

    }
예제 #7
0
  void emit(OutStream & stream) const
  {
      stream.out_uint16_le(this->capabilityType);
      stream.out_uint16_le(this->len);
      stream.out_uint16_le(this->colorTableCacheSize);
      stream.out_uint16_le(this->pad2octets);
 }
예제 #8
0
 void emit(OutStream & stream)override {
     stream.out_uint16_le(this->capabilityType);
     stream.out_uint16_le(this->len);
     stream.out_uint16_le(this->colorPointerFlag);
     stream.out_uint16_le(this->colorPointerCacheSize);
     if (this->len  < 10) return;
     stream.out_uint16_le(this->pointerCacheSize);
 }
예제 #9
0
    void emit(OutStream & stream) const
    {
        stream.out_uint16_le(this->capabilityType);
        stream.out_uint16_le(this->len);
        stream.out_uint16_le(this->nodeId);
        stream.out_uint16_le(this->pad2octets);

    }
예제 #10
0
 void emit(OutStream & stream) const
 {
     stream.out_uint16_le(this->capabilityType);
     stream.out_uint16_le(this->len);
     stream.out_uint8(this->cacheVersion);
     stream.out_uint8(this->pad1);
     stream.out_uint16_le(this->pad2);
 }
예제 #11
0
 void emit(OutStream & stream) const
 {
     stream.out_uint16_le(this->capabilityType);
     stream.out_uint16_le(this->len);
     stream.out_uint32_le(this->WndSupportLevel);
     stream.out_uint8(this->NumIconCaches);
     stream.out_uint16_le(this->NumIconCacheEntries);
 }
예제 #12
0
 FlowPDU_Send(OutStream & stream, uint8_t flow_pdu_type, uint8_t flow_identifier,
              uint8_t flow_number, uint16_t pdu_source)
 {
     stream.out_uint16_le(0x8000);
     stream.out_uint8(flow_pdu_type);
     stream.out_uint8(0);
     stream.out_uint8(flow_identifier);
     stream.out_uint8(flow_number);
     stream.out_uint16_le(pdu_source);
 }
예제 #13
0
 ShareControl_Send(OutStream & stream, uint8_t pduType, uint16_t PDUSource, uint16_t payload_len)
 {
     enum {
         versionLow = 0x10,
         versionHigh = 0
     };
     stream.out_uint16_le(payload_len + 6);
     stream.out_uint16_le(versionHigh | versionLow | pduType);
     stream.out_uint16_le(PDUSource);
 }
예제 #14
0
    void emit(OutStream & stream) const {
        stream.out_uint8(this->allowDisplayUpdates_);
        stream.out_clear_bytes(3);  // Padding(3)

        if (ALLOW_DISPLAY_UPDATES == this->allowDisplayUpdates_) {
            stream.out_uint16_le(this->left_);
            stream.out_uint16_le(this->top_);
            stream.out_uint16_le(this->right_);
            stream.out_uint16_le(this->bottom_);
        }
    }   // void emit(OutStream & stream) const
예제 #15
0
 void emit(OutStream & stream)override {
     stream.out_uint16_le(this->capabilityType);
     stream.out_uint16_le(this->len);
     stream.out_uint16_le(this->cacheFlags);
     stream.out_uint8(this->pad1);
     stream.out_uint8(this->numCellCaches);
     stream.out_uint32_le(this->bitmapCache0CellInfo);
     stream.out_uint32_le(this->bitmapCache1CellInfo);
     stream.out_uint32_le(this->bitmapCache2CellInfo);
     stream.out_uint32_le(this->bitmapCache3CellInfo);
     stream.out_uint32_le(this->bitmapCache4CellInfo);
     stream.out_clear_bytes(12);
 }
예제 #16
0
    void emit(OutStream & stream) const
    {
        if (this->length != 8
        && this->length != 12
        && this->length != 16) {
            LOG(LOG_ERR, "SC_CORE invalid length (%u)", this->length);
            throw Error(ERR_GCC);
        };

        stream.out_uint16_le(this->userDataType);
        stream.out_uint16_le(this->length);
        stream.out_uint32_le(this->version);

        if (this->length >= 12){
            stream.out_uint32_le(this->clientRequestedProtocols);
        }
        if (this->length >= 16){
            stream.out_uint32_le(this->earlyCapabilityFlags);
        }
    }
예제 #17
0
 void emit(OutStream & stream)override {
     stream.out_uint16_le(this->capabilityType);
     stream.out_uint16_le(this->len);
     stream.out_uint32_le(this->pad1);
     stream.out_uint32_le(this->pad2);
     stream.out_uint32_le(this->pad3);
     stream.out_uint32_le(this->pad4);
     stream.out_uint32_le(this->pad5);
     stream.out_uint32_le(this->pad6);
     stream.out_uint16_le(this->cache0Entries);
     stream.out_uint16_le(this->cache0MaximumCellSize);
     stream.out_uint16_le(this->cache1Entries);
     stream.out_uint16_le(this->cache1MaximumCellSize);
     stream.out_uint16_le(this->cache2Entries);
     stream.out_uint16_le(this->cache2MaximumCellSize);
 }
예제 #18
0
    void emit(OutStream & stream) const
    {
        using namespace RDP;

        uint8_t control = STANDARD | SECONDARY;
        stream.out_uint8(control);
        uint16_t len = 1027 - 7;    // length after type minus 7
        stream.out_uint16_le(len);
        stream.out_uint16_le(0);    // flags
        stream.out_uint8(TS_CACHE_COLOR_TABLE); // type

        stream.out_uint8(this->cacheIndex);
        stream.out_uint16_le(256); /* num colors */
        for (int i = 0; i < 256; i++) {
            uint32_t color = this->palette[i];
            uint8_t r = color >> 16;
            uint8_t g = color >> 8;
            uint8_t b = color;
            stream.out_uint8(b);
            stream.out_uint8(g);
            stream.out_uint8(r);
            stream.out_uint8(0);
        }
    }
예제 #19
0
    void emit(OutStream & stream,
            RDPOrderCommon & common,
            const RDPOrderCommon & oldcommon,
            const RDPLineTo & oldcmd) const
    {
        using namespace RDP;
        RDPPrimaryOrderHeader header(STANDARD, 0);

        // TODO check that
        if (!(common.clip.contains_pt(this->startx, this->starty)
           && common.clip.contains_pt(this->endx, this->endy))){
           header.control |= BOUNDS;
        }

        header.control |= (is_1_byte(this->startx - oldcmd.startx)
                 && is_1_byte(this->starty - oldcmd.starty)
                 && is_1_byte(this->endx - oldcmd.endx)
                 && is_1_byte(this->endy - oldcmd.endy)) * DELTA;

        header.fields =
                (this->back_mode  != oldcmd.back_mode  ) * 0x001
              | (this->startx     != oldcmd.startx     ) * 0x002
              | (this->starty     != oldcmd.starty     ) * 0x004
              | (this->endx       != oldcmd.endx       ) * 0x008
              | (this->endy       != oldcmd.endy       ) * 0x010
              | (this->back_color != oldcmd.back_color ) * 0x020
              | (this->rop2       != oldcmd.rop2       ) * 0x040
              | (this->pen.style  != oldcmd.pen.style  ) * 0x080
              | (this->pen.width  != oldcmd.pen.width  ) * 0x100
              | (this->pen.color  != oldcmd.pen.color  ) * 0x200
              ;

        common.emit(stream, header, oldcommon);

        if (header.fields & 0x001) { stream.out_uint16_le(this->back_mode); }

        header.emit_coord(stream, 0x02, this->startx, oldcmd.startx);
        header.emit_coord(stream, 0x04, this->starty, oldcmd.starty);
        header.emit_coord(stream, 0x08, this->endx,   oldcmd.endx);
        header.emit_coord(stream, 0x10, this->endy,   oldcmd.endy);

        if (header.fields & 0x20) {
            emit_rdp_color(stream, this->back_color);
        }
        if (header.fields & 0x40) { stream.out_uint8(this->rop2); }
        header.emit_pen(stream, 0x80, this->pen, oldcmd.pen);
    }
예제 #20
0
 void emit(OutStream & stream) const
 {
     stream.out_uint16_le(this->capabilityType);
     stream.out_uint16_le(this->len);
     for (auto const& glyph : this->GlyphCache) {
         stream.out_uint16_le(glyph.CacheEntries);
         stream.out_uint16_le(glyph.CacheMaximumCellSize);
     }
     stream.out_uint32_le(this->FragCache);
     stream.out_uint16_le(this->GlyphSupportLevel);
     stream.out_uint16_le(this->pad2octets);
 }
예제 #21
0
    void emit(OutStream & stream) {
        stream.out_uint16_le(this->numEntriesCache[0]);
        stream.out_uint16_le(this->numEntriesCache[1]);
        stream.out_uint16_le(this->numEntriesCache[2]);
        stream.out_uint16_le(this->numEntriesCache[3]);
        stream.out_uint16_le(this->numEntriesCache[4]);
        stream.out_uint16_le(this->totalEntriesCache[0]);
        stream.out_uint16_le(this->totalEntriesCache[1]);
        stream.out_uint16_le(this->totalEntriesCache[2]);
        stream.out_uint16_le(this->totalEntriesCache[3]);
        stream.out_uint16_le(this->totalEntriesCache[4]);
        stream.out_uint8(this->bBitMask);

        stream.out_clear_bytes(3);  // Pad2(1) + Pad3(2)

        for (uint32_t i = 0, c = this->maximum_entries(); i < c; i++) {
            stream.out_uint32_le(this->entries[i].Key1);
            stream.out_uint32_le(this->entries[i].Key2);
        }
    }
예제 #22
0
 void make_chunk_header(OutStream & stream, uint8_t chunk_type, uint16_t data_size) {
     stream.out_uint8(chunk_type);
     stream.out_uint16_le(data_size);
     stream.out_timeval_to_uint64le_usec(tvtime());
 }
예제 #23
0
    void emit(OutStream & stream) const {
        unsigned expected;

        if (    (this->flags & BITMAP_COMPRESSION)
            && !(this->flags & NO_BITMAP_COMPRESSION_HDR)) {
            expected = 26; /* destLeft(2) + destTop(2) + destRight(2) +
                              destBottom(2) + width(2) + height(2) +
                              bitsPerPixel(2) + flags(2) + bitmapLength(2) +
                              cbCompFirstRowSize(2) + cbCompMainBodySize(2) +
                              cbScanWidth(2) + cbUncompressedSize(2) */
        }
        else {
            expected = 18; /* destLeft(2) + destTop(2) + destRight(2) +
                              destBottom(2) + width(2) + height(2) +
                              bitsPerPixel(2) + flags(2) + bitmapLength(2) */
        }

        if (!stream.has_room(expected)) {
            LOG( LOG_ERR
               , "BitmapData::emit - stream too small, need=%u, remains=%zu"
               , expected, stream.tailroom());
            throw Error(ERR_STREAM_MEMORY_TOO_SMALL);
        }

        stream.out_uint16_le(this->dest_left);
        stream.out_uint16_le(this->dest_top);
        stream.out_uint16_le(this->dest_right);
        stream.out_uint16_le(this->dest_bottom);
        stream.out_uint16_le(this->width);
        stream.out_uint16_le(this->height);
        stream.out_uint16_le(this->bits_per_pixel);
        stream.out_uint16_le(this->flags);
        stream.out_uint16_le(this->bitmap_length);

        if (    (this->flags & BITMAP_COMPRESSION)
            && !(this->flags & NO_BITMAP_COMPRESSION_HDR)) {
            stream.out_uint16_le(0x0000);   /* cbCompFirstRowSize (2 bytes) */
            stream.out_uint16_le(this->cb_comp_main_body_size);
            stream.out_uint16_le(this->cb_scan_width);
            stream.out_uint16_le(this->cb_uncompressed_size);
        }
    }
예제 #24
0
        UnicodeKeyboardEvent_Send(OutStream & stream, uint16_t keyboardFlags, uint16_t unicodeCode) {
            stream.out_uint16_le(keyboardFlags);
            stream.out_uint16_le(unicodeCode);

            stream.out_clear_bytes(2); // pad2Octets
        }
예제 #25
0
 ExtendedMouseEvent_Send(  OutStream & stream, uint16_t pointerFlags, uint16_t xPos
                 , uint16_t yPos) {
     stream.out_uint16_le(pointerFlags);
     stream.out_uint16_le(xPos);
     stream.out_uint16_le(yPos);
 }
예제 #26
0
 void emit(OutStream & stream)override {
     stream.out_uint16_le(this->capabilityType);
     stream.out_uint16_le(this->len);
     stream.out_copy_bytes(this->terminalDescriptor, 16);
     stream.out_uint32_be(this->pad4octetsA);
     stream.out_uint16_le(this->desktopSaveXGranularity);
     stream.out_uint16_le(this->desktopSaveYGranularity);
     stream.out_uint16_le(this->pad2octetsA);
     stream.out_uint16_le(this->maximumOrderLevel);
     stream.out_uint16_le(this->numberFonts);
     stream.out_uint16_le(this->orderFlags);
     stream.out_copy_bytes(this->orderSupport, NB_ORDER_SUPPORT);
     stream.out_uint16_le(this->textFlags);
     stream.out_uint16_le(this->orderSupportExFlags);
     stream.out_uint32_le(this->pad4octetsB);
     stream.out_uint32_le(this->desktopSaveSize);
     stream.out_uint16_le(this->pad2octetsC);
     stream.out_uint16_le(this->pad2octetsD);
     stream.out_uint16_le(this->textANSICodePage);
     stream.out_uint16_le(this->pad2octetsE);
 }
예제 #27
0
 void emit(OutStream & stream)override {
     stream.out_uint16_le(this->capabilityType);
     stream.out_uint16_le(this->len);
     stream.out_uint16_le(this->CompDeskSupportLevel);
 }
예제 #28
0
 void emit(OutStream & stream) const
 {
     stream.out_uint16_le(this->userDataType);
     stream.out_uint16_le(this->length);
     stream.out_uint32_le(this->flags);
 }
예제 #29
0
 void emit(OutStream & stream) const
 {
     stream.out_uint16_le(this->capabilityType);
     stream.out_uint16_le(this->len);
     stream.out_uint32_le(this->MaxRequestSize);
 }
예제 #30
0
 void emit(NTLM_AV_ID avId, OutStream & stream) const
 {
     stream.out_uint16_le(avId);
     stream.out_uint16_le(this->avLen);
     stream.out_copy_bytes(this->data.get(), this->avLen);
 }