Skip to content

Commit eec7d99

Browse files
authored
Add basic documentation for HandlerType logical signatures
1 parent d909378 commit eec7d99

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/manual/Signatures/FileTypeMagic.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,7 @@ Where:
3131
`min_flevel`: (optional) The minimum ClamAV engine that the file type signature works with. See the [FLEVEL reference](../../appendix/FunctionalityLevels.md) for details. To be used in the event that file type support has been recently added.
3232

3333
`max_flevel`: (optional, requires `min_flevel` field, though the `min_flevel` number itself can be left empty) The maximum ClamAV engine that the file type signature works with. To be used in the event that file type support has been recently removed or replaced.
34+
35+
> _Note_: It is likely that `magictype` `0` is insufficient to identify a file and so type `1` may be necessary.
36+
>
37+
> If type `1` is also insufficient, you may have luck using a [logical signature with the `HandlerType` option](./LogicalSignatures.md). Be warned that `HandlerType` signatures are very inefficient as the given file will be scanned twice.

src/manual/Signatures/LogicalSignatures.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ Keywords used in `TargetDescriptionBlock`:
4646

4747
- `IconGroup2`: Icon group name 2 from .idb signature Required engine functionality (range; 0.96)
4848

49+
- `HandlerType:CL_TYPE_*`: If used, the logical signature will not cause an alert and will instead re-scan the file as a different file type, treating it as a child (contained) file.
50+
51+
For example, this signature will look for a selection of components with any file (because of `Target:0`). If found, it will rescan the file as a PDF:
52+
```
53+
Filetype.PDF;Engine:54-255,Target:0,HandlerType:CL_TYPE_PDF;(0|1)&2&3;0:255044462d??2e;0:257064662d??2e;737461727478726566;2525454f46
54+
```
55+
56+
> _Note_: This is an inefficient approach to file type identification, though it is more versatile than traditional [File Type Magic (`.ftm`) signatures](./FileTypeMagic.md).
57+
4958
Modifiers for subexpressions:
5059

5160
- `A=X`: If the SUB-EXPRESSION A refers to a single signature then this signature must get matched exactly X times; if it refers to a (logical) block of signatures then this block must generate exactly X matches (with any of its sigs).

0 commit comments

Comments
 (0)