minor fixes and formatting
parent
8d8df2ab5a
commit
ba8d38e56b
|
@ -2,3 +2,4 @@
|
|||
from .run import sins
|
||||
from .mutation import generation, mutate
|
||||
from .orm import db_config, ScrapNode
|
||||
from .disassemble import disasm, objdump
|
||||
|
|
|
@ -4,6 +4,7 @@ import json
|
|||
|
||||
capstone = Cs(CS_ARCH_X86, CS_MODE_64)
|
||||
|
||||
|
||||
def disasm(shellcode: bytes) -> list:
|
||||
opcodes = list()
|
||||
|
||||
|
@ -12,6 +13,7 @@ def disasm(shellcode: bytes)->list:
|
|||
|
||||
return opcodes
|
||||
|
||||
|
||||
def objdump(shellcode: bytes) -> str:
|
||||
opcodes = str()
|
||||
|
||||
|
|
|
@ -7,8 +7,6 @@ from sqlalchemy.ext.declarative import declarative_base
|
|||
from sqlalchemy.orm import Session, relationship, backref
|
||||
from sqlalchemy.orm.collections import attribute_mapped_collection
|
||||
|
||||
from .disassemble import objdump, disasm
|
||||
|
||||
now = '{0:%Y%m%dT%H%M%S}'.format(datetime.utcnow())
|
||||
Base = declarative_base()
|
||||
|
||||
|
@ -42,14 +40,11 @@ class ScrapNode(Base):
|
|||
self.image = child
|
||||
self.length = len(child)
|
||||
self.sha1sum
|
||||
self.objdump = objdump(child)
|
||||
|
||||
def __repr__(self):
|
||||
values = {
|
||||
'checksum': self.checksum,
|
||||
'length': self.length,
|
||||
# todo remove for performance
|
||||
'operations': len(disasm(self.image)),
|
||||
'parent_id': self.parent_id,
|
||||
'id': self.id,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue