Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #11 from demonduck/dev
Browse files Browse the repository at this point in the history
Requirements Update
  • Loading branch information
demonduck authored Sep 11, 2017
2 parents 422fd27 + 70cdd9e commit 8d3ad5f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
3 changes: 1 addition & 2 deletions install/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
mysqlclient
mongoengine
django
werkzeug
distorm3
capstone
httplib2
oauth2client
google-api-python-client
7 changes: 0 additions & 7 deletions server/first_core/engines/basic_masking.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,17 +146,11 @@ def normalize(self, disassembly):
normalized.append(instr + ', '.join(operand_instrs))
'''

print 'Original'
print original
print 'Normalized'
print [x.encode('hex') for x in normalized]

if MIN_REQUIRED_INSTRUCTIONS > len(normalized):
print 145
return (0, None)

h_sha256 = sha256(''.join(normalized)).hexdigest()
print (changed_bytes, h_sha256)
return (changed_bytes, h_sha256)

except Exception as e:
Expand All @@ -176,7 +170,6 @@ def _add(self, function):
if not h_sha256:
return


try:
db_obj = BasicMasking.objects.get(sha256=h_sha256,
architecture=architecture)
Expand Down
18 changes: 8 additions & 10 deletions server/utilities/user_shell.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /usr/bin/python
#-------------------------------------------------------------------------------
#
# Utility Shell to manage Engine related operations
# Utility Shell to manage User related operations
# Copyright (C) 2016 Angel M. Villegas
#
# This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -34,15 +34,13 @@
# FIRST Modules
import first.wsgi
import first.settings
from first_core.engines import AbstractEngine
from first_core.disassembly import Disassembly
from first_core import DBManager, EngineManager
from first_core.models import Engine, User, Function
from first_core.models import User

# Third Party Modules
from django.core.paginator import Paginator

class EngineCmd(Cmd):
class UserCmd(Cmd):

def __init__(self):
Cmd.__init__(self)
Expand All @@ -60,10 +58,10 @@ def preloop(self):
'+========================================================+\n'
'| FIRST User Shell Menu |\n'
'+========================================================+\n'
'| list | List all engines currently installed |\n'
'| info | Get info on an engine |\n'
'| list | List all users currently installed |\n'
'| info | Get info on an user |\n'
'| adduser | Registers a user manually |\n'
'| enable | Enable engine (Engine will be enabled) |\n'
'| enable | Enable user |\n'
'| disable | Disable user account |\n'
'+--------------------------------------------------------+\n')

Expand All @@ -88,7 +86,7 @@ def do_shell(self, line):
'''Run line in python'''
exec line

class RootCmd(EngineCmd):
class RootCmd(UserCmd):
def do_list(self, line):
print 'list - List all registered users'
if line in ['help', '?']:
Expand Down Expand Up @@ -166,7 +164,7 @@ def do_info(self, line):
'| Created | {1:53} |\n'
'+' + '-'*9 + '+' + '-'*55 + '\n'
'| Active | {0.active:53} |\n'
'+' + '-'*69 + '+\n').format(user, str(user.created))
'+' + '-'*65 + '+\n').format(user, str(user.created))

def do_enable(self, line):
print 'enable - Enable user \n'
Expand Down

0 comments on commit 8d3ad5f

Please sign in to comment.