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

Improvements to VBA's Heuristic #7079

Merged
merged 5 commits into from
Nov 25, 2024
Merged

Conversation

DecimalTurn
Copy link
Contributor

Description

3 small improvements to VBA's heuristic:

  • Currently, there is a non-negligible share of VBA code that does not include the vb-module metadata. This PR relaxes the need for that metadata for a .bas code file to be considered VBA. (See sample named d_WordCmds.bas).

  • This PR reverts commit 94e7b20. It wrongly presumed that Option Compare (Text|Binary) is exclusive to VBA, but only Option Compare Database is 1. (See sample named modFrm.bas for a VB6 file using using Option Compare Binary).

  • This PR adds Microsoft Word related objects to VBA's heuristic. (See sample named QuickCards.bas for a Word related sample).

Checklist:

Footnotes

  1. Option Compare Database can only be used within Microsoft Access (source)

@DecimalTurn DecimalTurn requested a review from a team as a code owner October 5, 2024 23:48
Copy link
Member

@lildude lildude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you removing the samples/VBA/AccUnitLoaderConfigProcedures.bas? We generally don't remove samples and when we do it's normally because they're complete rubbish or useless. This appears to be a legit sample.

@DecimalTurn
Copy link
Contributor Author

DecimalTurn commented Oct 6, 2024

This has to be done because I'm reverting the changes made to the heuristics in 94e7b20. If we leave AccUnitLoaderConfigProcedures.bas as a VBA sample, the test that checks if samples are identified correctly based on the heuristics will fail. That's because it doesn't contain anything specific to VBA, so it will be classified as Visual Basic 6.0. The only hint that it's part of a VBA project would be the use of the Access-related prefix Acc for certain variables, but that criteria is not good enough to be included in the heuristics, since this is pretty much unique to the repo where the sample is from.

For those reasons, I would say the sample is bad, because it fits the type of files that you'd expect to have to use an override for. It's simply VB6 code that is part of a VBA project.

@lildude lildude added this pull request to the merge queue Nov 25, 2024
Merged via the queue into github-linguist:main with commit c637573 Nov 25, 2024
5 checks passed
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

Successfully merging this pull request may close these issues.

2 participants