Skip to main content
Post Reopened by Dominik Antal, Igor Skochinsky
improved question
Source Link
user1365830
  • 563
  • 1
  • 5
  • 7

I disassembled a C# program with ildasm and modified the il code to my needs but now when i try to assemble it back into an exe i get these errors:

Cannot compile native/unmanaged method
Local (embedded native) PInvoke method, the resulting PE file is unusable

I have generated a snk file and tried to use that with ilasm but i still get the same errors.

EDIT: These errors were given by ilasm when i try to reassemble the .il file. I also tried to edit the code in Reflector but after editing and trying to save it says that it cannot save mixed mode assemblies. Maybe i would be able to edit the binary in HEX editor?

I disassembled a C# program with ildasm and modified the il code to my needs but now when i try to assemble it back into an exe i get these errors:

Cannot compile native/unmanaged method
Local (embedded native) PInvoke method, the resulting PE file is unusable

I have generated a snk file and tried to use that with ilasm but i still get the same errors.

I disassembled a C# program with ildasm and modified the il code to my needs but now when i try to assemble it back into an exe i get these errors:

Cannot compile native/unmanaged method
Local (embedded native) PInvoke method, the resulting PE file is unusable

I have generated a snk file and tried to use that with ilasm but i still get the same errors.

EDIT: These errors were given by ilasm when i try to reassemble the .il file. I also tried to edit the code in Reflector but after editing and trying to save it says that it cannot save mixed mode assemblies. Maybe i would be able to edit the binary in HEX editor?

Post Closed as "Needs details or clarity" by Guntram Blohm, Jason Geffner, perror, 0xec, Dominik Antal
Source Link
user1365830
  • 563
  • 1
  • 5
  • 7

Cannot compile native/unmanaged method

I disassembled a C# program with ildasm and modified the il code to my needs but now when i try to assemble it back into an exe i get these errors:

Cannot compile native/unmanaged method
Local (embedded native) PInvoke method, the resulting PE file is unusable

I have generated a snk file and tried to use that with ilasm but i still get the same errors.