Skip to content

Enhance binary lookup and Azure DevOps authentication for source downloads#47

Merged
ivberg merged 5 commits intomainfrom
user/ivberg/fix-binary-finding-disassembly
Apr 16, 2026
Merged

Enhance binary lookup and Azure DevOps authentication for source downloads#47
ivberg merged 5 commits intomainfrom
user/ivberg/fix-binary-finding-disassembly

Conversation

@ivberg
Copy link
Copy Markdown
Collaborator

@ivberg ivberg commented Apr 15, 2026

This pull request improves binary file matching and symbol server authentication in the Profile Explorer. Especially for Windows ETW traces where kernel-reported image sizes may differ from the PE header (random) and would cause dissassembly to not load. Implements Azure DevOps authentication for source server access. It also brings alterate source link support. Last it introduces fallback logic to use binaries with matching timestamps but different sizes, adds user-configurable options for approximate matches.

ETW event processing improvements:

  • Modified ETW event processing to prefer the image size from the ImageID event (which matches the PE header) over the kernel's mapped view size, ensuring more accurate symbol server lookups and reducing mismatches. This fixes some sources of assembly/dissassembly not loading due to missing binary load [1] [2] [3] [4]

Symbol server authentication enhancements:

  • Implemented a new AzureDevOpsSourceHandler for Azure AD authentication, enabling access to source server URLs hosted on Azure DevOps that require Bearer tokens. Integrated this handler into the authentication pipeline for symbol file retrieval. [1] [2] [3] [4]

Dependency updates:

  • Updated the Microsoft.Diagnostics.Tracing.TraceEvent NuGet package from version 3.1.28 to 3.1.30 across all relevant projects which has sourceLink support found in some pdbs necessary to fetch source code. [1] [2] [3]

Binary file matching improvements:

  • Enhanced the binary search logic to allow approximate matches when a binary with a matching timestamp but different image size is found, addressing common issues where the kernel-reported image size differs from the PE header. This includes correcting the image size for symbol server lookups and providing detailed logging and warnings when approximate matches are used. [1] [2] [3] [4] [5] [6] [7]

  • Added a new setting AllowApproximateBinaryMatch to the SymbolFileSourceSettings class, exposed in the UI, allowing users to enable or disable the use of approximate binary matches. [1] [2]

ivberg added 3 commits April 15, 2026 15:16
  Prefer ImageSize from ImageID events (PE SizeOfImage from trace merge)
  over kernel ImageGroup events (mapped view size with slack pages). The
  kernel can report a larger size than the PE header, causing exact-match
  failures for local binaries and wrong symbol server lookup keys (404s).

  Also add an approximate match fallback that accepts binaries with
  matching timestamp but different size when all exact matches fail, and
  correct the ImageSize before symbol server lookups when a local file
  with matching timestamp provides the real PE SizeOfImage.
upgrade TraceEvent from 3.1.28 to 3.1.30

  Gets SourceLink wildcard/exact path mapping fix and SHA-384/SHA-512
  PDB checksum support for newer .NET tooling.
  Source server for Windows OS PDBs uses Azure DevOps, which requires
  Azure AD authentication. Previously only symweb URLs were authenticated,
  causing source downloads to receive an HTML sign-in page instead of
  source code. Reuse the existing Azure AD credential chain to provide
  Bearer tokens for *.visualstudio.com and dev.azure.com URLs.
Copilot AI review requested due to automatic review settings April 15, 2026 22:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves Profile Explorer’s ability to locate the correct binaries/symbols for ETW traces (especially when ETW-reported image sizes don’t match PE headers) and adds Azure DevOps (Azure AD) authentication support for source server downloads.

Changes:

  • Prefer PE-header-derived ImageSize from ETW ImageID events and add fallback binary matching when timestamps match but sizes differ.
  • Add a user setting + UI toggle (AllowApproximateBinaryMatch) to enable/disable approximate binary matches.
  • Add an Azure DevOps auth handler to supply Bearer tokens for Azure DevOps source server URLs; bump TraceEvent to 3.1.30.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/ProfileExplorerUI/ProfileExplorerUI.csproj Bumps TraceEvent dependency to 3.1.30.
src/ProfileExplorerUI/OptionsPanels/SymbolOptionsPanel.xaml Exposes “Allow approximate binary match” as a UI setting.
src/ProfileExplorerCore/Settings/SymbolFileSourceSettings.cs Adds persisted setting AllowApproximateBinaryMatch.
src/ProfileExplorerCore/Providers/ICompilerInfoProvider.cs Extends BinaryFileSearchResult to mark approximate matches.
src/ProfileExplorerCore/ProfileExplorerCore.csproj Bumps TraceEvent dependency to 3.1.30.
src/ProfileExplorerCore/Profile/ETW/ETWEventProcessor.cs Uses ImageID’s ImageSize when available to improve symbol lookup keys.
src/ProfileExplorerCore/Binary/PEBinaryInfoProvider.cs Adds size-correction + approximate matching logic when locating binaries.
src/ProfileExplorerCore/Binary/PDBDebugInfoProvider.cs Adds Azure DevOps source authentication handler into the auth pipeline.
src/PDBViewer/PDBViewer.csproj Bumps TraceEvent dependency to 3.1.30.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/ProfileExplorerCore/Binary/PEBinaryInfoProvider.cs
ivberg added 2 commits April 15, 2026 16:10
…nt length

  Guard against ArgumentOutOfRangeException when an IRElement's text
  offset is beyond the current document length, which can happen when
  a preview popup references elements from a different document context.
  The details string was reporting the on-disk ImageSize instead of the
  trace-requested ImageSize after overwriting binaryFile. Also cache the
  result under the original trace descriptor so lookups for the same
  trace module hit the cache instead of repeating the search.
@ivberg ivberg merged commit c5d9fd9 into main Apr 16, 2026
6 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.

5 participants