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

DnSpy adds changes I did not make when I Save Module #401

Open
PeteJobi opened this issue Jan 19, 2025 · 2 comments
Open

DnSpy adds changes I did not make when I Save Module #401

PeteJobi opened this issue Jan 19, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@PeteJobi
Copy link

dnSpyEx version

6.5.1

Describe the Bug

I made some small changes via IL edit to a program and saved it via "File > Save Module". It crashed. I tried investigating the crash but couldn't find it: happened too deep in .NET code. After some fruitless troubleshooting, I started again by importing the original program into DnSpy, and going straight to "Save Module" without making any changes. This new program crashed as well (when I get past a step by changing values during debugging). I checked the diff in a hex editor and to my surprise, there's tons of changes.

Why is DnSpy adding changes I didn't make? Is this normal? Is there a way to exclude changes I did not make when I patch?

How To Reproduce

I can upload the program in question if anyone asks for it.

  • Drag and drop the program into DnSpy
  • Go to File > Save Module

Expected Behavior

There should be no changes when I save module without any edits.

Actual Behavior

There are changes when I save module without any edits.

Additional Context

No response

@PeteJobi PeteJobi added the bug Something isn't working label Jan 19, 2025
@GazziFX
Copy link

GazziFX commented Jan 19, 2025

This is absolutely normal, even without changes it will rebuild PE file and will remove all unknown sections and metadata streams, if you enable all toggles does it still crashes?

@PeteJobi
Copy link
Author

What toggles? The ones in the Save Module window? Only "Shared Method Bodies" is checked. I tried unchecking that but it crashes too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants