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

Support EOF data in debug data entries. #583

Merged
merged 32 commits into from
Nov 9, 2024

Conversation

DaZombieKiller
Copy link
Contributor

This pull request adds support for debug data entries located in EOF data, which are valid according to the PE spec:

Each debug directory entry identifies the location and size of a block of debug information. The specified RVA can be zero if the debug information is not covered by a section header (that is, it resides in the image file and is not mapped into the run-time address space). If it is mapped, the RVA is its address.

The file offset is also now preferred over the RVA when the file is not mapped.

Aragas and others added 18 commits September 22, 2024 12:45
* Removed OS injection in favor of runner.os
* Added a separate test publish step

* Removed old job

* Fix just in case

* Fix

* Fix

* Added missing run-id

* Another fix

* Using retention period instead of manual cleanup

Potential commit fix

* The lock emoji will put reusable workflows at the bottom

* Skip experimental executions on PR to avoid failed steps

* Fixed experimental check

* Fixed PR skip

* Fix

* Test

* Test

* Improvements

* Test

* Better namings

* Added emojis
Removed find-pr code
Added VersionSuffix calculation on non master branches
@DaZombieKiller DaZombieKiller changed the base branch from master to development September 22, 2024 13:49
@Washi1337 Washi1337 added this to the 6.0.0 milestone Sep 23, 2024
@Washi1337 Washi1337 added bug pe Issues related to AsmResolver.PE labels Sep 23, 2024
Washi1337 and others added 5 commits September 23, 2024 19:26
* Update action.yml

* Update reusable-build.yml

* Update action.yml

* Update action.yml
* Reusable Workflow Secrets Declaration

* Update test-and-publish.yml
@Washi1337
Copy link
Owner

Washi1337 commented Oct 7, 2024

Tests seem to fail because some debug data entries can have no contents (i.e., size == 0, and thus also pointer/address to raw data == 0, see HelloWorld.exe test binary).

We can't really return null for these entries or we lose the debug entry type. This is a downside of the current design on how debug data is modeled, as the entry type is currently only exposed by IDebugDataSegment to make it easier for end-users to add or swap out new debug data entries without having to specify the debug data type twice (i.e., the value of the DebugDataEntry::Contents implies the type of debug data).

Two options I see now:

  1. We reintroduce the Type property in DebugDataEntry, accepting that this is less ergonomic for end-users that want to add or modify debug data entries.
  2. We introduce an EmptyDebugDataSegment of sorts (or maybe reuse CustomDebugDataSegment), which is special cased for in the writer, allowing for empty debug entries to exist.

@Washi1337 Washi1337 merged commit 72eee24 into Washi1337:development Nov 9, 2024
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug pe Issues related to AsmResolver.PE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants