Skip to content

Commit

Permalink
rm tools
Browse files Browse the repository at this point in the history
  • Loading branch information
LoRexxar committed Sep 14, 2020
1 parent be95105 commit 7fc903d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 28 deletions.
4 changes: 1 addition & 3 deletions core/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

from utils.file import FileParseAll
from utils.log import logger
from utils.utils import Tool, SCAN_ID, get_scan_id
from utils.utils import get_scan_id

from web.index.models import ScanResultTask, NewEvilFunc
from web.index.models import get_resultflow_class
Expand Down Expand Up @@ -331,8 +331,6 @@ class SingleRule(object):
def __init__(self, target_directory, single_rule, files, language=None, tamper_name=None, is_unconfirm=False,
newcore_function_list=[]):
self.target_directory = target_directory
self.find = Tool().find
self.grep = Tool().grep
self.sr = single_rule
self.files = files
self.languages = language
Expand Down
25 changes: 0 additions & 25 deletions utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,31 +410,6 @@ def get_safe_ex_string(ex, encoding=None):
return get_unicode(ret or "", encoding=encoding).strip()


class Tool:
def __init__(self):

# `grep` (`ggrep` on Mac)
if os.path.isfile('/bin/grep'):
self.grep = '/bin/grep'
elif os.path.isfile('/usr/bin/grep'):
self.grep = '/usr/bin/grep'
elif os.path.isfile('/usr/local/bin/grep'):
self.grep='/usr/local/bin/grep'
else:
self.grep = 'grep'


# `find` (`gfind` on Mac)
if os.path.isfile('/bin/find'):
self.find = '/bin/find'
elif os.path.isfile('/usr/bin/find'):
self.find = '/usr/bin/find'
elif os.path.isfile('/usr/local/bin/find'):
self.find='/usr/local/bin/find'
else:
self.find = 'find'


def secure_filename(filename):
_filename_utf8_strip_re = re.compile(u"[^\u4e00-\u9fa5A-Za-z0-9_.\-\+]")
_windows_device_files = ('CON', 'AUX', 'COM1', 'COM2', 'COM3', 'COM4', 'LPT1', 'LPT2', 'LPT3', 'PRN', 'NUL')
Expand Down

0 comments on commit 7fc903d

Please sign in to comment.