#pattern #hex #representation #dead #decodable #unix #timestamp

nightly bin+lib deadyet

Checks whether hex representations contain patterns

4 releases (2 breaking)

0.3.0 Sep 7, 2020
0.2.2 Sep 7, 2020
0.2.1 Sep 7, 2020
0.1.0 Sep 7, 2020

#2 in #decodable

MIT license

16KB
285 lines

Deadyet?

Build Status


lib.rs:

This package allows you to efficiently search for hex patterns in the hex representation of Decodable values.

It is intended to find and search for these patterns in unix timestamps, specifically occurences of DEAD within the timestamp but is not limited to this.

use deadyet::{to_next_dead, to_next_pattern, has_pattern, Decodable};

assert_eq!(to_next_dead(0xDEAE), 0xFFFF);
assert_eq!(to_next_dead(0xDEACFF), 1);
assert_eq!(to_next_dead(0xDEAD0), 0);
assert_eq!(to_next_dead(0xDEAC0), 0x10);

assert_eq!(to_next_pattern(0xAAAAA, 0xABBA, 0xFFFF), 0x110);

assert!(has_pattern(0xAABBAA, 0xABBA));

Dependencies

~18–32MB
~491K SLoC