I'm trying to make some changes to .Net dll (note: dll is mixed mode module) used by an exe, ProtectionID detected nothing, so I happily jumped into dnSpy and made changes. I ran executable with dnSpy debugger and everything was working as expected. However when I saved module and tried to run executable, it worked as if no changes were made. I double checked, but module saved correctly, and x64dbg shows that it is loaded on runtime. So how is this possible?
Modified dll works as original without debugger attached
.net
Found the reason and I feel quite retarded now since it was so obvious. It was NativeImage being loaded and removing all generated images actually made my changes load. Thanks @Paweukasik for pointing me in right direction.