这篇教程C++ stream_read_uint8函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中stream_read_uint8函数的典型用法代码示例。如果您正苦于以下问题:C++ stream_read_uint8函数的具体用法?C++ stream_read_uint8怎么用?C++ stream_read_uint8使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了stream_read_uint8函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: license_read_preamblevoid license_read_preamble(STREAM* s, uint8* bMsgType, uint8* flags, uint16* wMsgSize){ /* preamble (4 bytes) */ stream_read_uint8(s, *bMsgType); /* bMsgType (1 byte) */ stream_read_uint8(s, *flags); /* flags (1 byte) */ stream_read_uint16(s, *wMsgSize); /* wMsgSize (2 bytes) */}
开发者ID:Cyclic,项目名称:FreeRDP,代码行数:7,
示例2: rdp_read_share_data_headerboolean rdp_read_share_data_header(STREAM* s, uint16* length, uint8* type, uint32* share_id, uint8 *compressed_type, uint16 *compressed_len){ if (stream_get_left(s) < 12) return false; /* Share Data Header */ stream_read_uint32(s, *share_id); /* shareId (4 bytes) */ stream_seek_uint8(s); /* pad1 (1 byte) */ stream_seek_uint8(s); /* streamId (1 byte) */ stream_read_uint16(s, *length); /* uncompressedLength (2 bytes) */ stream_read_uint8(s, *type); /* pduType2, Data PDU Type (1 byte) */ if (*type & 0x80) { stream_read_uint8(s, *compressed_type); /* compressedType (1 byte) */ stream_read_uint16(s, *compressed_len); /* compressedLength (2 bytes) */ } else { stream_seek(s, 3); *compressed_type = 0; *compressed_len = 0; } return true;}
开发者ID:CaledoniaProject,项目名称:rdpscan,代码行数:27,
示例3: ber_read_integerboolean ber_read_integer(STREAM* s, uint32* value){ int length; ber_read_universal_tag(s, BER_TAG_INTEGER, false); ber_read_length(s, &length); if (value == NULL) { stream_seek(s, length); return true; } if (length == 1) stream_read_uint8(s, *value); else if (length == 2) stream_read_uint16_be(s, *value); else if (length == 3) { uint8 byte; stream_read_uint8(s, byte); stream_read_uint16_be(s, *value); *value += (byte << 16); } else if (length == 4) stream_read_uint32_be(s, *value); else return false; return true;}
开发者ID:felfert,项目名称:FreeRDP,代码行数:31,
示例4: ber_read_application_tagboolean ber_read_application_tag(STREAM* s, uint8 tag, int* length){ uint8 byte; if (tag > 30) { stream_read_uint8(s, byte); if (byte != ((BER_CLASS_APPL | BER_CONSTRUCT) | BER_TAG_MASK)) return false; stream_read_uint8(s, byte); if (byte != tag) return false; ber_read_length(s, length); } else { stream_read_uint8(s, byte); if (byte != ((BER_CLASS_APPL | BER_CONSTRUCT) | (BER_TAG_MASK & tag))) return false; ber_read_length(s, length); } return true;}
开发者ID:felfert,项目名称:FreeRDP,代码行数:30,
示例5: rdp_decryptboolean rdp_decrypt(rdpRdp* rdp, STREAM* s, int length, uint16 securityFlags){ uint8 cmac[8], wmac[8]; if (rdp->settings->encryption_method == ENCRYPTION_METHOD_FIPS) { uint16 len; uint8 version, pad; uint8 *sig; stream_read_uint16(s, len); /* 0x10 */ stream_read_uint8(s, version); /* 0x1 */ stream_read_uint8(s, pad); sig = s->p; stream_seek(s, 8); /* signature */ length -= 12; if (!security_fips_decrypt(s->p, length, rdp)) { printf("FATAL: cannot decrypt/n"); return false; /* TODO */ } if (!security_fips_check_signature(s->p, length - pad, sig, rdp)) { printf("FATAL: invalid packet signature/n"); return false; /* TODO */ } /* is this what needs adjusting? */ s->size -= pad; return true; } stream_read(s, wmac, sizeof(wmac)); length -= sizeof(wmac); security_decrypt(s->p, length, rdp); if (securityFlags & SEC_SECURE_CHECKSUM) security_salted_mac_signature(rdp, s->p, length, false, cmac); else security_mac_signature(rdp, s->p, length, cmac); if (memcmp(wmac, cmac, sizeof(wmac)) != 0) { printf("WARNING: invalid packet signature/n"); /* * Because Standard RDP Security is totally broken, * and cannot protect against MITM, don't treat signature * verification failure as critical. This at least enables * us to work with broken RDP clients and servers that * generate invalid signatures. */ //return false; } return true;}
开发者ID:CaledoniaProject,项目名称:rdpscan,代码行数:57,
示例6: nego_read_requestboolean nego_read_request(rdpNego* nego, STREAM* s){ uint8 li; uint8 c; uint8 type; tpkt_read_header(s); li = tpdu_read_connection_request(s); if (li != stream_get_left(s) + 6) { printf("Incorrect TPDU length indicator./n"); return false; } if (stream_get_left(s) > 8) { /* Optional routingToken or cookie, ending with CR+LF */ while (stream_get_left(s) > 0) { stream_read_uint8(s, c); if (c != '/x0D') continue; stream_peek_uint8(s, c); if (c != '/x0A') continue; stream_seek_uint8(s); break; } } if (stream_get_left(s) >= 8) { /* rdpNegData (optional) */ stream_read_uint8(s, type); /* Type */ if (type != TYPE_RDP_NEG_REQ) { printf("Incorrect negotiation request type %d/n", type); return false; } nego_process_negotiation_request(nego, s); } return true;}
开发者ID:cheetah0216,项目名称:FreeRDP,代码行数:52,
示例7: rdp_decryptboolean rdp_decrypt(rdpRdp* rdp, STREAM* s, int length){ uint8 cmac[8], wmac[8]; uint32 ml; uint8* mk; if (rdp->settings->encryption_method == ENCRYPTION_METHOD_FIPS) { uint16 len; uint8 version, pad; uint8 *sig; stream_read_uint16(s, len); /* 0x10 */ stream_read_uint8(s, version); /* 0x1 */ stream_read_uint8(s, pad); sig = s->p; stream_seek(s, 8); /* signature */ length -= 12; if (!security_fips_decrypt(s->p, length, rdp)) { printf("FATAL: cannot decrypt/n"); return false; /* TODO */ } if (!security_fips_check_signature(s->p, length - pad, sig, rdp)) { printf("FATAL: invalid packet signature/n"); return false; /* TODO */ } /* is this what needs adjusting? */ s->size -= pad; return true; } stream_read(s, wmac, sizeof(wmac)); length -= sizeof(wmac); security_decrypt(s->p, length, rdp); mk = rdp->sign_key; ml = rdp->rc4_key_len; security_mac_signature(mk, ml, s->p, length, cmac); if (memcmp(wmac, cmac, sizeof(wmac)) != 0) { printf("FATAL: invalid packet signature/n"); return false; } return true;}
开发者ID:gcracker,项目名称:FreeRDP,代码行数:50,
示例8: rdpsnd_process_message_wave_infostatic void rdpsnd_process_message_wave_info(rdpsndPlugin* rdpsnd, STREAM* data_in, uint16 BodySize){ uint16 wFormatNo; stream_read_uint16(data_in, rdpsnd->wTimeStamp); stream_read_uint16(data_in, wFormatNo); stream_read_uint8(data_in, rdpsnd->cBlockNo); stream_seek(data_in, 3); /* bPad */ stream_read(data_in, rdpsnd->waveData, 4); rdpsnd->waveDataSize = BodySize - 8; rdpsnd->wave_timestamp = get_mstime(); rdpsnd->expectingWave = true; DEBUG_SVC("waveDataSize %d wFormatNo %d", rdpsnd->waveDataSize, wFormatNo); rdpsnd->close_timestamp = 0; if (!rdpsnd->is_open) { rdpsnd->current_format = wFormatNo; rdpsnd->is_open = true; if (rdpsnd->device) IFCALL(rdpsnd->device->Open, rdpsnd->device, &rdpsnd->supported_formats[wFormatNo], rdpsnd->latency); } else if (wFormatNo != rdpsnd->current_format) { rdpsnd->current_format = wFormatNo; if (rdpsnd->device) IFCALL(rdpsnd->device->SetFormat, rdpsnd->device, &rdpsnd->supported_formats[wFormatNo], rdpsnd->latency); }}
开发者ID:rafcabezas,项目名称:FreeRDP,代码行数:32,
示例9: rdp_read_bitmap_capability_setvoid rdp_read_bitmap_capability_set(STREAM* s, rdpSettings* settings){ uint8 drawingFlags; uint16 desktopWidth; uint16 desktopHeight; uint16 desktopResizeFlag; uint16 preferredBitsPerPixel; stream_read_uint16(s, preferredBitsPerPixel); /* preferredBitsPerPixel (2 bytes) */ stream_seek_uint16(s); /* receive1BitPerPixel (2 bytes) */ stream_seek_uint16(s); /* receive4BitsPerPixel (2 bytes) */ stream_seek_uint16(s); /* receive8BitsPerPixel (2 bytes) */ stream_read_uint16(s, desktopWidth); /* desktopWidth (2 bytes) */ stream_read_uint16(s, desktopHeight); /* desktopHeight (2 bytes) */ stream_seek_uint16(s); /* pad2Octets (2 bytes) */ stream_read_uint16(s, desktopResizeFlag); /* desktopResizeFlag (2 bytes) */ stream_seek_uint16(s); /* bitmapCompressionFlag (2 bytes) */ stream_seek_uint8(s); /* highColorFlags (1 byte) */ stream_read_uint8(s, drawingFlags); /* drawingFlags (1 byte) */ stream_seek_uint16(s); /* multipleRectangleSupport (2 bytes) */ stream_seek_uint16(s); /* pad2OctetsB (2 bytes) */ if (desktopResizeFlag == False) settings->desktop_resize = False;}
开发者ID:roman-bb,项目名称:FreeRDP-1.0,代码行数:25,
示例10: rdp_read_window_list_capability_setvoid rdp_read_window_list_capability_set(STREAM* s, rdpSettings* settings){ // TODO: // 2011-07-27: In current time icon cache is not supported by any // Microsoft implementation of server or client. // // But we must process this values according to 3.2.5.1.4 // uint8 numIconCaches; uint16 numIconCacheEntries; uint32 wndSupportLevel; stream_read_uint32(s, wndSupportLevel); /* wndSupportLevel (4 bytes) */ stream_read_uint8(s, numIconCaches); /* numIconCaches (1 byte) */ stream_read_uint16(s, numIconCacheEntries); /* numIconCacheEntries (2 bytes) */ settings->rail_window_supported = False; settings->rail_icon_cache_number = MIN(3, numIconCaches); settings->rail_icon_cache_entries_number = MIN(12, numIconCacheEntries); if ( (wndSupportLevel == WINDOW_LEVEL_SUPPORTED) || (wndSupportLevel == WINDOW_LEVEL_SUPPORTED_EX) ) { settings->rail_window_supported = True; }}
开发者ID:roman-bb,项目名称:FreeRDP-1.0,代码行数:29,
示例11: update_read_desktop_actively_monitored_ordervoid update_read_desktop_actively_monitored_order(STREAM* s, WINDOW_ORDER_INFO* orderInfo, MONITORED_DESKTOP_ORDER* monitored_desktop){ int i; int size; if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_DESKTOP_ACTIVE_WND) stream_read_uint32(s, monitored_desktop->activeWindowId); /* activeWindowId (4 bytes) */ if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_DESKTOP_ZORDER) { stream_read_uint8(s, monitored_desktop->numWindowIds); /* numWindowIds (1 byte) */ size = sizeof(uint32) * monitored_desktop->numWindowIds; if (monitored_desktop->windowIds == NULL) monitored_desktop->windowIds = (uint32*) xmalloc(size); else monitored_desktop->windowIds = (uint32*) xrealloc(monitored_desktop->windowIds, size); /* windowIds */ for (i = 0; i < monitored_desktop->numWindowIds; i++) { stream_read_uint32(s, monitored_desktop->windowIds[i]); } }}
开发者ID:kidfolk,项目名称:FreeRDP,代码行数:26,
示例12: nego_recvboolean nego_recv(rdpTransport* transport, STREAM* s, void* extra){ uint8 li; uint8 type; rdpNego* nego = (rdpNego*) extra; if (tpkt_read_header(s) == 0) return false; li = tpdu_read_connection_confirm(s); if (li > 6) { /* rdpNegData (optional) */ stream_read_uint8(s, type); /* Type */ switch (type) { case TYPE_RDP_NEG_RSP: nego_process_negotiation_response(nego, s); break; case TYPE_RDP_NEG_FAILURE: nego_process_negotiation_failure(nego, s); break; } } else { nego->state = NEGO_STATE_FINAL; } return true;}
开发者ID:ydal,项目名称:FreeRDP,代码行数:35,
示例13: ber_read_bit_stringboolean ber_read_bit_string(STREAM* s, int* length, uint8* padding){ ber_read_universal_tag(s, BER_TAG_BIT_STRING, false); ber_read_length(s, length); stream_read_uint8(s, *padding); return true;}
开发者ID:felfert,项目名称:FreeRDP,代码行数:8,
示例14: fastpath_header_length/* * The fastpath header may be two or three bytes long. * This function assumes that at least two bytes are available in the stream * and doesn't touch third byte. */uint16 fastpath_header_length(STREAM* s){ uint8 length1; stream_seek_uint8(s); stream_read_uint8(s, length1); stream_rewind(s, 2); return ((length1 & 0x80) != 0 ? 3 : 2);}
开发者ID:authentic8,项目名称:NeutrinoRDP,代码行数:15,
示例15: ber_read_universal_tagboolean ber_read_universal_tag(STREAM* s, uint8 tag, boolean pc){ uint8 byte; stream_read_uint8(s, byte); if (byte != (BER_CLASS_UNIV | BER_PC(pc) | (BER_TAG_MASK & tag))) return false; return true;}
开发者ID:felfert,项目名称:FreeRDP,代码行数:11,
示例16: ber_read_lengthvoid ber_read_length(STREAM* s, int* length){ uint8 byte; stream_read_uint8(s, byte); if (byte & 0x80) { byte &= ~(0x80); if (byte == 1) stream_read_uint8(s, *length); if (byte == 2) stream_read_uint16_be(s, *length); } else { *length = byte; }}
开发者ID:felfert,项目名称:FreeRDP,代码行数:20,
示例17: rdp_read_bitmap_cache_host_support_capability_setvoid rdp_read_bitmap_cache_host_support_capability_set(STREAM* s, rdpSettings* settings){ uint8 cacheVersion; stream_read_uint8(s, cacheVersion); /* cacheVersion (1 byte) */ stream_seek_uint8(s); /* pad1 (1 byte) */ stream_seek_uint16(s); /* pad2 (2 bytes) */ if (cacheVersion & BITMAP_CACHE_V2) settings->persistent_bitmap_cache = True;}
开发者ID:roman-bb,项目名称:FreeRDP-1.0,代码行数:11,
示例18: rdp_read_share_data_headervoid rdp_read_share_data_header(STREAM* s, uint16* length, uint8* type, uint32* share_id){ /* Share Data Header */ stream_read_uint32(s, *share_id); /* shareId (4 bytes) */ stream_seek_uint8(s); /* pad1 (1 byte) */ stream_seek_uint8(s); /* streamId (1 byte) */ stream_read_uint16(s, *length); /* uncompressedLength (2 bytes) */ stream_read_uint8(s, *type); /* pduType2, Data PDU Type (1 byte) */ stream_seek_uint8(s); /* compressedType (1 byte) */ stream_seek_uint16(s); /* compressedLength (2 bytes) */}
开发者ID:mwu406,项目名称:FreeRDP-1.0,代码行数:11,
示例19: rdp_decryptboolean rdp_decrypt(rdpRdp* rdp, STREAM* s, int length){ int cryptlen; if (rdp->settings->encryption_method == ENCRYPTION_METHOD_FIPS) { uint16 len; uint8 version, pad; uint8 *sig; stream_read_uint16(s, len); /* 0x10 */ stream_read_uint8(s, version); /* 0x1 */ stream_read_uint8(s, pad); sig = s->p; stream_seek(s, 8); /* signature */ cryptlen = length - 12; if (!security_fips_decrypt(s->p, cryptlen, rdp)) { printf("FATAL: cannot decrypt/n"); return false; /* TODO */ } if (!security_fips_check_signature(s->p, cryptlen-pad, sig, rdp)) { printf("FATAL: invalid packet signature/n"); return false; /* TODO */ } /* is this what needs adjusting? */ s->size -= pad; return true; } stream_seek(s, 8); /* signature */ cryptlen = length - 8; security_decrypt(s->p, cryptlen, rdp); return true;}
开发者ID:ydal,项目名称:FreeRDP,代码行数:41,
示例20: fastpath_read_header/** * Read a Fast-Path packet header./n * @param s stream * @param encryptionFlags * @return length */uint16 fastpath_read_header(rdpFastPath* fastpath, STREAM* s){ uint8 header; uint16 length; stream_read_uint8(s, header); if (fastpath != NULL) { fastpath->encryptionFlags = (header & 0xC0) >> 6; fastpath->numberEvents = (header & 0x3C) >> 2; }
开发者ID:authentic8,项目名称:NeutrinoRDP,代码行数:18,
示例21: nego_process_negotiation_responsevoid nego_process_negotiation_response(rdpNego* nego, STREAM* s){ uint16 length; DEBUG_NEGO("RDP_NEG_RSP"); stream_read_uint8(s, nego->flags); stream_read_uint16(s, length); stream_read_uint32(s, nego->selected_protocol); nego->state = NEGO_STATE_FINAL;}
开发者ID:rafcabezas,项目名称:FreeRDP,代码行数:12,
示例22: rpc_pdu_header_readvoid rpc_pdu_header_read(STREAM* s, RPC_PDU_HEADER* header){ stream_read_uint8(s, header->rpc_vers); /* rpc_vers (1 byte) */ stream_read_uint8(s, header->rpc_vers_minor); /* rpc_vers_minor (1 byte) */ stream_read_uint8(s, header->ptype); /* PTYPE (1 byte) */ stream_read_uint8(s, header->pfc_flags); /* pfc_flags (1 byte) */ stream_read_uint8(s, header->packed_drep[0]); /* packet_drep[0] (1 byte) */ stream_read_uint8(s, header->packed_drep[1]); /* packet_drep[1] (1 byte) */ stream_read_uint8(s, header->packed_drep[2]); /* packet_drep[2] (1 byte) */ stream_read_uint8(s, header->packed_drep[3]); /* packet_drep[3] (1 byte) */ stream_read_uint16(s, header->frag_length); /* frag_length (2 bytes) */ stream_read_uint16(s, header->auth_length); /* auth_length (2 bytes) */ stream_read_uint32(s, header->call_id); /* call_id (4 bytes) */}
开发者ID:felfert,项目名称:FreeRDP,代码行数:14,
示例23: nego_process_negotiation_requestvoid nego_process_negotiation_request(rdpNego* nego, STREAM* s){ uint8 flags; uint16 length; DEBUG_NEGO("RDP_NEG_REQ"); stream_read_uint8(s, flags); stream_read_uint16(s, length); stream_read_uint32(s, nego->requested_protocols); nego->state = NEGO_STATE_FINAL;}
开发者ID:ydal,项目名称:FreeRDP,代码行数:13,
示例24: fastpath_read_headeruint16 fastpath_read_header(STREAM* s, uint8* encryptionFlags){ uint8 header; uint16 length; uint8 t; stream_read_uint8(s, header); if (encryptionFlags != NULL) *encryptionFlags = (header & 0xC0) >> 6; stream_read_uint8(s, length); /* length1 */ /* If most significant bit is not set, length2 is not presented. */ if ((length & 0x80)) { length &= 0x7F; length <<= 8; stream_read_uint8(s, t); length += t; } return length;}
开发者ID:roman-bb,项目名称:FreeRDP-1.0,代码行数:22,
示例25: ber_read_sequence_tagboolean ber_read_sequence_tag(STREAM* s, int* length){ uint8 byte; stream_read_uint8(s, byte); if (byte != ((BER_CLASS_UNIV | BER_CONSTRUCT) | (BER_TAG_SEQUENCE_OF))) return false; ber_read_length(s, length); return true;}
开发者ID:felfert,项目名称:FreeRDP,代码行数:13,
示例26: update_read_icon_infovoid update_read_icon_info(STREAM* s, ICON_INFO* icon_info){ stream_read_uint16(s, icon_info->cacheEntry); /* cacheEntry (2 bytes) */ stream_read_uint8(s, icon_info->cacheId); /* cacheId (1 byte) */ stream_read_uint8(s, icon_info->bpp); /* bpp (1 byte) */ stream_read_uint16(s, icon_info->width); /* width (2 bytes) */ stream_read_uint16(s, icon_info->height); /* height (2 bytes) */ /* cbColorTable is only present when bpp is 1, 2 or 4 */ if (icon_info->bpp == 1 || icon_info->bpp == 2 || icon_info->bpp == 4) stream_read_uint16(s, icon_info->cbColorTable); /* cbColorTable (2 bytes) */ else icon_info->cbColorTable = 0; stream_read_uint16(s, icon_info->cbBitsMask); /* cbBitsMask (2 bytes) */ stream_read_uint16(s, icon_info->cbBitsColor); /* cbBitsColor (2 bytes) */ /* bitsMask */ if (icon_info->bitsMask == NULL) icon_info->bitsMask = (uint8*) xmalloc(icon_info->cbBitsMask); else icon_info->bitsMask = (uint8*) xrealloc(icon_info->bitsMask, icon_info->cbBitsMask); stream_read(s, icon_info->bitsMask, icon_info->cbBitsMask); /* colorTable */ if (icon_info->colorTable == NULL) icon_info->colorTable = (uint8*) xmalloc(icon_info->cbColorTable); else icon_info->colorTable = (uint8*) xrealloc(icon_info->colorTable, icon_info->cbColorTable); stream_read(s, icon_info->colorTable, icon_info->cbColorTable); /* bitsColor */ if (icon_info->bitsColor == NULL) icon_info->bitsColor = (uint8*) xmalloc(icon_info->cbBitsColor); else icon_info->bitsColor = (uint8*) xrealloc(icon_info->bitsColor, icon_info->cbBitsColor); stream_read(s, icon_info->bitsColor, icon_info->cbBitsColor);}
开发者ID:kidfolk,项目名称:FreeRDP,代码行数:38,
示例27: ber_read_booleanboolean ber_read_boolean(STREAM* s, boolean* value){ int length; uint8 v; if (!ber_read_universal_tag(s, BER_TAG_BOOLEAN, false)) return false; ber_read_length(s, &length); if (length != 1) return false; stream_read_uint8(s, v); *value = (v ? true : false); return true;}
开发者ID:felfert,项目名称:FreeRDP,代码行数:14,
注:本文中的stream_read_uint8函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ stream_set_pos函数代码示例 C++ stream_read_uint32函数代码示例 |