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

AddressFixups does not support AsmResolver.Symbol #444

Closed
BadRyuner opened this issue Jun 7, 2023 · 2 comments · Fixed by #449
Closed

AddressFixups does not support AsmResolver.Symbol #444

BadRyuner opened this issue Jun 7, 2023 · 2 comments · Fixed by #449
Labels
bug dotnet Issues related to AsmResolver.DotNet pe Issues related to AsmResolver.PE
Milestone

Comments

@BadRyuner
Copy link

BadRyuner commented Jun 7, 2023

AsmResolver Version

5.3.0

.NET Version

Any

Operating System

Windows

Describe the Bug

AddressFixups does not support AsmResolver.Symbol

How To Reproduce

ModuleDefinition module = ...;
NativeMethodBody native = ...;
DataSegment segment = new DataSegment(bytes);
native.AddressFixups.Add(new AddressFixup(somepos), AddressFixupType.Absolute64BitAddress, new Symbol(segment.ToReference())));

var image = module.ToPEImage(); // exception!

Expected Behavior

Ability to use DataSegment as a symbol in NativeMethodBody

Actual Behavior

Exception:
System.AggregateException: "Construction of the PE image failed with one or more errors. (Symbols of type AsmResolver.Symbol are not supported.)"

Additional Context

https://github.com/Washi1337/AsmResolver/blob/master/src/AsmResolver.DotNet/Code/Native/NativeSymbolsProvider.cs#L26-L32

No response

@BadRyuner BadRyuner added the bug label Jun 7, 2023
@Washi1337 Washi1337 added this to the 5.4.0 milestone Jun 7, 2023
@Washi1337 Washi1337 added pe Issues related to AsmResolver.PE dotnet Issues related to AsmResolver.DotNet labels Jun 7, 2023
@Washi1337
Copy link
Owner

Washi1337 commented Jun 13, 2023

A potential fix for this is in #449 . Could I ask you once again to verify this works for your use-case?

Your bug reports are highly appreciated btw!

@BadRyuner
Copy link
Author

I had already moved far away from this idea, so for the test I used this project with a slight modification. There are no errors, everything works perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug dotnet Issues related to AsmResolver.DotNet pe Issues related to AsmResolver.PE
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants