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

Updated BA2004 for HashType.None #381

Merged
merged 4 commits into from
May 29, 2021
Merged

Conversation

paddymcd-MSFT
Copy link
Contributor

  • work around certain files being listed as HashType.None by MSVC
    • pch files
    • the TU used to create a pch in objs using said pch
    • certain compiler inserted code
  • Check MASM files for Hash types as all MASM compilers support SHA_256 hash checksums
    • ml and ml64 /ZH:SHA_256
    • armasm and armasm64 /gh:SHA_256

Supporting changes:

  • Added CompilerCommandLine.GetOptionValue to get commandline parameter options as strings
  • Added support for the MASM assembler family for
    • CompilerNames
    • WellKnownCompilers

Incidental fixes:

  • Fixed issue in BA2007 where it skipped processing C++ warning levels.

- work around certain files being listed as HashType.None by MSVC
  - pch files
  - the TU used to create a pch in objs using said pch
  - certain compiler inserted code
- Check MASM files for Hash types as all MASM compilers support SHA_256 hash checksums
  - ml and ml64 /ZH:SHA_256
  - armasm and armasm64 /gh:SHA_256

Supporting changes:
- Added `CompilerCommandLine.GetOptionValue` to get commandline parameter options as strings
- Added support for the MASM assembler family for
  - CompilerNames
  - WellKnownCompilers

Incidental fixes:
- Fixed issue in BA2007 where it skipped processing C++ warning levels.
@@ -100,7 +100,8 @@ public override void AnalyzePortableExecutableAndPdb(BinaryAnalyzerContext conte
ObjectModuleDetails omDetails = om.GetObjectModuleDetails();

// Detection applies to C/C++ produced by MS compiler only
if (omDetails.WellKnownCompiler != WellKnownCompilers.MicrosoftC)
if (omDetails.WellKnownCompiler != WellKnownCompilers.MicrosoftC &&
omDetails.WellKnownCompiler != WellKnownCompilers.MicrosoftCxx)
Copy link
Member

Choose a reason for hiding this comment

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

nooooooooo.

thanks for this fix.

Copy link
Member

@michaelcfanning michaelcfanning left a comment

Choose a reason for hiding this comment

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

:shipit:

@eddynaka eddynaka enabled auto-merge (squash) May 29, 2021 23:14
@eddynaka eddynaka merged commit c79ba63 into main May 29, 2021
@eddynaka eddynaka deleted the dev/paddymcd-MSFT/AddressNoHash branch May 29, 2021 23:54
@eddynaka eddynaka linked an issue Jun 1, 2021 that may be closed by this pull request
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.

BA2004 Error despite /ZH:SHA_256 Flag in CL
3 participants