Version 1.2.0

This commit is contained in:
ruri
2020-03-13 15:07:38 +01:00
137 changed files with 2764 additions and 660 deletions
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+8 -2
View File
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2036
# Visual Studio Version 16
VisualStudioVersion = 16.0.29509.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenBullet", "OpenBullet\OpenBullet.csproj", "{99E40E7F-00A4-4FB1-9441-B05A56C47C08}"
EndProject
@@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RuriLib", "RuriLib\RuriLib.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenBulletCLI", "OpenBulletCLI\OpenBulletCLI.csproj", "{0B6D8B01-861E-4CAF-B1C9-6670884381DB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PluginFramework", "PluginFramework\PluginFramework.csproj", "{E1DD89D0-EC1D-4849-A2B6-ADB261DFA3CE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -27,6 +29,10 @@ Global
{0B6D8B01-861E-4CAF-B1C9-6670884381DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0B6D8B01-861E-4CAF-B1C9-6670884381DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0B6D8B01-861E-4CAF-B1C9-6670884381DB}.Release|Any CPU.Build.0 = Release|Any CPU
{E1DD89D0-EC1D-4849-A2B6-ADB261DFA3CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E1DD89D0-EC1D-4849-A2B6-ADB261DFA3CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E1DD89D0-EC1D-4849-A2B6-ADB261DFA3CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E1DD89D0-EC1D-4849-A2B6-ADB261DFA3CE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
+1 -1
View File
@@ -12,7 +12,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Encoding.CodePages" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
<bindingRedirect oldVersion="0.0.0.0-4.1.3.0" newVersion="4.1.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+15
View File
@@ -8,10 +8,25 @@ using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Media;
using PluginFramework;
using RuriLib;
using RuriLib.Models;
namespace OpenBullet
{
public static class BlocksExtensions
{
public static IEnumerable<BlockBase> OnlyPlugins(this IEnumerable<BlockBase> blocks)
{
return blocks.Where(b => b.IsPlugin());
}
public static bool IsPlugin(this BlockBase block)
{
return block.GetType().GetInterface(nameof(IBlockPlugin)) == typeof(IBlockPlugin);
}
}
public static class EnumerableExtensions
{
public static void SaveToFile<T>(this IEnumerable<T> items, string fileName, Func<T, string> mapping)
+9 -9
View File
@@ -171,39 +171,39 @@ ELEMENT LOCATOR "STRING" [INDEX]
Allowed Actions:
## Spawn a div with a given id to a (x,y) absolute position, so you can use it as element hook for mouse movement
SPAWN "ID" X Y
SPAWN "ID" "X" "Y"
CLICK [ELEMENT]
CLICKANDHOLD [ELEMENT]
RIGHTCLICK [ELEMENT]
DOUBLECLICK [ELEMENT]
DRAGANDDROP ELEMENT -> ELEMENT
DRAGANDDROPWITHOFFSET X Y ELEMENT
DRAGANDDROPWITHOFFSET "X" "Y" ELEMENT
KEYDOWN "KEY" [ELEMENT]
KEYUP "KEY" [ELEMENT]
MOVEBY X Y
MOVEBY "X" "Y"
MOVETO ELEMENT
RELEASE [ELEMENT]
SENDKEYS "KEYS" [ELEMENT]
## Draws random points in a square starting from the top left corner and with the given width and height
DRAWPOINTS MAXW MAXH AMOUNT
DRAWLINE (X1 Y2 -> X2 Y2 / ELEMENT -> ELEMENT) : AMOUNT
DRAWLINEHUMAN (X1 Y1 -> X2 Y2 / ELEMENT -> ELEMENT) : AMOUNT [GRAVITY WIND]
DRAWLINE ("X1" "Y1" -> "X2" "Y2" / ELEMENT -> ELEMENT) : AMOUNT
DRAWLINEHUMAN ("X1" "Y1" -> "X2" "Y2" / ELEMENT -> ELEMENT) : AMOUNT [GRAVITY WIND]
Examples:
## Moving to an element and clicking 100 pixels right of it
MOUSEACTION
MOVETO ELEMENT CLASS "testclass" 1
MOVEBY 100 0
MOVEBY "100" "0"
CLICK
## Moving to a specific set of coordinates on the page
MOUSEACTION
SPAWN "target" 100 150
SPAWN "target" "100" "150"
MOVETO ELEMENT ID "target"
## Moving like a human from point A (0,0) to point B (700,700). The lower the AMOUNT, the faster the line is drawn
MOUSEACTION
DRAWLINEHUMAN 0 0 -> 700 700 : 150 1 1
DRAWLINEHUMAN "0" "0" -> "700" "700" : 150 1 1
## Moving like a human from element with id="one" to element with id="two", 20 points and default gravity/wind
MOUSEACTION
@@ -239,7 +239,7 @@ FUNCTION Translate StopAfterFirstMatch=True
FUNCTION DateToUnixTime "format" "input" -> VAR "DATE"
FUNCTION Replace "what" "with" UseRegex=True "input" -> VAR "REPLACED"
FUNCTION RegexMatch "pattern" "input" -> VAR "MATCHED"
FUNCTION RandomNum 0 100 -> VAR "RANDOM"
FUNCTION RandomNum "0" "100" -> VAR "RANDOM"
FUNCTION CountOccurrences "tofind" "input" -> VAR "COUNT"
FUNCTION CharAt "index" "input" -> VAR "CHAR"
FUNCTION Substring "startindex" "length" "input" -> VAR "SUBSTRING"
+1
View File
@@ -88,6 +88,7 @@
<Label x:Name="menuOptionConfigCreator" Content="Configs" MouseDown="menuOptionConfigCreator_MouseDown" />
<Label x:Name="menuOptionHitsDatabase" Content="Hits DB" MouseDown="menuOptionHitsDatabase_MouseDown" />
<Label x:Name="menuOptionTools" Content="Tools" MouseDown="menuOptionTools_MouseDown" />
<Label x:Name="menuOptionPlugins" Content="Plugins" MouseDown="menuOptionPlugins_MouseDown" />
<Label x:Name="menuOptionSettings" Content="Settings" MouseDown="menuOptionSettings_MouseDown" />
<Label x:Name="menuOptionAbout" Content="About" MouseDown="menuOptionAbout_MouseDown" />
</StackPanel>
+60 -4
View File
@@ -19,6 +19,11 @@ using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Threading;
using OpenBullet.Plugins;
using System.Collections.Generic;
using OpenBullet.Views.UserControls;
using OpenBullet.Views.StackerBlocks;
using RuriLib.LS;
namespace OpenBullet
{
@@ -38,6 +43,7 @@ namespace OpenBullet
public HitsDB HitsDBPage { get; set; }
public Settings OBSettingsPage { get; set; }
public ToolsSection ToolsPage { get; set; }
public PluginsSection PluginsPage { get; set; }
public About AboutPage { get; set; }
public Rectangle Bounds { get; private set; }
@@ -59,8 +65,8 @@ namespace OpenBullet
titleLabel.Content = title;
// Make sure all folders are there or recreate them
var folders = new string[] { "Captchas", "ChromeExtensions", "Configs", "DB", "Screenshots", "Settings", "Sounds", "Wordlists" };
foreach (var folder in folders.Select(f => System.IO.Path.Combine(Directory.GetCurrentDirectory(), f)))
var folders = new string[] { "Captchas", "ChromeExtensions", "Configs", "DB", "Plugins", "Screenshots", "Settings", "Sounds", "Wordlists" };
foreach (var folder in folders.Select(f => Path.Combine(Directory.GetCurrentDirectory(), f)))
{
if (!Directory.Exists(folder))
Directory.CreateDirectory(folder);
@@ -73,13 +79,15 @@ namespace OpenBullet
}
catch
{
MessageBox.Show("Could not find / parse the Environment Settings file. Please fix the issue and try again.");
OB.Logger.LogError(Components.Main,
"Could not find / parse the Environment Settings file. Please fix the issue and try again.", true);
Environment.Exit(0);
}
if (OB.Settings.Environment.WordlistTypes.Count == 0 || OB.Settings.Environment.CustomKeychains.Count == 0)
{
MessageBox.Show("At least one WordlistType and one CustomKeychain must be defined in the Environment Settings file.");
OB.Logger.LogError(Components.Main,
"At least one WordlistType and one CustomKeychain must be defined in the Environment Settings file.", true);
Environment.Exit(0);
}
@@ -140,6 +148,46 @@ namespace OpenBullet
Topmost = OB.OBSettings.General.AlwaysOnTop;
// Load Plugins
var (plugins, blockPlugins) = Loader.LoadPlugins(OB.pluginsFolder);
OB.BlockPlugins = blockPlugins.ToList();
// Set mappings
OB.BlockMappings = new List<(Type, Type, System.Windows.Media.Color)>()
{
( typeof(BlockBypassCF), typeof(PageBlockBypassCF), Colors.DarkSalmon ),
( typeof(BlockImageCaptcha), typeof(PageBlockCaptcha), Colors.DarkOrange ),
( typeof(BlockFunction), typeof(PageBlockFunction), Colors.YellowGreen ),
( typeof(BlockKeycheck), typeof(PageBlockKeycheck), Colors.DodgerBlue ),
( typeof(BlockLSCode), typeof(PageBlockLSCode), Colors.White ),
( typeof(BlockParse), typeof(PageBlockParse), Colors.Gold ),
( typeof(BlockRecaptcha), typeof(PageBlockRecaptcha), Colors.Turquoise ),
( typeof(BlockRequest), typeof(PageBlockRequest), Colors.LimeGreen ),
( typeof(BlockTCP), typeof(PageBlockTCP), Colors.MediumPurple ),
( typeof(BlockUtility), typeof(PageBlockUtility), Colors.Wheat ),
( typeof(SBlockBrowserAction), typeof(PageSBlockBrowserAction), Colors.Green ),
( typeof(SBlockElementAction), typeof(PageSBlockElementAction), Colors.Firebrick ),
( typeof(SBlockExecuteJS), typeof(PageSBlockExecuteJS), Colors.Indigo ),
( typeof(SBlockNavigate), typeof(PageSBlockNavigate), Colors.RoyalBlue )
};
// Add block plugins to mappings
foreach (var plugin in blockPlugins)
{
try
{
var color = (System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString(plugin.Color);
OB.BlockMappings.Add((plugin.GetType(), typeof(BlockPluginPage), color));
BlockParser.BlockMappings.Add(plugin.Name, plugin.GetType());
OB.Logger.LogInfo(Components.Main, $"Initialized {plugin.Name} block plugin");
}
catch
{
OB.Logger.LogError(Components.Main, $"The color {plugin.Color} in block plugin {plugin.Name} is invalid", true);
Environment.Exit(0);
}
}
// ViewModels
OB.RunnerManager = new RunnerManagerViewModel();
OB.ProxyManager = new ProxyManagerViewModel();
@@ -164,6 +212,8 @@ namespace OpenBullet
OB.Logger.LogInfo(Components.Main, "Initialized Settings");
ToolsPage = new ToolsSection();
OB.Logger.LogInfo(Components.Main, "Initialized Tools");
PluginsPage = new PluginsSection(plugins);
OB.Logger.LogInfo(Components.Main, "Initialized Plugins");
AboutPage = new About();
menuOptionRunner_MouseDown(this, null);
@@ -284,6 +334,12 @@ namespace OpenBullet
menuOptionSelected(menuOptionTools);
}
private void menuOptionPlugins_MouseDown(object sender, MouseButtonEventArgs e)
{
Main.Content = PluginsPage;
menuOptionSelected(menuOptionPlugins);
}
private void menuOptionSettings_MouseDown(object sender, MouseButtonEventArgs e)
{
Main.Content = OBSettingsPage;
+14 -1
View File
@@ -1,6 +1,11 @@
using OpenBullet.ViewModels;
using PluginFramework;
using RuriLib;
using RuriLib.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Media;
namespace OpenBullet
{
@@ -20,7 +25,14 @@ namespace OpenBullet
};
public static string Version => "1.2.0";
public static Random Random { get; } = new Random();
// Block Mappings (including Plugins)
public static List<(Type, Type, Color)> BlockMappings = new List<(Type, Type, Color)>();
// Block Plugins
// HACK: Find a better way to do this and a better place to put them
public static List<IBlockPlugin> BlockPlugins;
public static IEnumerable<BlockBase> BlockPluginsAsBase => BlockPlugins.Cast<BlockBase>();
// Windows
// TODO: Remove these from here, everything should only depend on the ViewModels not on the Views!
@@ -48,5 +60,6 @@ namespace OpenBullet
public static readonly string licenseFile = @"Settings/License.txt";
public static readonly string logFile = @"Log.txt";
public static readonly string configFolder = @"Configs";
public static readonly string pluginsFolder = @"Plugins";
}
}
+15
View File
@@ -1,6 +1,10 @@
using Newtonsoft.Json;
using OpenBullet.ViewModels;
using RuriLib;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace OpenBullet
{
@@ -17,5 +21,16 @@ namespace OpenBullet
{
return JsonConvert.DeserializeObject<OBSettingsViewModel>(File.ReadAllText(settingsFile));
}
public static void CheckRequiredPlugins(IEnumerable<string> available, Config config)
{
foreach (var required in config.Settings.RequiredPlugins)
{
if (!available.Contains(required))
{
throw new Exception($"This config requires the plugin {required} which is missing from the Plugins folder and hence cannot be opened!");
}
}
}
}
}
+135 -28
View File
@@ -71,8 +71,8 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Extreme.Net.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.AvalonEdit, Version=5.0.3.0, Culture=neutral, PublicKeyToken=9cc39be672370310, processorArchitecture=MSIL">
<HintPath>..\packages\AvalonEdit.5.0.4\lib\Net40\ICSharpCode.AvalonEdit.dll</HintPath>
<Reference Include="ICSharpCode.AvalonEdit, Version=6.0.1.278, Culture=neutral, PublicKeyToken=9cc39be672370310, processorArchitecture=MSIL">
<HintPath>..\packages\AvalonEdit.6.0.1\lib\net45\ICSharpCode.AvalonEdit.dll</HintPath>
</Reference>
<Reference Include="IronPython, Version=2.7.9.0, Culture=neutral, PublicKeyToken=7f709c5b713576e1, processorArchitecture=MSIL">
<HintPath>..\packages\IronPython.2.7.9\lib\net45\IronPython.dll</HintPath>
@@ -102,7 +102,7 @@
<HintPath>..\packages\DynamicLanguageRuntime.1.2.2\lib\net45\Microsoft.Scripting.Metadata.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PresentationFramework.Aero2" />
<Reference Include="ProxySocket, Version=1.1.2.0, Culture=neutral, PublicKeyToken=966874d7118d1436, processorArchitecture=MSIL">
@@ -121,13 +121,13 @@
<Reference Include="System.Net.Http, Version=4.1.1.3, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Net.Http.4.3.4\lib\net46\System.Net.Http.dll</HintPath>
</Reference>
<Reference Include="System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll</HintPath>
<Reference Include="System.Runtime, Version=4.1.1.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.4.3.1\lib\net462\System.Runtime.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.7.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.Algorithms, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Algorithms.4.3.1\lib\net463\System.Security.Cryptography.Algorithms.dll</HintPath>
@@ -147,8 +147,8 @@
<Reference Include="System.Security.Cryptography.X509Certificates, Version=4.1.1.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.X509Certificates.4.3.2\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath>
</Reference>
<Reference Include="System.Text.Encoding.CodePages, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Encoding.CodePages.4.5.1\lib\net461\System.Text.Encoding.CodePages.dll</HintPath>
<Reference Include="System.Text.Encoding.CodePages, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Encoding.CodePages.4.7.0\lib\net461\System.Text.Encoding.CodePages.dll</HintPath>
</Reference>
<Reference Include="System.Windows" />
<Reference Include="System.Windows.Controls.Input.Toolkit, Version=3.5.40128.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
@@ -179,20 +179,20 @@
<Reference Include="WPFToolkit, Version=3.5.40128.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Infragistics.Themes.MetroDark.Wpf.1.0.0\lib\net40\WPFToolkit.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock, Version=3.5.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.3.5.0\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
<Reference Include="Xceed.Wpf.AvalonDock, Version=3.8.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.3.8.1\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=3.5.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.3.5.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=3.8.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.3.8.1\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=3.5.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.3.5.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=3.8.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.3.8.1\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=3.5.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.3.5.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=3.8.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.3.8.1\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit, Version=3.5.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.3.5.0\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
<Reference Include="Xceed.Wpf.Toolkit, Version=3.8.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.3.8.1\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
@@ -213,6 +213,10 @@
<DependentUpon>LogWindow.xaml</DependentUpon>
</Compile>
<Compile Include="OpenBulletApp.cs" />
<Compile Include="Plugins\Build.cs" />
<Compile Include="Plugins\Check.cs" />
<Compile Include="Plugins\IControl.cs" />
<Compile Include="Plugins\Loader.cs" />
<Compile Include="Utils.cs" />
<Compile Include="Views\Dialogs\DialogLSDoc.xaml.cs">
<DependentUpon>DialogLSDoc.xaml</DependentUpon>
@@ -235,6 +239,48 @@
<Compile Include="LoadingWindow.xaml.cs">
<DependentUpon>LoadingWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Main\PluginsSection.xaml.cs">
<DependentUpon>PluginsSection.xaml</DependentUpon>
</Compile>
<Compile Include="Views\UserControls\ButtonContainer.xaml.cs">
<DependentUpon>ButtonContainer.xaml</DependentUpon>
</Compile>
<Compile Include="Views\StackerBlocks\BlockPluginPage.xaml.cs">
<DependentUpon>BlockPluginPage.xaml</DependentUpon>
</Compile>
<Compile Include="Views\UserControls\PluginControl.xaml.cs">
<DependentUpon>PluginControl.xaml</DependentUpon>
</Compile>
<Compile Include="Views\UserControls\UserControlCheckbox.xaml.cs">
<DependentUpon>UserControlCheckbox.xaml</DependentUpon>
</Compile>
<Compile Include="Views\UserControls\UserControlContainer.xaml.cs">
<DependentUpon>UserControlContainer.xaml</DependentUpon>
</Compile>
<Compile Include="Views\UserControls\UserControlDropdown.xaml.cs">
<DependentUpon>UserControlDropdown.xaml</DependentUpon>
</Compile>
<Compile Include="Views\UserControls\UserControlConfig.xaml.cs">
<DependentUpon>UserControlConfig.xaml</DependentUpon>
</Compile>
<Compile Include="Views\UserControls\UserControlInfoText.xaml.cs">
<DependentUpon>UserControlInfoText.xaml</DependentUpon>
</Compile>
<Compile Include="Views\UserControls\UserControlWordlist.xaml.cs">
<DependentUpon>UserControlWordlist.xaml</DependentUpon>
</Compile>
<Compile Include="Views\UserControls\UserControlFilePicker.xaml.cs">
<DependentUpon>UserControlFilePicker.xaml</DependentUpon>
</Compile>
<Compile Include="Views\UserControls\UserControlNumeric.xaml.cs">
<DependentUpon>UserControlNumeric.xaml</DependentUpon>
</Compile>
<Compile Include="Views\UserControls\UserControlText.xaml.cs">
<DependentUpon>UserControlText.xaml</DependentUpon>
</Compile>
<Compile Include="Views\UserControls\UserControlTextMulti.xaml.cs">
<DependentUpon>UserControlTextMulti.xaml</DependentUpon>
</Compile>
<None Include="LSHighlighting.xshd">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<SubType>Designer</SubType>
@@ -381,8 +427,8 @@
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Views\Main\Tools.xaml.cs">
<DependentUpon>Tools.xaml</DependentUpon>
<Compile Include="Views\Main\ToolsSection.xaml.cs">
<DependentUpon>ToolsSection.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Main\Tools\ListGenerator.xaml.cs">
<DependentUpon>ListGenerator.xaml</DependentUpon>
@@ -511,6 +557,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\Main\PluginsSection.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\Main\RunnerManager.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -690,7 +740,7 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\Main\Tools.xaml">
<Page Include="Views\Main\ToolsSection.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
@@ -702,6 +752,58 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\UserControls\ButtonContainer.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\StackerBlocks\BlockPluginPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\UserControls\PluginControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\UserControls\UserControlCheckbox.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\UserControls\UserControlContainer.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\UserControls\UserControlDropdown.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\UserControls\UserControlConfig.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\UserControls\UserControlInfoText.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\UserControls\UserControlWordlist.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\UserControls\UserControlFilePicker.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\UserControls\UserControlNumeric.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\UserControls\UserControlText.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\UserControls\UserControlTextMulti.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
@@ -813,6 +915,10 @@
<Resource Include="Images\Icons\log.png" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PluginFramework\PluginFramework.csproj">
<Project>{E1DD89D0-EC1D-4849-A2B6-ADB261DFA3CE}</Project>
<Name>PluginFramework</Name>
</ProjectReference>
<ProjectReference Include="..\RuriLib\RuriLib.csproj">
<Project>{17e95d0b-c1fd-445c-9fdf-244af7299a67}</Project>
<Name>RuriLib</Name>
@@ -852,15 +958,16 @@
<PropertyGroup>
<ErrorText>Questo progetto fa riferimento a uno o più pacchetti NuGet che non sono presenti in questo computer. Usare lo strumento di ripristino dei pacchetti NuGet per scaricarli. Per altre informazioni, vedere http://go.microsoft.com/fwlink/?LinkID=322105. Il file mancante è {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Selenium.Chrome.WebDriver.76.0.0\build\Selenium.Chrome.WebDriver.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Selenium.Chrome.WebDriver.76.0.0\build\Selenium.Chrome.WebDriver.targets'))" />
<Error Condition="!Exists('..\packages\Selenium.Firefox.WebDriver.0.24.0\build\Selenium.Firefox.WebDriver.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Selenium.Firefox.WebDriver.0.24.0\build\Selenium.Firefox.WebDriver.targets'))" />
<Error Condition="!Exists('..\packages\Selenium.WebDriver.ChromeDriver.78.0.3904.10500\build\Selenium.WebDriver.ChromeDriver.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Selenium.WebDriver.ChromeDriver.78.0.3904.10500\build\Selenium.WebDriver.ChromeDriver.targets'))" />
<Error Condition="!Exists('..\packages\Selenium.WebDriver.GeckoDriver.Win64.0.26.0\build\Selenium.WebDriver.GeckoDriver.Win64.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Selenium.WebDriver.GeckoDriver.Win64.0.26.0\build\Selenium.WebDriver.GeckoDriver.Win64.targets'))" />
<Error Condition="!Exists('..\packages\Selenium.Chrome.WebDriver.79.0.0\build\Selenium.Chrome.WebDriver.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Selenium.Chrome.WebDriver.79.0.0\build\Selenium.Chrome.WebDriver.targets'))" />
<Error Condition="!Exists('..\packages\Selenium.Firefox.WebDriver.0.26.0\build\Selenium.Firefox.WebDriver.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Selenium.Firefox.WebDriver.0.26.0\build\Selenium.Firefox.WebDriver.targets'))" />
<Error Condition="!Exists('..\packages\Selenium.WebDriver.ChromeDriver.80.0.3987.10600\build\Selenium.WebDriver.ChromeDriver.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Selenium.WebDriver.ChromeDriver.80.0.3987.10600\build\Selenium.WebDriver.ChromeDriver.targets'))" />
</Target>
<PropertyGroup>
<PostBuildEvent>if not exist "$(TargetDir)bin" mkdir "$(TargetDir)bin"
if $(ConfigurationName) == Release move "$(TargetDir)*.dll" "$(TargetDir)bin\"
if $(ConfigurationName) == Release move "$(TargetDir)*driver.exe" "$(TargetDir)bin\"
if exist "$(TargetDir)cs-CZ" RD /S /Q "$(TargetDir)cs-CZ"
if exist "$(TargetDir)de" RD /S /Q "$(TargetDir)de"
if exist "$(TargetDir)es" RD /S /Q "$(TargetDir)es"
if exist "$(TargetDir)fr" RD /S /Q "$(TargetDir)fr"
@@ -877,8 +984,8 @@ if not exist "$(TargetDir)Sounds" mkdir "$(TargetDir)Sounds"
copy "$(ProjectDir)Sounds\rifle_hit.wav" "$(TargetDir)Sounds\rifle_hit.wav"
copy "$(ProjectDir)Sounds\rifle_reload.wav" "$(TargetDir)Sounds\rifle_reload.wav"</PostBuildEvent>
</PropertyGroup>
<Import Project="..\packages\Selenium.Chrome.WebDriver.76.0.0\build\Selenium.Chrome.WebDriver.targets" Condition="Exists('..\packages\Selenium.Chrome.WebDriver.76.0.0\build\Selenium.Chrome.WebDriver.targets')" />
<Import Project="..\packages\Selenium.Firefox.WebDriver.0.24.0\build\Selenium.Firefox.WebDriver.targets" Condition="Exists('..\packages\Selenium.Firefox.WebDriver.0.24.0\build\Selenium.Firefox.WebDriver.targets')" />
<Import Project="..\packages\Selenium.WebDriver.ChromeDriver.78.0.3904.10500\build\Selenium.WebDriver.ChromeDriver.targets" Condition="Exists('..\packages\Selenium.WebDriver.ChromeDriver.78.0.3904.10500\build\Selenium.WebDriver.ChromeDriver.targets')" />
<Import Project="..\packages\Selenium.WebDriver.GeckoDriver.Win64.0.26.0\build\Selenium.WebDriver.GeckoDriver.Win64.targets" Condition="Exists('..\packages\Selenium.WebDriver.GeckoDriver.Win64.0.26.0\build\Selenium.WebDriver.GeckoDriver.Win64.targets')" />
<Import Project="..\packages\Selenium.Chrome.WebDriver.79.0.0\build\Selenium.Chrome.WebDriver.targets" Condition="Exists('..\packages\Selenium.Chrome.WebDriver.79.0.0\build\Selenium.Chrome.WebDriver.targets')" />
<Import Project="..\packages\Selenium.Firefox.WebDriver.0.26.0\build\Selenium.Firefox.WebDriver.targets" Condition="Exists('..\packages\Selenium.Firefox.WebDriver.0.26.0\build\Selenium.Firefox.WebDriver.targets')" />
<Import Project="..\packages\Selenium.WebDriver.ChromeDriver.80.0.3987.10600\build\Selenium.WebDriver.ChromeDriver.targets" Condition="Exists('..\packages\Selenium.WebDriver.ChromeDriver.80.0.3987.10600\build\Selenium.WebDriver.ChromeDriver.targets')" />
</Project>
+72
View File
@@ -0,0 +1,72 @@
using OpenBullet.Views.UserControls;
using PluginFramework;
using PluginFramework.Attributes;
using System;
using System.Reflection;
namespace OpenBullet.Plugins
{
public static class Build
{
public static UserControlContainer InputField(object plugin, PropertyInfo property)
{
// Get the first attribute
var attribute = property.GetCustomAttribute<InputField>();
IControl control;
var defaultValue = (dynamic)Convert.ChangeType(property.GetValue(plugin), property.PropertyType);
switch (attribute)
{
case InfoText a:
control = new UserControlInfoText(defaultValue);
break;
case Text a:
control = new UserControlText(defaultValue);
break;
case Numeric a:
control = new UserControlNumeric(defaultValue, a.minimum, a.maximum);
break;
case Checkbox a:
control = new UserControlCheckbox(defaultValue);
break;
case TextMulti a:
control = new UserControlTextMulti(defaultValue);
break;
case FilePicker a:
control = new UserControlFilePicker(defaultValue, a.filter);
break;
case Dropdown a:
control = new UserControlDropdown(defaultValue, a.options);
break;
case WordlistPicker a:
control = new UserControlWordlist();
break;
case ConfigPicker a:
control = new UserControlConfig();
break;
default:
throw new NotImplementedException();
}
return new UserControlContainer(property.Name, control, attribute.label, attribute.tooltip);
}
public static ButtonContainer Button(MethodInfo method, PluginControl pluginControl)
{
// Get the first attribute
var attribute = method.GetCustomAttribute<Button>();
return new ButtonContainer(attribute.text, method.Name, pluginControl);
}
}
}
+91
View File
@@ -0,0 +1,91 @@
using PluginFramework;
using PluginFramework.Attributes;
using RuriLib.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace OpenBullet.Plugins
{
public static class Check
{
private static Dictionary<Type, Type> _requiredPropertyTypes = new Dictionary<Type, Type>()
{
{ typeof(InfoText), typeof(string) },
{ typeof(Text), typeof(string) },
{ typeof(Numeric), typeof(int) },
{ typeof(Checkbox), typeof(bool) },
{ typeof(TextMulti), typeof(string[]) },
{ typeof(FilePicker), typeof(string) },
{ typeof(Dropdown), typeof(string) },
{ typeof(WordlistPicker), typeof(RuriLib.Models.Wordlist) },
{ typeof(ConfigPicker), typeof(RuriLib.ViewModels.ConfigViewModel) }
};
public static bool InputProperty(PropertyInfo property)
{
// Check if it has one and only one InputField
if (property.GetCustomAttributes().Count(a => a is InputField) != 1)
{
return false;
}
/*
* HERE we know for certain that the property was meant to be used as an input field, so we will start throwing exceptions
* if there is something that doesn't meet the criteria
*/
// Get the first attribute
var attribute = property.GetCustomAttribute<InputField>();
// Check if the attribute type exists in the dictionary
if (!_requiredPropertyTypes.ContainsKey(attribute.GetType()))
{
throw new Exception($"Unknown attribute type {attribute.GetType()}");
}
var requiredType = _requiredPropertyTypes[attribute.GetType()];
// Check if the property type is correct
if (property.PropertyType != requiredType)
{
throw new Exception($"The property {property.Name} must be of type {requiredType}");
}
return true;
}
public static bool Method(IPlugin plugin, MethodInfo method)
{
// Check if it has one and only one Button attribute
if (method.GetCustomAttributes().Count(a => a is Button) != 1)
{
return false;
}
/*
* HERE we know for certain that the method was meant to be used as a button, so we will start throwing exceptions
* if there is something that doesn't meet the criteria
*/
// Get the first attribute
var attribute = method.GetCustomAttribute<Button>();
var parameters = method.GetParameters();
// Check if it accepts 0 or 1 parameters
if (parameters.Length > 1)
{
return false;
}
// If the method accepts 1 parameter, check that its type is IApplication
if (parameters.Length == 1 && !parameters.Any(p => p.ParameterType == typeof(IApplication)))
{
return false;
}
return true;
}
}
}
+15
View File
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OpenBullet.Plugins
{
public interface IControl
{
string Name { get; set; }
dynamic GetValue();
void SetValue(dynamic value);
}
}
+128
View File
@@ -0,0 +1,128 @@
using OpenBullet.Views.UserControls;
using PluginFramework;
using RuriLib;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
namespace OpenBullet.Plugins
{
public static class Loader
{
/// <summary>
/// Loads the plugins in a folder one by one.
/// </summary>
/// <param name="folder">The folder where plugins are located</param>
/// <returns>A tuple with the collection of plugin controls and block plugin controls.</returns>
public static (IEnumerable<PluginControl>, IEnumerable<IBlockPlugin>) LoadPlugins(string folder)
{
var plugins = new List<PluginControl>();
var blockPlugins = new List<IBlockPlugin>();
foreach (var dll in Directory.GetFiles(folder, "*.dll"))
{
var asm = Assembly.LoadFrom(dll);
// Hook the dependency folder (a folder with the name of the DLL) if it exists
var depFolder = Path.Combine(OB.pluginsFolder, Path.GetFileNameWithoutExtension(dll));
if (Directory.Exists(depFolder))
{
Hook(new string[] { depFolder });
}
// Load the dependencies
LoadDependencies(asm.GetReferencedAssemblies());
// Search all the types in the assembly
foreach (var type in asm.GetTypes())
{
// If it implements the IPlugin interface
if (type.GetInterface(nameof(IPlugin)) == typeof(IPlugin))
{
plugins.Add(new PluginControl(type, OB.App));
}
// If it implements the IBlockPlugin interface and derives from BlockBase
else if (type.GetInterface(nameof(IBlockPlugin)) == typeof(IBlockPlugin)
&& type.GetTypeInfo().IsSubclassOf(typeof(BlockBase)))
{
blockPlugins.Add(Activator.CreateInstance(type) as IBlockPlugin);
}
}
}
return (plugins, blockPlugins);
}
/// <summary>
/// Loads dependencies recursively in a greedy fashion.
/// </summary>
/// <param name="assemblies">The assemblies for which to load dependencies.</param>
public static void LoadDependencies(IEnumerable<AssemblyName> assemblies)
{
foreach (var asm in assemblies)
{
// Make sure we didn't load it yet
if (!AppDomain.CurrentDomain.GetAssemblies().Any(a => a.GetName().FullName == asm.FullName))
{
try
{
AppDomain.CurrentDomain.Load(asm);
// Load more dependencies recursively
LoadDependencies(Assembly.Load(asm).GetReferencedAssemblies());
}
catch { }
}
}
}
/// <summary>
/// Hooks folders to the AssemblyResolve of the current AppDomain.
/// </summary>
/// <param name="folders">The folders where to search for assemblies</param>
// Found on https://stackoverflow.com/questions/33975073/proper-way-to-resolving-assemblies-from-subfolders
public static void Hook(params string[] folders)
{
AppDomain.CurrentDomain.AssemblyResolve += (sender, args) =>
{
// Check if the requested assembly is part of the loaded assemblies
var loadedAssembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(a => a.FullName == args.Name);
if (loadedAssembly != null)
return loadedAssembly;
// This resolver is called when an loaded control tries to load a generated XmlSerializer - We need to discard it.
// http://connect.microsoft.com/VisualStudio/feedback/details/88566/bindingfailure-an-assembly-failed-to-load-while-using-xmlserialization
var n = new AssemblyName(args.Name);
if (n.Name.EndsWith(".xmlserializers", StringComparison.OrdinalIgnoreCase))
return null;
// http://stackoverflow.com/questions/4368201/appdomain-currentdomain-assemblyresolve-asking-for-a-appname-resources-assembl
if (n.Name.EndsWith(".resources", StringComparison.OrdinalIgnoreCase))
return null;
string assy = null;
// Find the corresponding assembly file
foreach (var dir in folders)
{
assy = new[] { "*.dll", "*.exe" }.SelectMany(g => Directory.EnumerateFiles(dir, g)).FirstOrDefault(f =>
{
try { return n.Name.Equals(AssemblyName.GetAssemblyName(f).Name, StringComparison.OrdinalIgnoreCase); }
catch (BadImageFormatException) { return false; /* Bypass assembly is not a .net exe */ }
catch (Exception ex) { throw new ApplicationException("Error loading assembly " + f, ex); }
});
if (assy != null)
return Assembly.LoadFrom(assy);
}
throw new ApplicationException("Assembly " + args.Name + " not found");
};
}
}
}
@@ -31,7 +31,6 @@ namespace OpenBullet.Repositories
Directory.CreateDirectory(Path.Combine(BaseFolder, entity.Category));
}
if (!File.Exists(path))
{
IOManager.SaveConfig(entity.Config, path);
@@ -1,9 +1,11 @@
using Extreme.Net;
using OpenBullet.Models;
using OpenBullet.Repositories;
using PluginFramework;
using RuriLib;
using RuriLib.Functions.Formats;
using RuriLib.Interfaces;
using RuriLib.LS;
using RuriLib.ViewModels;
using System;
using System.Collections.Generic;
@@ -62,6 +64,16 @@ namespace OpenBullet.ViewModels
Rescan();
}
public IEnumerable<string> GetRequiredPlugins(ConfigViewModel config)
{
return new LoliScript(config.Config.Script)
.ToBlocks()
.OnlyPlugins()
.Cast<IBlockPlugin>()
.Select(p => p.Name)
.Distinct();
}
#region Filters
private string searchString = "";
public string SearchString
+1 -1
View File
@@ -1,4 +1,4 @@
using OpenBullet.Pages.StackerBlocks;
using OpenBullet.Views.StackerBlocks;
using RuriLib;
using RuriLib.Functions.Conditions;
using RuriLib.Models;
@@ -55,7 +55,7 @@ namespace OpenBullet.ViewModels
public RunnerInstance(int id)
{
Id = id;
ViewModel = new RunnerViewModel(OB.Settings.Environment, OB.Settings.RLSettings, OB.Random);
ViewModel = new RunnerViewModel(OB.Settings.Environment, OB.Settings.RLSettings);
View = new Runner(ViewModel);
}
}
+30 -56
View File
@@ -1,7 +1,10 @@
using OpenBullet.Pages.StackerBlocks;
using OpenBullet.Views.StackerBlocks;
using PluginFramework;
using RuriLib;
using RuriLib.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Controls;
using System.Windows.Media;
@@ -10,92 +13,63 @@ namespace OpenBullet.ViewModels
public class StackerBlockViewModel : ViewModelBase
{
private int id;
public int Id { get { return id; } set { id = value; OnPropertyChanged("Id"); } }
public int Id { get => id; set { id = value; OnPropertyChanged(); } }
private bool selected = false;
public bool Selected { get { return selected; } set { selected = value; OnPropertyChanged("Selected"); OnPropertyChanged("BorderColor"); } }
public SolidColorBrush BorderColor { get { return new SolidColorBrush(Selected ? Colors.White : Colors.Black); } }
public bool Selected { get => selected; set { selected = value; OnPropertyChanged(); OnPropertyChanged(nameof(BorderColor)); } }
public SolidColorBrush BorderColor => new SolidColorBrush(Selected ? Colors.White : Colors.Black);
public SolidColorBrush Color { get { return new SolidColorBrush(Block.Disabled ? Colors.Gray : GetBlockColor()); } }
public SolidColorBrush Foreground { get { return new SolidColorBrush(Block.IsSelenium ? Colors.White : Colors.Black); } }
public SolidColorBrush Color => new SolidColorBrush(Block.Disabled ? Colors.Gray : GetBlockColor());
public SolidColorBrush Foreground => new SolidColorBrush(Block.IsSelenium ? Colors.White : Colors.Black);
private int height;
public int Height { get { return height; } set { height = value; OnPropertyChanged("Height"); OnPropertyChanged("FontSize"); } }
public int FontSize { get { return (int)(Height / 3); } }
public int Height { get => height; set { height = value; OnPropertyChanged(); OnPropertyChanged(nameof(FontSize)); } }
public int FontSize => Height / 3;
private Page page;
public Page Page { get { return page; } set { page = value; OnPropertyChanged("Page"); } }
public Page Page { get => page; set { page = value; OnPropertyChanged(); } }
private BlockBase block;
public BlockBase Block { get { return block; } set { block = value; OnPropertyChanged("Block"); } }
public BlockBase Block { get => block; set { block = value; OnPropertyChanged(); } }
public void Disable()
{
if (block.GetType() == typeof(BlockLSCode)) return;
Block.Disabled = !Block.Disabled;
OnPropertyChanged("Color");
OnPropertyChanged(nameof(Color));
}
public void UpdateHeight(int height)
{
Height = height;
OnPropertyChanged("Height");
OnPropertyChanged("FontSize");
OnPropertyChanged(nameof(Height));
OnPropertyChanged(nameof(FontSize));
}
public StackerBlockViewModel(BlockBase block, Random rand)
{
Id = rand.Next();
Block = block;
OnPropertyChanged("Label");
OnPropertyChanged("Color");
OnPropertyChanged(nameof(Block.Label));
OnPropertyChanged(nameof(Color));
// Define mapping scheme
var ts = new TypeSwitch()
.Case((BlockParse x) => Page = new PageBlockParse(x))
.Case((BlockKeycheck x) => Page = new PageBlockKeycheck(x))
.Case((BlockRequest x) => Page = new PageBlockRequest(x))
.Case((BlockRecaptcha x) => Page = new PageBlockRecaptcha(x))
.Case((BlockFunction x) => Page = new PageBlockFunction(x))
.Case((BlockImageCaptcha x) => Page = new PageBlockCaptcha(x))
.Case((BlockBypassCF x) => Page = new PageBlockBypassCF(x))
.Case((BlockUtility x) => Page = new PageBlockUtility(x))
.Case((BlockLSCode x) => Page = new PageBlockLSCode(x))
.Case((BlockTCP x) => Page = new PageBlockTCP(x))
.Case((SBlockNavigate x) => Page = new PageSBlockNavigate(x))
.Case((SBlockBrowserAction x) => Page = new PageSBlockBrowserAction(x))
.Case((SBlockElementAction x) => Page = new PageSBlockElementAction(x))
.Case((SBlockExecuteJS x) => Page = new PageSBlockExecuteJS(x));
ts.Switch(Block);
// Initialize the page
if (OB.BlockMappings.Any(m => m.Item1 == block.GetType()))
{
Page = Activator.CreateInstance(
OB.BlockMappings.First(m => m.Item1 == block.GetType()).Item2,
new object[] { block }) as Page;
}
else
{
throw new Exception($"Tried to initialize a page for the block type {block.GetType().Name} but it wasn't found in the mappings");
}
}
public Color GetBlockColor()
{
Color color = Colors.Black;
// Define mapping scheme
var ts = new TypeSwitch()
.Case((BlockParse x) => color = Colors.Gold)
.Case((BlockKeycheck x) => color = Colors.DodgerBlue)
.Case((BlockRequest x) => color = Colors.LimeGreen)
.Case((BlockRecaptcha x) => color = Colors.Turquoise)
.Case((BlockFunction x) => color = Colors.YellowGreen)
.Case((BlockImageCaptcha x) => color = Colors.DarkOrange)
.Case((BlockBypassCF x) => color = Colors.DarkSalmon)
.Case((BlockUtility x) => color = Colors.Wheat)
.Case((BlockLSCode x) => color = Colors.White)
.Case((BlockTCP x) => color = Colors.MediumPurple)
.Case((SBlockNavigate x) => color = Colors.RoyalBlue)
.Case((SBlockBrowserAction x) => color = Colors.Green)
.Case((SBlockElementAction x) => color = Colors.Firebrick)
.Case((SBlockExecuteJS x) => color = Colors.Indigo);
// Execute type check to set color data
ts.Switch(Block);
return color;
return OB.BlockMappings.First(m => m.Item1 == block.GetType()).Item3;
}
}
}
+13 -1
View File
@@ -1,5 +1,6 @@
using Extreme.Net;
using OpenBullet.Pages.StackerBlocks;
using OpenBullet.Views.StackerBlocks;
using PluginFramework;
using RuriLib;
using RuriLib.LS;
using RuriLib.ViewModels;
@@ -47,6 +48,7 @@ namespace OpenBullet.ViewModels
public List<BlockBase> GetList()
{
ConvertKeychains();
ConvertPlugins();
return Stack.Select(x => x.Block).ToList();
}
@@ -67,6 +69,16 @@ namespace OpenBullet.ViewModels
}
}
public void ConvertPlugins()
{
// For each plugin block in the stack
foreach (StackerBlockViewModel stackerBlock in Stack.Where(sb => sb.Block.IsPlugin()))
{
var page = stackerBlock.Page as BlockPluginPage;
page.SetPropertyValues();
}
}
public StackerBlockViewModel GetBlockById(int id)
{
return Stack.Where(x => x.Id == id).First();
+70 -39
View File
@@ -5,49 +5,80 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OpenBullet.Views.Dialogs"
mc:Ignorable="d"
d:DesignHeight="340" d:DesignWidth="510"
Title="DialogAddBlock">
<Page.Resources>
<Style TargetType="{x:Type Button}">
<Setter Property="FontFamily" Value="pack://application:,,,/Fonts/#Century Gothic"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="FontWeight" Value="Regular" />
<Setter Property="BorderThickness" Value="3"/>
<Setter Property="BorderBrush" Value="Black"/>
<Setter Property="Margin" Value="1"/>
<Setter Property="Width" Value="165" />
<Setter Property="Height" Value="55" />
</Style>
</Page.Resources>
<Grid Height="330" Width="500" Margin="5">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="20" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.Resources>
<Style TargetType="{x:Type Button}">
<Setter Property="FontFamily" Value="pack://application:,,,/Fonts/#Century Gothic"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="FontWeight" Value="Regular" />
<Setter Property="BorderThickness" Value="3"/>
<Setter Property="BorderBrush" Value="Black"/>
<Setter Property="Margin" Value="1"/>
<StackPanel Grid.Row="0" Orientation="Horizontal">
<Label Content="Current set:" />
<Label x:Name="defaultSetLabel" Content="Default" FontWeight="Bold" MouseDown="defaultSetLabel_MouseDown" />
<Label x:Name="pluginsSetLabel" Content="Plugins" FontWeight="Bold" MouseDown="pluginsSetLabel_MouseDown" />
</StackPanel>
<TabControl Grid.Row="1" x:Name="blockSetTabControl" Background="Transparent" BorderThickness="0">
<TabControl.ItemContainerStyle>
<Style TargetType="{x:Type TabItem}">
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
</Grid.Resources>
<Button Grid.Column="0" Grid.Row="0" x:Name="blockRequestButton" Background="LimeGreen" Content="REQUEST" Click="blockRequestButton_Click"/>
<Button Grid.Column="1" Grid.Row="0" x:Name="blockUtilityButton" Background="Wheat" Content="UTILITY" Click="blockUtilityButton_Click"/>
<Button Grid.Column="2" Grid.Row="0" x:Name="blockKeycheckButton" Background="DodgerBlue" Content="KEY CHECK" Click="blockKeycheckButton_Click"/>
<Button Grid.Column="0" Grid.Row="1" x:Name="blockParseButton" Background="Gold" Content="PARSE" Click="blockParseButton_Click"/>
<Button Grid.Column="1" Grid.Row="1" x:Name="blockFunctionButton" Background="YellowGreen" Content="FUNCTION" Click="blockFunctionButton_Click"/>
<Button Grid.Column="2" Grid.Row="1" x:Name="blockRecaptchaButton" Background="Turquoise" Content="RECAPTCHA" Click="blockRecaptchaButton_Click"/>
<Button Grid.Column="0" Grid.Row="2" x:Name="blockCaptchaButton" Background="DarkOrange" Content="CAPTCHA" Click="blockCaptchaButton_Click"/>
<Button Grid.Column="1" Grid.Row="2" x:Name="blockBypassCFButton" Background="DarkSalmon" Content="BYPASS CF" Click="blockBypassCFButton_Click"/>
<Button Grid.Column="2" Grid.Row="2" x:Name="blockTCPButton" Background="MediumPurple" Content="TCP" Click="blockTCPButton_Click"/>
</TabControl.ItemContainerStyle>
<TabItem>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="20" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<Button Grid.Column="0" Grid.Row="0" x:Name="blockRequestButton" Background="LimeGreen" Content="REQUEST" Click="blockRequestButton_Click"/>
<Button Grid.Column="1" Grid.Row="0" x:Name="blockUtilityButton" Background="Wheat" Content="UTILITY" Click="blockUtilityButton_Click"/>
<Button Grid.Column="2" Grid.Row="0" x:Name="blockKeycheckButton" Background="DodgerBlue" Content="KEY CHECK" Click="blockKeycheckButton_Click"/>
<Button Grid.Column="0" Grid.Row="1" x:Name="blockParseButton" Background="Gold" Content="PARSE" Click="blockParseButton_Click"/>
<Button Grid.Column="1" Grid.Row="1" x:Name="blockFunctionButton" Background="YellowGreen" Content="FUNCTION" Click="blockFunctionButton_Click"/>
<Button Grid.Column="2" Grid.Row="1" x:Name="blockRecaptchaButton" Background="Turquoise" Content="RECAPTCHA" Click="blockRecaptchaButton_Click"/>
<Button Grid.Column="0" Grid.Row="2" x:Name="blockCaptchaButton" Background="DarkOrange" Content="CAPTCHA" Click="blockCaptchaButton_Click"/>
<Button Grid.Column="1" Grid.Row="2" x:Name="blockBypassCFButton" Background="DarkSalmon" Content="BYPASS CF" Click="blockBypassCFButton_Click"/>
<Button Grid.Column="2" Grid.Row="2" x:Name="blockTCPButton" Background="MediumPurple" Content="TCP" Click="blockTCPButton_Click"/>
<Button Grid.Column="0" Grid.Row="4" x:Name="blockNavigateButton" Background="RoyalBlue" Foreground="Gainsboro" Content="NAVIGATE" Click="blockNavigateButton_Click"/>
<Button Grid.Column="1" Grid.Row="4" x:Name="blockBrowserActionButton" Background="Green" Foreground="Gainsboro" Content="BROWSER ACTION" Click="blockBrowserActionButton_Click"/>
<Button Grid.Column="2" Grid.Row="4" x:Name="blockElementActionButton" Background="Firebrick" Foreground="Gainsboro" Content="ELEMENT ACTION" Click="blockElementActionButton_Click"/>
<Button Grid.Column="0" Grid.Row="5" x:Name="blockExecuteJSButton" Background="Indigo" Foreground="Gainsboro" Content="EXECUTE JS" Click="blockExecuteJSButton_Click"/>
</Grid>
</TabItem>
<TabItem>
<Grid x:Name="pluginsGrid" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" />
</Grid.ColumnDefinitions>
</Grid>
</TabItem>
</TabControl>
<Button Grid.Column="0" Grid.Row="4" x:Name="blockNavigateButton" Background="RoyalBlue" Foreground="Gainsboro" Content="NAVIGATE" Click="blockNavigateButton_Click"/>
<Button Grid.Column="1" Grid.Row="4" x:Name="blockBrowserActionButton" Background="Green" Foreground="Gainsboro" Content="BROWSER ACTION" Click="blockBrowserActionButton_Click"/>
<Button Grid.Column="2" Grid.Row="4" x:Name="blockElementActionButton" Background="Firebrick" Foreground="Gainsboro" Content="ELEMENT ACTION" Click="blockElementActionButton_Click"/>
<Button Grid.Column="0" Grid.Row="5" x:Name="blockExecuteJSButton" Background="Indigo" Foreground="Gainsboro" Content="EXECUTE JS" Click="blockExecuteJSButton_Click"/>
</Grid>
</Grid>
</Page>
@@ -1,7 +1,11 @@
using OpenBullet.Views.Main.Configs;
using RuriLib;
using System;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
namespace OpenBullet.Views.Dialogs
{
@@ -16,6 +20,35 @@ namespace OpenBullet.Views.Dialogs
{
InitializeComponent();
Caller = caller;
// Add rows to the grid
for(var i = 0; i < OB.BlockPlugins.Count; i += 3)
{
pluginsGrid.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
}
// Create the buttons and fill the grid
for(var i = 0; i < OB.BlockPlugins.Count; i++)
{
var plugin = OB.BlockPlugins[i];
var button = new Button();
button.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(plugin.Color));
if (plugin.LightForeground) button.Foreground = new SolidColorBrush(Colors.Gainsboro);
button.Content = plugin.Name;
button.SetValue(Grid.ColumnProperty, i % 3);
button.SetValue(Grid.RowProperty, i / 3);
button.Tag = plugin.GetType();
button.Click += pluginButton_Click;
pluginsGrid.Children.Add(button);
}
defaultSetLabel_MouseDown(this, null);
}
private void pluginButton_Click(object sender, RoutedEventArgs e)
{
var type = (e.OriginalSource as Button).Tag as Type;
SendBack(Activator.CreateInstance(type) as BlockBase);
}
private void blockRequestButton_Click(object sender, RoutedEventArgs e)
@@ -91,5 +124,19 @@ namespace OpenBullet.Views.Dialogs
}
((MainDialog)Parent).Close();
}
private void defaultSetLabel_MouseDown(object sender, MouseButtonEventArgs e)
{
defaultSetLabel.Foreground = Utils.GetBrush("ForegroundMenuSelected");
pluginsSetLabel.Foreground = Utils.GetBrush("ForegroundMain");
blockSetTabControl.SelectedIndex = 0;
}
private void pluginsSetLabel_MouseDown(object sender, MouseButtonEventArgs e)
{
defaultSetLabel.Foreground = Utils.GetBrush("ForegroundMain");
pluginsSetLabel.Foreground = Utils.GetBrush("ForegroundMenuSelected");
blockSetTabControl.SelectedIndex = 1;
}
}
}
@@ -1,5 +1,6 @@
using OpenBullet.ViewModels;
using OpenBullet.Views.Main.Runner;
using OpenBullet.Views.UserControls;
using RuriLib;
using RuriLib.ViewModels;
using System.ComponentModel;
@@ -40,6 +41,10 @@ namespace OpenBullet
if (OB.OBSettings.General.LiveConfigUpdates) runner.SetConfig(config);
else runner.SetConfig(IOManager.CloneConfig(config));
}
else if (Caller.GetType() == typeof(UserControlConfig))
{
((UserControlConfig)Caller).Config = (ConfigViewModel)configsListView.SelectedItem;
}
((MainDialog)Parent).Close();
}
@@ -1,4 +1,5 @@
using OpenBullet.Views.Main.Runner;
using OpenBullet.Views.UserControls;
using RuriLib.Models;
using System.ComponentModel;
using System.IO;
@@ -33,6 +34,10 @@ namespace OpenBullet
{
((Runner)Caller).SetWordlist((Wordlist)wordlistsListView.SelectedItem);
}
else if (Caller.GetType() == typeof(UserControlWordlist))
{
((UserControlWordlist)Caller).Wordlist = (Wordlist)wordlistsListView.SelectedItem;
}
((MainDialog)Parent).Close();
}
@@ -173,6 +173,7 @@ namespace OpenBullet.Views.Main.Configs
var stacker = OB.Stacker;
stacker.ConvertKeychains();
stacker.ConvertPlugins();
if (stacker.View == StackerView.Blocks)
stacker.LS.FromBlocks(stacker.GetList());
@@ -183,6 +184,7 @@ namespace OpenBullet.Views.Main.Configs
vm.CurrentConfig.Config.Settings.LastModified = DateTime.Now;
vm.CurrentConfig.Config.Settings.Version = OB.Version;
vm.CurrentConfig.Config.Settings.RequiredPlugins = vm.GetRequiredPlugins(vm.CurrentConfig).ToArray();
OB.Logger.LogInfo(Components.ConfigManager, "Converted the unbinded observables and set the Last Modified date");
// Save to file
@@ -203,7 +205,18 @@ namespace OpenBullet.Views.Main.Configs
{
if (config == null)
{
OB.Logger.LogError(Components.ConfigManager, "The config to load cannot be null");
OB.Logger.LogError(Components.ConfigManager, "The config to load cannot be null", true);
return;
}
try
{
OBIOManager.CheckRequiredPlugins(OB.BlockPlugins.Select(b => b.Name), config.Config);
}
catch (Exception ex)
{
OB.Logger.LogError(Components.ConfigManager, ex.Message, true);
return;
}
// Set the config as current
@@ -25,6 +25,8 @@
<Label Content="Maximum CPM to avoid overloading the website (0 = infinite)" />
<xctk:IntegerUpDown Background="Transparent" Width="100" Margin="10 0 0 0" Value="{Binding MaxCPM}" Foreground="{DynamicResource ForegroundMain}" HorizontalAlignment="Left" Minimum="0" Maximum="100000"/>
</DockPanel>
<CheckBox Content="Save empty captures" IsChecked="{Binding SaveEmptyCaptures}" VerticalContentAlignment="Center"/>
<CheckBox Content="Continue after Custom Status" IsChecked="{Binding ContinueOnCustom}" VerticalContentAlignment="Center"/>
</StackPanel>
</Grid>
</Page>
@@ -15,10 +15,9 @@
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
<DockPanel Margin="5">
<CheckBox DockPanel.Dock="Top" Content="Always Open browser at the start" IsChecked="{Binding AlwaysOpen}" VerticalContentAlignment="Center"/>
<CheckBox DockPanel.Dock="Top" Content="Always Quit browser at the end" IsChecked="{Binding AlwaysQuit}" VerticalContentAlignment="Center"/>
</DockPanel>
<CheckBox Content="Always Open browser at the start" IsChecked="{Binding AlwaysOpen}" VerticalContentAlignment="Center"/>
<CheckBox Content="Always Quit browser at the end" IsChecked="{Binding AlwaysQuit}" VerticalContentAlignment="Center"/>
<CheckBox Content="Quit browser only on BAN or RETRY" IsChecked="{Binding QuitOnBanRetry}" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Grid.Column="1">
<DockPanel Margin="5">
@@ -344,7 +344,7 @@ namespace OpenBullet.Views.Main.Configs
// Initialize BotData and Reset LS
var cData = new CData(vm.TestData, OB.Settings.Environment.GetWordlistType(vm.TestDataType));
vm.BotData = new BotData(OB.Settings.RLSettings, vm.Config.Config.Settings, cData, proxy, vm.UseProxy, OB.Random);
vm.BotData = new BotData(OB.Settings.RLSettings, vm.Config.Config.Settings, cData, proxy, vm.UseProxy, new Random());
vm.LS.Reset();
// Ask for user input
@@ -416,7 +416,7 @@ namespace OpenBullet.Views.Main.Configs
}
// Quit Browser if Always Quit
if (vm.Config.Config.Settings.AlwaysQuit)
if (vm.Config.Config.Settings.AlwaysQuit || (vm.Config.Config.Settings.QuitOnBanRetry && (vm.BotData.Status == BotStatus.BAN || vm.BotData.Status == BotStatus.RETRY)))
{
try {
vm.BotData.Driver.Quit();
+32
View File
@@ -0,0 +1,32 @@
<Page x:Class="OpenBullet.Views.Main.PluginsSection"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OpenBullet.Views.Main"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
Title="Plugins">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="30" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Foreground="{DynamicResource ForegroundCustom}" Margin="0 0 0 10" >
<Span>Remember that some plugins might contain </Span>
<Span FontWeight="Bold" Foreground="{DynamicResource ForegroundBad}">MALICIOUS CODE</Span>
<Span>that runs even without clicking any buttons!</Span>
<Span TextDecorations="Underline" FontWeight="Bold">Only load plugins you can trust!</Span>
</TextBlock>
<StackPanel Grid.Row="1" x:Name="topMenu" Orientation="Horizontal">
<Label Content="Selected Plugin:" />
<ComboBox x:Name="pluginSelector" Width="200" Margin="5 0 0 0" SelectionChanged="pluginSelector_SelectionChanged" />
</StackPanel>
<Frame Grid.Row="2" x:Name="Main" NavigationUIVisibility="Hidden" />
</Grid>
</Page>
@@ -0,0 +1,47 @@
using OpenBullet.Views.UserControls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace OpenBullet.Views.Main
{
/// <summary>
/// Logica di interazione per PluginsSection.xaml
/// </summary>
public partial class PluginsSection : Page
{
private List<PluginControl> controls;
public PluginsSection(IEnumerable<PluginControl> controls)
{
InitializeComponent();
this.controls = controls.ToList();
foreach (var control in this.controls)
{
pluginSelector.Items.Add(control.Plugin.Name);
}
if (this.controls.Count > 0)
{
pluginSelector.SelectedIndex = 0;
}
}
private void pluginSelector_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
Main.Content = controls.First(c => c.Plugin.Name == (string)pluginSelector.SelectedValue);
}
}
}
+19 -11
View File
@@ -102,20 +102,16 @@ namespace OpenBullet.Views.Main.Runner
private void RegisterHit(IRunnerMessaging sender, Hit hit)
{
OB.Logger.LogInfo(Components.Runner, $"Adding {hit.Type} hit " + hit.Data + " to the DB");
try
Application.Current.Dispatcher.Invoke(new Action(() =>
{
using (var db = new LiteDatabase(OB.dataBaseFile))
try
{
App.Current.Dispatcher.Invoke(new Action(() =>
{
OB.HitsDB.Add(hit);
OB.MainWindow.HitsDBPage.AddConfigToFilter(vm.ConfigName);
}));
db.GetCollection<Hit>("hits").Insert(hit);
OB.Logger.LogInfo(Components.Runner, $"Adding {hit.Type} hit " + hit.Data + " to the DB");
OB.HitsDB.Add(hit);
OB.MainWindow.HitsDBPage.AddConfigToFilter(vm.ConfigName);
}
}
catch (Exception ex) { OB.Logger.LogError(Components.Runner, $"Failed to add {hit.Type} hit " + hit.Data + $" to the DB - {ex.Message}"); }
catch (Exception ex) { OB.Logger.LogError(Components.Runner, $"Failed to add {hit.Type} hit " + hit.Data + $" to the DB - {ex.Message}"); }
}));
}
private void PlayHitSound(IRunnerMessaging sender, Hit hit)
@@ -204,6 +200,18 @@ namespace OpenBullet.Views.Main.Runner
switch (vm.Master.Status)
{
case WorkerStatus.Idle:
// Check if the required plugins are present
try
{
OBIOManager.CheckRequiredPlugins(OB.BlockPlugins.Select(b => b.Name), vm.Config);
}
catch (Exception ex)
{
OB.Logger.LogError(Components.Runner, ex.Message, true);
return;
}
SetupSoundPlayers();
ThreadPool.SetMinThreads(vm.BotsAmount * 2 + 1, vm.BotsAmount * 2 + 1);
ServicePointManager.DefaultConnectionLimit = 10000; // This sets the default connection limit for requests on the whole application
@@ -35,6 +35,7 @@
<ComboBox DockPanel.Dock="Top" x:Name="botsDisplayModeCombobox" SelectionChanged="botsDisplayModeCombobox_SelectionChanged"/>
<CheckBox Content="Enable Bot Log (slow, RAM-heavy)" IsChecked="{Binding EnableBotLog}" VerticalAlignment="Center" VerticalContentAlignment="Center" />
<CheckBox Content="Save Last Response Source (RAM-heavy)" IsChecked="{Binding SaveLastSource}" VerticalAlignment="Center" VerticalContentAlignment="Center" />
<CheckBox Content="Send data in process to ToCheck on abort" IsChecked="{Binding SendToCheckOnAbort}" VerticalAlignment="Center" VerticalContentAlignment="Center" />
<Label FontWeight="Bold" Content="Hits Webhook" />
<CheckBox Content="Enabled" IsChecked="{Binding WebhookEnabled}" />
<Label Content="URL:" />
@@ -0,0 +1,10 @@
<Page x:Class="OpenBullet.Views.StackerBlocks.BlockPluginPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OpenBullet.Views.StackerBlocks"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<ItemsControl Grid.Row="1" ItemsSource="{Binding Controls}" Margin="5"/>
</Page>
@@ -0,0 +1,54 @@
using OpenBullet.Plugins;
using OpenBullet.Views.UserControls;
using PluginFramework;
using RuriLib;
using RuriLib.Interfaces;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Reflection;
using System.Windows.Controls;
namespace OpenBullet.Views.StackerBlocks
{
/// <summary>
/// Logica di interazione per BlockPluginControl.xaml
/// </summary>
public partial class BlockPluginPage : Page
{
public IBlockPlugin BlockPlugin { get; set; }
public BlockBase Block => BlockPlugin as BlockBase;
public ObservableCollection<UserControl> Controls { get; set; } = new ObservableCollection<UserControl>();
private List<PropertyInfo> ValidProperties { get; set; } = new List<PropertyInfo>();
public BlockPluginPage(IBlockPlugin blockPlugin)
{
InitializeComponent();
DataContext = this;
BlockPlugin = blockPlugin;
// For each valid property, add input field
foreach (var p in BlockPlugin.GetType().GetProperties().Where(p => Check.InputProperty(p)))
{
ValidProperties.Add(p);
Controls.Add(Build.InputField(BlockPlugin, p));
}
}
public void SetPropertyValues()
{
foreach (var property in ValidProperties)
{
// Retrieve and set the value
var value = Controls
.Where(c => c is UserControlContainer)
.Select(c => c as UserControlContainer)
.First(c => c.PropertyName == property.Name).GetValue();
property.SetValue(BlockPlugin, value);
}
}
}
}
@@ -1,9 +1,9 @@
<Page x:Class="OpenBullet.Pages.StackerBlocks.PageBlockBypassCF"
<Page x:Class="OpenBullet.Views.StackerBlocks.PageBlockBypassCF"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OpenBullet.Pages.StackerBlocks"
xmlns:local="clr-namespace:OpenBullet.Views.StackerBlocks"
mc:Ignorable="d"
d:DesignHeight="500" d:DesignWidth="400"
Title="PageBlockBypassCF">
@@ -1,7 +1,7 @@
using RuriLib;
using System.Windows.Controls;
namespace OpenBullet.Pages.StackerBlocks
namespace OpenBullet.Views.StackerBlocks
{
/// <summary>
/// Logica di interazione per PageBlockBypassCF.xaml
@@ -1,9 +1,9 @@
<Page x:Class="OpenBullet.Pages.StackerBlocks.PageBlockCaptcha"
<Page x:Class="OpenBullet.Views.StackerBlocks.PageBlockCaptcha"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OpenBullet.Pages.StackerBlocks"
xmlns:local="clr-namespace:OpenBullet.Views.StackerBlocks"
mc:Ignorable="d"
d:DesignHeight="500" d:DesignWidth="400"
Title="PageBlockCaptcha">
@@ -1,7 +1,7 @@
using RuriLib;
using System.Windows.Controls;
namespace OpenBullet.Pages.StackerBlocks
namespace OpenBullet.Views.StackerBlocks
{
/// <summary>
/// Logica di interazione per PageBlockCaptcha.xaml
@@ -1,9 +1,9 @@
<Page x:Class="OpenBullet.Pages.StackerBlocks.PageBlockFunction"
<Page x:Class="OpenBullet.Views.StackerBlocks.PageBlockFunction"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OpenBullet.Pages.StackerBlocks"
xmlns:local="clr-namespace:OpenBullet.Views.StackerBlocks"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
d:DesignHeight="500" d:DesignWidth="400"
@@ -116,11 +116,14 @@
<TabItem x:Name="randomNumberTab">
<StackPanel>
<DockPanel>
<Label Content="Min:"/>
<xctk:IntegerUpDown Value="{Binding RandomMin}" Minimum="0" Maximum="2147483647" Width="80" HorizontalAlignment="Left"/>
<Label Content="Max:"/>
<xctk:IntegerUpDown Value="{Binding RandomMax}" Minimum="0" Maximum="2147483647" Width="80" HorizontalAlignment="Left"/>
<Label Content="Minimum:"/>
<TextBox Text="{Binding RandomMin, UpdateSourceTrigger=PropertyChanged}"/>
</DockPanel>
<DockPanel>
<Label Content="Maximum:"/>
<TextBox Text="{Binding RandomMax, UpdateSourceTrigger=PropertyChanged}"/>
</DockPanel>
<CheckBox Content="Pad with zeros on the left" IsChecked="{Binding RandomZeroPad}" VerticalContentAlignment="Center"/>
</StackPanel>
</TabItem>
<TabItem x:Name="countOccurrencesTab">
@@ -131,19 +134,28 @@
</DockPanel>
</StackPanel>
</TabItem>
<TabItem x:Name="rsaTab">
<TabItem x:Name="rsaEncTab">
<StackPanel>
<DockPanel>
<Label Content="Key:"/>
<TextBox Text="{Binding RsaKey, UpdateSourceTrigger=PropertyChanged}"/>
<DockPanel Margin="0 5 0 0">
<Label Content="Public Key Modulus (n):"/>
<TextBox Text="{Binding RsaN, UpdateSourceTrigger=PropertyChanged}"/>
</DockPanel>
<DockPanel Margin="0 5 0 0">
<Label Content="Modulus:"/>
<TextBox Text="{Binding RsaMod, UpdateSourceTrigger=PropertyChanged}"/>
<Label Content="Public Key Exponent (e):"/>
<TextBox Text="{Binding RsaE, UpdateSourceTrigger=PropertyChanged}"/>
</DockPanel>
<CheckBox Content="Use OAEP instead of PKCS v1.5" IsChecked="{Binding RsaOAEP}" VerticalContentAlignment="Center"/>
</StackPanel>
</TabItem>
<TabItem x:Name="rsaDecTab">
<StackPanel>
<DockPanel Margin="0 5 0 0">
<Label Content="Public Key Modulus (n):"/>
<TextBox Text="{Binding RsaN, UpdateSourceTrigger=PropertyChanged}"/>
</DockPanel>
<DockPanel Margin="0 5 0 0">
<Label Content="Exponent:"/>
<TextBox Text="{Binding RsaExp, UpdateSourceTrigger=PropertyChanged}"/>
<Label Content="Private Key Exponent (d):"/>
<TextBox Text="{Binding RsaD, UpdateSourceTrigger=PropertyChanged}"/>
</DockPanel>
<CheckBox Content="Use OAEP instead of PKCS v1.5" IsChecked="{Binding RsaOAEP}" VerticalContentAlignment="Center"/>
</StackPanel>
@@ -168,6 +180,18 @@
</DockPanel>
</StackPanel>
</TabItem>
<TabItem x:Name="randomUATab">
<StackPanel>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<CheckBox Grid.Column="0" Content="Generate only for" IsChecked="{Binding UserAgentSpecifyBrowser}" VerticalContentAlignment="Center" Margin="0 0 10 0"/>
<ComboBox Grid.Column="1" x:Name="randomUABrowserCombobox" SelectionChanged="randomUABrowserCombobox_SelectionChanged"/>
</Grid>
</StackPanel>
</TabItem>
<TabItem x:Name="aesTab">
<StackPanel>
<DockPanel Margin="0 5 0 0">
@@ -1,13 +1,14 @@
using OpenBullet.Views.Main.Runner;
using RuriLib;
using RuriLib.Functions.Crypto;
using RuriLib.Functions.UserAgent;
using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Windows;
using System.Windows.Controls;
namespace OpenBullet.Pages.StackerBlocks
namespace OpenBullet.Views.StackerBlocks
{
/// <summary>
/// Logica di interazione per PageBlockFunction.xaml
@@ -38,6 +39,13 @@ namespace OpenBullet.Pages.StackerBlocks
hmacHashTypeCombobox.SelectedIndex = (int)vm.HashType;
kdfAlgorithmCombobox.SelectedIndex = (int)vm.KdfAlgorithm;
foreach (var b in Enum.GetNames(typeof(UserAgent.Browser)))
{
randomUABrowserCombobox.Items.Add(b);
}
randomUABrowserCombobox.SelectedIndex = (int)vm.UserAgentBrowser;
foreach (var m in Enum.GetNames(typeof(CipherMode)))
{
aesModeCombobox.Items.Add(m);
@@ -99,25 +107,34 @@ namespace OpenBullet.Pages.StackerBlocks
break;
case BlockFunction.Function.RSAEncrypt:
case BlockFunction.Function.RSADecrypt:
functionTabControl.SelectedIndex = 9;
break;
case BlockFunction.Function.CharAt:
/*
case BlockFunction.Function.RSADecrypt:
functionTabControl.SelectedIndex = 10;
break;
*/
case BlockFunction.Function.CharAt:
functionTabControl.SelectedIndex = 11;
break;
case BlockFunction.Function.Substring:
functionTabControl.SelectedIndex = 11;
functionTabControl.SelectedIndex = 12;
break;
case BlockFunction.Function.GetRandomUA:
functionTabControl.SelectedIndex = 13;
break;
case BlockFunction.Function.AESEncrypt:
case BlockFunction.Function.AESDecrypt:
functionTabControl.SelectedIndex = 12;
functionTabControl.SelectedIndex = 14;
break;
case BlockFunction.Function.PBKDF2PKCS5:
functionTabControl.SelectedIndex = 13;
functionTabControl.SelectedIndex = 15;
break;
}
}
@@ -168,5 +185,10 @@ namespace OpenBullet.Pages.StackerBlocks
{
vm.KdfAlgorithm = (Hash)((ComboBox)e.OriginalSource).SelectedIndex;
}
private void randomUABrowserCombobox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
vm.UserAgentBrowser = (UserAgent.Browser)((ComboBox)e.OriginalSource).SelectedIndex;
}
}
}
@@ -1,9 +1,9 @@
<Page x:Class="OpenBullet.Pages.StackerBlocks.PageBlockKeycheck"
<Page x:Class="OpenBullet.Views.StackerBlocks.PageBlockKeycheck"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OpenBullet.Pages.StackerBlocks"
xmlns:local="clr-namespace:OpenBullet.Views.StackerBlocks"
mc:Ignorable="d"
d:DesignHeight="500" d:DesignWidth="400"
Title="PageBlockKeycheck">
@@ -7,7 +7,7 @@ using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace OpenBullet.Pages.StackerBlocks
namespace OpenBullet.Views.StackerBlocks
{
/// <summary>
/// Logica di interazione per PageBlockKeycheck.xaml
@@ -1,9 +1,9 @@
<Page x:Class="OpenBullet.Pages.StackerBlocks.PageBlockLSCode"
<Page x:Class="OpenBullet.Views.StackerBlocks.PageBlockLSCode"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OpenBullet.Pages.StackerBlocks"
xmlns:local="clr-namespace:OpenBullet.Views.StackerBlocks"
xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"
mc:Ignorable="d"
d:DesignHeight="500" d:DesignWidth="400"
@@ -17,7 +17,7 @@ using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Xml;
namespace OpenBullet.Pages.StackerBlocks
namespace OpenBullet.Views.StackerBlocks
{
/// <summary>
/// Logica di interazione per PageBlockLSCode.xaml
@@ -1,4 +1,4 @@
<Page x:Class="OpenBullet.Pages.StackerBlocks.PageBlockParse"
<Page x:Class="OpenBullet.Views.StackerBlocks.PageBlockParse"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@@ -6,7 +6,7 @@ using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
namespace OpenBullet.Pages.StackerBlocks
namespace OpenBullet.Views.StackerBlocks
{
/// <summary>
/// Logica di interazione per PageBlockParse.xaml
@@ -1,9 +1,9 @@
<Page x:Class="OpenBullet.Pages.StackerBlocks.PageBlockRecaptcha"
<Page x:Class="OpenBullet.Views.StackerBlocks.PageBlockRecaptcha"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OpenBullet.Pages.StackerBlocks"
xmlns:local="clr-namespace:OpenBullet.Views.StackerBlocks"
mc:Ignorable="d"
d:DesignHeight="500" d:DesignWidth="400"
Title="PageBlockRecaptcha">
@@ -5,7 +5,7 @@ using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Controls;
namespace OpenBullet.Pages.StackerBlocks
namespace OpenBullet.Views.StackerBlocks
{
/// <summary>
/// Logica di interazione per PageBlockRecaptcha.xaml
@@ -1,4 +1,4 @@
<Page x:Class="OpenBullet.Pages.StackerBlocks.PageBlockRequest"
<Page x:Class="OpenBullet.Views.StackerBlocks.PageBlockRequest"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@@ -4,7 +4,7 @@ using System;
using System.Collections.Generic;
using System.Windows.Controls;
namespace OpenBullet.Pages.StackerBlocks
namespace OpenBullet.Views.StackerBlocks
{
/// <summary>
/// Logica di interazione per PageBlockRequest.xaml
@@ -1,9 +1,9 @@
<Page x:Class="OpenBullet.Pages.StackerBlocks.PageBlockTCP"
<Page x:Class="OpenBullet.Views.StackerBlocks.PageBlockTCP"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OpenBullet.Pages.StackerBlocks"
xmlns:local="clr-namespace:OpenBullet.Views.StackerBlocks"
mc:Ignorable="d"
d:DesignHeight="500" d:DesignWidth="400"
Title="PageBlockTCP">
@@ -14,7 +14,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace OpenBullet.Pages.StackerBlocks
namespace OpenBullet.Views.StackerBlocks
{
/// <summary>
/// Logica di interazione per PageBlockTCP.xaml
@@ -1,9 +1,9 @@
<Page x:Class="OpenBullet.Pages.StackerBlocks.PageBlockUtility"
<Page x:Class="OpenBullet.Views.StackerBlocks.PageBlockUtility"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OpenBullet.Pages.StackerBlocks"
xmlns:local="clr-namespace:OpenBullet.Views.StackerBlocks"
mc:Ignorable="d"
d:DesignHeight="500" d:DesignWidth="400"
Title="PageBlockUtility">
@@ -104,6 +104,19 @@
</DockPanel>
</StackPanel>
</TabItem>
<TabItem x:Name="removeValuesTab">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Grid.Column="0" Content="Remove element if" />
<ComboBox Grid.Column="1" x:Name="removeComparerCombobox" SelectionChanged="removeComparerCombobox_SelectionChanged"/>
<TextBox Grid.Column="2" Text="{Binding ListComparisonTerm, UpdateSourceTrigger=PropertyChanged}"/>
</Grid>
</TabItem>
</TabControl>
</StackPanel>
@@ -1,9 +1,10 @@
using RuriLib;
using RuriLib.Functions.Conditions;
using RuriLib.Functions.Conversions;
using System;
using System.Windows.Controls;
namespace OpenBullet.Pages.StackerBlocks
namespace OpenBullet.Views.StackerBlocks
{
/// <summary>
/// Logica di interazione per Pagexaml
@@ -47,6 +48,11 @@ namespace OpenBullet.Pages.StackerBlocks
fileActionCombobox.Items.Add(a);
fileActionCombobox.SelectedIndex = (int)block.FileAction;
foreach (var c in Enum.GetNames(typeof(Comparer)))
removeComparerCombobox.Items.Add(c);
removeComparerCombobox.SelectedIndex = (int)block.ListElementComparer;
}
private void groupCombobox_SelectionChanged(object sender, SelectionChangedEventArgs e)
@@ -111,6 +117,10 @@ namespace OpenBullet.Pages.StackerBlocks
case ListAction.Remove:
listActionTabControl.SelectedIndex = 5;
break;
case ListAction.RemoveValues:
listActionTabControl.SelectedIndex = 6;
break;
}
}
@@ -129,6 +139,11 @@ namespace OpenBullet.Pages.StackerBlocks
block.FileAction = (FileAction)((ComboBox)e.OriginalSource).SelectedIndex;
}
private void removeComparerCombobox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
block.ListElementComparer = (Comparer)((ComboBox)e.OriginalSource).SelectedIndex;
}
private void varActionCombobox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
block.VarAction = (VarAction)((ComboBox)e.OriginalSource).SelectedIndex;
@@ -1,9 +1,9 @@
<Page x:Class="OpenBullet.Pages.StackerBlocks.PageSBlockBrowserAction"
<Page x:Class="OpenBullet.Views.StackerBlocks.PageSBlockBrowserAction"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OpenBullet.Pages.StackerBlocks"
xmlns:local="clr-namespace:OpenBullet.Views.StackerBlocks"
mc:Ignorable="d"
d:DesignHeight="500" d:DesignWidth="400"
Title="PageSBlockBrowserAction">
@@ -3,7 +3,7 @@ using System;
using System.Collections.Generic;
using System.Windows.Controls;
namespace OpenBullet.Pages.StackerBlocks
namespace OpenBullet.Views.StackerBlocks
{
/// <summary>
/// Logica di interazione per PageSBlockBrowserAction.xaml
@@ -1,9 +1,9 @@
<Page x:Class="OpenBullet.Pages.StackerBlocks.PageSBlockElementAction"
<Page x:Class="OpenBullet.Views.StackerBlocks.PageSBlockElementAction"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OpenBullet.Pages.StackerBlocks"
xmlns:local="clr-namespace:OpenBullet.Views.StackerBlocks"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
d:DesignHeight="500" d:DesignWidth="400"
@@ -3,7 +3,7 @@ using System;
using System.Collections.Generic;
using System.Windows.Controls;
namespace OpenBullet.Pages.StackerBlocks
namespace OpenBullet.Views.StackerBlocks
{
/// <summary>
/// Logica di interazione per PageSBlockElementAction.xaml
@@ -1,9 +1,9 @@
<Page x:Class="OpenBullet.Pages.StackerBlocks.PageSBlockExecuteJS"
<Page x:Class="OpenBullet.Views.StackerBlocks.PageSBlockExecuteJS"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OpenBullet.Pages.StackerBlocks"
xmlns:local="clr-namespace:OpenBullet.Views.StackerBlocks"
xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"
mc:Ignorable="d"
d:DesignHeight="500" d:DesignWidth="400"
@@ -3,7 +3,7 @@ using RuriLib;
using System;
using System.Windows.Controls;
namespace OpenBullet.Pages.StackerBlocks
namespace OpenBullet.Views.StackerBlocks
{
/// <summary>
/// Logica di interazione per PageSBlockExecuteJS.xaml
@@ -1,9 +1,9 @@
<Page x:Class="OpenBullet.Pages.StackerBlocks.PageSBlockNavigate"
<Page x:Class="OpenBullet.Views.StackerBlocks.PageSBlockNavigate"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OpenBullet.Pages.StackerBlocks"
xmlns:local="clr-namespace:OpenBullet.Views.StackerBlocks"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
d:DesignHeight="500" d:DesignWidth="400"
@@ -1,7 +1,7 @@
using RuriLib;
using System.Windows.Controls;
namespace OpenBullet.Pages.StackerBlocks
namespace OpenBullet.Views.StackerBlocks
{
/// <summary>
/// Logica di interazione per PageSBlockNavigate.xaml
@@ -0,0 +1,10 @@
<UserControl x:Class="OpenBullet.Views.UserControls.ButtonContainer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OpenBullet.Views.UserControls"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Button x:Name="SubmitButton" Content="{Binding Text}" Margin="5" Padding="5" Click="SubmitButton_Click" />
</UserControl>
@@ -0,0 +1,30 @@
using System.Windows;
using System.Windows.Controls;
namespace OpenBullet.Views.UserControls
{
/// <summary>
/// Logica di interazione per ButtonContainer.xaml
/// </summary>
public partial class ButtonContainer : UserControl
{
public string Text { get; set; }
private string MethodName { get; set; }
private PluginControl PluginControl { get; set; }
public ButtonContainer(string text, string methodName, PluginControl pluginControl)
{
InitializeComponent();
DataContext = this;
Text = text;
MethodName = methodName;
PluginControl = pluginControl;
}
private void SubmitButton_Click(object sender, RoutedEventArgs e)
{
PluginControl.RunMethod(MethodName);
}
}
}
@@ -0,0 +1,18 @@
<UserControl x:Class="OpenBullet.Views.UserControls.PluginControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OpenBullet.Views.UserControls"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<Label Grid.Row="0" FontWeight="Bold" Content="{Binding Plugin.Name}" />
<ItemsControl Grid.Row="1" ItemsSource="{Binding Controls}" Padding="5"/>
</Grid>
</UserControl>
@@ -0,0 +1,77 @@
using OpenBullet.Plugins;
using PluginFramework;
using RuriLib.Interfaces;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Reflection;
using System.Windows.Controls;
namespace OpenBullet.Views.UserControls
{
/// <summary>
/// Logica di interazione per PluginControl.xaml
/// </summary>
public partial class PluginControl : UserControl
{
public IPlugin Plugin { get; set; }
public ObservableCollection<UserControl> Controls { get; set; } = new ObservableCollection<UserControl>();
private List<PropertyInfo> ValidProperties { get; set; } = new List<PropertyInfo>();
public PluginControl(Type type, IApplication app)
{
InitializeComponent();
DataContext = this;
var constructorParams = new object[] { };
// If the constructor supports IApplication
if (type.GetConstructors()
.Any(c => c.GetParameters()
.Any(p => p.ParameterType == typeof(IApplication))))
{
constructorParams = new object[] { app };
}
Plugin = Activator.CreateInstance(type, constructorParams) as IPlugin;
// For each valid property, add input field
foreach (var p in type.GetProperties().Where(p => Check.InputProperty(p)))
{
ValidProperties.Add(p);
Controls.Add(Build.InputField(Plugin, p));
}
// For each valid method, add button
foreach (var m in type.GetMethods().Where(m => Check.Method(Plugin, m)))
{
Controls.Add(Build.Button(m, this));
}
}
public void RunMethod(string methodName)
{
foreach (var property in ValidProperties)
{
// Retrieve and set the value
property.SetValue(Plugin, Controls
.Where(c => c is UserControlContainer)
.Select(c => c as UserControlContainer)
.First(c => c.PropertyName == property.Name).GetValue());
}
var method = Plugin.GetType().GetMethod(methodName);
var parameters = method.GetParameters();
var passed = new object[] { };
// If the method supports 1 paramters of type IApplication
if (parameters.Length == 1 && parameters.First().ParameterType == typeof(IApplication))
{
passed = new object[] { OB.App };
}
method.Invoke(Plugin, passed);
}
}
}
@@ -0,0 +1,17 @@
<UserControl x:Class="OpenBullet.Views.UserControls.UserControlCheckbox"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OpenBullet.Views.UserControls"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<CheckBox Grid.Column="0" IsChecked="{Binding Value}" VerticalContentAlignment="Center" VerticalAlignment="Center"/>
</Grid>
</UserControl>
@@ -0,0 +1,31 @@
using OpenBullet.Plugins;
using System.Windows.Controls;
namespace OpenBullet.Views.UserControls
{
/// <summary>
/// Logica di interazione per UserControlCheckbox.xaml
/// </summary>
public partial class UserControlCheckbox : UserControl, IControl
{
public bool Value { get; set; }
public UserControlCheckbox(bool value)
{
InitializeComponent();
DataContext = this;
Value = value;
}
public dynamic GetValue()
{
return Value;
}
public void SetValue(dynamic value)
{
Value = (bool)value;
}
}
}
@@ -0,0 +1,18 @@
<UserControl x:Class="OpenBullet.Views.UserControls.UserControlConfig"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OpenBullet.Views.UserControls"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="auto" />
</Grid.ColumnDefinitions>
<TextBox x:Name="ConfigName" Grid.Column="0" IsReadOnly="True" VerticalContentAlignment="Center" />
<Button x:Name="Choose" Grid.Column="1" Content="Choose" Click="Choose_Click" Padding="10 0" />
</Grid>
</UserControl>
@@ -0,0 +1,42 @@
using Microsoft.Win32;
using OpenBullet.Plugins;
using RuriLib.Models;
using RuriLib.ViewModels;
using System.Windows;
using System.Windows.Controls;
namespace OpenBullet.Views.UserControls
{
/// <summary>
/// Logica di interazione per UserControlConfig.xaml
/// </summary>
public partial class UserControlConfig : UserControl, IControl
{
public ConfigViewModel Config { get; set; } = null;
public UserControlConfig()
{
InitializeComponent();
DataContext = this;
}
public dynamic GetValue()
{
return Config;
}
public void SetValue(dynamic value)
{
Config = (ConfigViewModel)value;
}
private void Choose_Click(object sender, RoutedEventArgs e)
{
new MainDialog(new DialogSelectConfig(this), "Select a Config").ShowDialog();
if (Config != null)
{
ConfigName.Text = Config.Name;
}
}
}
}
@@ -0,0 +1,23 @@
<UserControl x:Class="OpenBullet.Views.UserControls.UserControlContainer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OpenBullet.Views.UserControls"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid x:Name="Grid" Margin="0 0 0 5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Grid.Column="0" Content="{Binding Label}">
<Label.ToolTip>
<TextBlock Text="{Binding Tooltip}" />
</Label.ToolTip>
</Label>
<!-- Specific user control goes here -->
</Grid>
</UserControl>
@@ -0,0 +1,43 @@
using OpenBullet.Plugins;
using System.Windows.Controls;
namespace OpenBullet.Views.UserControls
{
/// <summary>
/// Logica di interazione per UserControlContainer.xaml
/// </summary>
public partial class UserControlContainer : UserControl, IControl
{
public string PropertyName { get; set; }
public IControl UserControl { get; set; }
public string Label { get; set; }
public string Tooltip { get; set; }
public UserControlContainer(string propertyName, IControl userControl, string label, string tooltip)
{
InitializeComponent();
DataContext = this;
PropertyName = propertyName;
UserControl = userControl;
var uc = UserControl as UserControl;
uc.SetValue(Grid.ColumnProperty, 1);
Grid.Children.Add(UserControl as UserControl);
Label = label;
Tooltip = tooltip;
}
public dynamic GetValue()
{
return UserControl.GetValue();
}
public void SetValue(dynamic value)
{
UserControl.SetValue(value);
}
}
}
@@ -0,0 +1,17 @@
<UserControl x:Class="OpenBullet.Views.UserControls.UserControlDropdown"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OpenBullet.Views.UserControls"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ComboBox Grid.Column="0" Width="250" x:Name="Dropdown" VerticalContentAlignment="Center" />
</Grid>
</UserControl>
@@ -0,0 +1,34 @@
using OpenBullet.Plugins;
using System.Windows.Controls;
namespace OpenBullet.Views.UserControls
{
/// <summary>
/// Logica di interazione per UserControlDropdown.xaml
/// </summary>
public partial class UserControlDropdown : UserControl, IControl
{
public UserControlDropdown(string value, string[] options)
{
InitializeComponent();
DataContext = this;
foreach (var option in options)
{
Dropdown.Items.Add(option);
}
SetValue(value);
}
public dynamic GetValue()
{
return Dropdown.SelectedValue;
}
public void SetValue(dynamic value)
{
Dropdown.SelectedValue = (string)value;
}
}
}
@@ -0,0 +1,18 @@
<UserControl x:Class="OpenBullet.Views.UserControls.UserControlFilePicker"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OpenBullet.Views.UserControls"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="auto" />
</Grid.ColumnDefinitions>
<TextBox x:Name="Location" Grid.Column="0" IsReadOnly="True" VerticalContentAlignment="Center" />
<Button x:Name="Choose" Grid.Column="1" Content="Choose" Click="Choose_Click" Padding="10 0" />
</Grid>
</UserControl>
@@ -0,0 +1,47 @@
using Microsoft.Win32;
using OpenBullet.Plugins;
using System.Windows;
using System.Windows.Controls;
namespace OpenBullet.Views.UserControls
{
/// <summary>
/// Logica di interazione per UserControlFilePicker.xaml
/// </summary>
public partial class UserControlFilePicker : UserControl, IControl
{
public string Filter { get; set; }
public UserControlFilePicker(string location, string filter)
{
InitializeComponent();
DataContext = this;
Filter = filter;
SetValue(location);
}
public dynamic GetValue()
{
return Location.Text;
}
public void SetValue(dynamic value)
{
Location.Text = (string)value;
}
private void Choose_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = Filter;
var result = ofd.ShowDialog();
if (result.HasValue && result.Value)
{
SetValue(ofd.FileName);
}
}
}
}
@@ -0,0 +1,10 @@
<UserControl x:Class="OpenBullet.Views.UserControls.UserControlInfoText"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OpenBullet.Views.UserControls"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Label Content="{Binding Path=Value, Mode=OneWay}" />
</UserControl>
@@ -0,0 +1,44 @@
using OpenBullet.Plugins;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace OpenBullet.Views.UserControls
{
/// <summary>
/// Logica di interazione per UserControlInfoText.xaml
/// </summary>
public partial class UserControlInfoText : IControl
{
public string Value { get; set; }
public UserControlInfoText(string defaultValue)
{
InitializeComponent();
DataContext = this;
Value = defaultValue;
}
public dynamic GetValue()
{
return Value;
}
public void SetValue(dynamic value)
{
Value = (string)value;
}
}
}
@@ -0,0 +1,18 @@
<UserControl x:Class="OpenBullet.Views.UserControls.UserControlNumeric"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:local="clr-namespace:OpenBullet.Views.UserControls"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<xctk:IntegerUpDown Grid.Column="0" Width="100" Name="myUpDownControl" Value="{Binding Value}" Minimum="{Binding Minimum}" Maximum="{Binding Maximum}" />
</Grid>
</UserControl>
@@ -0,0 +1,35 @@
using OpenBullet.Plugins;
using System.Windows.Controls;
namespace OpenBullet.Views.UserControls
{
/// <summary>
/// Logica di interazione per UserControlNumeric.xaml
/// </summary>
public partial class UserControlNumeric : UserControl, IControl
{
public int Value { get; set; }
public int Minimum { get; set; }
public int Maximum { get; set; }
public UserControlNumeric(int defaultValue, int minimum, int maximum)
{
InitializeComponent();
DataContext = this;
Value = defaultValue;
Minimum = minimum;
Maximum = maximum;
}
public dynamic GetValue()
{
return Value;
}
public void SetValue(dynamic value)
{
Value = (int)value;
}
}
}
@@ -0,0 +1,10 @@
<UserControl x:Class="OpenBullet.Views.UserControls.UserControlText"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OpenBullet.Views.UserControls"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<TextBox Text="{Binding Path=Value, Mode=TwoWay}" VerticalContentAlignment="Center" />
</UserControl>
@@ -0,0 +1,30 @@
using OpenBullet.Plugins;
namespace OpenBullet.Views.UserControls
{
/// <summary>
/// Logica di interazione per UserControlText.xaml
/// </summary>
public partial class UserControlText : IControl
{
public string Value { get; set; }
public UserControlText(string defaultValue)
{
InitializeComponent();
DataContext = this;
Value = defaultValue;
}
public dynamic GetValue()
{
return Value;
}
public void SetValue(dynamic value)
{
Value = (string)value;
}
}
}
@@ -0,0 +1,10 @@
<UserControl x:Class="OpenBullet.Views.UserControls.UserControlTextMulti"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OpenBullet.Views.UserControls"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<TextBox x:Name="Box" TextWrapping="Wrap" AcceptsReturn="True" Height="100" />
</UserControl>
@@ -0,0 +1,31 @@
using OpenBullet.Plugins;
using System;
using System.Windows.Controls;
namespace OpenBullet.Views.UserControls
{
/// <summary>
/// Logica di interazione per UserControlTextMulti.xaml
/// </summary>
public partial class UserControlTextMulti : UserControl, IControl
{
public UserControlTextMulti(string[] value)
{
InitializeComponent();
DataContext = this;
SetValue(value);
}
public dynamic GetValue()
{
return Box.Text.Split(new string[] { "\r\n", "\n" }, StringSplitOptions.None);
}
public void SetValue(dynamic value)
{
var val = (string[])value;
Box.Text = string.Join(Environment.NewLine, val);
}
}
}
@@ -0,0 +1,18 @@
<UserControl x:Class="OpenBullet.Views.UserControls.UserControlWordlist"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OpenBullet.Views.UserControls"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="auto" />
</Grid.ColumnDefinitions>
<TextBox x:Name="WordlistName" Grid.Column="0" IsReadOnly="True" VerticalContentAlignment="Center" />
<Button x:Name="Choose" Grid.Column="1" Content="Choose" Click="Choose_Click" Padding="10 0" />
</Grid>
</UserControl>
@@ -0,0 +1,41 @@
using Microsoft.Win32;
using OpenBullet.Plugins;
using RuriLib.Models;
using System.Windows;
using System.Windows.Controls;
namespace OpenBullet.Views.UserControls
{
/// <summary>
/// Logica di interazione per UserControlWordlist.xaml
/// </summary>
public partial class UserControlWordlist : UserControl, IControl
{
public Wordlist Wordlist { get; set; } = null;
public UserControlWordlist()
{
InitializeComponent();
DataContext = this;
}
public dynamic GetValue()
{
return Wordlist;
}
public void SetValue(dynamic value)
{
Wordlist = (Wordlist)value;
}
private void Choose_Click(object sender, RoutedEventArgs e)
{
new MainDialog(new DialogSelectWordlist(this), "Select a Wordlist").ShowDialog();
if (Wordlist != null)
{
WordlistName.Text = Wordlist.Name;
}
}
}
}
+9 -9
View File
@@ -1,28 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AngleSharp" version="0.13.0" targetFramework="net472" />
<package id="AvalonEdit" version="5.0.4" targetFramework="net461" />
<package id="AvalonEdit" version="6.0.1" targetFramework="net472" />
<package id="DynamicLanguageRuntime" version="1.2.2" targetFramework="net461" />
<package id="Extended.Wpf.Toolkit" version="3.5.0" targetFramework="net461" />
<package id="Extended.Wpf.Toolkit" version="3.8.1" targetFramework="net472" />
<package id="Infragistics.Themes.MetroDark.Wpf" version="1.0.0" targetFramework="net461" />
<package id="IronPython" version="2.7.9" targetFramework="net461" />
<package id="Jint" version="2.11.58" targetFramework="net461" />
<package id="LiteDB" version="4.1.4" targetFramework="net461" />
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net461" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net472" />
<package id="ProxySocket" version="1.1.2" targetFramework="net461" />
<package id="Selenium.Chrome.WebDriver" version="76.0.0" targetFramework="net461" />
<package id="Selenium.Firefox.WebDriver" version="0.24.0" targetFramework="net461" />
<package id="Selenium.Chrome.WebDriver" version="79.0.0" targetFramework="net472" />
<package id="Selenium.Firefox.WebDriver" version="0.26.0" targetFramework="net472" />
<package id="Selenium.Support" version="3.141.0" targetFramework="net461" />
<package id="Selenium.WebDriver" version="3.141.0" targetFramework="net461" />
<package id="Selenium.WebDriver.ChromeDriver" version="78.0.3904.10500" targetFramework="net472" />
<package id="Selenium.WebDriver.ChromeDriver" version="80.0.3987.10600" targetFramework="net472" />
<package id="Selenium.WebDriver.GeckoDriver.Win64" version="0.26.0" targetFramework="net472" />
<package id="System.IO" version="4.3.0" targetFramework="net472" />
<package id="System.Net.Http" version="4.3.4" targetFramework="net461" />
<package id="System.Runtime" version="4.3.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net472" />
<package id="System.Runtime" version="4.3.1" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.7.0" targetFramework="net472" />
<package id="System.Security.Cryptography.Algorithms" version="4.3.1" targetFramework="net472" />
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net472" />
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net472" />
<package id="System.Security.Cryptography.X509Certificates" version="4.3.2" targetFramework="net461" />
<package id="System.Text.Encoding.CodePages" version="4.5.1" targetFramework="net472" />
<package id="System.Text.Encoding.CodePages" version="4.7.0" targetFramework="net472" />
</packages>
+1 -1
View File
@@ -8,7 +8,7 @@
<probing privatePath="bin" />
<dependentAssembly>
<assemblyIdentity name="System.Text.Encoding.CodePages" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
<bindingRedirect oldVersion="0.0.0.0-4.1.3.0" newVersion="4.1.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
+4 -4
View File
@@ -52,11 +52,11 @@
<ApplicationIcon>OBlogoIcon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Colorful.Console, Version=1.2.9.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Colorful.Console.1.2.9\lib\net461\Colorful.Console.dll</HintPath>
<Reference Include="Colorful.Console, Version=1.2.10.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Colorful.Console.1.2.10\lib\net461\Colorful.Console.dll</HintPath>
</Reference>
<Reference Include="CommandLine, Version=2.6.0.0, Culture=neutral, PublicKeyToken=5a870481e358d379, processorArchitecture=MSIL">
<HintPath>..\packages\CommandLineParser.2.6.0\lib\net461\CommandLine.dll</HintPath>
<Reference Include="CommandLine, Version=2.7.82.0, Culture=neutral, PublicKeyToken=5a870481e358d379, processorArchitecture=MSIL">
<HintPath>..\packages\CommandLineParser.2.7.82\lib\net461\CommandLine.dll</HintPath>
</Reference>
<Reference Include="Extreme.Net, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
+2 -2
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Colorful.Console" version="1.2.9" targetFramework="net461" />
<package id="CommandLineParser" version="2.6.0" targetFramework="net472" />
<package id="Colorful.Console" version="1.2.10" targetFramework="net472" />
<package id="CommandLineParser" version="2.7.82" targetFramework="net472" />
</packages>
+19
View File
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PluginFramework.Attributes
{
[AttributeUsage(AttributeTargets.Method)]
public class Button : Attribute
{
public string text;
public Button(string text)
{
this.text = text;
}
}
}
+13
View File
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PluginFramework.Attributes
{
public class Checkbox : InputField
{
public Checkbox(string label, string tooltip = "") : base(label, tooltip) { }
}
}
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PluginFramework.Attributes
{
public class ConfigPicker : InputField
{
public ConfigPicker(string label, string tooltip = "") : base(label, tooltip) { }
}
}
+15
View File
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PluginFramework.Attributes
{
public class Dropdown : InputField
{
public string[] options = new string[] { };
public Dropdown(string label, string tooltip = "") : base(label, tooltip) { }
}
}
+15
View File
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PluginFramework.Attributes
{
public class FilePicker : InputField
{
public string filter = "Text Files|*.txt";
public FilePicker(string label, string tooltip = "") : base(label, tooltip) { }
}
}
+13
View File
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PluginFramework.Attributes
{
public class InfoText : InputField
{
public InfoText(string label, string tooltip = "") : base(label, tooltip) { }
}
}

Some files were not shown because too many files have changed in this diff Show More