diff --git a/dailalib/binsync_plugin/ai_bs_user.py b/dailalib/binsync_plugin/ai_bs_user.py index 0ae57f3..5caedca 100644 --- a/dailalib/binsync_plugin/ai_bs_user.py +++ b/dailalib/binsync_plugin/ai_bs_user.py @@ -3,12 +3,11 @@ import shutil from pathlib import Path import tempfile -from typing import Union, Dict +from typing import Dict import math import threading from binsync.api import load_decompiler_controller, BSController -from binsync.decompilers import ANGR_DECOMPILER from binsync.data.state import State from binsync.data import ( Function, Comment, StackVariable diff --git a/dailalib/binsync_plugin/ai_user_config_ui.py b/dailalib/binsync_plugin/ai_user_config_ui.py index b1df15c..84d4312 100644 --- a/dailalib/binsync_plugin/ai_user_config_ui.py +++ b/dailalib/binsync_plugin/ai_user_config_ui.py @@ -1,7 +1,6 @@ import os from pathlib import Path import logging -from threading import Thread from binsync.ui.qt_objects import ( QComboBox, @@ -12,17 +11,11 @@ QHBoxLayout, QLabel, QLineEdit, - QMessageBox, QPushButton, - QVBoxLayout, - QTableWidget, - QTableWidgetItem, - QHeaderView + QVBoxLayout ) -from binsync.ui.utils import QProgressBarDialog from . import AIBSUser, add_ai_user_to_project from binsync.api.controller import BSController -from binsync.decompilers import ANGR_DECOMPILER, IDA_DECOMPILER _l = logging.getLogger(__name__) AUTO_DECOMPILER = "automatic" diff --git a/dailalib/installer.py b/dailalib/installer.py index 8b55820..e45710b 100644 --- a/dailalib/installer.py +++ b/dailalib/installer.py @@ -9,7 +9,7 @@ class DAILAInstaller(Installer): def __init__(self): super().__init__(targets=("ida", "ghidra", "binja")) self.plugins_path = Path( - pkg_resources.resource_filename("dailalib", f"plugins") + pkg_resources.resource_filename("dailalib", "plugins") ) def display_prologue(self): diff --git a/dailalib/interfaces/__init__.py b/dailalib/interfaces/__init__.py index 52af746..697c433 100644 --- a/dailalib/interfaces/__init__.py +++ b/dailalib/interfaces/__init__.py @@ -1,2 +1,7 @@ from .generic_ai_interface import GenericAIInterface from .openai_interface import OpenAIInterface + +__all__ = [ + "GenericAIInterface", + "OpenAIInterface", +] diff --git a/dailalib/interfaces/generic_ai_interface.py b/dailalib/interfaces/generic_ai_interface.py index 9977f6d..2debc94 100644 --- a/dailalib/interfaces/generic_ai_interface.py +++ b/dailalib/interfaces/generic_ai_interface.py @@ -1,4 +1,4 @@ -from typing import Dict, Optional +from typing import Optional from binsync.api import load_decompiler_controller, BSController diff --git a/dailalib/interfaces/openai_interface.py b/dailalib/interfaces/openai_interface.py index 1af2806..5575a57 100644 --- a/dailalib/interfaces/openai_interface.py +++ b/dailalib/interfaces/openai_interface.py @@ -1,7 +1,6 @@ import re from typing import Optional, Dict import os -import textwrap import json from functools import wraps @@ -201,7 +200,7 @@ def query_for_cmd(self, cmd, func_addr=None, decompilation=None, edit_dec=False, kwargs.update(self.AI_COMMANDS[cmd]) if func_addr is None and decompilation is None: - raise Exception(f"You must provide either a function address or decompilation!") + raise Exception("You must provide either a function address or decompilation!") prompt = self.PROMPTS[cmd] if decompilation is not None: diff --git a/plugins/daila_ida.py b/plugins/daila_ida.py index 54444df..a602586 100644 --- a/plugins/daila_ida.py +++ b/plugins/daila_ida.py @@ -153,7 +153,7 @@ def __init__(self): def _decompile(self, func_addr: int, **kwargs): try: cfunc = ida_hexrays.decompile(func_addr) - except Exception as e: + except Exception: return None return str(cfunc)