Skip to content

Commit

Permalink
isort
Browse files Browse the repository at this point in the history
  • Loading branch information
Arkadiusz Wróbel committed Sep 13, 2021
1 parent 2a2b1e1 commit 5db1cef
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 74 deletions.
5 changes: 3 additions & 2 deletions drakrun/drakrun/apiscout.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import json
import logging
from operator import attrgetter
import os
from operator import attrgetter
from pathlib import Path, PureWindowsPath
from typing import Any, Dict, List

import pefile
from typing import List, Dict, Any

log = logging.getLogger(__name__)

Expand Down
68 changes: 22 additions & 46 deletions drakrun/drakrun/draksetup.py
Original file line number Diff line number Diff line change
@@ -1,65 +1,41 @@
import configparser
import hashlib
import logging
import io
import sys
import json
import logging
import os
import re
import json
import time
import secrets
import subprocess
import string
import subprocess
import sys
import tempfile
import time
import traceback
from pathlib import Path, PureWindowsPath
from typing import Optional

import click
import requests
from requests import RequestException
from minio import Minio
from minio.error import NoSuchKey
from drakrun.drakpdb import (
fetch_pdb,
make_pdb_profile,
dll_file_list,
compulsory_dll_file_list,
pe_codeview_data,
DLL,
)
from drakrun.config import (
InstallInfo,
LIB_DIR,
VOLUME_DIR,
PROFILE_DIR,
ETC_DIR,
VM_CONFIG_DIR,
APISCOUT_PROFILE_DIR,
)
from drakrun.networking import (
setup_vm_network,
start_dnsmasq,
delete_vm_network,
stop_dnsmasq,
)
from drakrun.storage import get_storage_backend, REGISTERED_BACKEND_NAMES
from drakrun.injector import Injector
from drakrun.vm import (
generate_vm_conf,
FIRST_CDROM_DRIVE,
SECOND_CDROM_DRIVE,
get_all_vm_conf,
delete_vm_conf,
VirtualMachine,
)
from drakrun.apiscout import (
make_static_apiscout_profile_for_dll,
build_static_apiscout_profile,
)
from drakrun.util import RuntimeInfo, VmiOffsets, safe_delete
from requests import RequestException
from tqdm import tqdm
from pathlib import Path, PureWindowsPath
import traceback

from drakrun.apiscout import (build_static_apiscout_profile,
make_static_apiscout_profile_for_dll)
from drakrun.config import (APISCOUT_PROFILE_DIR, ETC_DIR, LIB_DIR,
PROFILE_DIR, VM_CONFIG_DIR, VOLUME_DIR,
InstallInfo)
from drakrun.drakpdb import (DLL, compulsory_dll_file_list, dll_file_list,
fetch_pdb, make_pdb_profile, pe_codeview_data)
from drakrun.injector import Injector
from drakrun.networking import (delete_vm_network, setup_vm_network,
start_dnsmasq, stop_dnsmasq)
from drakrun.storage import REGISTERED_BACKEND_NAMES, get_storage_backend
from drakrun.util import RuntimeInfo, VmiOffsets, safe_delete
from drakrun.vm import (FIRST_CDROM_DRIVE, SECOND_CDROM_DRIVE, VirtualMachine,
delete_vm_conf, generate_vm_conf, get_all_vm_conf)

log = logging.getLogger(__name__)

Expand Down
49 changes: 23 additions & 26 deletions drakrun/drakrun/main.py
Original file line number Diff line number Diff line change
@@ -1,46 +1,43 @@
#!/usr/bin/python3

import argparse
import contextlib
import functools
import hashlib
import json
import logging
import sys
import ntpath
import os
import re
import shutil
import argparse
import subprocess
import hashlib
import socket
import subprocess
import sys
import tempfile
import time
import zipfile
import json
import re
import functools
import tempfile
from io import StringIO
from typing import List, Dict
from stat import S_ISREG, ST_CTIME, ST_MODE, ST_SIZE
from configparser import NoOptionError
from io import StringIO
from itertools import chain
from pathlib import Path
from stat import S_ISREG, ST_CTIME, ST_MODE, ST_SIZE
from typing import Dict, List

import magic
import ntpath
from karton.core import Karton, Config, Task, LocalResource, Resource
from karton.core import Config, Karton, LocalResource, Resource, Task

from drakrun.version import __version__ as DRAKRUN_VERSION
import drakrun.sample_startup as sample_startup
from drakrun.config import (APISCOUT_PROFILE_DIR, ETC_DIR, PROFILE_DIR,
InstallInfo)
from drakrun.drakpdb import dll_file_list
from drakrun.config import InstallInfo, ETC_DIR, PROFILE_DIR, APISCOUT_PROFILE_DIR
from drakrun.storage import get_storage_backend
from drakrun.networking import start_tcpdump_collector, start_dnsmasq, setup_vm_network
from drakrun.util import (
patch_config,
get_xl_info,
get_xen_commandline,
graceful_exit,
RuntimeInfo,
)
from drakrun.vm import generate_vm_conf, VirtualMachine
from drakrun.injector import Injector
import drakrun.sample_startup as sample_startup
from drakrun.networking import (setup_vm_network, start_dnsmasq,
start_tcpdump_collector)
from drakrun.storage import get_storage_backend
from drakrun.util import (RuntimeInfo, get_xen_commandline, get_xl_info,
graceful_exit, patch_config)
from drakrun.version import __version__ as DRAKRUN_VERSION
from drakrun.vm import VirtualMachine, generate_vm_conf


class LocalLogBuffer(logging.Handler):
Expand Down

0 comments on commit 5db1cef

Please sign in to comment.