#guid #protocols #api #winstructs

winstructs

Common structures used in parsing various windows protocols

8 releases

0.3.2 Aug 23, 2023
0.3.0 Jan 6, 2020
0.2.3 Sep 5, 2019
0.2.2 Jun 1, 2019
0.1.1 May 23, 2019

#1792 in Network programming

Download history 787/week @ 2024-12-21 437/week @ 2024-12-28 927/week @ 2025-01-04 1230/week @ 2025-01-11 1368/week @ 2025-01-18 1284/week @ 2025-01-25 2324/week @ 2025-02-01 2998/week @ 2025-02-08 2703/week @ 2025-02-15 1983/week @ 2025-02-22 2547/week @ 2025-03-01 2911/week @ 2025-03-08 2342/week @ 2025-03-15 2278/week @ 2025-03-22 1565/week @ 2025-03-29 1550/week @ 2025-04-05

8,052 downloads per month
Used in 18 crates (9 directly)

MIT/Apache

37KB
866 lines

This crate contains definitions and some parsing logic for structures that are common across windows formats.

Documentation

API

Generally, structs in this crate will have either from_reader, if they can be read from a Read instance, or from_stream, if reading them requires Read + Seek.

from_buffer is also provided as convenience, but it generally just builds a cursor and uses either from_reader or from_stream internally.


Build Status crates.io

winstructs

This crate contains definitions and some parsing logic for structures that are common across windows formats.

Consult the Documentation for supported structs and usage instructions.

Example

Here is an example for parsing a GUID.

use winstructs::guid::Guid;

fn main() {
   let raw_guid: &[u8] = &[0x25, 0x96, 0x84, 0x54, 0x78, 0x54, 0x94, 0x49,
                           0xa5, 0xba, 0x3e, 0x3b, 0x3, 0x28, 0xc3, 0xd];
                           
   let guid = Guid::from_buffer(raw_guid).unwrap();
   assert_eq!(format!("{}", guid), "54849625-5478-4994-A5BA-3E3B0328C30D");
}

Dependencies

~1.8–3MB
~57K SLoC