├── Steam Two
├── on.ico
├── side.ico
├── favicon.ico
├── Properties
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── App.xaml.cs
├── packages.config
├── AddAccount.xaml.cs
├── App.xaml
├── AddAccount.xaml
├── GetInput.xaml
├── LocalSteamController.cs
├── steamChatWindow.xaml
├── ToolWindow.xaml
├── GetInput.xaml.cs
├── BotMainWindow.xaml
├── MainWindow.xaml
├── Encryption.cs
├── steamChatWindow.xaml.cs
├── Settings.xaml
├── AccountController.cs
├── BotMainWindow.xaml.cs
├── ToolWindow.xaml.cs
├── SteamTwo.csproj
├── Settings.xaml.cs
├── MainWindow.xaml.cs
└── SteamBotController.cs
├── SteamTwo Launcher
├── App.config
├── Properties
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── SteamTwo Launcher.csproj
└── Program.cs
├── README.md
├── Steam Two.sln
├── .gitattributes
├── .gitignore
└── LICENSE
/Steam Two/on.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/00000vish/Steam-Two/HEAD/Steam Two/on.ico
--------------------------------------------------------------------------------
/Steam Two/side.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/00000vish/Steam-Two/HEAD/Steam Two/side.ico
--------------------------------------------------------------------------------
/Steam Two/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/00000vish/Steam-Two/HEAD/Steam Two/favicon.ico
--------------------------------------------------------------------------------
/SteamTwo Launcher/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Steam Two/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/SteamTwo Launcher/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Steam Two/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace SteamTwo
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Steam Two/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Steam-Two
2 |
3 | ### main login
4 |
5 |
6 | 
7 |
8 |
9 | ### bot login
10 |
11 |
12 | 
13 |
14 |
15 | ### logged in steam tookkit
16 |
17 | 
18 |
19 |
20 | ### encrypt passwords
21 |
22 |
23 | 
24 |
25 |
26 | ### add account page
27 |
28 |
29 | 
30 |
31 |
32 | ### steam 2 step auth support
33 |
34 |
35 | 
36 |
37 |
38 | ### settings
39 |
40 |
41 | 
42 |
43 |
44 | ### settings
45 |
46 |
47 | 
48 |
49 | 
50 |
--------------------------------------------------------------------------------
/Steam Two/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace SteamTwo.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/SteamTwo Launcher/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace SteamTwo_Launcher.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Steam Two/AddAccount.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows;
3 | using System.Windows.Threading;
4 |
5 | namespace SteamTwo
6 | {
7 | ///
8 | /// Interaction logic for AddAccount.xaml
9 | ///
10 | public partial class AddAccount
11 | {
12 | bool givenInput = false; // wait for add account button to be pressed
13 |
14 | public AddAccount()
15 | {
16 | InitializeComponent();
17 | }
18 |
19 | //ignore the parameter lol, overiding doesnt work so
20 | //once add account button is pressed it returns username and password
21 | public String[] Show(String lol)
22 | {
23 | Show();
24 | while (!givenInput)
25 | {
26 | try
27 | {
28 | Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, new Action(delegate { }));
29 |
30 | } catch (Exception) { }
31 | }
32 | return new string[] { textbox1.Text, textbox2.Text , desktopAuth.IsChecked.ToString()};
33 | }
34 |
35 | //add account button
36 | private void button1_Click(object sender, RoutedEventArgs e)
37 | {
38 | givenInput = true;
39 | }
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/Steam Two/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/SteamTwo Launcher/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("SteamTwo Launcher")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("SteamTwo Launcher")]
13 | [assembly: AssemblyCopyright("Copyright © 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("86699279-dd50-46ea-a69e-53475e5b8e6d")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Steam Two/AddAccount.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Steam Two/GetInput.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Steam Two.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27428.2037
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SteamTwo", "Steam Two\SteamTwo.csproj", "{DCC72F43-FFAE-4F1E-86DA-9D437BBCCFCB}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SteamTwo Launcher", "SteamTwo Launcher\SteamTwo Launcher.csproj", "{86699279-DD50-46EA-A69E-53475E5B8E6D}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {DCC72F43-FFAE-4F1E-86DA-9D437BBCCFCB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {DCC72F43-FFAE-4F1E-86DA-9D437BBCCFCB}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {DCC72F43-FFAE-4F1E-86DA-9D437BBCCFCB}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {DCC72F43-FFAE-4F1E-86DA-9D437BBCCFCB}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {86699279-DD50-46EA-A69E-53475E5B8E6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {86699279-DD50-46EA-A69E-53475E5B8E6D}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {86699279-DD50-46EA-A69E-53475E5B8E6D}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {86699279-DD50-46EA-A69E-53475E5B8E6D}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {221EBE20-81C6-44ED-8F94-7C77A0C35DA1}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/Steam Two/LocalSteamController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 |
4 | namespace SteamTwo
5 | {
6 | class LocalSteamController
7 | {
8 | //starts steam
9 | public static bool startSteam(String username, String password)
10 | {
11 | killSteam();
12 | if (checkForSteam())
13 | {
14 | System.Threading.Thread.Sleep(2000);
15 | Process proc = new Process
16 | {
17 | StartInfo = new ProcessStartInfo
18 | {
19 | FileName = SteamTwoProperties.jsonSetting.steamLocation,
20 | Arguments = "-login " + username + " " + password,
21 | UseShellExecute = false,
22 | RedirectStandardOutput = true,
23 | CreateNoWindow = true
24 | }
25 | };
26 | proc.Start();
27 | return true;
28 | }
29 | return false;
30 | }
31 |
32 | //finds steam in disk
33 | private static bool checkForSteam()
34 | {
35 | if(!System.IO.File.Exists(SteamTwoProperties.jsonSetting.steamLocation)){
36 | new SteamTwo.Settings().Show("find steam"); // if not ask to locate it
37 | return false;
38 | }
39 | return true;
40 | }
41 |
42 | //kills steam
43 | private static void killSteam()
44 | {
45 | Process[] proc = Process.GetProcesses();
46 | foreach (Process item in proc)
47 | {
48 | if (item.ProcessName.ToLower().Equals("steam") || item.ProcessName.Equals("gameOverlayui"))
49 | {
50 | item.Kill();
51 | }
52 | }
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/Steam Two/steamChatWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/Steam Two/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("Steam Two")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("")]
14 | [assembly: AssemblyProduct("Steam Two")]
15 | [assembly: AssemblyCopyright("Copyright © 2018")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.2.0.0")]
55 | [assembly: AssemblyFileVersion("1.2.0.0")]
56 |
--------------------------------------------------------------------------------
/Steam Two/ToolWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/Steam Two/GetInput.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows;
3 | using System.Windows.Threading;
4 |
5 |
6 | namespace SteamTwo
7 | {
8 | ///
9 | /// Interaction logic for GetInput.xaml
10 | ///
11 | public partial class GetInput
12 | {
13 | bool givenInput = false;
14 |
15 | public GetInput()
16 | {
17 | InitializeComponent();
18 | }
19 |
20 | //pass the title and discription and check if its asking for a password
21 | //if its password input is hidden
22 | public String Show(String title, String discription, bool password)
23 | {
24 | String key = "";
25 | if (password)
26 | {
27 | Cancel1.IsEnabled = true;
28 | Cancel1.Visibility = Visibility.Visible;
29 | PasswordBox1.IsEnabled = true;
30 | PasswordBox1.Visibility = Visibility.Visible;
31 | textBox1.IsEnabled = false;
32 | textBox1.Visibility = Visibility.Hidden;
33 | }
34 | Title = title;
35 | label1.Text = discription;
36 | Show();
37 |
38 | while (!givenInput)
39 | {
40 | Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, new Action(delegate { }));
41 | }
42 |
43 | key = textBox1.Text;
44 | if (password)
45 | {
46 | key = new System.Net.NetworkCredential(string.Empty, PasswordBox1.SecurePassword).Password;
47 | }
48 | return key;
49 | }
50 |
51 | //ok button is clicked
52 | private void Button_Click(object sender, RoutedEventArgs e)
53 | {
54 | givenInput = true;
55 | }
56 |
57 | //when the form is closing
58 | private void GetInput1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
59 | {
60 | givenInput = true;
61 | }
62 |
63 | //enter is pressed
64 | private void textBox1_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
65 | {
66 | if (e.Key.ToString().Equals("Return"))
67 | {
68 | givenInput = true;
69 | }
70 | }
71 |
72 | //enter is pressed
73 | private void PasswordBox1_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
74 | {
75 | if (e.Key.ToString().Equals("Return"))
76 | {
77 | givenInput = true;
78 | }
79 | }
80 |
81 | private void Cancel_Click(object sender, RoutedEventArgs e)
82 | {
83 | Environment.Exit(0);
84 | }
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/Steam Two/BotMainWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/Steam Two/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace SteamTwo.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SteamTwo.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/SteamTwo Launcher/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace SteamTwo_Launcher.Properties
12 | {
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// Returns the cached ResourceManager instance used by this class.
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SteamTwo_Launcher.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// Overrides the current thread's CurrentUICulture property for all
56 | /// resource lookups using this strongly typed resource class.
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/Steam Two/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/SteamTwo Launcher/SteamTwo Launcher.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {86699279-DD50-46EA-A69E-53475E5B8E6D}
8 | WinExe
9 | SteamTwo_Launcher
10 | SteamTwo Launcher
11 | v4.6.1
12 | 512
13 | true
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 | ResXFileCodeGenerator
52 | Resources.Designer.cs
53 | Designer
54 |
55 |
56 | True
57 | Resources.resx
58 |
59 |
60 | SettingsSingleFileGenerator
61 | Settings.Designer.cs
62 |
63 |
64 | True
65 | Settings.settings
66 | True
67 |
68 |
69 |
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/SteamTwo Launcher/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.IO;
5 | using System.Linq;
6 | using System.Threading;
7 | using System.Threading.Tasks;
8 | using System.Windows.Forms;
9 |
10 | namespace SteamTwo_Launcher
11 | {
12 | static class Program
13 | {
14 | ///
15 | /// The main entry point for the application.
16 | ///
17 | [STAThread]
18 | static void Main()
19 | {
20 | Application.EnableVisualStyles();
21 | Application.SetCompatibleTextRenderingDefault(false);
22 | try
23 | {
24 | //since cant detect if user open or started with windows
25 | //this app will only open with windows and opens app with -startup let main know its open with windowws
26 | checkArgs();
27 | }
28 | catch (Exception D) { MessageBox.Show(D.ToString());}
29 | Environment.Exit(0);
30 | }
31 |
32 | private static void checkArgs()
33 | {
34 | String args = "";
35 | try
36 | {
37 | args = Environment.GetCommandLineArgs()[1];
38 | }
39 | catch (Exception) { }
40 |
41 | switch (args)
42 | {
43 | case "on":
44 | createRegistryKey();
45 | break;
46 | case "off":
47 | deleteRegistryKey();
48 | break;
49 | default:
50 | luanchSteamTwo();
51 | break;
52 | }
53 | }
54 |
55 | //delte auto start reg key
56 | private static void deleteRegistryKey()
57 | {
58 | Microsoft.Win32.RegistryKey regKey = default(Microsoft.Win32.RegistryKey);
59 | regKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
60 | try
61 | {
62 | regKey.DeleteValue("Steam Two", true);
63 | }
64 | catch (Exception) { }
65 | Properties.Settings.Default.Save();
66 | regKey.Close();
67 | }
68 |
69 | //create auto start reg key
70 | private static void createRegistryKey()
71 | {
72 | Microsoft.Win32.RegistryKey regKey = default(Microsoft.Win32.RegistryKey);
73 | regKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
74 | try
75 | {
76 | string KeyName = "Steam Two";
77 | string KeyValue = Environment.CurrentDirectory + "\\SteamTwo Launcher.exe";
78 | regKey.SetValue(KeyName, KeyValue, Microsoft.Win32.RegistryValueKind.String);
79 | }
80 | catch (Exception e) { System.Windows.Forms.MessageBox.Show(e.ToString()); }
81 | Properties.Settings.Default.Save();
82 | regKey.Close();
83 | }
84 | //start the main app
85 | private static void luanchSteamTwo()
86 | {
87 | string exepath = AppDomain.CurrentDomain.BaseDirectory + "\\Steam Two.exe";
88 | ProcessStartInfo psi = new ProcessStartInfo();
89 | psi.FileName = exepath;
90 | psi.WorkingDirectory = Path.GetDirectoryName(exepath);
91 | psi.Arguments = "startup";
92 | Process.Start(psi);
93 | }
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/Steam Two/Encryption.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Security.Cryptography;
3 | using System.Text;
4 | using System.IO;
5 |
6 |
7 | namespace SteamTwo
8 | {
9 | class Cryptography
10 | {
11 | #region Settings
12 |
13 | private static int _iterations = 2;
14 | private static int _keySize = 256;
15 |
16 | private static string _hash = "SHA1";
17 | private static string _salt = "qyotvsvbitb1fh70"; // Random
18 | private static string _vector = "wgcsg7si5sbspunf"; // Random
19 |
20 | #endregion
21 |
22 | public static string Encrypt(string value, string password)
23 | {
24 | return Encrypt(value, password);
25 | }
26 | public static string Encrypt(string value, string password)
27 | where T : SymmetricAlgorithm, new()
28 | {
29 | byte[] vectorBytes = ASCIIEncoding.ASCII.GetBytes(_vector);
30 | byte[] saltBytes = ASCIIEncoding.ASCII.GetBytes(_salt);
31 | byte[] valueBytes = UTF8Encoding.UTF8.GetBytes(value);
32 |
33 | byte[] encrypted;
34 | using (T cipher = new T())
35 | {
36 | PasswordDeriveBytes _passwordBytes =
37 | new PasswordDeriveBytes(password, saltBytes, _hash, _iterations);
38 | byte[] keyBytes = _passwordBytes.GetBytes(_keySize / 8);
39 |
40 | cipher.Mode = CipherMode.CBC;
41 |
42 | using (ICryptoTransform encryptor = cipher.CreateEncryptor(keyBytes, vectorBytes))
43 | {
44 | using (MemoryStream to = new MemoryStream())
45 | {
46 | using (CryptoStream writer = new CryptoStream(to, encryptor, CryptoStreamMode.Write))
47 | {
48 | writer.Write(valueBytes, 0, valueBytes.Length);
49 | writer.FlushFinalBlock();
50 | encrypted = to.ToArray();
51 | }
52 | }
53 | }
54 | cipher.Clear();
55 | }
56 | return Convert.ToBase64String(encrypted);
57 | }
58 |
59 | public static string Decrypt(string value, string password)
60 | {
61 | return Decrypt(value, password);
62 | }
63 | public static string Decrypt(string value, string password) where T : SymmetricAlgorithm, new()
64 | {
65 | byte[] vectorBytes = ASCIIEncoding.ASCII.GetBytes(_vector);
66 | byte[] saltBytes = ASCIIEncoding.ASCII.GetBytes(_salt);
67 | byte[] valueBytes = Convert.FromBase64String(value);
68 |
69 | byte[] decrypted;
70 | int decryptedByteCount = 0;
71 |
72 | using (T cipher = new T())
73 | {
74 | PasswordDeriveBytes _passwordBytes = new PasswordDeriveBytes(password, saltBytes, _hash, _iterations);
75 | byte[] keyBytes = _passwordBytes.GetBytes(_keySize / 8);
76 |
77 | cipher.Mode = CipherMode.CBC;
78 |
79 | try
80 | {
81 | using (ICryptoTransform decryptor = cipher.CreateDecryptor(keyBytes, vectorBytes))
82 | {
83 | using (MemoryStream from = new MemoryStream(valueBytes))
84 | {
85 | using (CryptoStream reader = new CryptoStream(from, decryptor, CryptoStreamMode.Read))
86 | {
87 | decrypted = new byte[valueBytes.Length];
88 | decryptedByteCount = reader.Read(decrypted, 0, decrypted.Length);
89 | }
90 | }
91 | }
92 | }
93 | catch (Exception)
94 | {
95 | return String.Empty;
96 | }
97 |
98 | cipher.Clear();
99 | }
100 | return Encoding.UTF8.GetString(decrypted, 0, decryptedByteCount);
101 | }
102 |
103 | }
104 | }
105 |
--------------------------------------------------------------------------------
/Steam Two/steamChatWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Shapes;
15 | using System.Windows.Threading;
16 |
17 | namespace SteamTwo
18 | {
19 | ///
20 | /// Interaction logic for steamChatWindow.xaml
21 | ///
22 | public partial class steamChatWindow
23 | {
24 | private DispatcherTimer dispatcherTimer;
25 | public string user = "";
26 |
27 | public steamChatWindow()
28 | {
29 | InitializeComponent();
30 | dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
31 | dispatcherTimer.Tick += dispatcherTimer_Tick;
32 | dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
33 | dispatcherTimer.Start();
34 | }
35 |
36 | public void Show(String username)
37 | {
38 | SteamBotController.chatOpen = true;
39 | user = username;
40 | Show();
41 | }
42 |
43 | //checks for chat message updates
44 | private void dispatcherTimer_Tick(object sender, EventArgs e)
45 | {
46 | updateFriendList();
47 | updateChatLog();
48 | }
49 |
50 | //update friends list
51 | public void updateFriendList()
52 | {
53 | int temp = friendsList1.SelectedIndex;
54 | friendsList1.Items.Clear();
55 | if (AccountController.getAccount(user).getFriendArray() != null)
56 | foreach (var item in AccountController.getAccount(user).getFriendArray())
57 | {
58 | Friend obj = (Friend)item;
59 | friendsList1.Items.Add(obj.getName());
60 | }
61 | friendsList1.SelectedIndex = temp;
62 | }
63 |
64 | //update chat
65 | public void updateChatLog()
66 | {
67 | chatLog1.Items.Clear();
68 | chatLog1.Items.Add(" ");
69 | //chatLog1.Items.RemoveAt(0);
70 | if (friendsList1.SelectedIndex != -1)
71 | {
72 | foreach (var item in AccountController.getAccount(user).getFriend(friendsList1.SelectedIndex).chatLog)
73 | {
74 | if (item.ToString().Length > 104)
75 | {
76 | chatLog1.Items.Add(item.ToString().Substring(0, 104));
77 | chatLog1.Items.Add(item.ToString().Substring(104, item.ToString().Length - 104));
78 | }
79 | else
80 | {
81 | chatLog1.Items.Add(item);
82 | }
83 |
84 | }
85 | }
86 | chatLog1.UpdateLayout();
87 | }
88 |
89 | //sends message
90 | public void sendMessage()
91 | {
92 | if (friendsList1.SelectedIndex != -1)
93 | {
94 | SteamBotController.sendChatMessage(AccountController.getAccount(user).getFriend(friendsList1.SelectedIndex).SteamIDObject, textbox1.Text);
95 | }
96 | }
97 |
98 | //send message enter is pressed
99 | private void textbox1_KeyDown(object sender, KeyEventArgs e)
100 | {
101 | if (e.Key.ToString().Equals("Return"))
102 | {
103 | sendMessage();
104 | textbox1.Text = "";
105 | }
106 | }
107 |
108 | //send button is clicked
109 | private void Button_Click(object sender, RoutedEventArgs e)
110 | {
111 | sendMessage();
112 | textbox1.Text = "";
113 | }
114 |
115 | //since wpf u cant check windows state, just to keep track is chat window is focused and its checked from steam bot thread
116 | private void MetroWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
117 | {
118 | SteamBotController.chatOpen = false;
119 | }
120 |
121 | private void MetroWindow_Deactivated(object sender, EventArgs e)
122 | {
123 | SteamBotController.chatOpen = false;
124 | }
125 |
126 | private void MetroWindow_Activated(object sender, EventArgs e)
127 | {
128 | SteamBotController.chatOpen = true;
129 | }
130 | }
131 | }
--------------------------------------------------------------------------------
/Steam Two/Settings.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/Steam Two/AccountController.cs:
--------------------------------------------------------------------------------
1 | using SteamKit2;
2 | using System;
3 | using System.Collections;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace SteamTwo
10 | {
11 |
12 | static class AccountController
13 | {
14 | //array of the accounts
15 | public static ArrayList userAccounts = new ArrayList();
16 |
17 | //add account to unserAccounts, only adds if the account doesnt exist
18 | public static void addAccount(String paraUsername, String paraPassword, bool paraDesktopAuth)
19 | {
20 | bool found = false;
21 | foreach (var item in userAccounts)
22 | {
23 | UserAccount temp = (UserAccount)item;
24 | if (temp.username.ToLower().Equals(paraUsername.ToLower()))
25 | {
26 | found = true;
27 | }
28 | }
29 | if (!found)
30 | {
31 | userAccounts.Add(new UserAccount { username = paraUsername, password = paraPassword, desktopAuth = paraDesktopAuth });
32 | }
33 | }
34 |
35 | //returns account if it exist or return null
36 | public static UserAccount getAccount(String username)
37 | {
38 | foreach (var item in userAccounts)
39 | {
40 | UserAccount temp = (UserAccount)item;
41 | if (temp.username.ToLower().Equals(username.ToLower()))
42 | {
43 | return temp;
44 | }
45 | }
46 | return null;
47 | }
48 |
49 | //remove account
50 | public static void removeAccount(UserAccount account)
51 | {
52 | userAccounts.Remove(account);
53 | }
54 | }
55 |
56 | class UserAccount
57 | {
58 | public string username { get; set; }
59 | public string password { get; set; }
60 | public bool desktopAuth { get; set; } //if SDA ( steam desktop auth is enabled)
61 |
62 | ArrayList friendArray = new ArrayList();
63 |
64 | //add friend to array if it doesnt exist
65 | public void AddFriend(Friend item)
66 | {
67 | bool found = false;
68 | foreach (Friend var in friendArray)
69 | {
70 | Friend temp = (Friend)var;
71 | if (temp.steamFrindsID.ToLower().Equals(item.steamFrindsID.ToLower()))
72 | {
73 | found = true;
74 | }
75 | }
76 | if (!found)
77 | {
78 | friendArray.Add(item);
79 | }
80 | }
81 |
82 | //set name
83 | public void setFriendsName(Friend input)
84 | {
85 | foreach (var item in friendArray)
86 | {
87 |
88 | Friend temp = (Friend)item;
89 | if (temp.steamFrindsID.Equals(input.steamFrindsID))
90 | {
91 | temp.name = input.name;
92 |
93 | }
94 | }
95 | }
96 |
97 | //returns friends name
98 | public string getFriendsName(Friend input)
99 | {
100 | foreach (var item in friendArray)
101 | {
102 | Friend temp = (Friend)item;
103 | if (temp.steamFrindsID.Equals(input.steamFrindsID))
104 | {
105 | return temp.name;
106 |
107 | }
108 | }
109 | return "";
110 | }
111 |
112 | //update friends chat logs
113 | public void updateChatLogs(Friend input, String mgs, bool outgoing)
114 | {
115 | foreach (var item in friendArray)
116 | {
117 |
118 | Friend temp = (Friend)item;
119 | if (temp.steamFrindsID.Equals(input.steamFrindsID))
120 | {
121 | if (outgoing)
122 | {
123 | temp.newMessage("Me", mgs);
124 | }
125 | else
126 | {
127 | temp.newMessage(temp.name, mgs);
128 | }
129 |
130 | }
131 | }
132 | }
133 |
134 | //get friend from index
135 | public Friend getFriend(int index)
136 | {
137 | return (Friend)friendArray[index];
138 | }
139 |
140 | //get whole friend array
141 | public ArrayList getFriendArray()
142 | {
143 | return friendArray;
144 | }
145 | }
146 |
147 | class Friend
148 | {
149 | public string name { get; set; }
150 | public string steamFrindsID { get; set; }
151 | public ArrayList chatLog { get; set; }
152 | public SteamID SteamIDObject { get; set; }
153 |
154 | //returns custom name
155 | public string getName()
156 | {
157 | return name;
158 | }
159 |
160 | //add msg to chat log
161 | public void newMessage(String n, String msg)
162 | {
163 | chatLog.Add(n + ": " + msg);
164 | }
165 |
166 | //returns steam ID
167 | public string getId()
168 | {
169 | return steamFrindsID;
170 | }
171 | }
172 | }
173 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 | *.file
10 |
11 | # User-specific files (MonoDevelop/Xamarin Studio)
12 | *.userprefs
13 |
14 | # Build results
15 | [Dd]ebug/
16 | [Dd]ebugPublic/
17 | [Rr]elease/
18 | [Rr]eleases/
19 | x64/
20 | x86/
21 | bld/
22 | [Bb]in/
23 | [Oo]bj/
24 | [Ll]og/
25 |
26 | # Visual Studio 2015 cache/options directory
27 | .vs/
28 | # Uncomment if you have tasks that create the project's static files in wwwroot
29 | #wwwroot/
30 |
31 | # MSTest test Results
32 | [Tt]est[Rr]esult*/
33 | [Bb]uild[Ll]og.*
34 |
35 | # NUNIT
36 | *.VisualState.xml
37 | TestResult.xml
38 |
39 | # Build Results of an ATL Project
40 | [Dd]ebugPS/
41 | [Rr]eleasePS/
42 | dlldata.c
43 |
44 | # DNX
45 | project.lock.json
46 | project.fragment.lock.json
47 | artifacts/
48 |
49 | *_i.c
50 | *_p.c
51 | *_i.h
52 | *.ilk
53 | *.meta
54 | *.obj
55 | *.pch
56 | *.pdb
57 | *.pgc
58 | *.pgd
59 | *.rsp
60 | *.sbr
61 | *.tlb
62 | *.tli
63 | *.tlh
64 | *.tmp
65 | *.tmp_proj
66 | *.log
67 | *.vspscc
68 | *.vssscc
69 | .builds
70 | *.pidb
71 | *.svclog
72 | *.scc
73 |
74 | # Chutzpah Test files
75 | _Chutzpah*
76 |
77 | # Visual C++ cache files
78 | ipch/
79 | *.aps
80 | *.ncb
81 | *.opendb
82 | *.opensdf
83 | *.sdf
84 | *.cachefile
85 | *.VC.db
86 | *.VC.VC.opendb
87 |
88 | # Visual Studio profiler
89 | *.psess
90 | *.vsp
91 | *.vspx
92 | *.sap
93 |
94 | # TFS 2012 Local Workspace
95 | $tf/
96 |
97 | # Guidance Automation Toolkit
98 | *.gpState
99 |
100 | # ReSharper is a .NET coding add-in
101 | _ReSharper*/
102 | *.[Rr]e[Ss]harper
103 | *.DotSettings.user
104 |
105 | # JustCode is a .NET coding add-in
106 | .JustCode
107 |
108 | # TeamCity is a build add-in
109 | _TeamCity*
110 |
111 | # DotCover is a Code Coverage Tool
112 | *.dotCover
113 |
114 | # NCrunch
115 | _NCrunch_*
116 | .*crunch*.local.xml
117 | nCrunchTemp_*
118 |
119 | # MightyMoose
120 | *.mm.*
121 | AutoTest.Net/
122 |
123 | # Web workbench (sass)
124 | .sass-cache/
125 |
126 | # Installshield output folder
127 | [Ee]xpress/
128 |
129 | # DocProject is a documentation generator add-in
130 | DocProject/buildhelp/
131 | DocProject/Help/*.HxT
132 | DocProject/Help/*.HxC
133 | DocProject/Help/*.hhc
134 | DocProject/Help/*.hhk
135 | DocProject/Help/*.hhp
136 | DocProject/Help/Html2
137 | DocProject/Help/html
138 |
139 | # Click-Once directory
140 | publish/
141 |
142 | # Publish Web Output
143 | *.[Pp]ublish.xml
144 | *.azurePubxml
145 | # TODO: Comment the next line if you want to checkin your web deploy settings
146 | # but database connection strings (with potential passwords) will be unencrypted
147 | #*.pubxml
148 | *.publishproj
149 |
150 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
151 | # checkin your Azure Web App publish settings, but sensitive information contained
152 | # in these scripts will be unencrypted
153 | PublishScripts/
154 |
155 | # NuGet Packages
156 | *.nupkg
157 | # The packages folder can be ignored because of Package Restore
158 | **/packages/*
159 | # except build/, which is used as an MSBuild target.
160 | !**/packages/build/
161 | # Uncomment if necessary however generally it will be regenerated when needed
162 | #!**/packages/repositories.config
163 | # NuGet v3's project.json files produces more ignoreable files
164 | *.nuget.props
165 | *.nuget.targets
166 |
167 | # Microsoft Azure Build Output
168 | csx/
169 | *.build.csdef
170 |
171 | # Microsoft Azure Emulator
172 | ecf/
173 | rcf/
174 |
175 | # Windows Store app package directories and files
176 | AppPackages/
177 | BundleArtifacts/
178 | Package.StoreAssociation.xml
179 | _pkginfo.txt
180 |
181 | # Visual Studio cache files
182 | # files ending in .cache can be ignored
183 | *.[Cc]ache
184 | # but keep track of directories ending in .cache
185 | !*.[Cc]ache/
186 |
187 | # Others
188 | ClientBin/
189 | ~$*
190 | *~
191 | *.dbmdl
192 | *.dbproj.schemaview
193 | *.jfm
194 | *.pfx
195 | *.publishsettings
196 | node_modules/
197 | orleans.codegen.cs
198 |
199 | # Since there are multiple workflows, uncomment next line to ignore bower_components
200 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
201 | #bower_components/
202 |
203 | # RIA/Silverlight projects
204 | Generated_Code/
205 |
206 | # Backup & report files from converting an old project file
207 | # to a newer Visual Studio version. Backup files are not needed,
208 | # because we have git ;-)
209 | _UpgradeReport_Files/
210 | Backup*/
211 | UpgradeLog*.XML
212 | UpgradeLog*.htm
213 |
214 | # SQL Server files
215 | *.mdf
216 | *.ldf
217 |
218 | # Business Intelligence projects
219 | *.rdl.data
220 | *.bim.layout
221 | *.bim_*.settings
222 |
223 | # Microsoft Fakes
224 | FakesAssemblies/
225 |
226 | # GhostDoc plugin setting file
227 | *.GhostDoc.xml
228 |
229 | # Node.js Tools for Visual Studio
230 | .ntvs_analysis.dat
231 |
232 | # Visual Studio 6 build log
233 | *.plg
234 |
235 | # Visual Studio 6 workspace options file
236 | *.opt
237 |
238 | # Visual Studio LightSwitch build output
239 | **/*.HTMLClient/GeneratedArtifacts
240 | **/*.DesktopClient/GeneratedArtifacts
241 | **/*.DesktopClient/ModelManifest.xml
242 | **/*.Server/GeneratedArtifacts
243 | **/*.Server/ModelManifest.xml
244 | _Pvt_Extensions
245 |
246 | # Paket dependency manager
247 | .paket/paket.exe
248 | paket-files/
249 |
250 | # FAKE - F# Make
251 | .fake/
252 |
253 | # JetBrains Rider
254 | .idea/
255 | *.sln.iml
256 |
257 | # CodeRush
258 | .cr/
259 |
260 | # Python Tools for Visual Studio (PTVS)
261 | __pycache__/
262 | *.pyc
263 |
--------------------------------------------------------------------------------
/Steam Two/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/SteamTwo Launcher/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/Steam Two/BotMainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.IO;
4 | using System.Threading;
5 | using System.Windows;
6 | using System.Windows.Controls;
7 | using System.Windows.Threading;
8 |
9 | namespace SteamTwo
10 | {
11 | ///
12 | /// Interaction logic for BotMainWindow.xaml
13 | ///
14 | public partial class BotMainWindow
15 | {
16 | private const string STEAM_BOOST_DIRECTORY = "steamBoost\\";
17 | private const string STEAM_GAME_CONTROLLER = STEAM_BOOST_DIRECTORY + "steamGameControl.exe"; //https://github.com/vishwenga/Steam-Boost/tree/master/steamGameControl
18 | private const string SAM_GAME = STEAM_BOOST_DIRECTORY + "SAM.Game.exe";
19 |
20 | private string gameListFile = "-game-list.txt";
21 |
22 | public BotMainWindow()
23 | {
24 | InitializeComponent();
25 | }
26 |
27 | string username; // log in on the bot with username and password
28 | public void Show(string u, string p, MainWindow backHandle)
29 | {
30 | logIn1.IsEnabled = false;
31 | logOut1.IsEnabled = true;
32 |
33 | this.username = u;
34 | gameListFile = username + gameListFile;
35 | Show();
36 | do
37 | {
38 | Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, new Action(delegate { }));
39 | } while (!_shown && !SteamBotController.loggedIn);
40 | SteamBotController.steamLogin(username, p);
41 | initLogics();
42 | label1.Content = "Logged into: " + username;
43 | openChat1.IsEnabled = SteamTwoProperties.jsonSetting.chatSetting;
44 | if (SteamTwoProperties.jsonSetting.chatComSetting)
45 | {
46 | label3.Content = "Chat Commands: On";
47 | }
48 | else
49 | {
50 | label3.Content = "Chat Commands: Off";
51 | }
52 | }
53 |
54 | //checks if the game file is there and reads it, if not found it open steam boost and generate game lsit
55 | private void initLogics()
56 | {
57 | if (File.Exists(STEAM_GAME_CONTROLLER))
58 | {
59 | if (!File.Exists(gameListFile))
60 | {
61 | do
62 | {
63 | Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, new Action(delegate { }));
64 | } while (!SteamBotController.loggedIn);
65 | generateGames();
66 | }
67 | getGamesFromFile();
68 | }
69 | else
70 | {
71 | System.Windows.Forms.MessageBox.Show("FILES MISSING >> download at \n https://github.com/vishwenga/Steam-Boost/."
72 | + " \n\n\n MISSING FOLDER >> \n\n"
73 | + Environment.CurrentDirectory.ToString() + STEAM_BOOST_DIRECTORY
74 | + " \n\n\n MISSING FILES IN FOLDER >> \n\n"
75 | + Environment.CurrentDirectory.ToString() + STEAM_GAME_CONTROLLER + "\n\n"
76 | + Environment.CurrentDirectory.ToString() + SAM_GAME + "\n\n"
77 | + Environment.CurrentDirectory.ToString() + "\\steamBoost\\CSteamworks.dll \n\n"
78 | + Environment.CurrentDirectory.ToString() + "\\steamBoost\\Newtonsoft.Json.dll \n\n"
79 | + Environment.CurrentDirectory.ToString() + "\\steamBoost\\Newtonsoft.Json.xml \n\n"
80 | + Environment.CurrentDirectory.ToString() + "\\steamBoost\\steam_api.dll \n\n"
81 | + Environment.CurrentDirectory.ToString() + "\\steamBoost\\Steamworks.NET.dll \n\n");
82 |
83 | Close();
84 | }
85 |
86 | }
87 |
88 | //generate games
89 | private void generateGames()
90 | {
91 | try
92 | {
93 | Process.Start(new ProcessStartInfo(STEAM_GAME_CONTROLLER, "botgamelist " + SteamBotController.getSteamUserID() + " " + username));
94 | }
95 | catch (Exception) { }
96 | do
97 | {
98 | Thread.Sleep(2000);
99 | } while (!File.Exists(gameListFile));
100 | }
101 |
102 | //gets game list from file
103 | private void getGamesFromFile()
104 | {
105 | string[] gameList = System.IO.File.ReadAllLines(gameListFile);
106 | foreach (string game in gameList)
107 | {
108 | listView1.Items.Add(new ListViewItem() { Content = game.Split('`')[1], Tag = game.Split('`')[0] });
109 | }
110 | }
111 |
112 | //log out is clicked
113 | private void logOut1_Click(object sender, RoutedEventArgs e)
114 | {
115 | label1.Content = "Logged off...";
116 | SteamBotController.logBotOff();
117 | logIn1.IsEnabled = true;
118 | logOut1.IsEnabled = false;
119 | }
120 |
121 | //log in is clicked
122 | private void logIn1_Click(object sender, RoutedEventArgs e)
123 | {
124 | if (!SteamBotController.loggedIn)
125 | {
126 | label1.Content = "Logged into: " + username;
127 | SteamBotController.logBotIn();
128 | logIn1.IsEnabled = false;
129 | logOut1.IsEnabled = true;
130 | }
131 | }
132 |
133 | //end bot is clicked
134 | private void endBot1_Click(object sender, RoutedEventArgs e)
135 | {
136 | SteamBotController.logBotOff();
137 | Close();
138 | }
139 |
140 | //back button
141 | private void backButton(object sender, RoutedEventArgs e)
142 | {
143 | if (settingButton.Content.Equals("Back to Main Page"))
144 | {
145 | MainWindow.currentHandle.Show();
146 | settingButton.Content = "Hide Main Page";
147 | }
148 | else
149 | {
150 | MainWindow.currentHandle.Hide();
151 | settingButton.Content = "Back to Main Page";
152 | }
153 | }
154 |
155 | //when bot window is closing
156 | private void MetroWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
157 | {
158 | SteamBotController.logBotOff();
159 | MainWindow.currentHandle.Show();
160 | }
161 |
162 | private void storePage1_Click(object sender, RoutedEventArgs e)
163 | {
164 | if (listView1.SelectedItem != null)
165 | {
166 | ListViewItem item = new ListViewItem();
167 | item = (ListViewItem)listView1.SelectedItem;
168 | Process.Start("https://store.steampowered.com/app/" + item.Tag.ToString());
169 | }
170 | }
171 |
172 | bool _shown; //wiat form is shown
173 | protected override void OnContentRendered(EventArgs e)
174 | {
175 | base.OnContentRendered(e);
176 |
177 | if (_shown)
178 | return;
179 | _shown = true;
180 | }
181 |
182 | //open button is clicked
183 | private void openChat1_Click(object sender, RoutedEventArgs e)
184 | {
185 | steamChatWindow SCW = new steamChatWindow();
186 | SCW.Show(username);
187 | }
188 |
189 | //idle button is clicked
190 | private void idle1_Click(object sender, RoutedEventArgs e)
191 | {
192 | if (listView1.SelectedItem != null)
193 | {
194 | ListViewItem item = new ListViewItem();
195 | item = (ListViewItem)listView1.SelectedItem;
196 | int temp;
197 | int.TryParse(item.Tag.ToString(), out temp);
198 | SteamBotController.playGame(temp);
199 | }
200 | }
201 | }
202 | }
203 |
--------------------------------------------------------------------------------
/Steam Two/ToolWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using System.Diagnostics;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading;
9 | using System.Threading.Tasks;
10 | using System.Windows;
11 | using System.Windows.Controls;
12 | using System.Windows.Data;
13 | using System.Windows.Documents;
14 | using System.Windows.Input;
15 | using System.Windows.Media;
16 | using System.Windows.Media.Imaging;
17 | using System.Windows.Shapes;
18 | using System.Windows.Threading;
19 |
20 | namespace SteamTwo
21 | {
22 | ///
23 | /// Interaction logic for ToolKit.xaml
24 | ///
25 | public partial class ToolKit
26 | {
27 | private const String STEAM_BOOST_DIRECTORY = "steamBoost\\";
28 | private const String STEAM_GAME_CONTROLLER = STEAM_BOOST_DIRECTORY + "steamGameControl.exe"; //https://github.com/vishwenga/Steam-Boost/tree/master/steamGameControl
29 | private const String GAME_LIST_FILE = "game-list.txt";
30 | private const String SAM_GAME = STEAM_BOOST_DIRECTORY + "SAM.Game.exe";
31 |
32 | private bool idleStoper = false; //mostly for spam is checked
33 | private ArrayList runningProc = new ArrayList();
34 |
35 | public ToolKit()
36 | {
37 | InitializeComponent();
38 | }
39 |
40 | private void initLogics()
41 | {
42 | if (File.Exists(STEAM_GAME_CONTROLLER))
43 | {
44 | if (!File.Exists(GAME_LIST_FILE))
45 | {
46 | generateGames();
47 | }
48 | getGamesFromFile();
49 | }
50 | else
51 | {
52 | System.Windows.Forms.MessageBox.Show("FILES MISSING >> download at \n https://github.com/vishwenga/Steam-Boost/."
53 | + " \n\n\n MISSING FOLDER >> \n\n"
54 | + Environment.CurrentDirectory.ToString() + STEAM_BOOST_DIRECTORY
55 | + " \n\n\n MISSING FILES IN FOLDER >> \n\n"
56 | + Environment.CurrentDirectory.ToString() + STEAM_GAME_CONTROLLER + "\n\n"
57 | + Environment.CurrentDirectory.ToString() + SAM_GAME + "\n\n"
58 | + Environment.CurrentDirectory.ToString() + "\\steamBoost\\CSteamworks.dll \n\n"
59 | + Environment.CurrentDirectory.ToString() + "\\steamBoost\\Newtonsoft.Json.dll \n\n"
60 | + Environment.CurrentDirectory.ToString() + "\\steamBoost\\Newtonsoft.Json.xml \n\n"
61 | + Environment.CurrentDirectory.ToString() + "\\steamBoost\\steam_api.dll \n\n"
62 | + Environment.CurrentDirectory.ToString() + "\\steamBoost\\Steamworks.NET.dll \n\n");
63 |
64 | Close();
65 | }
66 |
67 | }
68 |
69 | //genereate game list file
70 | private void generateGames()
71 | {
72 | try
73 | {
74 | Process.Start(new ProcessStartInfo(STEAM_GAME_CONTROLLER, "gamelist"));
75 | }
76 | catch (Exception) { }
77 | Hide();
78 | do
79 | {
80 | Thread.Sleep(2000);
81 | } while (!File.Exists(GAME_LIST_FILE));
82 | Show();
83 | }
84 |
85 | //read games from file
86 | private void getGamesFromFile()
87 | {
88 | string[] gameList = System.IO.File.ReadAllLines(GAME_LIST_FILE);
89 | foreach (string game in gameList)
90 | {
91 | listView1.Items.Add(new ListViewItem() { Content = game.Split('`')[1], Tag = game.Split('`')[0] });
92 | }
93 | }
94 |
95 | //back button
96 | private void backButton(object sender, RoutedEventArgs e)
97 | {
98 | if (settingButton.Content.ToString().Equals("Back to Main Page"))
99 | {
100 | MainWindow.currentHandle.Show();
101 | settingButton.Content = "Hide Main Page";
102 | }
103 | else
104 | {
105 | MainWindow.currentHandle.Hide();
106 | settingButton.Content = "Back to Main Page";
107 | }
108 | }
109 |
110 | public void Show(MainWindow backHandle)
111 | {
112 | Show();
113 | initLogics();
114 | }
115 |
116 | //when form is closing
117 | private void MetroWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
118 | {
119 | killRunningProc();
120 | MainWindow.currentHandle.Show();
121 | }
122 |
123 | //store page is clicked
124 | private void storePage1_Click(object sender, RoutedEventArgs e)
125 | {
126 | if (listView1.SelectedItem != null)
127 | {
128 | ListViewItem item = new ListViewItem();
129 | item = (ListViewItem)listView1.SelectedItem;
130 | Process.Start("https://store.steampowered.com/app/" + item.Tag.ToString());
131 | }
132 | }
133 |
134 | //achievement is clicked
135 | private void achievements1_Click(object sender, RoutedEventArgs e)
136 | {
137 | if (listView1.SelectedItem != null)
138 | {
139 | ListViewItem item = new ListViewItem();
140 | item = (ListViewItem)listView1.SelectedItem;
141 | Process.Start(new ProcessStartInfo(SAM_GAME, item.Tag.ToString()));
142 | }
143 | }
144 |
145 | //launch game is lcicked
146 | private void launch1_Click(object sender, RoutedEventArgs e)
147 | {
148 |
149 | if (listView1.SelectedItem != null)
150 | {
151 | ListViewItem item = new ListViewItem();
152 | item = (ListViewItem)listView1.SelectedItem;
153 | Process.Start("steam://rungameid/" + item.Tag.ToString());
154 | WindowState = WindowState.Minimized;
155 | }
156 | }
157 |
158 | //idle is clicked
159 | private async void idle1_Click(object sender, RoutedEventArgs e)
160 | {
161 | killRunningProc();
162 | idleStoper = false;
163 | if (listView1.SelectedItem != null)
164 | {
165 | if ((bool)Spam.IsChecked)
166 | {
167 | do
168 | {
169 | startIdler(true);
170 | await Task.Delay(30000);
171 | killRunningProc();
172 | await Task.Delay(5000);
173 |
174 | } while (!idleStoper);
175 | }
176 | else
177 | {
178 | startIdler(false);
179 | }
180 | }
181 | }
182 |
183 | //actaully start idle.exe
184 | private async void startIdler(bool delayed)
185 | {
186 | foreach (ListViewItem item in listView1.SelectedItems)
187 | {
188 | if (delayed)
189 | await Task.Delay(4000);
190 | runningProc.Add(Process.Start(new ProcessStartInfo(STEAM_GAME_CONTROLLER, item.Tag.ToString()) { WindowStyle = ProcessWindowStyle.Hidden }));
191 | }
192 | }
193 |
194 | //stop idle clicked
195 | private void stopIdle1_Click(object sender, RoutedEventArgs e)
196 | {
197 | idleStoper = true;
198 | killRunningProc();
199 | }
200 |
201 | //kill idle processed
202 | private void killRunningProc()
203 | {
204 | if (runningProc.Count > 0)
205 | {
206 | foreach (var item in runningProc)
207 | {
208 | Process tempp = (Process)item;
209 | try
210 | {
211 | tempp.Kill();
212 | }
213 | catch (Exception) { }
214 | }
215 | runningProc.Clear();
216 | }
217 | }
218 |
219 | private void Refresh_Click(object sender, RoutedEventArgs e)
220 | {
221 | idleStoper = true;
222 | killRunningProc();
223 | File.Delete(GAME_LIST_FILE);
224 | generateGames();
225 | }
226 | }
227 | }
228 |
--------------------------------------------------------------------------------
/Steam Two/SteamTwo.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {DCC72F43-FFAE-4F1E-86DA-9D437BBCCFCB}
8 | WinExe
9 | SteamTwo
10 | Steam Two
11 | v4.6.1
12 | 512
13 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
14 | 4
15 | true
16 |
17 |
18 | AnyCPU
19 | true
20 | full
21 | false
22 | bin\Debug\
23 | DEBUG;TRACE
24 | prompt
25 | 4
26 |
27 |
28 | AnyCPU
29 | pdbonly
30 | true
31 | bin\Release\
32 | TRACE
33 | prompt
34 | 4
35 |
36 |
37 | side.ico
38 |
39 |
40 | SteamTwo.App
41 |
42 |
43 |
44 | ..\packages\ControlzEx.3.0.2.4\lib\net45\ControlzEx.dll
45 |
46 |
47 | ..\packages\MahApps.Metro.1.6.5\lib\net46\MahApps.Metro.dll
48 |
49 |
50 | ..\packages\Microsoft.Win32.Registry.4.4.0\lib\net461\Microsoft.Win32.Registry.dll
51 |
52 |
53 | ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll
54 |
55 |
56 |
57 | ..\packages\protobuf-net.2.1.0\lib\net451\protobuf-net.dll
58 |
59 |
60 | ..\packages\SteamKit2.2.0.0\lib\netstandard2.0\SteamKit2.dll
61 |
62 |
63 |
64 |
65 |
66 | ..\packages\System.Security.AccessControl.4.4.0\lib\net461\System.Security.AccessControl.dll
67 |
68 |
69 | ..\packages\System.Security.Principal.Windows.4.4.0\lib\net461\System.Security.Principal.Windows.dll
70 |
71 |
72 |
73 |
74 | ..\packages\ControlzEx.3.0.2.4\lib\net45\System.Windows.Interactivity.dll
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 | 4.0
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 | MSBuild:Compile
94 | Designer
95 |
96 |
97 | AddAccount.xaml
98 |
99 |
100 | BotMainWindow.xaml
101 |
102 |
103 |
104 | GetInput.xaml
105 |
106 |
107 |
108 | Settings.xaml
109 |
110 |
111 |
112 | steamChatWindow.xaml
113 |
114 |
115 | ToolWindow.xaml
116 |
117 |
118 | Designer
119 | MSBuild:Compile
120 |
121 |
122 | Designer
123 | MSBuild:Compile
124 |
125 |
126 | Designer
127 | MSBuild:Compile
128 |
129 |
130 | MSBuild:Compile
131 | Designer
132 |
133 |
134 | App.xaml
135 | Code
136 |
137 |
138 |
139 | MainWindow.xaml
140 | Code
141 |
142 |
143 | Designer
144 | MSBuild:Compile
145 |
146 |
147 | Designer
148 | MSBuild:Compile
149 |
150 |
151 | Designer
152 | MSBuild:Compile
153 |
154 |
155 |
156 |
157 | Code
158 |
159 |
160 | True
161 | True
162 | Resources.resx
163 |
164 |
165 | True
166 | Settings.settings
167 | True
168 |
169 |
170 | ResXFileCodeGenerator
171 | Resources.Designer.cs
172 |
173 |
174 |
175 | SettingsSingleFileGenerator
176 | Settings.Designer.cs
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
--------------------------------------------------------------------------------
/Steam Two/Settings.xaml.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Diagnostics;
4 | using System.IO;
5 | using System.Windows;
6 | using System.Windows.Controls;
7 |
8 | class SettingJson
9 | {
10 | public bool encryptedSetting { get; set; }
11 | public bool autoAddFriendSetting { get; set; }
12 | public bool chatComSetting { get; set; }
13 | public string encryptedKeySetting { get; set; }
14 | public bool closeStemLaunchSetting { get; set; }
15 | public bool copyPasswordSetting { get; set; }
16 | public bool multipleBotSetting { get; set; }
17 | public bool badAttemptSetting { get; set; }
18 | public bool chatSetting { get; set; }
19 | public bool autoStartSetting { get; set; }
20 | public bool autoLoginSetting { get; set; }
21 | public bool notifyOnMessageSetting { get; set; }
22 | public string SDALinkSetting { get; set; }
23 | public string selectedAccountSetting { get; set; }
24 | public bool forwardCheckSetting { get; set; }
25 | public string forwardSetting { get; set; }
26 | public string steamLocation { get; set; }
27 | }
28 |
29 | static class SteamTwoProperties
30 | {
31 | private const string SETTING_FILE = "SteamTwoSetting.config";
32 | public static SettingJson jsonSetting = null;
33 |
34 | //init settings
35 | static SteamTwoProperties()
36 | {
37 | if (File.Exists(SETTING_FILE))
38 | {
39 | try
40 | {
41 | readSettingFile();
42 | }
43 | catch (Exception)
44 | {
45 | System.Windows.Forms.MessageBox.Show("Error reading settings, settings have been reset");
46 | reset();
47 | updateSettingFile();
48 | }
49 | }
50 | else
51 | {
52 | reset();
53 | updateSettingFile();
54 | }
55 | }
56 |
57 | //reset resstings
58 | public static void reset()
59 | {
60 | jsonSetting = new SettingJson()
61 | {
62 | encryptedSetting = false,
63 | autoAddFriendSetting = false,
64 | chatComSetting = false,
65 | encryptedKeySetting = "FteUuLPNgH2K7YjGhHbPGw==",
66 | closeStemLaunchSetting = false,
67 | copyPasswordSetting = false,
68 | multipleBotSetting = false,
69 | badAttemptSetting = true,
70 | chatSetting = false,
71 | autoStartSetting = false,
72 | autoLoginSetting = false,
73 | notifyOnMessageSetting = false,
74 | SDALinkSetting = "",
75 | selectedAccountSetting = "",
76 | forwardCheckSetting = false,
77 | forwardSetting = "",
78 | steamLocation = "C:\\Program Files (x86)\\Steam\\Steam.exe"
79 | };
80 | }
81 |
82 | //update seetting file
83 | public static void updateSettingFile()
84 | {
85 | string json = JsonConvert.SerializeObject(jsonSetting);
86 | System.IO.File.WriteAllText(SETTING_FILE, json);
87 | }
88 |
89 | //read settings from setting files
90 | public static void readSettingFile()
91 | {
92 | try
93 | {
94 | var JsonData = JsonConvert.DeserializeObject(File.ReadAllText(SETTING_FILE));
95 | jsonSetting = JsonData;
96 | }
97 | catch (Exception)
98 | {
99 | SteamTwoProperties.reset();
100 | SteamTwoProperties.updateSettingFile();
101 | }
102 | }
103 | }
104 |
105 | namespace SteamTwo
106 | {
107 | ///
108 | /// Interaction logic for Settings.xaml
109 | ///
110 | public partial class Settings
111 | {
112 |
113 |
114 | public Settings()
115 | {
116 | InitializeComponent();
117 | }
118 |
119 | public void Show(string cond)
120 | {
121 | Show();
122 | updateGUI();
123 | switch (cond.ToLower())
124 | {
125 | case "find steam": SteamLink.Content = "Click here to locate Steam.exe"; break;
126 | default: break;
127 | }
128 | }
129 |
130 | //updates gui according to currentsettings
131 | private void updateGUI()
132 | {
133 | comboBoxLogin.Items.Clear();
134 | Forward2.IsChecked = SteamTwoProperties.jsonSetting.forwardCheckSetting;
135 | enableChat.IsChecked = SteamTwoProperties.jsonSetting.chatSetting;
136 | autoStart.IsChecked = SteamTwoProperties.jsonSetting.autoStartSetting;
137 | autoLogin.IsChecked = SteamTwoProperties.jsonSetting.autoLoginSetting;
138 | badAttempt.IsChecked = SteamTwoProperties.jsonSetting.badAttemptSetting;
139 | multipleBots.IsChecked = SteamTwoProperties.jsonSetting.multipleBotSetting;
140 | copyPassword.IsChecked = SteamTwoProperties.jsonSetting.copyPasswordSetting;
141 | closeStemLaunch.IsChecked = SteamTwoProperties.jsonSetting.closeStemLaunchSetting;
142 | autoAddFriends.IsChecked = SteamTwoProperties.jsonSetting.autoAddFriendSetting;
143 | enableEncryption.IsChecked = SteamTwoProperties.jsonSetting.encryptedSetting;
144 | changeKey.IsEnabled = SteamTwoProperties.jsonSetting.encryptedSetting;
145 | chatCommand.IsEnabled = SteamTwoProperties.jsonSetting.chatComSetting;
146 | chatCommandButton.IsChecked = SteamTwoProperties.jsonSetting.chatComSetting;
147 | notifyOnMessage.IsChecked = SteamTwoProperties.jsonSetting.notifyOnMessageSetting;
148 | SteamLink.Content = SteamTwoProperties.jsonSetting.steamLocation;
149 | if (SteamTwoProperties.jsonSetting.SDALinkSetting.Equals(""))
150 | {
151 | Link.Content = "Link";
152 | }
153 | else
154 | {
155 | Link.Content = "Linked";
156 | }
157 | foreach (var item in AccountController.userAccounts)
158 | {
159 | UserAccount acc = (UserAccount)item;
160 | comboBoxLogin.Items.Add(acc.username);
161 | }
162 | comboBoxLogin.Text = SteamTwoProperties.jsonSetting.selectedAccountSetting;
163 | if (!SteamTwoProperties.jsonSetting.forwardSetting.Equals(""))
164 | {
165 | Forward.Content = SteamTwoProperties.jsonSetting.forwardSetting;
166 | }
167 | else
168 | {
169 | Forward.Content = "No one";
170 | }
171 | }
172 |
173 | private void changeSteamLoc_Click(object sender, RoutedEventArgs e)
174 | {
175 | System.Windows.Forms.OpenFileDialog fd = new System.Windows.Forms.OpenFileDialog();
176 | if (fd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
177 | {
178 | SteamTwoProperties.jsonSetting.steamLocation = fd.FileName;
179 | }
180 | else
181 | {
182 | SteamTwoProperties.jsonSetting.steamLocation = "C:\\Program Files (x86)\\Steam\\Steam.exe";
183 | }
184 | SteamTwoProperties.updateSettingFile();
185 | updateGUI();
186 | }
187 |
188 | //change passkey
189 | private void changeKey_Click(object sender, RoutedEventArgs e)
190 | {
191 | changeKeyClicked();
192 | }
193 |
194 | //change pass key button pressed
195 | private void changeKeyClicked()
196 | {
197 | GetInput GI = new GetInput();
198 | string temp = GI.Show("Encryption", "Please enter the passkey below", false);
199 | GI.Close();
200 | MainWindow.setEncryptionKey(temp);
201 | MainWindow.writeAccountData();
202 |
203 | }
204 |
205 | //when settings changed
206 | private void settingsChanged(object sender, RoutedEventArgs e)
207 | {
208 |
209 | CheckBox item = (CheckBox)sender;
210 | //encryption
211 |
212 | SteamTwoProperties.jsonSetting.encryptedSetting = (bool)enableEncryption.IsChecked;
213 | if (SteamTwoProperties.jsonSetting.encryptedSetting == true && item.Name.ToString().Equals("enableEncryption"))
214 | {
215 | changeKeyClicked();
216 | }
217 |
218 | //auto start
219 | SteamTwoProperties.jsonSetting.autoStartSetting = (bool)autoStart.IsChecked;
220 | if (SteamTwoProperties.jsonSetting.autoStartSetting == true && item.Name.ToString().Equals("autoStart"))
221 | {
222 | createRegKey();
223 | }
224 | else if (SteamTwoProperties.jsonSetting.autoStartSetting != true && item.Name.ToString().Equals("autoStart"))
225 | {
226 | deleteRegKey();
227 | }
228 | SteamTwoProperties.jsonSetting.forwardCheckSetting = (bool)Forward2.IsChecked;
229 | SteamTwoProperties.jsonSetting.autoLoginSetting = (bool)autoLogin.IsChecked;
230 | SteamTwoProperties.jsonSetting.badAttemptSetting = (bool)badAttempt.IsChecked;
231 | SteamTwoProperties.jsonSetting.multipleBotSetting = (bool)multipleBots.IsChecked;
232 | SteamTwoProperties.jsonSetting.copyPasswordSetting = (bool)copyPassword.IsChecked;
233 | SteamTwoProperties.jsonSetting.closeStemLaunchSetting = (bool)closeStemLaunch.IsChecked;
234 | SteamTwoProperties.jsonSetting.chatComSetting = (bool)chatCommandButton.IsChecked;
235 | SteamTwoProperties.jsonSetting.chatSetting = (bool)enableChat.IsChecked;
236 | SteamTwoProperties.jsonSetting.autoAddFriendSetting = (bool)autoAddFriends.IsChecked;
237 | SteamTwoProperties.jsonSetting.notifyOnMessageSetting = (bool)notifyOnMessage.IsChecked;
238 | SteamTwoProperties.updateSettingFile();
239 | updateGUI();
240 | }
241 |
242 | //open launcher and enabled auto start
243 | private void createRegKey()
244 | {
245 | using (Process p = new Process())
246 | {
247 | p.StartInfo = new ProcessStartInfo { FileName = "SteamTwo Launcher.exe", Arguments = "on" };
248 | p.Start();
249 | }
250 | }
251 |
252 | //closes launcher and disable auto start
253 | private void deleteRegKey()
254 | {
255 | using (Process p = new Process())
256 | {
257 | p.StartInfo = new ProcessStartInfo { FileName = "SteamTwo Launcher.exe", Arguments = "off" };
258 | p.Start();
259 | }
260 | }
261 |
262 | //reset settings
263 | private void resetSettings_Click(object sender, RoutedEventArgs e)
264 | {
265 | SteamTwoProperties.reset();
266 | SteamTwoProperties.updateSettingFile();
267 | updateGUI();
268 | }
269 |
270 | private void SDALink(object sender, RoutedEventArgs e)
271 | {
272 | System.Windows.Forms.OpenFileDialog fd = new System.Windows.Forms.OpenFileDialog();
273 | if (fd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
274 | {
275 | SteamTwoProperties.jsonSetting.SDALinkSetting = fd.FileName;
276 | }
277 | else
278 | {
279 | SteamTwoProperties.jsonSetting.SDALinkSetting = "";
280 | }
281 | SteamTwoProperties.updateSettingFile();
282 | updateGUI();
283 | }
284 |
285 | private void Settings1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
286 | {
287 | SteamTwoProperties.updateSettingFile();
288 | }
289 |
290 | private void comboBoxLogin_DropDownClosed(object sender, EventArgs e)
291 | {
292 | SteamTwoProperties.jsonSetting.selectedAccountSetting = comboBoxLogin.Text;
293 | SteamTwoProperties.updateSettingFile();
294 | updateGUI();
295 | }
296 |
297 | private void Forward_Click(object sender, RoutedEventArgs e)
298 | {
299 | GetInput FBTN = new GetInput();
300 | string var = FBTN.Show("Forward Messages", "Enter steamID (STEAM_0:0:00000000) of the account the below", false);
301 | FBTN.Close();
302 | SteamTwoProperties.jsonSetting.forwardSetting = var;
303 | SteamTwoProperties.updateSettingFile();
304 | updateGUI();
305 | }
306 | }
307 | }
308 |
--------------------------------------------------------------------------------
/Steam Two/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Diagnostics;
4 | using System.IO;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 |
10 | namespace SteamTwo
11 | {
12 | ///
13 | /// Interaction logic for MainWindow.xaml
14 | ///
15 | public partial class MainWindow
16 | {
17 | private const String DEFUALT_KEY = "vishwawenga";
18 | private const String DEFUALT_KEY_TEST = "FteUuLPNgH2K7YjGhHbPGw==";
19 | private const String SAVE_FILE_NAME = "accounts.file";
20 |
21 | private static bool encrypted = false;
22 | private static String encryptionKey = DEFUALT_KEY;
23 |
24 | public static bool LaunchedViaStartup = false;
25 | public static MainWindow currentHandle = null;
26 |
27 | public MainWindow()
28 | {
29 | InitializeComponent();
30 | initVariables();
31 | initLogics();
32 | }
33 |
34 | private void initVariables()
35 | {
36 | LaunchedViaStartup = Environment.GetCommandLineArgs() != null && Environment.GetCommandLineArgs().Any(arg => arg.Equals("startup", StringComparison.CurrentCultureIgnoreCase));
37 | encrypted = SteamTwoProperties.jsonSetting.encryptedSetting;
38 | currentHandle = this;
39 | }
40 |
41 | //ask password and decrypt passwords and displays
42 | private void initLogics()
43 | {
44 | setupEncryptionKey(0, "Please enter the encryption key below");
45 | if (File.Exists(SAVE_FILE_NAME))
46 | {
47 | try
48 | {
49 | getAccountData();
50 | }
51 | catch (Exception)
52 | {
53 | System.Windows.Forms.MessageBox.Show("Error getting account information from the save file, if the file was encrypted with different password goto settings and change the password and restart the application", "Error Decrypting", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
54 | }
55 | updateAccountList();
56 | if (SteamTwoProperties.jsonSetting.autoLoginSetting)
57 | {
58 | loginOnSteam(true);
59 | }
60 | }
61 | }
62 |
63 | //set up encryption
64 | internal static void setEncryptionKey(string temp)
65 | {
66 | encryptionKey = temp;
67 | SteamTwoProperties.jsonSetting.encryptedKeySetting = SteamTwo.Cryptography.Encrypt(DEFUALT_KEY, encryptionKey);
68 | Properties.Settings.Default.Save();
69 | }
70 |
71 | //update the account display list
72 | private void updateAccountList()
73 | {
74 | listView1.Items.Clear();
75 | foreach (UserAccount item in AccountController.userAccounts)
76 | {
77 | listView1.Items.Add(new ListViewItem { Content = item.username});
78 | }
79 | }
80 |
81 | //read account information from file
82 | private void getAccountData()
83 | {
84 | var JsonAccounts = JsonConvert.DeserializeObject(File.ReadAllText(SAVE_FILE_NAME));
85 | for (int i = 0; i < JsonAccounts.count; i++)
86 | {
87 | AccountController.addAccount(JsonAccounts.accounts[i].username, JsonAccounts.accounts[i].password, JsonAccounts.accounts[i].desktopAuth);
88 | }
89 | }
90 |
91 | //write account information to file
92 | internal static void writeAccountData()
93 | {
94 | Account[] accArray = new Account[AccountController.userAccounts.Count];
95 | for (int i = 0; i < AccountController.userAccounts.Count; i++)
96 | {
97 | UserAccount item = (UserAccount)AccountController.userAccounts[i];
98 | accArray[i] = new Account { username = item.username, password = item.password , desktopAuth = item.desktopAuth };
99 | }
100 | string json = JsonConvert.SerializeObject(new jsonObject { count = accArray.Length, accounts = accArray });
101 | System.IO.File.WriteAllText(SAVE_FILE_NAME, json);
102 | }
103 |
104 | //gets password and checks if its the right passwords
105 | private void setupEncryptionKey(int attempts, String discriptionText)
106 | {
107 | if (encrypted)
108 | {
109 | if (attempts <= 2)
110 | {
111 | GetInput GI = new GetInput();
112 | String temp = GI.Show("Encryption", discriptionText, true);
113 | GI.Close();
114 | if (temp != "-1" && SteamTwo.Cryptography.Encrypt(DEFUALT_KEY, temp).Equals(SteamTwoProperties.jsonSetting.encryptedKeySetting))
115 | {
116 | encryptionKey = temp;
117 | }
118 | else
119 | {
120 | attempts++;
121 | discriptionText = "Encryption key is invalid, enter a valid encryption key";
122 | setupEncryptionKey(attempts, discriptionText);
123 | }
124 | }
125 | else
126 | {
127 | if (SteamTwoProperties.jsonSetting.badAttemptSetting)
128 | {
129 | SteamTwoProperties.jsonSetting.encryptedSetting = false;
130 | SteamTwoProperties.jsonSetting.encryptedKeySetting = DEFUALT_KEY_TEST;
131 | Properties.Settings.Default.Save();
132 | encryptionKey = DEFUALT_KEY;
133 | File.Delete(SAVE_FILE_NAME);
134 | System.Windows.Forms.MessageBox.Show("Encryption key will reset back to defualt key and previous account details will be deleted.", "Encryption", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
135 | }
136 | else
137 | {
138 | Environment.Exit(0);
139 | }
140 | }
141 | }
142 | else
143 | {
144 | encryptionKey = DEFUALT_KEY;
145 | }
146 | }
147 |
148 | //open settings
149 | private void settingTitleBarButton(object sender, RoutedEventArgs e)
150 | {
151 | Settings SW = new Settings();
152 | SW.Show("zzz");
153 | }
154 |
155 | //add account button
156 | private void addButton_Click(object sender, RoutedEventArgs e)
157 | {
158 | AddAccount ASA = new AddAccount();
159 | String[] newAccount = ASA.Show("lol");
160 | ASA.Close();
161 | AccountController.addAccount(newAccount[0], Cryptography.Encrypt(newAccount[1], encryptionKey), bool.Parse(newAccount[2]));
162 | updateAccountList();
163 | writeAccountData();
164 | listView1.SelectedIndex = 0;
165 | }
166 |
167 | //remove accounnt button
168 | private void removeButton_Click(object sender, RoutedEventArgs e)
169 | {
170 | if (listView1.Items.Count > 0)
171 | {
172 | UserAccount account = (UserAccount)AccountController.userAccounts[listView1.SelectedIndex];
173 | AccountController.removeAccount(account);
174 | updateAccountList();
175 | writeAccountData();
176 | listView1.SelectedIndex = 0;
177 | }
178 | }
179 |
180 | //login on bot
181 | private void loginBot1_Click(object sender, RoutedEventArgs e)
182 | {
183 | if (listView1.SelectedItem != null)
184 | {
185 | Hide();
186 | BotMainWindow BMW = new BotMainWindow();
187 | UserAccount account = (UserAccount)AccountController.userAccounts[listView1.SelectedIndex];
188 | BMW.Show(account.username, Cryptography.Decrypt(account.password, encryptionKey), this);
189 | }
190 | }
191 |
192 | //login on steam
193 | private void loginSteam1_Click(object sender, RoutedEventArgs e)
194 | {
195 | loginOnSteam(false);
196 | }
197 |
198 | //before closing form
199 | private void beforeClosing()
200 | {
201 | Properties.Settings.Default.Save();
202 | System.Windows.Application.Current.Shutdown();
203 | }
204 |
205 | //copy password
206 | private void listView1_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
207 | {
208 | if (SteamTwoProperties.jsonSetting.copyPasswordSetting)
209 | {
210 | UserAccount account = (UserAccount)AccountController.userAccounts[listView1.SelectedIndex];
211 | if (listView1.SelectedItem != null)
212 | {
213 | Clipboard.SetText(Cryptography.Decrypt(account.password, encryptionKey));
214 | }
215 | }
216 | }
217 |
218 | //open tool kit button
219 | private void openToolKit_Click(object sender, RoutedEventArgs e)
220 | {
221 | Hide();
222 | ToolKit TK = new ToolKit();
223 | TK.Show(this);
224 |
225 | }
226 |
227 | //opens Steam desktop Authenticator
228 | private void openSteamDesktopAuthAsync()
229 | {
230 | if (!SteamTwoProperties.jsonSetting.SDALinkSetting.Equals(""))
231 | {
232 | string exepath = SteamTwoProperties.jsonSetting.SDALinkSetting;
233 | ProcessStartInfo psi = new ProcessStartInfo();
234 | psi.FileName = exepath;
235 | psi.WorkingDirectory = Path.GetDirectoryName(exepath);
236 | Process.Start(psi);
237 | }
238 | }
239 |
240 | //steam login
241 | private void loginOnSteam(bool auto)
242 | {
243 | //on start up
244 | if (auto && AccountController.userAccounts.Count > 0 && LaunchedViaStartup)
245 | {
246 | UserAccount account = (UserAccount)AccountController.userAccounts[0];
247 | account = (UserAccount)AccountController.getAccount(SteamTwoProperties.jsonSetting.selectedAccountSetting);
248 | bool success = LocalSteamController.startSteam(account.username, Cryptography.Decrypt(account.password, encryptionKey));
249 | if (account.desktopAuth)
250 | {
251 | openSteamDesktopAuthAsync();
252 | }
253 | if (SteamTwoProperties.jsonSetting.closeStemLaunchSetting && success)
254 | {
255 | beforeClosing();
256 | }
257 | }
258 | //normal login button click
259 | if (!auto && listView1.SelectedItem != null)
260 | {
261 | UserAccount account = (UserAccount)AccountController.userAccounts[listView1.SelectedIndex];
262 | bool success = LocalSteamController.startSteam(account.username, Cryptography.Decrypt(account.password, encryptionKey));
263 | if (account.desktopAuth)
264 | {
265 | openSteamDesktopAuthAsync();
266 | }
267 | if (SteamTwoProperties.jsonSetting.closeStemLaunchSetting && success)
268 | {
269 | beforeClosing();
270 | }
271 | }
272 | }
273 |
274 | //windows is closing
275 | private void MainWindow1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
276 | {
277 |
278 | }
279 | }
280 | }
281 |
282 | ///
283 | /// ///////////////////// JSON CLASSES BELOW
284 | ///
285 |
286 | //to store json object
287 | public class jsonObject
288 | {
289 | // {"count":1,"accounts":[{"username":"1234","password":"qwert"},{"username":"1234","password":"qwert"}]}
290 | public int count { get; set; }
291 | public Account[] accounts { get; set; }
292 | }
293 |
294 | //to store account information
295 | public class Account
296 | {
297 | public String username { get; set; }
298 | public String password { get; set; }
299 | public bool desktopAuth { get; set; }
300 | }
--------------------------------------------------------------------------------
/Steam Two/SteamBotController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.IO;
4 | using System.Security.Cryptography;
5 | using System.Threading;
6 | using System.Windows;
7 | using SteamKit2;
8 | using SteamKit2.Internal;
9 |
10 | namespace SteamTwo
11 | {
12 | static class SteamBotController
13 | {
14 | private static bool isRunning;
15 | public static bool loggedIn = false;
16 | public static bool chatOpen = false;
17 | private static SteamUser steamUser;
18 | private static SteamClient steamClient;
19 | private static CallbackManager manager;
20 | private static SteamFriends steamFriends;
21 | private static string user, pass;
22 | private static string authCode, twoFactorAuth;
23 | private static Thread workThread = null;
24 |
25 | public static void steamLogin(String username, String password)
26 | {
27 | workThread = new Thread(steamLogin);
28 | user = username;
29 | pass = password;
30 | workThread.Start();
31 | }
32 |
33 | public static void logBotIn()
34 | {
35 | workThread = new Thread(steamLogin);
36 | workThread.Start();
37 | }
38 |
39 | public static void logBotOff()
40 | {
41 | steamUser.LogOff();
42 | workThread.Abort();
43 | loggedIn = false;
44 | }
45 |
46 | private static void steamLogin()
47 | {
48 |
49 | // create our steamclient instance
50 | var configuration = SteamConfiguration.Create(b => b.WithProtocolTypes(ProtocolTypes.Tcp));
51 | steamClient = new SteamClient();
52 | // create the callback manager which will route callbacks to function calls
53 | manager = new CallbackManager(steamClient);
54 |
55 | // get the steamuser handler, which is used for logging on after successfully connecting
56 | steamUser = steamClient.GetHandler();
57 | steamFriends = steamClient.GetHandler();
58 | // register a few callbacks we're interested in
59 | // these are registered upon creation to a callback manager, which will then route the callbacks
60 | // to the functions specified
61 | manager.Subscribe(OnConnected);
62 | manager.Subscribe(OnDisconnected);
63 |
64 | manager.Subscribe(OnLoggedOn);
65 | manager.Subscribe(OnLoggedOff);
66 |
67 | // this callback is triggered when the steam servers wish for the client to store the sentry file
68 | manager.Subscribe(OnMachineAuth);
69 |
70 |
71 |
72 | // we use the following callbacks for friends related activities
73 | manager.Subscribe(OnAccountInfo);
74 | manager.Subscribe(OnFriendsList);
75 | manager.Subscribe(OnPersonaState);
76 | manager.Subscribe(OnFriendAdded);
77 | manager.Subscribe(OnChatMessage);
78 |
79 | isRunning = true;
80 |
81 | Console.WriteLine("Connecting to Steam...");
82 |
83 | // initiate the connection
84 | steamClient.Connect();
85 |
86 | // create our callback handling loop
87 | while (isRunning)
88 | {
89 | // in order for the callbacks to get routed, they need to be handled by the manager
90 | manager.RunWaitCallbacks(TimeSpan.FromSeconds(1));
91 | }
92 | }
93 |
94 | static void OnConnected(SteamClient.ConnectedCallback callback)
95 | {
96 | Console.WriteLine("Connected to Steam! Logging in '{0}'...", user);
97 |
98 | byte[] sentryHash = null;
99 | if (File.Exists("sentry.bin"))
100 | {
101 | // if we have a saved sentry file, read and sha-1 hash it
102 | byte[] sentryFile = File.ReadAllBytes("sentry.bin");
103 | sentryHash = CryptoHelper.SHAHash(sentryFile);
104 | }
105 |
106 | steamUser.LogOn(new SteamUser.LogOnDetails
107 | {
108 | Username = user,
109 | Password = pass,
110 |
111 | // in this sample, we pass in an additional authcode
112 | // this value will be null (which is the default) for our first logon attempt
113 | AuthCode = authCode,
114 |
115 | // if the account is using 2-factor auth, we'll provide the two factor code instead
116 | // this will also be null on our first logon attempt
117 | TwoFactorCode = twoFactorAuth,
118 |
119 | // our subsequent logons use the hash of the sentry file as proof of ownership of the file
120 | // this will also be null for our first (no authcode) and second (authcode only) logon attempts
121 | SentryFileHash = sentryHash,
122 | });
123 | }
124 |
125 |
126 |
127 | static void OnDisconnected(SteamClient.DisconnectedCallback callback)
128 | {
129 | // after recieving an AccountLogonDenied, we'll be disconnected from steam
130 | // so after we read an authcode from the user, we need to reconnect to begin the logon flow again
131 |
132 | Console.WriteLine("Disconnected from Steam, reconnecting in 5...");
133 |
134 | Thread.Sleep(TimeSpan.FromSeconds(5));
135 |
136 | //means disconnect was not users request so we reconnect
137 | if (loggedIn)
138 | {
139 | steamClient.Connect();
140 | }
141 | }
142 |
143 | static void OnLoggedOn(SteamUser.LoggedOnCallback callback)
144 | {
145 | bool isSteamGuard = callback.Result == EResult.AccountLogonDenied;
146 | bool is2FA = callback.Result == EResult.AccountLoginDeniedNeedTwoFactor;
147 |
148 | if (isSteamGuard || is2FA)
149 | {
150 | Console.WriteLine("This account is SteamGuard protected!");
151 |
152 | if (is2FA)
153 | {
154 | Application.Current.Dispatcher.Invoke((Action)delegate
155 | {
156 | //Console.Write("Please enter your 2 factor auth code from your authenticator app: ");
157 | // MainWindow.currentHandle.Show();
158 | GetInput GI = new GetInput();
159 | twoFactorAuth = GI.Show("Authentication", "Please enter your 2 factor auth code from your authenticator app below", false);
160 | GI.Close();
161 | });
162 | }
163 | else
164 | {
165 | Application.Current.Dispatcher.Invoke((Action)delegate
166 | {
167 | //Console.Write("Please enter the auth code sent to the email at {0}: ", callback.EmailDomain);
168 | //MainWindow.currentHandle.Show();
169 | GetInput GI = new GetInput();
170 | authCode = GI.Show("Authentication", "Please enter the auth code sent to the email at " + callback.EmailDomain, false);
171 | GI.Close();
172 | });
173 | }
174 |
175 | return;
176 | }
177 |
178 | if (callback.Result != EResult.OK)
179 | {
180 | Console.WriteLine("Unable to logon to Steam: {0} / {1}", callback.Result, callback.ExtendedResult);
181 |
182 | isRunning = false;
183 | return;
184 | }
185 |
186 | Console.WriteLine("Successfully logged on!");
187 | loggedIn = true;
188 | // at this point, we'd be able to perform actions on Steam
189 | }
190 |
191 | static void OnLoggedOff(SteamUser.LoggedOffCallback callback)
192 | {
193 | Console.WriteLine("Logged off of Steam: {0}", callback.Result);
194 | }
195 |
196 | static void OnMachineAuth(SteamUser.UpdateMachineAuthCallback callback)
197 | {
198 | Console.WriteLine("Updating sentryfile...");
199 |
200 | // write out our sentry file
201 | // ideally we'd want to write to the filename specified in the callback
202 | // but then this sample would require more code to find the correct sentry file to read during logon
203 | // for the sake of simplicity, we'll just use "sentry.bin"
204 |
205 | int fileSize;
206 | byte[] sentryHash;
207 | using (var fs = File.Open("sentry.bin", FileMode.OpenOrCreate, FileAccess.ReadWrite))
208 | {
209 | fs.Seek(callback.Offset, SeekOrigin.Begin);
210 | fs.Write(callback.Data, 0, callback.BytesToWrite);
211 | fileSize = (int)fs.Length;
212 |
213 | fs.Seek(0, SeekOrigin.Begin);
214 | using (var sha = SHA1.Create())
215 | {
216 | sentryHash = sha.ComputeHash(fs);
217 | }
218 | }
219 |
220 | // inform the steam servers that we're accepting this sentry file
221 | steamUser.SendMachineAuthResponse(new SteamUser.MachineAuthDetails
222 | {
223 | JobID = callback.JobID,
224 |
225 | FileName = callback.FileName,
226 |
227 | BytesWritten = callback.BytesToWrite,
228 | FileSize = fileSize,
229 | Offset = callback.Offset,
230 |
231 | Result = EResult.OK,
232 | LastError = 0,
233 |
234 | OneTimePassword = callback.OneTimePassword,
235 |
236 | SentryFileHash = sentryHash,
237 | });
238 |
239 | Console.WriteLine("Done!");
240 | }
241 |
242 | static void OnAccountInfo(SteamUser.AccountInfoCallback callback)
243 | {
244 | // before being able to interact with friends, you must wait for the account info callback
245 | // this callback is posted shortly after a successful logon
246 |
247 | // at this point, we can go online on friends, so lets do that
248 | steamFriends.SetPersonaState(EPersonaState.Online);
249 | }
250 |
251 | static void OnFriendsList(SteamFriends.FriendsListCallback callback)
252 | {
253 | // at this point, the client has received it's friends list
254 |
255 | int friendCount = steamFriends.GetFriendCount();
256 |
257 | Console.WriteLine("We have {0} friends", friendCount);
258 |
259 | for (int x = 0; x < friendCount; x++)
260 | {
261 | // steamids identify objects that exist on the steam network, such as friends, as an example
262 | SteamID steamIdFriend = steamFriends.GetFriendByIndex(x);
263 |
264 |
265 | AccountController.getAccount(user).AddFriend(new Friend() { steamFrindsID = "" + steamIdFriend.ConvertToUInt64().ToString(), chatLog = new ArrayList(), SteamIDObject = steamIdFriend });
266 |
267 | // we'll just display the STEAM_ rendered version
268 | Console.WriteLine("Friend: {0}", steamIdFriend.Render());
269 | }
270 |
271 | // we can also iterate over our friendslist to accept or decline any pending invites
272 | if (SteamTwoProperties.jsonSetting.autoAddFriendSetting)
273 | {
274 | foreach (var friend in callback.FriendList)
275 | {
276 | if (friend.Relationship == EFriendRelationship.RequestRecipient)
277 | {
278 | // this user has added us, let's add him back
279 | steamFriends.AddFriend(friend.SteamID);
280 | }
281 | }
282 | }
283 | }
284 |
285 | static void OnFriendAdded(SteamFriends.FriendAddedCallback callback)
286 | {
287 | // someone accepted our friend request, or we accepted one
288 | Console.WriteLine("{0} is now a friend", callback.PersonaName);
289 | }
290 |
291 | static void OnPersonaState(SteamFriends.PersonaStateCallback callback)
292 | {
293 | // this callback is received when the persona state (friend information) of a friend changes
294 |
295 | // for this sample we'll simply display the names of the friends
296 | AccountController.getAccount(user).setFriendsName(new Friend() { name = callback.Name, steamFrindsID = callback.FriendID.ConvertToUInt64().ToString() });
297 | Console.WriteLine("State change: {0}", callback.Name);
298 | }
299 |
300 | static void OnChatMessage(SteamFriends.FriendMsgCallback callback)
301 | {
302 | if (callback.EntryType == EChatEntryType.ChatMsg)
303 | {
304 | if (SteamTwoProperties.jsonSetting.notifyOnMessageSetting && !chatOpen)
305 | {
306 | System.Windows.Forms.MessageBox.Show("New Message!" , "Steam Two" , System.Windows.Forms.MessageBoxButtons.OK,System.Windows.Forms.MessageBoxIcon.Information);
307 | }
308 | if (SteamTwoProperties.jsonSetting.forwardCheckSetting)
309 | {
310 | steamFriends.SendChatMessage(new SteamID(SteamTwoProperties.jsonSetting.forwardSetting), EChatEntryType.ChatMsg, "<> " + AccountController.getAccount(user).getFriendsName(new Friend() { steamFrindsID = callback.Sender.ConvertToUInt64().ToString() }) + " : " + callback.Message.ToString());}
311 | AccountController.getAccount(user).updateChatLogs(new Friend() { steamFrindsID =callback.Sender.ConvertToUInt64().ToString() }, callback.Message.ToString(), false);
312 | }
313 | }
314 |
315 | public static String getSteamUserID()
316 | {
317 | if (steamUser != null)
318 | {
319 | return steamUser.SteamID.ConvertToUInt64().ToString();
320 | }
321 | return "";
322 | }
323 |
324 | public static void sendChatMessage(SteamID id, String msg)
325 | {
326 | AccountController.getAccount(user).updateChatLogs(new Friend() { steamFrindsID = id.ConvertToUInt64().ToString()},msg,true);
327 | steamFriends.SendChatMessage(id , EChatEntryType.ChatMsg, msg);
328 | }
329 |
330 | public static void playGame(int gameID)
331 | {
332 | var request = new ClientMsgProtobuf(EMsg.ClientGamesPlayed);
333 |
334 | request.Body.games_played.Add(new CMsgClientGamesPlayed.GamePlayed
335 | {
336 | game_id = new GameID(gameID),
337 | });
338 | steamClient.Send(request);
339 | }
340 | }
341 | }
342 |
343 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------