Error Has No Valid Clr Header
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up What is a CLR header in .net applications? up vote 1 down vote favorite While using the ildasm.exe tool for disassembling other .Net applications, I came across the following line. program.exe has not valid CLR Header and cannot be disassembled But when I tried to disassemble my code, it didn't show any error, and disassembled the code easily. As a result I am curious about what is a CLR Header and what can be the advantages/disadvantages of having a valid CLR Header for your assembly? Can anybody please answer the above questions? I checked the msdn, but couldn't find much information on the topic. c# .net decompiling disassembling share|improve this question asked Jan 21 '14 at 19:10 Pratik Singhal - ps06756 2,41322050 In what language did you write the application? –Pete Garafano Jan 21 '14 at 19:14 I wrote my application in C# –Pratik Singhal - ps06756 Jan 21 '14 at 19:26 The "other .Net applications" must not have been .NET applications. –Scott Chamberlain Jan 21 '14 at 19:30 add a comment| 1 Answer 1 active oldest votes up vote 5 down vote accepted ILDASM.exe is meant to disassemble CLR code. If there is not a valid CLR header, it usually means that the executable was written in another language and compiled natively. share|improve this answer answered Jan 21 '14 at 19:13 Justin Niessner 179k19300438 So, is there any way to protect my .Net app from being disassembled. –Pratik Singhal - ps06756 Jan 21 '14 at 19:15 2 There is no way to prevent any program from being disassembled. You can only make it harder to figure out what the disassembled code is doing by using Code Obfuscation (either through a automated tool or hiring a expert on it as a consultant for your project). See "How to protect .Net exe from Decompiling/Cracking" –Scott Chamberlain Jan 21 '14 at 19:21 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using
in MSIL In the Start menu's Run dialog box, type ildasm and click OK. You'll see a nondescript application with a few menu options. At this point, from the File menu, click Open. When the File Open dialog box appears, browse to the folder containing the HelloWorld.exe application you created earlier (on Chapter 3) and select it. As shown in Figure 3-4, things start to look a bit more promising. - Figure 3-4 ILDASM lets you spelunk in the caverns of the manifest and the IL opcodes that make up your .NET application.- http://stackoverflow.com/questions/21267011/what-is-a-clr-header-in-net-applications Notice the tree view that ILDASM uses to list the contents of a managed binary. Figure 3-5 shows the various icons used in the ILDASM tree view to describe the parts of a .NET application. As you can see by cross-referencing the icons shown in Figure 3-5 and the "Hello, World" program in ILDASM, HelloWorld.exe consists of a manifest, one class (HelloWorld), two methods (a class http://www.brainbell.com/tutors/C_Sharp/Hello_World_in_MSIL.htm constructor and the static method Main), and a bit of class information. - Figure 3-5 The different icons used to denote the parts of a .NET application in ILDASM.- The most interesting part of "Hello, World" is in the Main method. Double-click the Main method in the ILDASM tree view, and ILDASM will present a window displaying the MSIL for the Main method, as shown in Figure 3-6. - Figure 3-6 To look at the generated MSIL for a method, open the binary in ILDASM and double-click the method.- "Hello, World," even in MSIL, isn't too exciting, but you can learn a few facts about the generated MSIL to carry over to any .NET application. Let's look at this method line by line to see what I mean. .method public hidebysig static void Main() il managed { .entrypoint // Code size 11 (0xb) .maxstack 8 IL_0000: ldstr "Hello, World" IL_0005: call void [mscorlib]System.Console::WriteLine (class System.String) } // end of method HelloWorld::Main The first line defines the Main method by using the .method MSIL keyword. We can also see that the method is defined as being public and static, which are the default modifiers for the Main meth
Portability Issues C++ & MFC » General Array Handling Binary Trees Bits and Bytes Buffer & Memory Manipulation Callbacks Classes and Class Use Collections Compression Drag http://www.codeguru.com/csharp/.net/cpp_managed/article.php/c4871/Managed-Unmanaged-Native-What-Kind-of-Code-Is-This.htm and Drop Events Exceptions External Links File I/O Function Calling Linked Lists Memory Tracking Object Oriented Programming (OOP) Open FAQ Parsing Patterns Pointers Portability RTTI Serialization Singletons Standard Template https://github.com/gbarnett/shared-source-cli-2.0/blob/master/clr/src/ildasm/dasm.rc Library (STL) Templates Tutorials Date & Time » General Date Controls Time Routines C++/CLI » .NET Framework Classes General ASP/ASP.NET Boxing and UnBoxing Components Garbage Collection and Finalizers error has Interop Moving from Unmanaged Processes & Threads Templates Visual Studio .NET 2003 String Programming » General CString Alternatives CString Extensions CString Manipulation Open FAQ Regular Expressions String Arrays String Conversions .NET COM-based Technologies » ATL & WTL Programming » General ATL Active Scripting ActiveX Controls Database Debugging External links Graphics Support Misc. Performance Printing Tutorials Utilities Windows Template error has no Library (WTL) ActiveX Programming » General Active Scripting ActiveX Controls ActiveX Documents Apartments & Threading Error Handling External links General COM/DCOM Misc. Registry Security Structured Storage Tutorials Wrappers COM+ » General COM Interop Managed Code / .NET SOAP and Web Services Shell Programming » General Open FAQ Shortcuts Tray Icons Previous Section Manager Controls » Property Sheet » Open FAQ Property Sheet Buttons Sizing Wizards Button Control » Advanced Buttons Bitmap Buttons Flat Buttons Menus Non-Rectangular buttons Windows XP ComboBox » Colour Pickers DropDown Font selection combos Multicolumn combos Special Effects Tooltips Edit Control » Background & Color Editors Keyboard Masked Edit Controls Passwords and Security Spin Controls Transparent ImageList Control » Open FAQ ListBox Control » Checkboxes Color Listboxes Drag & Drop LEDs ListView Control » Advanced Background color and image Checkboxes Columns Custom Drawing Data Deleting Drag & Drop Editing items and subitem FilterBar Grid lines Header Control Introduction Miscellaneous Navigation New ListView control (IE 4.0) Printing Property Lists Reports Scrollbars Selection Sorting Tooltip & Titletip Using images
Sign in Pricing Blog Support Search GitHub This repository Watch 2 Star 9 Fork 7 gbarnett/shared-source-cli-2.0 Code Issues 0 Pull requests 0 Projects 0 Pulse Graphs Permalink Branch: master Switch branches/tags Branches Tags master Nothing to show Nothing to show Find file Copy path shared-source-cli-2.0/clr/src/ildasm/dasm.rc Fetching contributors… Cannot retrieve contributors at this time Raw Blame History 213 lines (193 sloc) 11.9 KB // ==++== // // // Copyright (c) 2006 Microsoft Corporation. All rights reserved. // // The use and distribution terms for this software are contained in the file // named license.txt, which can be found in the root of this distribution. // By using this software in any fashion, you are agreeing to be bound by the // terms of this license. // // You must not remove this notice, or any other, from this software. // // // ==--== //Microsoft Developer Studio generated resource script. // #include "resource.h" #define FX_VER_FILEDESCRIPTION_STR "Microsoft .NET Framework IL disassembler\0" #include