-
Notifications
You must be signed in to change notification settings - Fork 156
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
Add new PE CV_CFL_LANG language code for ALIASOBJ and Rust #530
Changes from 23 commits
cffed44
e497d5f
484bf18
84728fa
1e03879
21329eb
ba2136f
914b14d
9b9d3a6
a8c7f72
4593f04
3fabb3c
258fb73
fd58c56
cd21338
03fc7fb
50cfd14
43bcf65
9a60f7f
268eae2
d2d41f0
af8906a
719fbc1
4c816b9
a8b922d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Build Scripts | ||
|
||
This file records scripts used to compile the test files, in alphabetical order. | ||
Base scenario is a simple hello world program built with different parameters for testing purpose. | ||
Test files are located in [BaselineTestsData](https://github.com/microsoft/binskim/tree/main/src/Test.FunctionalTests.BinSkim.Driver/BaselineTestsData) and [FunctionalTestsData](https://github.com/microsoft/binskim/tree/main/src/Test.FunctionalTests.BinSkim.Rules/FunctionalTestsData). | ||
|
||
## clangcl.pe.c.codeview.exe | ||
|
||
A simple hello world program, compiled with `clang 13.0.0` that generates a .exe and associated .pdb file. Script to reproduce: | ||
`clang-cl -o clangcl.pe.c.codeview.exe -fuse-ld=lld-link hello.c -m32 -Z7 -MTd` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "A simple hello world program, compiled with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks great, will follow this style. |
||
|
||
## Native_x64_RustC_Rust_debuginfo2_v1.58.1.exe | ||
|
||
A simple hello world program, compiled with `rustc 1.58.1` that generates a .exe and associated .pdb file. Script to reproduce: | ||
`rustc -g -Clink-arg=/DEBUG:FULL src\main.rs -o Native_x64_RustC_Rust_debuginfo2_v1.58.1.exe` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -224,6 +224,11 @@ public string GetDialect(out string versionNumber) | |
} | ||
} | ||
|
||
/// <summary> | ||
/// The CV_CFL_LANG enumeration, | ||
/// which specifies the code language of the application or linked module in the debug interface access SDK. | ||
/// https://docs.microsoft.com/en-us/visualstudio/debugger/debug-interface-access/cv-cfl-lang | ||
/// </summary> | ||
public enum Language : uint | ||
{ | ||
C = 0x00, | ||
|
@@ -242,11 +247,13 @@ public enum Language : uint | |
Java = 0x0D, | ||
JScript = 0x0E, | ||
MSIL = 0x0F, | ||
HLSL = 0x10, // High Level Shader Language | ||
HLSL = 0x10, | ||
ObjectiveC = 0x11, | ||
ObjectiveCxx = 0x12, | ||
Swift = 0x13, | ||
NASM = 0x4E, // The Netwide Assembler | ||
ALIASOBJ = 0x14, | ||
Rust = 0x15, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does adding these accomplish? Does it prevent an error if we come across one of these files while trying to analyze a repo? Does it unblock future work? What does the customer get out of this addition? #Resolved There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the only thing it is for is when the compilers Clang/GCC starts to emit the 0x15 value when the program is Rust program, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, so I think what you've done is to partly port the documentation for enum values over. My feedback to you is: don't do that in an inconsistent way. You have two choices:
i.e., stay out of the middle, which is to inconsistently apply exact language in some cases, partial documentation in others, and to ignore others entirely. V_CFL_C Application language is C. CV_CFL_CXX Application language is C++. CV_CFL_FORTRAN Application language is FORTRAN. CV_CFL_MASM Application language is Microsoft Macro Assembler. CV_CFL_PASCAL Application language is Pascal. CV_CFL_BASIC Application language is BASIC. CV_CFL_COBOL Application language is COBOL. CV_CFL_LINK Application is a linker-generated module. CV_CFL_CVTRES Application is a resource module converted with CVTRES tool. CV_CFL_CVTPGD Application is a POGO optimized module generated with CVTPGD tool. CV_CFL_CSHARP Application language is C#. CV_CFL_VB Application language is Visual Basic. CV_CFL_ILASM Application language is intermediate language assembly (that is, Common Language Runtime (CLR) assembly). CV_CFL_JAVA Application language is Java. CV_CFL_JSCRIPT Application language is Jscript. CV_CFL_MSIL Application language is an unknown Microsoft Intermediate Language (MSIL), possibly a result of using the /LTCG (Link-time Code Generation) switch. CV_CFL_HLSL Application language is High Level Shader Language. CV_CFL_OBJC Application language is Objective-C. CV_CFL_OBJCXX Application language is Objective-C++. CV_CFL_SWIFT Application language is Swift. CV_CFL_ALIASOBJ Application is a module generated by the aliasobj tool. CV_CFL_RUST Application language is Rust. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. stay out of the middle --- agree and also agree some of the comments does not add value at all, so removed all to be consistent. |
||
NASM = 0x4E, | ||
Unknown | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
# BinSkim Release History | ||
|
||
## Unreleased | ||
|
||
* BUGFIX: Add new PE `CV_CFL_LANG` language code for `ALIASOBJ` and `Rust`. [530](https://github.com/microsoft/binskim/pull/530) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. originally I set as FEATURE, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @michaelcfanning and @VCOLAWTON is there a better label we can use for this type of code change for documentation purposes? FEATURE and BUGFIX both don't fit this scenario. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
## **v1.9.3** [NuGet Package](https://www.nuget.org/packages/Microsoft.CodeAnalysis.BinSkim/1.9.3) | ||
|
||
* BUGFIX: Fix `KeyNotFoundException` exception raised by `BA2006.BuildWithSecureTools` when individual `MinimumToolVersions` properties are removed from XML configuration. [#565](https://github.com/microsoft/binskim/pull/565) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@VCOLAWTON, if you have a chance to take a quick look to see if there is anything that should be considered form a documentation standard perspective that'd be awesome. #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Mary, looks good! I looked at other GH content and think that adding a sentence or two would make the section look more like information and less like loose leaf data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This document is definitely going to need some expansion, but I don't believe all of that is necessary at the moment. What we want to immediately focus on is, usability. Can someone come in, take a look at this document, and walk away knowing how to recreate your files? No. What will it take to get someone up and running?
Are these both pretty much basic hello world binaries? In which case, expand the paragraph beginning at line 3, to explain that the base scenario is going to be a simple hello world program.
As for where I see this document going, I think this would be a good location to begin describing our functional and baseline testing approach for binskim. But, again, that's going to be a longer process/discussion and should be a collaborative effort. I wouldn't include all of that as part of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expand the paragraph beginning at line 3, to explain that the base scenario is going to be a simple hello world program. ---- done, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This document is definitely going to need expansion, and it is absolutely necessary for usability. Not sure, what you mean by "all of that" but anything we add to this document will be tremendously helpful. I know people in your positions do not typically like to do this type of work and would rather be as simple as possible, so just let me know how you want me to help. Probably a good idea to loop Michael in, too!