kirk-sayre-work / ViperMonkey

A VBA parser and emulation engine to analyze malicious macros.
90 stars 14 forks source link

Fix for import bug #39

Open cccs-jh opened 2 years ago

cccs-jh commented 2 years ago

Fixes #40 Importing vipermonkey fails because Context is not defined in vipermonkey.api. I assume it used to be imported by one of the wildcard imports, this bug doesn't happen with the upstream decalage2 ViperMonkey. importing Context explicitly from vba_context fixes the issue. Using "import vba_context" rather than "from vba_context import Context" to avoid namespace overlap.

gdesmar commented 2 years ago

Hello @kirk-sayre-work,

Are there any plans to merge pull requests for python2 before the python3 version is finished?

I am asking because it is starting to become a little complicated to manage the multiple forks. Yesterday I fixed one situation where multiple ADODB.Stream would be used, and their content not cleared between re-opening. It is now in PR#43 along with other fixes by the PR opener. I could make my own PR for my fix only, but he needed it anyway. I am now debating doing a PR in @cccs-jh's fork to have both the api.py fix plus the Stream fix, and maybe check what the random and int_convert fixes are doing from PR#43.

I see that you are doing plenty of work to move this project toward python3, and this is excellent news. I don't know how close you are to being done, and I understand that modifying the python2 code base while trying to migrate it may cause headaches, so I would be happy to know what your plans are.

If pull requests for python2 are planned to be accepted it would really help if this PR and PR#43 could be merged so that all the fixes could be in one place. If python2 is essentially fixed until the python3 version is finished I can do pull requests on a fork and avoid the trouble of maintaining multiple pull requests with the same fixes on different versions.

I believe the fixes to the ADODB.Stream and other fixes in PR#43 would need to be applied to your python3/pyuno_elimination branches as well. Would having a PR into one of those branch make it easier to merge these PRs into the base master branch? I could also make changes in this PR if there is something keeping it from being merged. If the python2 version is fixed, would you be interested into having PR#43 merged into a python3 branch?

cccs-kevin commented 11 months ago

@kirk-sayre-work thoughts on this?