X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-registry%2Fsrc%2Fdetect.rs;h=e73ae4b2924cf1db80877a64529594e70caaa416;hb=ff6a914f5b07a9c62d7624fb6dd9f1fc093e82ca;hp=f79d063db8165c2d360cea58b728f34e6d2e308d;hpb=2826a23f3a214e2f5d47d6dee6fb06754730dc0e;p=nihav.git diff --git a/nihav-registry/src/detect.rs b/nihav-registry/src/detect.rs index f79d063..e73ae4b 100644 --- a/nihav-registry/src/detect.rs +++ b/nihav-registry/src/detect.rs @@ -169,7 +169,7 @@ enum CC<'a> { impl<'a> CC<'a> { fn eval(&self, src: &mut ByteReader) -> bool { match *self { - CC::Or (ref a, ref b) => { a.eval(src) || b.eval(src) }, + CC::Or(a, b) => { a.eval(src) || b.eval(src) }, CC::Eq(ref arg) => { arg.eq(src) }, CC::In(ref a, ref b) => { a.ge(src) && b.le(src) }, CC::Lt(ref arg) => { arg.lt(src) }, @@ -244,6 +244,12 @@ const DETECTORS: &[DetectConditions] = &[ DetectConditions { demux_name: "ivf", extensions: ".ivf", + conditions: &[CheckItem{offs: 0, cond: &CC::Str(&[0x50, 0xEF, 0x81, 0x19, 0xB3, 0xBD, 0xD0, 0x11, 0xA3, 0xE5, 0x00, 0xA0, 0xC9, 0x24, 0x44])}, + CheckItem{offs: 15, cond: &CC::Or(&CC::Eq(Arg::Byte(0x36)), &CC::Eq(Arg::Byte(0x37)))}], + }, + DetectConditions { + demux_name: "dkivf", + extensions: ".ivf", conditions: &[CheckItem{offs: 0, cond: &CC::Str(b"DKIF\x00\x00")}, CheckItem{offs: 6, cond: &CC::Ge(Arg::U16LE(32))}], }, @@ -268,6 +274,12 @@ const DETECTORS: &[DetectConditions] = &[ conditions: &[CheckItem{offs: 0, cond: &CC::Str(b"IMAX") }, CheckItem{offs: 10, cond: &CC::Eq(Arg::U16LE(0x102)) }], }, + DetectConditions { + demux_name: "hl-fmv", + extensions: ".fmv", + conditions: &[CheckItem{offs: 0, cond: &CC::Str(b"FMV*") }, + CheckItem{offs: 4, cond: &CC::Eq(Arg::U32LE(0)) }], + }, DetectConditions { demux_name: "legend-q", extensions: ".q",