omerbenamram / evtx

A Fast (and safe) parser for the Windows XML Event Log (EVTX) format
Apache License 2.0
625 stars 61 forks source link

feat: add initial support for size_t #232

Closed alexkornitzer closed 1 year ago

alexkornitzer commented 1 year ago

Heya,

Very happy to finally have something to provide upstream to such a core crate in Chainsaw :)

Someone at work provided me with an evtx file which was failing to parse due to this size_t type.

From looking at an event log which utilises size_t it can be seen to output size_t in hex. This commit adds support for widths 4 & 8, by applying them to the HexInt32 and HexInt64 variants.

HandleId & ProcessId:

Screenshot 2023-02-17 at 10 38 39 Screenshot 2023-02-17 at 10 40 26

The assumptions above would make sense to me as this is usually how size_t is typedef'd. But I fully get if you would not want to merge this as it has only been tested on one sample and some assumptions have been made.

alexkornitzer commented 1 year ago

Yep here is the sample, which was taken from here, challenge 1 (https://www.ashemery.com/dfir.html)

Security.evtx.zip

ohadravid commented 1 year ago

Great! So could you add a test like test_event_json_with_multiple_nodes_same_name or test_issue_65 with this example?

alexkornitzer commented 1 year ago

Done and squashed to keep the commit log clean.