asp tutorials, asp.net tutorials, sample code, and Microsoft news from 15Seconds
Data Access  |   Troubleshooting  |   Security  |   Performance  |   ADSI  |   Upload  |   Email  |   Control Building  |   Component Building  |   Forms  |   XML  |   Web Services  |   ASP.NET  |   .NET Features  |   .NET 2.0  |   App Development  |   App Architecture  |   IIS  |   Wireless
 
Pioneering Active Server
 Power Search





Active News
15 Seconds Weekly Newsletter
• Complete Coverage
• Site Updates
• Upcoming Features

More Free Newsletters
Reference
News
Articles
Archive
Writers
Code Samples
Components
Tools
FAQ
Feedback
Books
Links
DL Archives
Community
Messageboard
List Servers
Mailing List
WebHosts
Consultants
Tech Jobs
15 Seconds
Home
Site Map
Press
Legal
Privacy Policy
internet.commerce














internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

HardwareCentral
Compare products, prices, and stores at Hardware Central!

Intellectual Property Protection and Code Obfuscation -- Cont'd
By Adnan Masood


  • email this article to a colleague
  • suggest an article

    PEManifest

    This is a simple C# program that uses the Reflection API to read metadata information from an assembly. As shown in the figures below, an executable or DLL is loaded into the program and upon clicking the disassamble button, PEManifest reads the metadata and displays it in the text box.

    Figure: PEManifest Loading DLL file

    PEManifest uses System.Reflection and System.Reflection.Emit to provide the metadata-reading facilities. I won't get into all the code, just the important parts. Upon clicking the Disassemble button, we initialize an ArrayList to hold the manifest details

                ArrayList manifestdata = new ArrayList();

    Then an Assembly class loads assemblyName as the parameter.

                manifestdata.Add("Reading " + assemblyName + " Metadata...");

     

                Assembly a = Assembly.LoadFrom(assemblyName);

    assemblyName holds the filename, which could be an exe or DLL waiting to be explored.

    Figure: PEManifest Exploring PEManifest.exe

    PEManifest is developed using SharpDevelop IDE. It's an open source (GPL) free integrated development environment for C# and VB.NET Projects on the Microsoft.NET platform.

    Later we created an array of modules

                Module[] modules = a.GetModules();

    Iterated them and read their corresponding information then added it into a text area

                foreach(Module m in modules)

                {          

                      manifestdata.Add ("Module: " + m.Name);

                }

    After modules, it hits the types

                Type[] types = a.GetTypes();

    And then iterates types for further data

      foreach(Type type in types)

         {

    manifestdata.Add (": :"+ type);

    It iterates each type for the member's information.

            foreach(MemberInfo member in type.GetMembers(BindingFlags.Public|BindingFlags.Instance))

            {

              manifestdata.Add(": "+ member);

            }

          }

    To display it in the text area, it copies the array to the text area

          for (int cnt=0; cnt<manifestdata.Count; cnt++)

                ManifestConsole.Text += (cnt+1) +": " + manifestdata[cnt].ToString()+ "";

          }

    This iteration provides the complete details of an assembly in the text area. If you'll look at the figure above where PEManifest is self-decompiled by itself, you'll see a list of operations that were in the original source but can be back tracked using portable executables.

    Figure: PEManifest Loading InterOp assemblyDLL file

    The full source of this application can be downloaded with this article. MainForm.cs contains all of the listing of the PEManifest Project

    << Introduction •       • Code Obfuscation >>

  • Supporting Products/Tools
    AspEncrypt
    Built around the Microsoft CryptoAPI, AspEncrypt helps you harness all major encryption and hashing algorithms such as DES, Triple-DES, RC2, RC4, RSA, MD5 and SHA1 in just a few lines of code. The component can be used in tandem with AspEmail to send encrypted and signed mail in the industry-standard S/MIME format, or with AspUpload to encrypt files as they are being uploaded. AspEncrypt can also be used to issue and manage X.509 digital certificates.
    [Top]
    AspPDF
    AspPDF is an ASP/ASP.NET component which enables generation and management of documents in PDF format. Features include advanced text formatting, font embedding, form fill-in, images, tables, content and page extraction, document stitching, encryption, digital signatures, and more.
    [Top]
    Other Articles
    Feb 3, 2005 - ASP.NET Mixed Mode Authentication
    In many web applications it is desirable for both intranet users and external parties to be able to seamlessly log onto the system. The problem this raises is that it is not easy to allow intranet users to log in via Windows integrated authentication while also allowing external parties to log in to the same application using standard forms authentication. This article will show you one way to achieve the best of both worlds when it comes to authentication.
    [Read This Article]  [Top]
    Dec 8, 2004 - Designing Role-Based Security Models for .NET
    In this article, Michele Leroux Bustamante discusses authentication, authorization and role-based security in .NET. Along the way, he provides some best practices for implementing role-based security in some typical .NET application scenarios including rich clients, Web applications, and Web services.
    [Read This Article]  [Top]
    May 11, 2004 - SharePoint Security and .NET Impersonation
    When implementing custom components that require access to restricted resources, implicit impersonation must be used. Jay Nathan shows how to create a class that makes using .NET Impersonation a snap.
    [Read This Article]  [Top]
    Mar 10, 2004 - Intellectual Property Protection and Code Obfuscation
    Learn about the execution process of CLR-based programs and how to protect your applications from being easily disassembled back into source code.
    [Read This Article]  [Top]
    Feb 24, 2004 - How to Send Secure Mail in ASP-Based E-Commerce Applications - Part II
    Businesses that utilize encrypted e-mail may find Secure Multipurpose Internet Mail Extensions (S/MIME) to be somewhat restrictive. This article shows how to use security features in PDF as an alternative to S/MIME.
    [Read This Article]  [Top]
    Feb 2, 2004 - Fighting Spambots with .NET and AI
    Bill Gates, in a recent interview, predicted the end of spam by 2006. One of the methods he mentioned involved a challenge only a real live person could handle. Adnan Masood shows how to use AI and .NET to create a user verification scheme that incorporates similar concepts Gates alluded to.
    [Read This Article]  [Top]
    Jan 21, 2004 - Configuring .NET Code Access Security
    Code Access Security (CAS) is the .NET Framework security model that grants code permission to resources based on "evidence" pertaining to the encapsulating assembly. In this article, David Myers examines CAS and explains different configuration methods.
    [Read This Article]  [Top]
    Mar 10, 2003 - Platform Neutral and Transparent Encryption of Sensitive Customer Information
    Zhenlei Cai combines an open source C++ encryption library with SQL Server extended stored procedures to create a platform neutral, transparent encryption solution that resides at the database layer.
    [Read This Article]  [Top]
    Jan 15, 2003 - Exploring Machine.Config - User Security and More
    Christopher Spann offers a .NET configuration tip that should help ease system administrators' fears of security compromise and thus assuage growing developer demand for a .NET environment.
    [Read This Article]  [Top]
    Dec 10, 2002 - Encrypting Cookie Data with ASP.NET
    You don't have to be a cryptography expert or spend lots of money on third-party components to secure sensitive data in .NET. In this article, Wayne Plourde shows just how easy it is to encrypt cookie data using encryption classes in the .NET System.Security.Cryptography namespace.
    [Read This Article]  [Top]
    Mailing List
    Want to receive email when the next article is published? Just Click Here to sign up.

    Support the Active Server Industry

    internet.comearthweb.comDevx.commediabistro.comGraphics.com

    Search:

    Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

    Jupitermedia Corporate Info

    Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
    Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers