Skip to content

Commit 76d22af

Browse files
committed
v0.1.0
1 parent fcc7558 commit 76d22af

File tree

3 files changed

+28
-6
lines changed

3 files changed

+28
-6
lines changed

Changelog.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
SigTool Changelog.
2+
3+
=== VERSIONING GUIDELINES ===
4+
SigTool adheres to the SemVer guidelines for versioning.
5+
6+
Versioning guidelines for SemVer can be found at: http://www.semver.org/
7+
8+
=== Changes made since last versioned release ===
9+
10+
(none)
11+
12+
=== Version/Release 0.1.0 ===
13+
FIRST TAGGED RELEASE.
14+
15+
Caleb M (Maikuolan),
16+
8th August 2017.

_docs/readme.en.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ clamav_swf_regex.db | Targets SWF files; Works with raw data; Signatures can con
8080
- __db__: Standard signature files (these are extracted from the `.ndb` signature files contained by `daily.cvd` and `main.cvd`). Signature files that work directly with file content use this extension.
8181
- __fdb__: Filename signature files (the ClamAV signatures database formerly supported filename signatures, but doesn't anymore; SigTool doesn't generate any signature files using this extension; maintained due to continued usefulness for phpMussel). Signature files that work with filenames use this extension.
8282
- __hdb__: Hash signature files (these are extracted from the `.hdb` signature files contained by `daily.cvd` and `main.cvd`). Signature files that work with file hashes use this extension.
83-
- __htdb__: HTML signature files (these are extracted from the `.ndb` signature files contained by `daily.cvd` and `main.cvd`). Signature files that work with HTML content use this extension.
83+
- __htdb__: HTML signature files (these are extracted from the `.ndb` signature files contained by `daily.cvd` and `main.cvd`). Signature files that work with HTML-normalised content use this extension.
8484
- __mdb__: PE sectional signature files (these are extracted from the `.mdb` signature files contained by `daily.cvd` and `main.cvd`). Signature files that work with PE sectional metadata use this extension.
8585
- __medb__: PE extended signature files (this is a homebrew format created for phpMussel, and has nothing to do with the ClamAV signatures database; SigTool doesn't generate any signature files using this extension; these are written manually for the `phpMussel/Signatures` repository). Signature files that work with PE metadata (other than PE sectional metadata) use this extension.
86-
- __ndb__: Normalised signature files (these are extracted from the `.ndb` signature files contained by `daily.cvd` and `main.cvd`). Signature files that work with normalised file content use this extension.
86+
- __ndb__: Normalised signature files (these are extracted from the `.ndb` signature files contained by `daily.cvd` and `main.cvd`). Signature files that work with ANSI-normalised file content use this extension.
8787
- __udb__: URL signature files (this is a homebrew format created for phpMussel, and has nothing to do with the ClamAV signatures database; SigTool doesn't *currently* generate any signature files using this extension, although this may change in the future; currently, these are written manually for the `phpMussel/Signatures` repository). Signature files that work with URLs use this extension.
88-
- __ldb__: Logical signature files (these will *eventually*, for a future SigTool version, be extracted from the `.ldb` signature files contained by `daily.cvd` and `main.cvd`, but aren't supported by SigTool or phpMussel). Signature files that work with various logical rules use this extension.
88+
- __ldb__: Logical signature files (these will *eventually*, for a future SigTool version, be extracted from the `.ldb` signature files contained by `daily.cvd` and `main.cvd`, but aren't yet supported by SigTool or phpMussel). Signature files that work with various logical rules use this extension.
8989

9090

9191
---

sigtool.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* SigTool v0.0.4-ALPHA (last modified: 2017.08.08).
3+
* SigTool v0.1.0 (last modified: 2017.08.08).
44
* Generates signatures for phpMussel using main.cvd and daily.cvd from ClamAV.
55
*
66
* Package location: GitHub <https://github.com/phpMussel/SigTool>.
@@ -16,7 +16,7 @@
1616
class SigTool
1717
{
1818
/** Script version. */
19-
public $Ver = '0.0.4-ALPHA';
19+
public $Ver = '0.1.0';
2020

2121
/** Script user agent. */
2222
public $UA = 'SigTool v%s (https://github.com/phpMussel/SigTool)';
@@ -394,7 +394,7 @@ public function fixPath($Path) {
394394
/** L10N. */
395395
$L10N = [
396396
'Help' =>
397-
" SigTool v0.0.4-ALPHA (last modified: 2017.08.08).\n" .
397+
" SigTool v0.1.0 (last modified: 2017.08.08).\n" .
398398
" Generates signatures for phpMussel using main.cvd and daily.cvd from ClamAV.\n\n" .
399399
" Syntax:\n" .
400400
" \$ php sigtool.php [arguments]\n" .
@@ -664,6 +664,9 @@ public function fixPath($Path) {
664664
$RemSize -= $SigTool->SafeReadSize;
665665
$FileData = fread($Handle, $SigTool->SafeReadSize) . $FileData;
666666
}
667+
if ($RemSize < 1 && substr($FileData, -1, 1) !== "\n" && ($EoF = strrpos($FileData, "\n")) !== false) {
668+
$FileData = substr($FileData, 0, $EoF) . "\n";
669+
}
667670
fclose($Handle);
668671
echo $L10N['Done'];
669672
}
@@ -679,6 +682,9 @@ public function fixPath($Path) {
679682
/** Apply shorthand to signature names and remove any unwanted lines. */
680683
$SigTool->shorthand($FileData);
681684

685+
/** Remove erroneous lines. */
686+
$FileData = preg_replace('~^(?!phpMussel|\n)[^\x1A\n]+$\n~im', '', $FileData);
687+
682688
/** Write to file. */
683689
if (!is_resource($Handle = fopen($SigTool->fixPath(__DIR__ . '/' . $Set[4]), 'wb'))) {
684690
$Terminate();

0 commit comments

Comments
 (0)