engine type stored in db
parent
8cb6a2f393
commit
2ad8d47d3a
|
@ -20,12 +20,13 @@ class Disassembly(Base):
|
|||
arch = Column(String, nullable=False)
|
||||
checksum = Column(String, nullable=False)
|
||||
count = Column(Integer, nullable=False)
|
||||
engine = Column(String, nullable=False)
|
||||
mnemonic_rates = Column(String, nullable=False)
|
||||
ret_rates = Column(String, nullable=False)
|
||||
size = Column(Integer, nullable=False)
|
||||
offset = Column(Integer, nullable=False)
|
||||
opcodes = Column(String, nullable=False)
|
||||
path = Column(String, nullable=False)
|
||||
ret_rates = Column(String, nullable=False)
|
||||
size = Column(Integer, nullable=False)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Disassembly {json.dumps(self.values, indent=1)}>"
|
||||
|
@ -41,11 +42,11 @@ class Disassembly(Base):
|
|||
values_dict = {
|
||||
"id": self.id,
|
||||
"arch": self.arch,
|
||||
"engine": self.engine,
|
||||
"count": self.count,
|
||||
"size": self.size,
|
||||
"mnemonic_rates": self.mnemonic_rates,
|
||||
"ret_rates": self.ret_rates,
|
||||
"size": self.size,
|
||||
"offset": self.offset,
|
||||
}
|
||||
|
||||
return values_dict
|
||||
|
|
|
@ -95,12 +95,13 @@ def subdisassem_script():
|
|||
row.arch = disasembler.arch
|
||||
row.checksum = checksum
|
||||
row.count = len(disasembler)
|
||||
row.engine = str(arch.__bases__)
|
||||
row.mnemonic_rates = str(disasembler.mnemonic_rates[:5])
|
||||
row.ret_rates = str(disasembler.ret_rates[:5])
|
||||
row.size = len(raw_bytes) - offset
|
||||
row.offset = offset
|
||||
row.opcodes = disasembler.objdump
|
||||
row.path = str(args.bin_path.absolute())
|
||||
row.ret_rates = str(disasembler.ret_rates[:5])
|
||||
row.size = len(raw_bytes) - offset
|
||||
session.add(row)
|
||||
|
||||
session.commit()
|
||||
|
|
Loading…
Reference in New Issue