I hope someone has an idea on what's happening.
Let's say I have a .NET application (with any other application, apparently, there is no such problem). I open the app in a hex editor, search for the code section header and change the Characteristics value (the last one in a section header) by adding an IMAGE_SCN_MEM_WRITE value to it (and by adding I mean the OR operation).
For example, it was 0x60 0x00 0x00 0x02, i change it to 0xE0 0x00 0x00 0x02. (IMAGE_SCN_MEM_WRITE = 0x80 0x00 0x00 0x00)
Then I try to start the application that worked fine before me changing anything and I get this error message error "This application could not be started"
That's where it redirects me when i press OK https://support.microsoft.com/en-us/help/2715633/shim-errors-for-the--net-framework-version-and-platform-support
That's what it says there:
The app is not configured in a way that makes it possible to determine the appropriate version of the .NET Framework runtime. The corresponding shim code is SHIM_NOVERSION_FOUND. You can't fix the configuration problem yourself. Contact the app vendor to resolve the issue.
So what could possibly be the problem here? Oh, by the way, no other bytes in the file were changed and when I change the Characteristics value back everything works fine.