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

Optionally skip printing the function sections #60

Merged

Conversation

pombredanne
Copy link
Contributor

@pombredanne pombredanne commented Aug 1, 2024

Add a new -no-functions command line flag to skip printing the UserFunctions and StdFunctions detailed sections.
This is useful to get a quick summary of what is in a Go binary.
The default is to always print the function sections.

Reference: #49
Signed-off-by: Philippe Ombredanne [email protected]

Add a new -no-functions command line flag to skip printing the
UserFunctions and StdFunctions detailed sections.
This is useful to get a quick summary of what is in a Go binary.
The default is to always print the function sections.

Reference: mandiant#49
Signed-off-by: Philippe Ombredanne <[email protected]>
main.go Outdated
}

func main_impl(fileName string, printStdPkgs bool, printFilePaths bool, printTypes bool, manualTypeAddress int, versionOverride string) (metadata ExtractMetadata, err error) {
func main_impl(fileName string, printStdPkgs bool, printFilePaths bool, printTypes bool, manualTypeAddress int, versionOverride string, noPrintFunctions bool) (metadata ExtractMetadata, err error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Lets move noPrintFunctions arg to right after printTypes for consistency with the order of where the rest of the output related args are.

main.go Outdated
@@ -425,6 +427,7 @@ func main() {
typeAddress := flag.Int("m", 0, "Manually parse the RTYPE at the provided virtual address, disables automated enumeration of moduledata typelinks itablinks")
versionOverride := flag.String("v", "", "Override the automated version detection, ex: 1.17. If this is wrong, parsing may fail or produce nonsense")
humanView := flag.Bool("human", false, "Human view, print information flat rather than json, some information is omitted for clarity")
noPrintFunctions := flag.Bool("no-functions", false, "Do not print user and standard function sections")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't like the dash here in the arg name. Lets choose something that's a single word, nofuncs works nice and is short.

@stevemk14ebr
Copy link
Collaborator

Thanks for the PR, two small adjustments and I'll merge!

Use -nofuncs command line flag instead.
Reorder main_impl() function arguments.

Reference: mandiant#49
Signed-off-by: Philippe Ombredanne <[email protected]>
@stevemk14ebr stevemk14ebr merged commit e3bc188 into mandiant:master Aug 2, 2024
2 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