Add ELF file hash to PE image #4759
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Moving this PR to draft until the corresponding issue is in the current milestone
Resolves: #4758
Description
This pull request introduces a new API for extracting data from named sections in PE and ELF files, and adds a corresponding NetSh command to display hash information from eBPF binaries. It also includes related project file updates, utility improvements, and comprehensive tests for the new functionality.
New API and Feature Implementation
ebpf_api_get_data_sectionAPI to extract data from a named section in PE or ELF files, supporting buffer size queries and error handling for missing files or sections. (include/ebpf_api.h,libs/api/ebpf_api.cpp,ebpfapi/Source.def) [1] [2] [3]handle_ebpf_show_hashto display hash information from eBPF binaries, supporting both detailed and PowerShell-style output. (libs/ebpfnetsh/netsh_hash.cpp,libs/ebpfnetsh/netsh_hash.h,libs/ebpfnetsh/tokens.h) [1] [2] [3]Project and Build System Updates
libs/ebpfnetsh/ebpfnetsh.vcxproj,libs/ebpfnetsh/ebpfnetsh.vcxproj.filters) [1] [2] [3] [4]Utility Improvements
min/maxwithstd::min/std::maxfor improved portability and to avoid macro conflicts. (libs/api/ebpf_api.cpp) [1] [2] [3] [4]Testing
tests/end_to_end/end_to_end.cpp)tests/end_to_end/netsh_test.cpp,tests/end_to_end/netsh_test_helper.h) [1] [2]Testing
New tests added.
Documentation
Netsh help updated.
Installation
No.