Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql code is broken #70

Open
arkkors opened this issue May 5, 2021 · 4 comments
Open

sql code is broken #70

arkkors opened this issue May 5, 2021 · 4 comments

Comments

@arkkors
Copy link

arkkors commented May 5, 2021

when importing the winappdbg.sql module I get an crash:

    __all__ = ['CrashDAO']
    
    import sqlite3
    import datetime
    import warnings
    
    from sqlalchemy import create_engine, Column, ForeignKey, Sequence
    from sqlalchemy.engine.url import URL
    from sqlalchemy.ext.compiler import compiles
    from sqlalchemy.ext.declarative import declarative_base
>   from sqlalchemy.interfaces import PoolListener
E   ImportError: No module named interfaces

I installed the winappdbg version from current head, running on python 2.7 and sqlalchemy is present (SQLAlchemy==1.4.13)

@MarioVilas
Copy link
Owner

Looks like SQLAlchemy has changed their interface a bit: https://docs.sqlalchemy.org/en/13/core/interfaces.html#sqlalchemy.interfaces.PoolListener

For the time being I recommend installing an older version of SQLAlchemy until I port the code to the latest version.

@MarioVilas
Copy link
Owner

Alright, a quick look at the code shows that PoolListener was used as a hack for detecting certain features of sqlite. So another option is to just remove the offending code, that is, the broken import, the definition of the _SQLitePatch class and the line where that class is used.

I have no idea if anything else is broken too, down the road. I wrote this back when SQLAlchemy was still below 1.0 so more features could be gone. :(

@arkkors
Copy link
Author

arkkors commented May 8, 2021

The PoolListener logic is roughly equivalent to the Event system now, as far as I see it. The code snippet from here should do the same thing like your _SQLitePatch class, for example.
As for CrashDAO / BaseDAO, I'm not sure. I think the mapper functionality would the similar to the logic, however I have never used it.

@retpoline
Copy link

retpoline commented Sep 10, 2021

Another workaround for now would also be using an older version of SQLAlchemy.

pip install sqlalchemy==1.3.24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants