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

The MVID is not added to the sections #934

Open
mattleibow opened this issue Mar 6, 2024 · 1 comment
Open

The MVID is not added to the sections #934

mattleibow opened this issue Mar 6, 2024 · 1 comment

Comments

@mattleibow
Copy link

Looking at the code use a C# build: https://github.com/dotnet/roslyn/blob/main/src/Compilers/Core/MSBuildTask/MvidReader.cs

I see it scans the sections for a .mvid to locate the MVID. If I open, edit, and then write the module, I lose the .mvid section.

When debugging, I see that before saving, there are 4 sections, after there are 3.

@mattleibow
Copy link
Author

mattleibow commented Mar 6, 2024

Looking at the sections builder in the writer, I do only see 3 being written:

void BuildSections ()
{
var has_win32_resources = win32_resources != null;
if (has_win32_resources)
sections++;
text = CreateSection (".text", text_map.GetLength (), null);
var previous = text;
if (has_win32_resources) {
rsrc = CreateSection (".rsrc", (uint) win32_resources.length, previous);
PatchWin32Resources (win32_resources);
previous = rsrc;
}
if (has_reloc)
reloc = CreateSection (".reloc", 12u, previous);
}

I see the .mvid section being loaded in the module image before

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

No branches or pull requests

1 participant