From c70a72ec79b78f9a90dd012a2ec47756f341581d Mon Sep 17 00:00:00 2001 From: Julien (jvoisin) Voisin Date: Tue, 26 Jul 2016 17:29:53 +0200 Subject: Long lines aren't checked by default PERFORMANCES PLUS PLUS YEAH YEAH YEAH! --- php-malware-finder/phpmalwarefinder | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/php-malware-finder/phpmalwarefinder b/php-malware-finder/phpmalwarefinder index 9853e94..f226a85 100755 --- a/php-malware-finder/phpmalwarefinder +++ b/php-malware-finder/phpmalwarefinder @@ -72,8 +72,6 @@ determine_format() { fi } -# before starting yara, check if the file -# TODO (too heavy) one_line_trick() { if [ -z "$FORMAT" ]; then @@ -115,12 +113,13 @@ Usage ${0##*/} [-cfhtvl] ... -t Specify the number of threads to use (8 by default) -v Verbose mode -l Set language ('asp', 'php') + -L Check long lines -u update rules EOF } OPTIND=1 -while getopts "c:fht:vl:u" opt; do +while getopts "c:fht:vl:Lu" opt; do case "$opt" in h) show_help @@ -141,6 +140,9 @@ while getopts "c:fht:vl:u" opt; do l) FORMAT=${OPTARG} ;; + L) + LONG_LINES=1 + ;; u) update_rules exit 0 @@ -177,7 +179,10 @@ then fi +if [ ! -e "${LONG_LINES}" ] +then one_line_trick "$@" +fi # Include correct yara rule CONFIG_PATH=${CONFIG_PATH%/*}/ -- cgit v1.3