Skip to content

Commit

Permalink
v0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Maikuolan committed Aug 8, 2017
1 parent fcc7558 commit 76d22af
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
16 changes: 16 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
SigTool Changelog.

=== VERSIONING GUIDELINES ===
SigTool adheres to the SemVer guidelines for versioning.

Versioning guidelines for SemVer can be found at: http://www.semver.org/

=== Changes made since last versioned release ===

(none)

=== Version/Release 0.1.0 ===
FIRST TAGGED RELEASE.

Caleb M (Maikuolan),
8th August 2017.
6 changes: 3 additions & 3 deletions _docs/readme.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ clamav_swf_regex.db | Targets SWF files; Works with raw data; Signatures can con
- __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.
- __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.
- __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.
- __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.
- __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.
- __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.
- __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.
- __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.
- __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.
- __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.
- __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.
- __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.


---
Expand Down
12 changes: 9 additions & 3 deletions sigtool.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* SigTool v0.0.4-ALPHA (last modified: 2017.08.08).
* SigTool v0.1.0 (last modified: 2017.08.08).
* Generates signatures for phpMussel using main.cvd and daily.cvd from ClamAV.
*
* Package location: GitHub <https://github.com/phpMussel/SigTool>.
Expand All @@ -16,7 +16,7 @@
class SigTool
{
/** Script version. */
public $Ver = '0.0.4-ALPHA';
public $Ver = '0.1.0';

/** Script user agent. */
public $UA = 'SigTool v%s (https://github.com/phpMussel/SigTool)';
Expand Down Expand Up @@ -394,7 +394,7 @@ public function fixPath($Path) {
/** L10N. */
$L10N = [
'Help' =>
" SigTool v0.0.4-ALPHA (last modified: 2017.08.08).\n" .
" SigTool v0.1.0 (last modified: 2017.08.08).\n" .
" Generates signatures for phpMussel using main.cvd and daily.cvd from ClamAV.\n\n" .
" Syntax:\n" .
" \$ php sigtool.php [arguments]\n" .
Expand Down Expand Up @@ -664,6 +664,9 @@ public function fixPath($Path) {
$RemSize -= $SigTool->SafeReadSize;
$FileData = fread($Handle, $SigTool->SafeReadSize) . $FileData;
}
if ($RemSize < 1 && substr($FileData, -1, 1) !== "\n" && ($EoF = strrpos($FileData, "\n")) !== false) {
$FileData = substr($FileData, 0, $EoF) . "\n";
}
fclose($Handle);
echo $L10N['Done'];
}
Expand All @@ -679,6 +682,9 @@ public function fixPath($Path) {
/** Apply shorthand to signature names and remove any unwanted lines. */
$SigTool->shorthand($FileData);

/** Remove erroneous lines. */
$FileData = preg_replace('~^(?!phpMussel|\n)[^\x1A\n]+$\n~im', '', $FileData);

/** Write to file. */
if (!is_resource($Handle = fopen($SigTool->fixPath(__DIR__ . '/' . $Set[4]), 'wb'))) {
$Terminate();
Expand Down

0 comments on commit 76d22af

Please sign in to comment.