Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is "verifiable managed assembly"

While checking the possibility of developing for Windows Phone 7 using C++, I came across this thread, which states:

"...any language that can compile to a verifiable managed assembly (the verifiability requirement applies to all dependencies, too!) is good" (for WP7 development)

What is "verifiable managed assembly" and where can I learn more about this?

like image 890
Android Eve Avatar asked Dec 29 '22 03:12

Android Eve


1 Answers

Verifiable code is code that gets compiled to IL and can be proven to not produce any IL that can execute unsafe code, bypass code access security checks or in any way corrupt the state of the CLR. The exact rules are complex however. The ten-thousand feet view is code written in managed languages like VB.NET or C# without the unsafe keyword. Nevertheless, you can write unverifiable code in C# without using the unsafe keyword. Check this answer for example.

There's a dedicated tool to check an assembly, PEVerify.exe. It executes the same checks the JIT compiler and the CLR perform. The bottom of the linked page has links to MSDN articles about verification.

like image 63
Hans Passant Avatar answered Jan 12 '23 00:01

Hans Passant