Dotfuscator User's Guide
Example PreEmptive Analytics Enabled Application

Here is a simple sample C# application scenario that uses custom attributes to drive instrumentation for application analytics.

Sample C# Scenario
Copy Code
[assembly: Business("66ce94c5-08c2-4b3b-99e4-0a92a5bb3c17", "PreEmptive Solutions")]
[assembly: Application("8F6A00E8-0C11-433e-A683-30EB828C4B3C")]
[assembly: Binary("444745EB-92CE-45e8-A749-33A0A92364FC")]

Entry point:

   static class Program
   {
      /// <summary>
      /// Demonstrating sample use of PreEmptive Analytics.
      /// </summary>
      [STAThread]
      static void Main() {
         SoSetup("357-1113-1719");
         Application.Run(new Form1());
      }

      [Setup(
          OptInSourceElement = SourceElements.None,
          InstanceIdSourceElement = SourceElements.MethodArgument,
          InstanceIdSourceName = "instanceId",
          UseSSL = false
       )]
      public static void SoSetup(string instanceId) {
      //empty method. Dotfuscator supplies the code (if the method is not
      // empty, Dotfuscator adds the code at the start of the method)
      }
   }

Exit point:

   public partial class Form1 : Form {
      [InsertTamperCheck()]
      public Form1() {
      // Dotfuscator will add application integrity checks here
      // along with code to send a message if the integrity check fails.
         InitializeComponent();
      }

      [Teardown]
      private void Form1_FormClosing(object s, FormClosingEventArgs e) {
      //empty method. Dotfuscator supplies the code (if the method is not
      // empty, Dotfuscator adds the code at the end of the method)
      }
   }

Application Startup message for SOSWinApp.exe, whose serial number is 357-1113-1719:

<MessageCache>
  <InstanceId>357-1113-1719</InstanceId>
  <ApplicationGroupId>1cb4c0ba-f9b1-4935-a633-7cdc2ff6d38b</ApplicationGroupId>
  <Business>
    <CompanyName>PreEmptive Solutions</CompanyName>
    <CompanyId>66ce94c5-08c2-4b3b-99e4-0a92a5bb3c17</CompanyId>
  </Business>
  <TimeSentUtc>2007-10-01T21:46:00.2250193Z</TimeSentUtc>
  <ApiLanguage>.NET CLR</ApiLanguage>
  <ApiVersion>2.0.2795.27414</ApiVersion>
  <Id>1a97253b-045b-486d-a097-c8ca5eea0efd</Id>
  <Messages>
    <Message xsi:type="ApplicationLifeCycle">
      <SessionId>1cb4c0ba-f9b1-4935-a633-7cdc2ff6d38b</SessionId>
      <Event>
        <PrivacySetting>SupportOptout</PrivacySetting>
        <Code>Application.Start</Code>
      </Event>
      <Binary>
        <ModifiedDate>2007-10-01T17:40:53.947891-04:00</ModifiedDate>
        <Id>444745eb-92ce-45e8-a749-33a0a92364fc</Id>
        <Name>SOSWinApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</Name>
        <Version>1.0.0.0</Version>
      </Binary>
      <TimeStampUtc>2007-10-01T21:45:50.2500433Z</TimeStampUtc>
      <Id>63d588c4-761a-4f6a-90fe-f3d89432a797</Id>
      <User>
        <IsAdministrator>false</IsAdministrator>
        <Name>724908d2f82cafe6b03e51438dcc5838</Name>
      </User>
      <Host>
        <RuntimeVersion>2.0.50727.42</RuntimeVersion>
        <IPAddress>172.16.7.42</IPAddress>
        <Name>04f07368bbabe92b7494f5fdd72c6476</Name>
        <OS>
          <OsInstallDate>2006-10-24T13:45:38</OsInstallDate>
          <OsName>Microsoft Windows XP Professional</OsName>
          <OsServicePackMajorVersion>2</OsServicePackMajorVersion>
          <OsServicePackMinorVersion>0</OsServicePackMinorVersion>
          <Locale>0409</Locale>
          <OSLanguage>1033</OSLanguage>
          <IsVirtualized>false</IsVirtualized>
        </OS>
      </Host>
    </Message>
    <Message xsi:type="SessionLifeCycle">
      <SessionId>1cb4c0ba-f9b1-4935-a633-7cdc2ff6d38b</SessionId>
      <Event>
        <PrivacySetting>SupportOptout</PrivacySetting>
        <Code>Session.Start</Code>
      </Event>
      <Binary>
        <ModifiedDate>2007-10-01T17:40:53.947891-04:00</ModifiedDate>
        <Id>444745eb-92ce-45e8-a749-33a0a92364fc</Id>
        <Name>SOSWinApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</Name>
        <Version>1.0.0.0</Version>
      </Binary>
      <TimeStampUtc>2007-10-01T21:45:50.4214882Z</TimeStampUtc>
      <Id>0e7c2426-dd62-44cd-ad66-4d9c05097af5</Id>
    </Message>
    <Message xsi:type="SessionLifeCycle">
      <SessionId>1cb4c0ba-f9b1-4935-a633-7cdc2ff6d38b</SessionId>
      <Event>
        <PrivacySetting>SupportOptout</PrivacySetting>
        <Code>Session.Start</Code>
      </Event>
      <Binary>
        <ModifiedDate>2007-10-01T17:40:53.947891-04:00</ModifiedDate>
        <Id>444745eb-92ce-45e8-a749-33a0a92364fc</Id>
        <Name>SOSWinApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</Name>
        <Version>1.0.0.0</Version>
      </Binary>
      <TimeStampUtc>2007-10-01T21:45:50.4214882Z</TimeStampUtc>
      <Id>a44c5dd3-6328-47aa-82a2-63a28bf8270d</Id>
    </Message>
  </Messages>
  <SchemaVersion>02.00.00</SchemaVersion>
  <Application>
    <ApplicationType>.exe</ApplicationType>
    <Id>8f6a00e8-0c11-433e-a683-30eb828c4b3c</Id>
    <Name>SOSWinApp</Name>
    <Version>1.0.0.0</Version>
  </Application>
</MessageCache>

Application Shutdown for SOSWinApp.exe, whose serial number is 357-1113-1719:

<MessageCache>
  <InstanceId>357-1113-1719</InstanceId>
  <ApplicationGroupId>1cb4c0ba-f9b1-4935-a633-7cdc2ff6d38b</ApplicationGroupId>
  <Business>
    <CompanyName>PreEmptive Solutions</CompanyName>
    <CompanyId>66ce94c5-08c2-4b3b-99e4-0a92a5bb3c17</CompanyId>
  </Business>
  <TimeSentUtc>2007-10-01T21:47:17.6401846Z</TimeSentUtc>
  <ApiLanguage>.NET CLR</ApiLanguage>
  <ApiVersion>2.0.2795.27414</ApiVersion>
  <Id>2ab3e80c-2a37-4cbb-ae0c-905ba7f20f4d</Id>
  <Messages>
    <Message xsi:type="SessionLifeCycle">
      <SessionId>1cb4c0ba-f9b1-4935-a633-7cdc2ff6d38b</SessionId>
      <Event>
        <PrivacySetting>SupportOptout</PrivacySetting>
        <Code>Session.Stop</Code>
      </Event>
      <Binary>
        <ModifiedDate>2007-10-01T17:40:53.947891-04:00</ModifiedDate>
        <Id>444745eb-92ce-45e8-a749-33a0a92364fc</Id>
        <Name>SOSWinApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</Name>
        <Version>1.0.0.0</Version>
      </Binary>
      <TimeStampUtc>2007-10-01T21:47:17.5934269Z</TimeStampUtc>
      <Id>ae2d572d-6d22-4176-aa98-4ea69ef649fb</Id>
    </Message>
    <Message xsi:type="ApplicationLifeCycle">
      <SessionId>1cb4c0ba-f9b1-4935-a633-7cdc2ff6d38b</SessionId>
      <Event>
        <PrivacySetting>SupportOptout</PrivacySetting>
        <Code>Application.Stop</Code>
      </Event>
      <Binary>
        <ModifiedDate>2007-10-01T17:40:53.947891-04:00</ModifiedDate>
        <Id>444745eb-92ce-45e8-a749-33a0a92364fc</Id>
        <Name>SOSWinApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</Name>
        <Version>1.0.0.0</Version>
      </Binary>
      <TimeStampUtc>2007-10-01T21:47:17.5934269Z</TimeStampUtc>
      <Id>086289bc-d8cb-453e-b5ea-b4ac238a4647</Id>
      <User>
        <IsAdministrator>false</IsAdministrator>
        <Name>724908d2f82cafe6b03e51438dcc5838</Name>
      </User>
      <Host>
        <RuntimeVersion>2.0.50727.42</RuntimeVersion>
        <IPAddress>172.16.7.42</IPAddress>
        <Name>04f07368bbabe92b7494f5fdd72c6476</Name>
        <OS>
          <OsInstallDate>2006-10-24T13:45:38</OsInstallDate>
          <OsName>Microsoft Windows XP Professional</OsName>
          <OsServicePackMajorVersion>2</OsServicePackMajorVersion>
          <OsServicePackMinorVersion>0</OsServicePackMinorVersion>
          <Locale>0409</Locale>
          <OSLanguage>1033</OSLanguage>
          <IsVirtualized>false</IsVirtualized>
        </OS>
      </Host>
    </Message>
  </Messages>
  <SchemaVersion>02.00.00</SchemaVersion>
  <Application>
    <ApplicationType>.exe</ApplicationType>
    <Id>8f6a00e8-0c11-433e-a683-30eb828c4b3c</Id>
    <Name>SOSWinApp</Name>
    <Version>1.0.0.0</Version>
  </Application>
</MessageCache>

Tamper detected message for SOSWinApp.exe, whose serial number is 357-1113-1719:

<MessageCache>
  <InstanceId>357-1113-1719</InstanceId>
  <ApplicationGroupId>b38041f6-f01c-4a2a-8ce5-b6caaa7d39e8</ApplicationGroupId>
  <Business>
    <CompanyName>PreEmptive Solutions</CompanyName>
    <CompanyId>66ce94c5-08c2-4b3b-99e4-0a92a5bb3c17</CompanyId>
  </Business>
  <TimeSentUtc>2007-10-01T21:51:12.5359398Z</TimeSentUtc>
  <ApiLanguage>.NET CLR</ApiLanguage>
  <ApiVersion>2.0.2795.27414</ApiVersion>
  <Id>47da5317-4df6-4f15-85cd-f0a01ed5c00c</Id>
  <Messages>
    <Message xsi:type="SecurityMessage">
      <SessionId>b38041f6-f01c-4a2a-8ce5-b6caaa7d39e8</SessionId>
      <Event>
        <PrivacySetting>AlwaysSend</PrivacySetting>
        <Code>Security.Integrity.Tampering</Code>
      </Event>
      <Binary>
        <ModifiedDate>2007-10-01T17:50:18.4525198-04:00</ModifiedDate>
        <Id>444745eb-92ce-45e8-a749-33a0a92364fc</Id>
        <Name>SOSWinApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</Name>
        <Version>1.0.0.0</Version>
      </Binary>
      <TimeStampUtc>2007-10-01T21:51:02.7323458Z</TimeStampUtc>
      <Id>8f3c939a-79f3-4fbc-97b0-d8af5ef9ad4b</Id>
    </Message>
  </Messages>
  <SchemaVersion>02.00.00</SchemaVersion>
  <Application>
    <ApplicationType>.exe</ApplicationType>
    <Id>8f6a00e8-0c11-433e-a683-30eb828c4b3c</Id>
    <Name>SOSWinApp</Name>
    <Version>1.0.0.0</Version>
  </Application>
</MessageCache>

 

 


© 2016 PreEmptive Solutions, LLC. All Rights Reserved.

www.preemptive.com