Ryan Stecker avatar Ryan Stecker committed 94b0bb8

Moved OSW powered projects into a "Projects" directory.

Comments (0)

Files changed (324)

Chat Log/Chat Log.csproj

-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>9.0.30729</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{AD738C92-B479-45C4-96B7-AF778AD4B749}</ProjectGuid>
-    <OutputType>WinExe</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>ChatLog</RootNamespace>
-    <AssemblyName>Chat Log</AssemblyName>
-    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
-    <FileAlignment>512</FileAlignment>
-    <ApplicationIcon>Resources/logger.ico</ApplicationIcon>
-    <PublishUrl>publish\</PublishUrl>
-    <Install>true</Install>
-    <InstallFrom>Disk</InstallFrom>
-    <UpdateEnabled>false</UpdateEnabled>
-    <UpdateMode>Foreground</UpdateMode>
-    <UpdateInterval>7</UpdateInterval>
-    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
-    <UpdatePeriodically>false</UpdatePeriodically>
-    <UpdateRequired>false</UpdateRequired>
-    <MapFileExtensions>true</MapFileExtensions>
-    <ApplicationRevision>0</ApplicationRevision>
-    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
-    <IsWebBootstrapper>false</IsWebBootstrapper>
-    <UseApplicationTrust>false</UseApplicationTrust>
-    <BootstrapperEnabled>true</BootstrapperEnabled>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <PlatformTarget>x86</PlatformTarget>
-    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <PlatformTarget>x86</PlatformTarget>
-    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Core">
-      <RequiredTargetFramework>3.5</RequiredTargetFramework>
-    </Reference>
-    <Reference Include="System.Data" />
-    <Reference Include="System.Deployment" />
-    <Reference Include="System.Drawing" />
-    <Reference Include="System.Web" />
-    <Reference Include="System.Windows.Forms" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Data\LinkEntry.cs" />
-    <Compile Include="Events\LogFailureEventArgs.cs" />
-    <Compile Include="LogManager.cs" />
-    <Compile Include="Data\LogMessage.cs" />
-    <Compile Include="SigScan\VTScan.cs" />
-    <Compile Include="UI\BrowseTextBox.cs">
-      <SubType>UserControl</SubType>
-    </Compile>
-    <Compile Include="UI\BrowseTextBox.Designer.cs">
-      <DependentUpon>BrowseTextBox.cs</DependentUpon>
-    </Compile>
-    <Compile Include="UI\LinkIDForm.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="UI\LinkIDForm.Designer.cs">
-      <DependentUpon>LinkIDForm.cs</DependentUpon>
-    </Compile>
-    <Compile Include="UI\PreviewTextBox.cs">
-      <SubType>UserControl</SubType>
-    </Compile>
-    <Compile Include="UI\PreviewTextBox.Designer.cs">
-      <DependentUpon>PreviewTextBox.cs</DependentUpon>
-    </Compile>
-    <Compile Include="UI\Notification.cs">
-      <SubType>Component</SubType>
-    </Compile>
-    <Compile Include="Program.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <EmbeddedResource Include="UI\BrowseTextBox.resx">
-      <DependentUpon>BrowseTextBox.cs</DependentUpon>
-      <SubType>Designer</SubType>
-    </EmbeddedResource>
-    <EmbeddedResource Include="UI\LinkIDForm.resx">
-      <DependentUpon>LinkIDForm.cs</DependentUpon>
-      <SubType>Designer</SubType>
-    </EmbeddedResource>
-    <EmbeddedResource Include="UI\Notification.resx">
-      <DependentUpon>Notification.cs</DependentUpon>
-      <SubType>Designer</SubType>
-    </EmbeddedResource>
-    <EmbeddedResource Include="Properties\Resources.resx">
-      <Generator>ResXFileCodeGenerator</Generator>
-      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
-      <SubType>Designer</SubType>
-    </EmbeddedResource>
-    <EmbeddedResource Include="UI\PreviewTextBox.resx">
-      <DependentUpon>PreviewTextBox.cs</DependentUpon>
-      <SubType>Designer</SubType>
-    </EmbeddedResource>
-    <EmbeddedResource Include="UI\SettingsForm.resx">
-      <DependentUpon>SettingsForm.cs</DependentUpon>
-      <SubType>Designer</SubType>
-    </EmbeddedResource>
-    <Compile Include="Properties\Resources.Designer.cs">
-      <AutoGen>True</AutoGen>
-      <DependentUpon>Resources.resx</DependentUpon>
-      <DesignTime>True</DesignTime>
-    </Compile>
-    <None Include="Properties\Settings.settings">
-      <Generator>SettingsSingleFileGenerator</Generator>
-      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
-    </None>
-    <Compile Include="Properties\Settings.Designer.cs">
-      <AutoGen>True</AutoGen>
-      <DependentUpon>Settings.settings</DependentUpon>
-      <DesignTimeSharedInput>True</DesignTimeSharedInput>
-    </Compile>
-    <Compile Include="Utils\Serializable.cs" />
-    <Compile Include="Data\Settings.cs" />
-    <Compile Include="UI\SettingsForm.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="UI\SettingsForm.Designer.cs">
-      <DependentUpon>SettingsForm.cs</DependentUpon>
-    </Compile>
-    <Compile Include="Utils\Util.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <Content Include="Resources\logger.ico" />
-    <None Include="license.txt">
-      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-    </None>
-    <None Include="readme.txt">
-      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
-      <Visible>False</Visible>
-      <ProductName>.NET Framework 2.0 %28x86%29</ProductName>
-      <Install>false</Install>
-    </BootstrapperPackage>
-    <BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
-      <Visible>False</Visible>
-      <ProductName>.NET Framework 3.0 %28x86%29</ProductName>
-      <Install>false</Install>
-    </BootstrapperPackage>
-    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
-      <Visible>False</Visible>
-      <ProductName>.NET Framework 3.5</ProductName>
-      <Install>true</Install>
-    </BootstrapperPackage>
-    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
-      <Visible>False</Visible>
-      <ProductName>Windows Installer 3.1</ProductName>
-      <Install>true</Install>
-    </BootstrapperPackage>
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\Steam4NET\Steam4NET.csproj">
-      <Project>{1A204257-FE82-4BBE-9ED4-40694821C31F}</Project>
-      <Name>Steam4NET</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-</Project>

Chat Log/Chat Log.sln

-
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Chat Log", "Chat Log.csproj", "{AD738C92-B479-45C4-96B7-AF778AD4B749}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Steam4NET", "..\Steam4NET\Steam4NET.csproj", "{1A204257-FE82-4BBE-9ED4-40694821C31F}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Any CPU = Debug|Any CPU
-		Release|Any CPU = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{AD738C92-B479-45C4-96B7-AF778AD4B749}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{AD738C92-B479-45C4-96B7-AF778AD4B749}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{AD738C92-B479-45C4-96B7-AF778AD4B749}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{AD738C92-B479-45C4-96B7-AF778AD4B749}.Release|Any CPU.Build.0 = Release|Any CPU
-		{1A204257-FE82-4BBE-9ED4-40694821C31F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{1A204257-FE82-4BBE-9ED4-40694821C31F}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{1A204257-FE82-4BBE-9ED4-40694821C31F}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{1A204257-FE82-4BBE-9ED4-40694821C31F}.Release|Any CPU.Build.0 = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal

Chat Log/Data/LinkEntry.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace ChatLog
-{
-    public class LinkEntry
-    {
-        public ulong SteamID;
-        public string Name;
-    }
-}

Chat Log/Data/LogMessage.cs

-
-namespace ChatLog
-{
-    using System;
-    using Steam4NET;
-
-    class LogMessage
-    {
-        public bool IsGroupMsg;
-
-        public CSteamID ChatRoom;
-        public string ChatRoomName;
-
-        public CSteamID Sender;
-        public string SenderName;
-
-        public CSteamID Reciever;
-        public string RecieverName;
-
-        public string Message;
-
-        public DateTime MessageTime;
-
-        public EChatEntryType MessageType;
-    }
-}

Chat Log/Data/Settings.cs

-
-namespace ChatLog
-{
-    using System;
-    using System.Collections.Generic;
-
-    public class Settings : Serializable<Settings>
-    {
-        public const string BackingFile = "settings.xml";
-
-        public string LogDirectory;
-        public string Filename;
-
-        public string LogFormat;
-        public string EmoteFormat;
-
-        public string InvalidReplacement;
-
-        public string DateFormat;
-        public string TimeFormat;
-
-        public bool TrackSessions;
-        public int MinsBetweenSessions;
-
-        public bool GroupChatEnabled;
-
-        public List<LinkEntry> Links;
-
-
-        public Settings()
-        {
-            Filename = "{Name}.txt";
-
-            LogFormat = "[{Time}] {Name}: {Message}";
-            EmoteFormat = "[{Time}] * {Name} {Message}";
-
-            InvalidReplacement = "_";
-
-            DateFormat = "d";
-            TimeFormat = "t";
-
-            TrackSessions = true;
-            MinsBetweenSessions = 60;
-
-            Links = new List<LinkEntry>();
-        }
-
-        public string LookupLinkID( ulong commId )
-        {
-            foreach ( LinkEntry le in Links )
-            {
-                if ( le.SteamID == commId )
-                    return le.Name;
-            }
-            return null;
-        }
-
-
-        public bool Save()
-        {
-            return base.Save( BackingFile );
-        }
-    }
-}

Chat Log/Events/LogFailureEventArgs.cs

-
-namespace ChatLog
-{
-    using System;
-
-    class LogFailureEventArgs : EventArgs
-    {
-        public string Reason { get; private set; }
-
-        public LogFailureEventArgs( string reason )
-        {
-            this.Reason = reason;
-        }
-    }
-}

Chat Log/LogManager.cs

-namespace ChatLog
-{
-    using System;
-    using System.Globalization;
-    using System.IO;
-    using Steam4NET;
-    using System.Text;
-    using System.Runtime.InteropServices;
-    using System.Collections.Generic;
-
-    [UnmanagedFunctionPointer( CallingConvention.ThisCall )]
-    delegate Int32 NativeGetChatRoomEntry( IntPtr thisobj, UInt64 steamIDchat, Int32 iChatID, ref UInt64 steamIDuser, byte[] pvData, Int32 cubData, ref EChatEntryType peChatEntryType );
-
-    [UnmanagedFunctionPointer( CallingConvention.ThisCall )]
-    delegate string NativeGetChatRoomName( IntPtr thisobj, UInt64 steamIDchat );
-
-    class LogManager
-    {
-        Settings sets;
-
-        IClientEngine clientEngine;
-        IClientFriends clientFriends;
-        ISteamClient008 steamClient;
-        ISteamFriends002 steamFriends;
-
-        int pipe;
-        int user;
-
-        bool groupChatEnabled;
-        NativeGetChatRoomEntry getChatMsg;
-        NativeGetChatRoomName getChatName;
-        string groupStatusMsg;
-
-        Dictionary<ulong, DateTime> sessionInfo;
-
-        public event EventHandler<LogFailureEventArgs> LogFailure;
-
-        Callback<FriendChatMsg_t> chatCallback;
-        Callback<PersonaStateChange_t> stateCallback;
-        Callback<ChatRoomMsg_t> chatRoomCallback;
-
-
-        public LogManager( Settings settings )
-        {
-            groupChatEnabled = false;
-
-            sets = settings;
-
-            sessionInfo = new Dictionary<ulong, DateTime>();
-
-            chatCallback = new Callback<FriendChatMsg_t>( ChatMsg, FriendChatMsg_t.k_iCallback );
-            stateCallback = new Callback<PersonaStateChange_t>( StateChange, PersonaStateChange_t.k_iCallback );
-            chatRoomCallback = new Callback<ChatRoomMsg_t>( ChatRoomMsg, ChatRoomMsg_t.k_iCallback );
-
-        }
-
-
-        protected virtual void OnLogFailure( LogFailureEventArgs e )
-        {
-            if ( LogFailure != null )
-                LogFailure( this, e );
-        }
-
-        public bool GetSteamClient()
-        {
-            if ( !Steamworks.Load() )
-                return false;
-
-            steamClient = Steamworks.CreateInterface<ISteamClient008>( "SteamClient008" );
-            clientEngine = Steamworks.CreateInterface<IClientEngine>( "CLIENTENGINE_INTERFACE_VERSION001" );
-
-            if ( steamClient == null )
-                return false;
-
-            if ( clientEngine == null )
-                return false;
-
-            return true;
-        }
-
-        public bool GetPipe()
-        {
-            if ( pipe != 0 )
-            {
-                steamClient.ReleaseSteamPipe( pipe );
-            }
-
-            pipe = steamClient.CreateSteamPipe();
-
-            if ( pipe == 0 )
-                return false;
-
-            return true;
-        }
-
-        public bool GetUser()
-        {
-            if ( user != 0 )
-            {
-                steamClient.ReleaseUser( pipe, user );
-            }
-
-            user = steamClient.ConnectToGlobalUser( pipe );
-
-            if ( user == 0 )
-                return false;
-
-            return true;
-        }
-
-        public bool GetInterface()
-        {
-            steamFriends = Steamworks.CastInterface<ISteamFriends002>( steamClient.GetISteamFriends( user, pipe, "SteamFriends002" ) );
-
-            if ( steamFriends == null )
-                return false;
-
-            clientFriends = Steamworks.CastInterface<IClientFriends>( clientEngine.GetIClientFriends( user, pipe, "CLIENTFRIENDS_INTERFACE_VERSION001" ) );
-
-            if ( clientFriends == null )
-                return false;
-
-            VTScan vtScan = new VTScan( clientFriends.Interface );
-
-            if ( vtScan.Init() )
-            {
-
-                /*
-                .text:3809F73D 6A 00                                   push    0
-                .text:3809F73F 68 62 D4 46 38                          push    offset unk_3846D462
-                .text:3809F744 68 95 03 00 00                          push    394h
-                .text:3809F749 68 40 E7 3C 38                          push    offset aEBuild_slav_20 ; "e:\\build_slave\\steam_rel_client_win32\\b"...
-                .text:3809F74E 6A 00                                   push    0
-                .text:3809F750 68 90 E7 3C 38                          push    offset asc_383CE790 ; "Assertion Failed: bufRet.GetUint8() == "...
-                .text:3809F755 FF 15 44 E5 37 38                       call    ds:AssertMsgImplementation
-                */
-                var results = vtScan.DoScan<NativeGetChatRoomEntry>(
-                    "\x6A\x00\x68\x62\xD4\x46\x38\x68\x95\x03\x00\x00\x68\x40\xE7\x3C\x38\x6A\x00\x68\x90\xE7\x3C\x38\xFF\x15\x44\xE5\x37\x38",
-                    "xxx????xxxxxx????xxx????xx????"
-                );
-
-                bool foundFirst = false;
-
-                if ( results.Count == 0 )
-                {
-                    groupStatusMsg = "Error: Unable to scan for GetChatRoomEntry";
-                }
-                else
-                {
-                    if ( results.Count > 1 )
-                    {
-                        groupStatusMsg = "Error: Scan for GetChatRoomEntry gave multiple results!";
-                    }
-                    else
-                    {
-                        getChatMsg = results[ 0 ].Delegate;
-                        foundFirst = true;
-                    }
-                }
-
-                /*
-                .text:380A06A4 6A 00                                   push    0
-                .text:380A06A6 68 69 D4 46 38                          push    offset unk_3846D469
-                .text:380A06AB 68 AB 03 00 00                          push    3AAh
-                .text:380A06B0 68 40 E7 3C 38                          push    offset aEBuild_slav_20 ; "e:\\build_slave\\steam_rel_client_win32\\b"...
-                .text:380A06B5 6A 00                                   push    0
-                .text:380A06B7 68 90 E7 3C 38                          push    offset asc_383CE790 ; "Assertion Failed: bufRet.GetUint8() == "...
-                .text:380A06BC FF 15 44 E5 37 38                       call    ds:AssertMsgImplementation
-                */
-
-                var results2 = vtScan.DoScan<NativeGetChatRoomName>(
-                    "\x6A\x00\x68\x69\xD4\x46\x38\x68\xAB\x03\x00\x00\x68\x40\xE7\x3C\x38\x6A\x00\x68\x90\xE7\x3C\x38\xFF\x15\x44\xE5\x37\x38",
-                    "xxx????xxxxxx????xxx????xx????"
-                );
-
-                if ( results2.Count == 0 )
-                {
-                    groupStatusMsg = "Error: Unable to scan for GetChatRoomName";
-                }
-                else
-                {
-                    if ( results2.Count > 1 )
-                    {
-                        groupStatusMsg = "Error: Scan for GetChatRoomName gave multiple results!";
-                    }
-                    else
-                    {
-                        getChatName = results2[ 0 ].Delegate;
-                        groupChatEnabled = foundFirst && true;
-                    }
-                }
-            }
-            else
-            {
-                groupStatusMsg = "Error: Unable to initialize scan!";
-            }
-
-            CallbackDispatcher.SpawnDispatchThread( pipe );
-
-            return true;
-        }
-
-        public string GetGroupChatStatus()
-        {
-            if ( groupChatEnabled )
-                return "Working normally";
-
-            return groupStatusMsg ?? "Not enabled. (Requires restart)";
-        }
-
-        private void AddLog( LogMessage log )
-        {
-            string directoryName = sets.LogDirectory;
-
-            if ( string.IsNullOrEmpty( directoryName ) )
-            {
-                OnLogFailure( new LogFailureEventArgs( "Log directory not configured" ) );
-                return;
-            }
-
-            string linkRep = sets.LookupLinkID( log.Sender );
-
-            if ( linkRep == null )
-                linkRep = log.SenderName;
-
-            string fileLink = null;
-
-            if ( log.IsGroupMsg )
-                fileLink = sets.LookupLinkID( log.ChatRoom );
-            else
-                fileLink = sets.LookupLinkID( log.Reciever );
-
-            if ( fileLink == null )
-            {
-                if ( log.IsGroupMsg )
-                    fileLink = log.ChatRoomName;
-                else
-                    fileLink = log.RecieverName;
-            }
-
-
-            try
-            {
-                directoryName = directoryName.FormatWith(
-                    new
-                    {
-                        CommunityID = ( ulong )log.Reciever,
-                        SteamID = log.Reciever.Render().Replace( ":", sets.InvalidReplacement ),
-                        Name = Util.StripInvalidChars( log.RecieverName, sets.InvalidReplacement ),
-                        LinkID = Util.StripInvalidChars( fileLink, sets.InvalidReplacement ),
-                        Date = Util.StripInvalidChars( DateTime.Now.ToString( sets.DateFormat, CultureInfo.CurrentCulture ), sets.InvalidReplacement ),
-                        Time = Util.StripInvalidChars( DateTime.Now.ToString( sets.TimeFormat, CultureInfo.CurrentCulture ), sets.InvalidReplacement ),
-                    }
-                );
-
-            }
-            catch
-            {
-                OnLogFailure( new LogFailureEventArgs( "Directory name format is invalid" ) );
-                return;
-            }
-
-            if ( !Directory.Exists( directoryName ) )
-            {
-                try
-                {
-                    Directory.CreateDirectory( directoryName );
-                }
-                catch
-                {
-                    OnLogFailure( new LogFailureEventArgs( "Log directory configured, but the directory could not be created" ) );
-                    return;
-                }
-            }
-
-
-            string fileName = sets.Filename;
-
-            if ( string.IsNullOrEmpty( fileName ) )
-            {
-                OnLogFailure( new LogFailureEventArgs( "Log filename not configured" ) );
-                return;
-            }
-
-            try
-            {
-                if ( log.IsGroupMsg )
-                {
-                    fileName = fileName.FormatWith(
-                        new
-                        {
-                            Name = Util.StripInvalidChars( log.ChatRoomName, sets.InvalidReplacement ),
-                            Date = Util.StripInvalidChars( DateTime.Now.ToString( sets.DateFormat, CultureInfo.CurrentCulture ), sets.InvalidReplacement ),
-                            Time = Util.StripInvalidChars( DateTime.Now.ToString( sets.TimeFormat, CultureInfo.CurrentCulture ), sets.InvalidReplacement ),
-                        }
-                    );
-                }
-                else
-                {
-                    fileName = fileName.FormatWith(
-                        new
-                        {
-                            CommunityID = ( ulong )log.Reciever,
-                            SteamID = log.Reciever.Render().Replace( ":", sets.InvalidReplacement ),
-                            Name = Util.StripInvalidChars( log.RecieverName, sets.InvalidReplacement ),
-                            LinkID = Util.StripInvalidChars( fileLink, sets.InvalidReplacement ),
-                            Date = Util.StripInvalidChars( DateTime.Now.ToString( sets.DateFormat, CultureInfo.CurrentCulture ), sets.InvalidReplacement ),
-                            Time = Util.StripInvalidChars( DateTime.Now.ToString( sets.TimeFormat, CultureInfo.CurrentCulture ), sets.InvalidReplacement ),
-                        }
-                    );
-                }
-            }
-            catch
-            {
-                OnLogFailure( new LogFailureEventArgs( "Filename format is invalid" ) );
-                return;
-            }
-
-            string logMessage = string.Empty;
-
-            string dateStr = string.Empty;
-            try
-            {
-                dateStr = DateTime.Now.ToString( sets.DateFormat, CultureInfo.CurrentCulture );
-            }
-            catch
-            {
-                OnLogFailure( new LogFailureEventArgs( "Bad date format" ) );
-                return;
-
-                //dateStr = "Bad Date Format";
-            }
-
-            string timeStr = string.Empty;
-            try
-            {
-                timeStr = DateTime.Now.ToString( sets.TimeFormat, CultureInfo.CurrentCulture );
-            }
-            catch
-            {
-                OnLogFailure( new LogFailureEventArgs( "Bad time format" ) );
-                return;
-
-                //timeStr = "Bad Time Format";
-            }
-
-
-            var ReplaceTable = new
-            {
-                Name = log.SenderName,
-                SteamID = log.Sender.Render(),
-                CommunityID = ( ulong )log.Sender,
-                LinkID = linkRep,
-
-                Message = log.Message,
-
-                MyName = log.RecieverName,
-                MySteamID = log.Reciever.Render(),
-
-                Date = dateStr,
-                Time = timeStr,
-                UnixTime = ( DateTime.UtcNow - new DateTime( 1970, 1, 1, 0, 0, 0 ) ).TotalSeconds,
-
-                NewLine = Environment.NewLine,
-                Tab = "\t",
-
-            };
-
-            if ( log.MessageType == EChatEntryType.k_EChatEntryTypeChatMsg )
-            {
-                logMessage = sets.LogFormat;
-
-                if ( string.IsNullOrEmpty( logMessage ) )
-                {
-                    OnLogFailure( new LogFailureEventArgs( "Log format not configured" ) );
-                    return;
-                }
-
-                try
-                {
-                    logMessage = logMessage.FormatWith( ReplaceTable );
-                }
-                catch
-                {
-                    OnLogFailure( new LogFailureEventArgs( "Log format was invalid" ) );
-                    return;
-                }
-            }
-            else if ( log.MessageType == EChatEntryType.k_EChatEntryTypeEmote )
-            {
-                logMessage = sets.EmoteFormat;
-
-                if ( string.IsNullOrEmpty( logMessage ) )
-                {
-                    OnLogFailure( new LogFailureEventArgs( "Log emote format not configured" ) );
-                    return;
-                }
-
-                try
-                {
-                    logMessage = logMessage.FormatWith( ReplaceTable );
-                }
-                catch
-                {
-                    OnLogFailure( new LogFailureEventArgs( "Log emote format was invalid" ) );
-                    return;
-                }
-            }
-
-            if ( string.IsNullOrEmpty( logMessage ) )
-                return;
-
-            ulong senderId = log.Sender;
-
-            if ( log.IsGroupMsg )
-            {
-                try
-                {
-                    File.AppendAllText( Path.Combine( directoryName, fileName ), logMessage + Environment.NewLine );
-                    return;
-                }
-                catch ( Exception ex )
-                {
-                    OnLogFailure( new LogFailureEventArgs( ex.Message ) );
-                    return;
-                }
-            }
-
-            if ( sets.TrackSessions )
-            {
-                if ( sessionInfo.ContainsKey( senderId ) )
-                {
-                    DateTime lastMsg = sessionInfo[ senderId ];
-
-                    if ( ( DateTime.Now - lastMsg ) > TimeSpan.FromMinutes( sets.MinsBetweenSessions ) )
-                    {
-                        File.AppendAllText( Path.Combine( directoryName, fileName ), Environment.NewLine + Environment.NewLine + "New session started on " + dateStr + " at " + timeStr + Environment.NewLine );
-                        sessionInfo[ senderId ] = DateTime.Now;
-                    }
-                }
-                else
-                {
-                    File.AppendAllText( Path.Combine( directoryName, fileName ), Environment.NewLine + Environment.NewLine + "New session started on " + dateStr + " at " + timeStr + Environment.NewLine );
-
-                    sessionInfo.Add( senderId, DateTime.Now );
-                }
-            }
-
-            try
-            {
-                File.AppendAllText( Path.Combine( directoryName, fileName ), logMessage + Environment.NewLine );
-            }
-            catch ( Exception ex )
-            {
-                OnLogFailure( new LogFailureEventArgs( ex.Message ) );
-                return;
-            }
-        }
-
-        void StateChange( PersonaStateChange_t perState )
-        {
-        }
-
-        int Clamp( int value, int min, int max )
-        {
-            if ( value < min )
-                return min;
-
-            if ( value > max )
-                return max;
-
-            return value;
-        }
-
-        void ChatRoomMsg( ChatRoomMsg_t chatMsg )
-        {
-            if ( !groupChatEnabled || !sets.GroupChatEnabled )
-                return;
-
-            byte[] msgData = new byte[ 1024 * 4 ];
-            EChatEntryType chatType = EChatEntryType.k_EChatEntryTypeInvalid;
-            ulong chatter = 0;
-
-            int len = getChatMsg( clientFriends.Interface, chatMsg.m_ulSteamIDChat, ( int )chatMsg.m_iChatID, ref chatter, msgData, msgData.Length, ref chatType );
-
-            len = Clamp( len, 1, msgData.Length );
-
-            LogMessage log = new LogMessage();
-
-            log.IsGroupMsg = true;
-            log.ChatRoom = chatMsg.m_ulSteamIDChat;
-            log.ChatRoomName = getChatName( clientFriends.Interface, log.ChatRoom );
-
-            log.Sender = new CSteamID( chatMsg.m_ulSteamIDUser );
-            log.SenderName = steamFriends.GetFriendPersonaName( log.Sender );
-
-            log.Reciever = log.Sender;
-            log.RecieverName = log.SenderName;
-
-            log.Message = Encoding.UTF8.GetString( msgData, 0, len );
-            log.Message = log.Message.Substring(0, log.Message.Length - 1);
-            log.MessageTime = DateTime.Now;
-            log.MessageType = chatType;
-
-            AddLog( log );
-            
-        }
-
-        void ChatMsg( FriendChatMsg_t chatMsg )
-        {
-            
-            byte[] msgData = new byte[ 1024 * 4 ];
-            EChatEntryType type = EChatEntryType.k_EChatEntryTypeChatMsg;
-
-            CSteamID reciever = new CSteamID( chatMsg.m_ulReceiver );
-
-            int msgLength = steamFriends.GetChatMessage( chatMsg.m_ulReceiver, ( int )chatMsg.m_iChatID, msgData, msgData.Length, ref type );
-
-            if ( type == EChatEntryType.k_EChatEntryTypeTyping )
-                return;
-
-            msgLength = Clamp( msgLength, 1, msgData.Length );
-
-            LogMessage log = new LogMessage();
-
-            log.Sender = new CSteamID( chatMsg.m_ulSender );
-            log.SenderName = steamFriends.GetFriendPersonaName( log.Sender );
-
-            log.Reciever = reciever;
-            log.RecieverName = steamFriends.GetFriendPersonaName( log.Reciever );
-
-            log.Message = Encoding.UTF8.GetString( msgData, 0, msgLength );
-            log.Message = log.Message.Substring( 0, log.Message.Length - 1 );
-            log.MessageTime = DateTime.Now;
-            log.MessageType = type;
-
-            AddLog( log );
-        }
-
-
-        public void Close()
-        {
-            CallbackDispatcher.StopDispatchThread( this.pipe );
-        }
-    }
-}

Chat Log/Program.cs

-/*
-Copyright (c) 2009 Ryan Stecker
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-namespace ChatLog
-{
-    using System;
-    using System.IO;
-    using System.Threading;
-    using System.Windows.Forms;
-    using Steam4NET;
-
-    static class Program
-    {
-        static Settings sets;
-
-        static Notification notifyIcon;
-        static LogManager logManager;
-
-        static SettingsForm setsForm;
-
-        static bool running = true;
-
-        [STAThread]
-        static void Main()
-        {
-            bool firstProcess;
-            Mutex singleMutex = new Mutex
-            (
-                true,
-                "SteamChatLogger_4d8g8hisih39", // this is hopefully a unique mutex string not present on the current system
-                out firstProcess
-            );
-
-            if ( !firstProcess )
-            {
-                // process already exists, so we exit
-                Util.ShowWarning( null, "Steam chat logger is already running. You may control it through context menus in the task bar icon." );
-                return;
-            }
-
-            Application.EnableVisualStyles();
-            Application.SetCompatibleTextRenderingDefault( false );
-
-            // load our settings
-            try
-            {
-                sets = Settings.Load( Settings.BackingFile );
-            }
-            catch ( FileNotFoundException )
-            {
-                // if the file isn't found, no biggie
-                sets = new Settings();
-                sets.Save();
-            }
-            catch ( Exception ex )
-            {
-                Util.ShowError( null, "Unable to load settings: " + ex.Message + "\n\nResetting to defaults." );
-                sets = new Settings();
-                sets.Save();
-            }
-
-            setsForm = new SettingsForm( sets );
-
-            // initialize the notification icon context
-            notifyIcon = new Notification();
-            notifyIcon.Exit += new EventHandler( notifyIcon_Exit );
-            notifyIcon.ShowSettings += new EventHandler( notifyIcon_ShowSettings );
-
-
-            // initialize logging
-            logManager = new LogManager( sets );
-            logManager.LogFailure += new EventHandler<LogFailureEventArgs>( logManager_LogFailure );
-
-
-            // gasp a label.. what could it be for?
-        //SteamInit: // maybe someday this will come back (not likely)
-
-            bool waited = false;
-
-            if ( !logManager.GetSteamClient() )
-            {
-                Util.ShowFatalError( null, "Unable get SteamClient interface.\nThis indicates a major change in the steam client, please contact voidedweasel@gmail.com." );
-                return;
-            }
-
-            if ( !logManager.GetPipe() )
-            {
-                notifyIcon.ShowError( "Steam is currently not running.. Waiting for it to startup." );
-                waited = true;
-
-                while ( !logManager.GetPipe() )
-                {
-                    Application.DoEvents();
-
-                    Thread.Sleep( 2000 );
-                }
-
-                // get the pipe again just in case
-                if ( !logManager.GetPipe() )
-                {
-                    Util.ShowFatalError( null, "Error getting steam pipe after steam startup!" );
-                    return;
-                }
-            }
-
-            while ( !logManager.GetUser() )
-            {
-                Application.DoEvents();
-
-                Thread.Sleep( 2000 );
-            }
-
-            // wait for steam to full start itself
-            if ( waited )
-                Thread.Sleep( 10000 );
-
-            // get the user again
-            if ( !logManager.GetUser() )
-            {
-                Util.ShowFatalError( null, "Error getting steam user after steam startup!" );
-                return;
-            }
-
-
-            if ( !logManager.GetInterface() )
-            {
-                Util.ShowFatalError( null, "Unable to get SteamFriends interface.\nThis indicates a major change in the steam client, please contact voidedweasel@gmail.com." );
-                return;
-            }
-
-
-            if ( waited )
-                notifyIcon.ShowInfo( "Steam is now running, logging enabled." );
-           
-
-            while ( running )
-            {
-                // CreateSteamPipe causes deadlocks, not using this for now
-                /*if ( !logManager.GetPipe() )
-                {
-                    Util.ShowError( null, "Steam pipe error!\nAttempting to regain pipe..." );
-                    goto SteamInit; // gasp! a goto!?
-                }*/
-
-                Application.DoEvents();
-
-                Thread.Sleep( 10 );
-            }
-
-            logManager.Close();
-
-            GC.KeepAlive( singleMutex );
-        }
-
-        static void logManager_LogFailure( object sender, LogFailureEventArgs e )
-        {
-            notifyIcon.ShowError( "Unable to log message: " + e.Reason + "\n\nPlease check settings." );
-        }
-
-        static void notifyIcon_ShowSettings( object sender, EventArgs e )
-        {
-            if ( setsForm == null )
-                return;
-
-            setsForm.Show();
-            setsForm.SetGroupChatStatus( logManager.GetGroupChatStatus() );
-        }
-
-        static void notifyIcon_Exit( object sender, EventArgs e )
-        {
-            running = false;
-
-            notifyIcon.Visible = false;
-            setsForm.Close(); // this saves settings and hides the form
-        }
-    }
-}

Chat Log/Properties/AssemblyInfo.cs

-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System;
-using System.Resources;
-using System.Diagnostics.CodeAnalysis;
-
-// General Information about an assembly is controlled through the following 
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle( "Steam Chat Logger" )]
-[assembly: AssemblyDescription( "Steam Chat Logger" )]
-[assembly: AssemblyConfiguration( "" )]
-[assembly: AssemblyCompany( "VoiDeD" )]
-[assembly: AssemblyProduct( "Steam Chat Logger" )]
-[assembly: AssemblyCopyright( "Copyright © Ryan Stecker 2009" )]
-[assembly: AssemblyTrademark( "" )]
-
-[assembly: NeutralResourcesLanguageAttribute( "en-US" )]
-
-[assembly: ComVisible( false )]
-
-// steam ids aren't CLS compliant apparently...
-// [assembly: CLSCompliant( true )]
-
-
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version 
-//      Build Number
-//      Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers 
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion( "0.7.*" )]

Chat Log/Properties/Resources.Designer.cs

-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:2.0.50727.3603
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace ChatLog.Properties {
-    using System;
-    
-    
-    /// <summary>
-    ///   A strongly-typed resource class, for looking up localized strings, etc.
-    /// </summary>
-    // This class was auto-generated by the StronglyTypedResourceBuilder
-    // class via a tool like ResGen or Visual Studio.
-    // To add or remove a member, edit your .ResX file then rerun ResGen
-    // with the /str option, or rebuild your VS project.
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    internal class Resources {
-        
-        private static global::System.Resources.ResourceManager resourceMan;
-        
-        private static global::System.Globalization.CultureInfo resourceCulture;
-        
-        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        internal Resources() {
-        }
-        
-        /// <summary>
-        ///   Returns the cached ResourceManager instance used by this class.
-        /// </summary>
-        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Resources.ResourceManager ResourceManager {
-            get {
-                if (object.ReferenceEquals(resourceMan, null)) {
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ChatLog.Properties.Resources", typeof(Resources).Assembly);
-                    resourceMan = temp;
-                }
-                return resourceMan;
-            }
-        }
-        
-        /// <summary>
-        ///   Overrides the current thread's CurrentUICulture property for all
-        ///   resource lookups using this strongly typed resource class.
-        /// </summary>
-        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Globalization.CultureInfo Culture {
-            get {
-                return resourceCulture;
-            }
-            set {
-                resourceCulture = value;
-            }
-        }
-        
-        internal static System.Drawing.Icon logger {
-            get {
-                object obj = ResourceManager.GetObject("logger", resourceCulture);
-                return ((System.Drawing.Icon)(obj));
-            }
-        }
-    }
-}

Chat Log/Properties/Resources.resx

-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!-- 
-    Microsoft ResX Schema 
-    
-    Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
-    associated with the data types.
-    
-    Example:
-    
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-                
-    There are any number of "resheader" rows that contain simple 
-    name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
-    mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
-    extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
-    read any of the formats listed below.
-    
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-    
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-  <data name="logger" type="System.Resources.ResXFileRef, System.Windows.Forms">
-    <value>..\Resources\logger.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
-  </data>
-</root>

Chat Log/Properties/Settings.Designer.cs

-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:2.0.50727.3603
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace ChatLog.Properties {
-    
-    
-    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
-    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
-        
-        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-        
-        public static Settings Default {
-            get {
-                return defaultInstance;
-            }
-        }
-    }
-}
Add a comment to this file

Chat Log/Resources/logger.ico

Removed
Old image

Chat Log/SigScan/VTScan.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Runtime.InteropServices;
-using System.Diagnostics;
-using System.Collections.ObjectModel;
-
-namespace ChatLog
-{
-    class ScanResultCollection<T> : ReadOnlyCollection<ScanResult<T>>
-    {
-        public ScanResultCollection( IList<ScanResult<T>> list )
-            : base( list )
-        {
-        }
-    }
-
-    class ScanResult<T>
-    {
-        public T Delegate { get; private set; }
-        public uint Address { get; private set; }
-
-        public ScanResult( T dele, uint addr )
-        {
-            this.Delegate = dele;
-            this.Address = addr;
-        }
-    }
-
-    class VTScan
-    {
-        static class Native
-        {
-            [DllImport( "kernel32.dll" )]
-            public static extern int VirtualQuery(
-                IntPtr lpAddress,
-                ref MEMORY_BASIC_INFORMATION lpBuffer,
-                uint dwLength
-            );
-
-            public const ushort IMAGE_DOS_SIGNATURE = 0x5A4D; // MZ
-            public const uint IMAGE_NT_SIGNATURE = 0x00004550; // PE00
-
-            [StructLayout( LayoutKind.Sequential )]
-            public struct MEMORY_BASIC_INFORMATION
-            {
-                public IntPtr BaseAddress;
-                public IntPtr AllocationBase;
-                public uint AllocationProtect;
-                public IntPtr RegionSize;
-                public uint State;
-                public uint Protect;
-                public uint Type;
-            }
-
-            [StructLayout( LayoutKind.Sequential )]
-            public struct IMAGE_DOS_HEADER
-            {
-                public UInt16 e_magic;       // Magic number
-                public UInt16 e_cblp;        // Bytes on last page of file
-                public UInt16 e_cp;          // Pages in file
-                public UInt16 e_crlc;        // Relocations
-                public UInt16 e_cparhdr;     // Size of header in paragraphs
-                public UInt16 e_minalloc;    // Minimum extra paragraphs needed
-                public UInt16 e_maxalloc;    // Maximum extra paragraphs needed
-                public UInt16 e_ss;          // Initial (relative) SS value
-                public UInt16 e_sp;          // Initial SP value
-                public UInt16 e_csum;        // Checksum
-                public UInt16 e_ip;          // Initial IP value
-                public UInt16 e_cs;          // Initial (relative) CS value
-                public UInt16 e_lfarlc;      // File address of relocation table
-                public UInt16 e_ovno;        // Overlay number
-                [MarshalAs( UnmanagedType.ByValArray, SizeConst = 4 )]
-                public UInt16[] e_res1;        // Reserved words
-                public UInt16 e_oemid;       // OEM identifier (for e_oeminfo)
-                public UInt16 e_oeminfo;     // OEM information; e_oemid specific
-                [MarshalAs( UnmanagedType.ByValArray, SizeConst = 10 )]
-                public UInt16[] e_res2;        // Reserved words
-                public Int32 e_lfanew;      // File address of new exe header
-            }
-
-            [StructLayout( LayoutKind.Sequential )]
-            public struct IMAGE_NT_HEADERS
-            {
-                public UInt32 Signature;
-                public IMAGE_FILE_HEADER FileHeader;
-                public IMAGE_OPTIONAL_HEADER32 OptionalHeader;
-            }
-
-            [StructLayout( LayoutKind.Sequential )]
-            public struct IMAGE_FILE_HEADER
-            {
-                public UInt16 Machine;
-                public UInt16 NumberOfSections;
-                public UInt32 TimeDateStamp;
-                public UInt32 PointerToSymbolTable;
-                public UInt32 NumberOfSymbols;
-                public UInt16 SizeOfOptionalHeader;
-                public UInt16 Characteristics;
-            }
-
-            [StructLayout( LayoutKind.Sequential )]
-            public struct IMAGE_OPTIONAL_HEADER32
-            {
-                //
-                // Standard fields.
-                //
-                public UInt16 Magic;
-                public Byte MajorLinkerVersion;
-                public Byte MinorLinkerVersion;
-                public UInt32 SizeOfCode;
-                public UInt32 SizeOfInitializedData;
-                public UInt32 SizeOfUninitializedData;
-                public UInt32 AddressOfEntryPoint;
-                public UInt32 BaseOfCode;
-                public UInt32 BaseOfData;
-                //
-                // NT additional fields.
-                //
-                public UInt32 ImageBase;
-                public UInt32 SectionAlignment;
-                public UInt32 FileAlignment;
-                public UInt16 MajorOperatingSystemVersion;
-                public UInt16 MinorOperatingSystemVersion;
-                public UInt16 MajorImageVersion;
-                public UInt16 MinorImageVersion;
-                public UInt16 MajorSubsystemVersion;
-                public UInt16 MinorSubsystemVersion;
-                public UInt32 Win32VersionValue;
-                public UInt32 SizeOfImage;
-                public UInt32 SizeOfHeaders;
-                public UInt32 CheckSum;
-                public UInt16 Subsystem;
-                public UInt16 DllCharacteristics;
-                public UInt32 SizeOfStackReserve;
-                public UInt32 SizeOfStackCommit;
-                public UInt32 SizeOfHeapReserve;
-                public UInt32 SizeOfHeapCommit;
-                public UInt32 LoaderFlags;
-                public UInt32 NumberOfRvaAndSizes;
-                [MarshalAs( UnmanagedType.ByValArray, SizeConst = 16 )]
-                public IMAGE_DATA_DIRECTORY[] DataDirectory;
-            }
-
-            [StructLayout( LayoutKind.Sequential )]
-            public struct IMAGE_DATA_DIRECTORY
-            {
-                public UInt32 VirtualAddress;
-                public UInt32 Size;
-            }
-        }
-
-        IntPtr vtObject;
-        uint baseAddr, baseLen;
-
-        List<IntPtr> vtFuncs = new List<IntPtr>();
-
-
-        public unsafe VTScan( IntPtr vtObject )
-        {
-            this.vtObject = vtObject;
-
-            int* vtable = ( int* )*( ( int* )vtObject.ToInt32() );
-            for ( int i = 0 ; vtable[ i ] != 0 ; ++i )
-            {
-                vtFuncs.Add( new IntPtr( vtable[ i ] ) );
-            }
-        }
-
-
-        public bool Init()
-        {
-            if ( vtFuncs.Count == 0 )
-                return false;
-
-            Native.MEMORY_BASIC_INFORMATION memInfo = new Native.MEMORY_BASIC_INFORMATION();
-
-            if ( Native.VirtualQuery( vtFuncs[ 0 ], ref memInfo, ( uint )Marshal.SizeOf( memInfo ) ) == 0 )
-                return false;
-
-            baseAddr = ( uint )memInfo.AllocationBase.ToInt32();
-
-            Native.IMAGE_DOS_HEADER dos = PtrToStruct<Native.IMAGE_DOS_HEADER>( memInfo.AllocationBase );
-
-            if ( dos.e_magic != Native.IMAGE_DOS_SIGNATURE )
-                return false;
-
-            Native.IMAGE_NT_HEADERS pe = PtrToStruct<Native.IMAGE_NT_HEADERS>( new IntPtr( baseAddr + dos.e_lfanew ) );
-
-            if ( pe.Signature != Native.IMAGE_NT_SIGNATURE )
-                return false;
-
-            baseLen = pe.OptionalHeader.SizeOfImage;
-
-            return true;
-        }
-
-        public unsafe ScanResultCollection<T> DoScan<T>( string sig, string mask )
-            where T : class
-        {
-            Debug.Assert( sig.Length == mask.Length );
-            int sigLen = sig.Length;
-
-            List<ScanResult<T>> matches = new List<ScanResult<T>>();
-
-            foreach ( IntPtr vFunc in vtFuncs )
-            {
-
-                byte* basePtr = ( byte* )vFunc.ToInt32();
-                byte* endPtr = ( byte* )( baseAddr + baseLen );
-                int i = 0;
-
-                while ( basePtr < endPtr )
-                {
-                    for ( i = 0 ; i < sigLen ; ++i )
-                    {
-                        if ( ( mask[ i ] != '?' ) && ( sig[ i ] != basePtr[ i ] ) )
-                            break;
-                    }
-
-                    ushort padding = *( ushort* )basePtr;
-
-                    if ( padding == 0xCCCC )
-                        break;
-
-                    if ( i == sigLen )
-                    {
-                        ScanResult<T> result = new ScanResult<T>( ( T )( object )Marshal.GetDelegateForFunctionPointer( vFunc, typeof( T ) ), ( uint )vFunc.ToInt32() );
-                        matches.Add( result );
-                    }
-
-                    basePtr++;
-                }
-            }
-
-            ScanResultCollection<T> src = new ScanResultCollection<T>( matches );
-            return src;
-        }
-
-        T PtrToStruct<T>( IntPtr addr )
-        {
-            return ( T )Marshal.PtrToStructure( addr, typeof( T ) );
-        }
-    }
-}

Chat Log/UI/BrowseTextBox.Designer.cs

-namespace ChatLog
-{
-    partial class BrowseTextBox
-    {
-        /// <summary> 
-        /// Required designer variable.
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary> 
-        /// Clean up any resources being used.
-        /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        protected override void Dispose( bool disposing )
-        {
-            if ( disposing && ( components != null ) )
-            {
-                components.Dispose();
-            }
-            base.Dispose( disposing );
-        }
-
-        #region Component Designer generated code
-
-        /// <summary> 
-        /// Required method for Designer support - do not modify 
-        /// the contents of this method with the code editor.
-        /// </summary>
-        private void InitializeComponent()
-        {
-            this.browseButton = new System.Windows.Forms.Button();
-            this.textBox = new System.Windows.Forms.TextBox();
-            this.SuspendLayout();
-            // 
-            // browseButton
-            // 
-            this.browseButton.Anchor = ( ( System.Windows.Forms.AnchorStyles )( ( System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right ) ) );
-            this.browseButton.Location = new System.Drawing.Point( 324, 3 );
-            this.browseButton.Name = "browseButton";
-            this.browseButton.Size = new System.Drawing.Size( 75, 23 );
-            this.browseButton.TabIndex = 0;
-            this.browseButton.Text = "Browse";
-            this.browseButton.UseVisualStyleBackColor = true;
-            this.browseButton.Click += new System.EventHandler( this.browseButton_Click );
-            // 
-            // textBox
-            // 
-            this.textBox.Anchor = ( ( System.Windows.Forms.AnchorStyles )( ( ( ( System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom )
-                        | System.Windows.Forms.AnchorStyles.Left )
-                        | System.Windows.Forms.AnchorStyles.Right ) ) );
-            this.textBox.Location = new System.Drawing.Point( 3, 5 );
-            this.textBox.Name = "textBox";
-            this.textBox.Size = new System.Drawing.Size( 315, 20 );
-            this.textBox.TabIndex = 1;
-            // 
-            // BrowseTextBox
-            // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 13F );
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.Controls.Add( this.textBox );
-            this.Controls.Add( this.browseButton );
-            this.Name = "BrowseTextBox";
-            this.Size = new System.Drawing.Size( 402, 29 );
-            this.ResumeLayout( false );
-            this.PerformLayout();
-
-        }
-
-        #endregion
-
-        private System.Windows.Forms.Button browseButton;
-        private System.Windows.Forms.TextBox textBox;
-    }
-}

Chat Log/UI/BrowseTextBox.cs

-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Drawing;
-using System.Data;
-using System.Linq;
-using System.Text;
-using System.Windows.Forms;
-using System.IO;
-
-namespace ChatLog
-{
-    public partial class BrowseTextBox : UserControl
-    {
-        public override string Text
-        {
-            get { return textBox.Text; }
-            set {textBox.Text = value; }
-        }