X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-registry%2Fsrc%2Fdetect.rs;h=6603c0db243eeb7a9262465d0c610129f8f1b7f1;hb=fead60e32f35ca21262769174a23f6b4735bf28e;hp=bfe1d44a301656edf49b7d977996d581c2107517;hpb=1991b7da1b628e3a5dbef45431e47e890491ceb5;p=nihav.git diff --git a/nihav-registry/src/detect.rs b/nihav-registry/src/detect.rs index bfe1d44..6603c0d 100644 --- a/nihav-registry/src/detect.rs +++ b/nihav-registry/src/detect.rs @@ -176,11 +176,11 @@ impl<'a> CC<'a> { CC::Le(ref arg) => { arg.le(src) }, CC::Gt(ref arg) => { arg.gt(src) }, CC::Ge(ref arg) => { arg.ge(src) }, - CC::Str(str) => { - let mut val: Vec = vec![0; str.len()]; + CC::Str(strng) => { + let mut val: Vec = vec![0; strng.len()]; let res = src.peek_buf(val.as_mut_slice()); if res.is_err() { return false; } - val == str + val == strng } } } @@ -230,6 +230,15 @@ const DETECTORS: &[DetectConditions] = &[ &CC::Str(b"moov")), &CC::Str(b"ftyp")) }], }, + DetectConditions { + demux_name: "mov-macbin", + extensions: ".mov,.bin", + conditions: &[CheckItem{offs: 0, cond: &CC::Eq(Arg::Byte(0))}, + CheckItem{offs: 0x41, cond: &CC::Str(b"MooV")}, + CheckItem{offs: 0x7A, cond: &CC::Eq(Arg::Byte(0x81))}, + CheckItem{offs: 0x7B, cond: &CC::Eq(Arg::Byte(0x81))}, + CheckItem{offs: 0x84, cond: &CC::Str(b"mdat")}], + }, DetectConditions { demux_name: "yuv4mpeg", extensions: ".y4m", @@ -394,6 +403,11 @@ const DETECTORS: &[DetectConditions] = &[ conditions: &[CheckItem{offs: 0, cond: &CC::Str(b"BMVi") }, CheckItem{offs: 32, cond: &CC::Str(b"DATA")}], }, + DetectConditions { + demux_name: "sga", + extensions: ".dtv,.avc", + conditions: &[], + }, DetectConditions { demux_name: "vmd", extensions: ".vmd",