Skip to content

Commit

Permalink
0.18.1
Browse files Browse the repository at this point in the history
- Automatic initialisation
- Removed loki.exe from the main repository
  • Loading branch information
Florian Roth committed Dec 10, 2016
1 parent 3588a9e commit 04c7cd0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
Binary file removed loki.exe
Binary file not shown.
32 changes: 23 additions & 9 deletions loki.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
DISCLAIMER - USE AT YOUR OWN RISK.
"""
__version__ = '0.18.0'
__version__ = '0.18.1'

import os
import argparse
Expand All @@ -38,7 +38,7 @@
from colorama import Fore, Back, Style
from colorama import init
from sys import platform as _platform
from git import cmd
from git import cmd, Repo
import sys
sys.stdout = codecs.getwriter('utf8')(sys.stdout)

Expand Down Expand Up @@ -115,10 +115,18 @@ def __init__(self, intense_mode):
self.app_path = get_application_path()

# Check if signature database is present
if os.listdir(os.path.join(self.app_path, "./signature-base/")) == []:
logger.log("WARNING", "The 'signature-base' subdirectory is empty. Download the signature database and "
"extract it to this sub directory or simply clone the LOKI github repository instead "
"of a ZIP download. URL: https://github.com/Neo23x0/signature-base")
sig_dir = os.path.join(self.app_path, "./signature-base/")
if not os.path.exists(sig_dir) or os.listdir(sig_dir) == []:
logger.log("WARNING", "The 'signature-base' subdirectory doesn't exist or is empty. "
"Trying to retrieve the signature database automatically.")
success_init = update_signatures()
if success_init:
logger.log("INFO", "Signature-Base repository initialised successful")
else:
logger.log("ERROR", "Signature-Base initialisation failed. "
"Try running 'loki --update --debug' manually to initialise the signature "
"repository and see the errors.")
sys.exit(1)

# Excludes
self.initialize_excludes(os.path.join(self.app_path, "./config/excludes.cfg"))
Expand Down Expand Up @@ -1315,9 +1323,14 @@ def get_application_path():

def update_signatures():
try:
g = cmd.Git(os.path.join(get_application_path(), './signature-base/'))
pull_result = g.pull("https://github.com/Neo23x0/signature-base")
print pull_result
sig_dir = os.path.join(get_application_path(), './signature-base/')
if not os.path.exists(sig_dir):
clone_result = Repo.clone_from("https://github.com/Neo23x0/signature-base", sig_dir)
# print clone_result
else:
g = cmd.Git(sig_dir)
pull_result = g.pull("https://github.com/Neo23x0/signature-base")
# print pull_result
except Exception, e:
if args.debug:
traceback.print_exc()
Expand Down Expand Up @@ -1382,6 +1395,7 @@ def signal_handler(signal_name, frame):

# Update
if args.update:
logger.log("INFO", "Retrieving signature database from git repo https://github.com/Neo23x0/signature-base")
success = update_signatures()
if success:
logger.log("INFO", "Update successful")
Expand Down
Binary file added screens/lokiinit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 04c7cd0

Please sign in to comment.