<reponame>MrT3acher/Android-Malware-Sandbox
import datetime
import re
import socket
from urllib.parse import urlparse

from sqlalchemy import Column, Integer, String, Boolean, ForeignKey, DateTime

from lib.model.database.Database import Database

import binascii
import base64

Base = Database.get_declarative_base()


class TCPDump(Base):
    __tablename__ = 'tcpdump'
    id = Column(Integer, primary_key=True)
    date = Column(DateTime, default=datetime.datetime.utcnow)
    summary = Column(String)
    show = Column(String)
    hexdump = Column(String)
    file_path = Column(String)
    application_id = Column(Integer, ForeignKey('application.id'))

    def __init__(self, msg):
        self.summary = msg['summary']
        self.show = msg['show']
        self.hexdump = msg['hexdump']
        self.file_path = msg['file_path']

    def __repr__(self):
        return f'<TCPDump(summary={self.summary}, date="{self.date}")>'