This commit is contained in:
世元 李
2020-03-14 15:24:11 +08:00
parent 019dbd45e6
commit cf3a5c1d7d
77 changed files with 39236 additions and 120 deletions

BIN
cs2_chs/01.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
cs2_chs/02.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
</startup>
</configuration>

View File

@@ -4,6 +4,16 @@
xmlns:local="clr-namespace:cs2_chs"
StartupUri="MainWindow.xaml">
<Application.Resources>
<Style x:Key="tranBtn" TargetType="Button">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="Chrome" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Application.Resources>
</Application>

View File

@@ -5,6 +5,7 @@ using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
namespace cs2_chs
{
@@ -14,4 +15,81 @@ namespace cs2_chs
public partial class App : Application
{
}
public class ImageButton : System.Windows.Controls.Button
{
/// <summary>
/// 图片
/// </summary>
public static readonly DependencyProperty ImageProperty = DependencyProperty.Register("Image", typeof(ImageSource), typeof(ImageButton),
new PropertyMetadata(null));
/// <summary>
/// 图片的宽度
/// </summary>
public static readonly DependencyProperty ImageWidthProperty = DependencyProperty.Register("ImageWidth", typeof(double), typeof(ImageButton),
new PropertyMetadata(double.NaN));
/// <summary>
/// 图片的高度
/// </summary>
public static readonly DependencyProperty ImageHeightProperty = DependencyProperty.Register("ImageHeight", typeof(double), typeof(ImageButton),
new PropertyMetadata(double.NaN));
/// <summary>
/// 构造函数
/// </summary>
static ImageButton()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(ImageButton),
new System.Windows.FrameworkPropertyMetadata(typeof(ImageButton)));
}
/// <summary>
/// 设置图片
/// </summary>
public ImageSource Image
{
get
{
return GetValue(ImageProperty) as ImageSource;
}
set
{
SetValue(ImageProperty, value);
}
}
/// <summary>
/// 图片宽度(属性)
/// </summary>
public double ImageWidth
{
get
{
return (double)GetValue(ImageWidthProperty);
}
set
{
SetValue(ImageWidthProperty, value);
}
}
/// <summary>
/// 图片高度(属性)
/// </summary>
public double ImageHeight
{
get
{
return (double)GetValue(ImageHeightProperty);
}
set
{
SetValue(ImageHeightProperty, value);
}
}
}
}

336
cs2_chs/DllTools.cs Normal file
View File

@@ -0,0 +1,336 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
using System.IO;
using Microsoft.IdentityModel.Logging;
namespace cs2_chs
{
class DllTools
{
[DllImport("kernel32.dll")]
public static extern uint GetLastError();
[DllImport("kernel32.dll", EntryPoint = "LoadLibraryEx", SetLastError = true)]
public static extern int LoadLibraryEx(string lpFileName, IntPtr hReservedNull, LoadLibraryFlags dwFlags);
[DllImport("Kernel32", EntryPoint = "GetProcAddress", SetLastError = true)]
public static extern int GetProcAddress(int handle, string funcname);
[DllImport("Kernel32", EntryPoint = "FreeLibrary", SetLastError = true)]
private static extern int FreeLibrary(int handle);
[DllImport("kernel32.dll", EntryPoint = "GetModuleHandleA", SetLastError = true)]
public static extern int GetModuleHandleA(string lpFileName);
public static Delegate GetFunctionAddress(int dllModule, string functionName, Type t)
{
int address = GetProcAddress(dllModule, functionName);
if (address == 0)
return null;
else
return Marshal.GetDelegateForFunctionPointer(new IntPtr(address), t);
}
public static Delegate GetDelegateFromIntPtr(IntPtr address, Type t)
{
if (address == IntPtr.Zero)
return null;
else
return Marshal.GetDelegateForFunctionPointer(address, t);
}
public static Delegate GetDelegateFromIntPtr(int address, Type t)
{
if (address == 0)
return null;
else
return Marshal.GetDelegateForFunctionPointer(new IntPtr(address), t);
}
public static int LoadSDK(string lpFileName)
{
if (File.Exists(lpFileName))
{
var hReservedNull = IntPtr.Zero;
var dwFlags = LoadLibraryFlags.LOAD_WITH_ALTERED_SEARCH_PATH;
var result = LoadLibraryEx(lpFileName, hReservedNull, dwFlags);
var errCode = GetLastError();
LogHelper.LogInformation($"LoadSDK Result:{result}, ErrorCode: {errCode}");
return result;
}
return 0;
}
public static int ReleaseSDK(int handle)
{
try
{
if (handle > 0)
{
LogHelper.LogInformation($"FreeLibrary handle{handle}");
var result = FreeLibrary(handle);
var errCode = GetLastError();
LogHelper.LogInformation($"FreeLibrary Result:{result}, ErrorCode: {errCode}");
return 0;
}
return -1;
}
catch (Exception ex)
{
//LogHelper.LogException<Exception>(ex);
return -1;
}
}
public enum LoadLibraryFlags : uint
{
/// <summary>
/// DONT_RESOLVE_DLL_REFERENCES
/// </summary>
DONT_RESOLVE_DLL_REFERENCES = 0x00000001,
/// <summary>
/// LOAD_IGNORE_CODE_AUTHZ_LEVEL
/// </summary>
LOAD_IGNORE_CODE_AUTHZ_LEVEL = 0x00000010,
/// <summary>
/// LOAD_LIBRARY_AS_DATAFILE
/// </summary>
LOAD_LIBRARY_AS_DATAFILE = 0x00000002,
/// <summary>
/// LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE
/// </summary>
LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE = 0x00000040,
/// <summary>
/// LOAD_LIBRARY_AS_IMAGE_RESOURCE
/// </summary>
LOAD_LIBRARY_AS_IMAGE_RESOURCE = 0x00000020,
/// <summary>
/// LOAD_LIBRARY_SEARCH_APPLICATION_DIR
/// </summary>
LOAD_LIBRARY_SEARCH_APPLICATION_DIR = 0x00000200,
/// <summary>
/// LOAD_LIBRARY_SEARCH_DEFAULT_DIRS
/// </summary>
LOAD_LIBRARY_SEARCH_DEFAULT_DIRS = 0x00001000,
/// <summary>
/// LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR
/// </summary>
LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR = 0x00000100,
/// <summary>
/// LOAD_LIBRARY_SEARCH_SYSTEM32
/// </summary>
LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800,
/// <summary>
/// LOAD_LIBRARY_SEARCH_USER_DIRS
/// </summary>
LOAD_LIBRARY_SEARCH_USER_DIRS = 0x00000400,
/// <summary>
/// LOAD_WITH_ALTERED_SEARCH_PATH
/// </summary>
LOAD_WITH_ALTERED_SEARCH_PATH = 0x00000008
}
}
public abstract class MProcess
{
[DllImport("kernel32", EntryPoint = "GetModuleHandleW")]
public static extern int GetModuleHandle(string lpModuleName);
[DllImport("kernel32.dll", EntryPoint = "ReadProcessMemory")]
public static extern int _MemoryReadByteSet(int hProcess, int lpBaseAddress, byte[] lpBuffer, int nSize, int lpNumberOfBytesRead);
[DllImport("kernel32.dll", EntryPoint = "ReadProcessMemory")]
public static extern int _MemoryReadInt32(int hProcess, int lpBaseAddress, ref int lpBuffer, int nSize, int lpNumberOfBytesRead);
[DllImport("kernel32.dll", EntryPoint = "WriteProcessMemory")]
public static extern int _MemoryWriteByteSet(int hProcess, int lpBaseAddress, byte[] lpBuffer, int nSize, int lpNumberOfBytesWritten);
[DllImport("kernel32.dll", EntryPoint = "WriteProcessMemory")]
public static extern int _MemoryWriteInt32(int hProcess, int lpBaseAddress, ref int lpBuffer, int nSize, int lpNumberOfBytesWritten);
[DllImport("kernel32.dll", EntryPoint = "GetCurrentProcess")]
public static extern int GetCurrentProcess();
[DllImport("kernel32.dll", EntryPoint = "OpenProcess")]
public static extern int OpenProcess(int dwDesiredAccess, int bInheritHandle, int dwProcessId);
[DllImport("kernel32.dll", EntryPoint = "CloseHandle")]
public static extern int CloseHandle(int hObject);
[DllImport("kernel32.dll", EntryPoint = "RtlMoveMemory")]
public static extern int _CopyMemory_ByteSet_Float(ref float item, ref byte source, int length);
const int PROCESS_POWER_MAX = 2035711;
/// <summary>
/// 读内存整数型
/// </summary>
/// <param name="pID">进程ID</param>
/// <param name="bAddress">0x地址</param>
/// <returns>0失败</returns>
public static int ReadMemoryInt32(int pID, int bAddress)
{
int num = 0;
int handle = GetProcessHandle(pID);
int num3 = MProcess._MemoryReadInt32(handle, bAddress, ref num, 4, 0);
MProcess.CloseHandle(handle);
if (num3 == 0)
{
return 0;
}
else
{
return num;
}
}
/// <summary>
/// 写内存整数型
/// </summary>
/// <param name="pID">进程ID</param>
/// <param name="bAddress">0x地址</param>
/// <param name="value">写入值</param>
/// <returns>false失败 true成功</returns>
public static bool WriteMemoryInt32(int pID, int bAddress, int value)
{
int handle = GetProcessHandle(pID);
int num2 = MProcess._MemoryWriteInt32(handle, bAddress, ref value, 4, 0);
MProcess.CloseHandle(handle);
return num2 != 0;
}
/// <summary>
/// 读内存小数型
/// </summary>
/// <param name="pID">进程ID</param>
/// <param name="bAddress">0x地址</param>
/// <returns>0失败</returns>
public static float ReadMemoryFloat(int pID, int bAddress)
{
//byte[] array = MProcess.GetVoidByteSet(4);
byte[] array = new byte[4];//不取空字节集也可以正确转换成单精度小数型
int handle = GetProcessHandle(pID);
int temp = MProcess._MemoryReadByteSet(handle, bAddress, array, 4, 0);
if (temp == 0)
{
return 0f;
}
else
{
return MProcess.GetFloatFromByteSet(array, 0);
}
}
/// <summary>
/// 写内存小数型
/// </summary>
/// <param name="pID">进程ID</param>
/// <param name="bAddress">0x地址</param>
/// <param name="value">写入数据</param>
/// <returns>false失败</returns>
public static bool WriteMemoryFloat(int pID, int bAddress, float value)
{
//byte[] byteSet = MProcess.GetByteSet(value);
byte[] byteSet = BitConverter.GetBytes(value);//https://msdn.microsoft.com/en-us/library/yhwsaf3w
//byte[] byteSet = Encoding.GetEncoding("gb2312").GetBytes(value.ToString());
return MProcess.WriteMemoryByteSet(pID, bAddress, byteSet, 0);
}
/// <summary>
/// 写内存字节集
/// </summary>
/// <param name="pID">进程ID</param>
/// <param name="bAddress">0x地址</param>
/// <param name="value">字节数据</param>
/// <param name="length">写入长度 0代表字节数据的长度</param>
/// <returns>false失败</returns>
private static bool WriteMemoryByteSet(int pID, int bAddress, byte[] value, int length = 0)
{
int handle = MProcess.GetProcessHandle(pID);
int nSize = (length == 0) ? value.Length : length;
int tmp = MProcess._MemoryWriteByteSet(handle, bAddress, value, nSize, 0);//byte[]属于引用类型 引用类型不用ref也是以传址方式进行运算
//MProcess.CloseHandle(pID);
return tmp != 0;
}
/// <summary>
/// 取空白字节集
/// </summary>
/// <param name="num"></param>
/// <returns></returns>
public static byte[] GetVoidByteSet(int num)
{
if (num <= 0)
{
num = 1;
}
string text = "";
for (int i = 0; i < num; i++)
{
text += "0";
}
return Encoding.UTF8.GetBytes(text);
}
/// <summary>
/// 取进程句柄
/// </summary>
/// <param name="pID">进程ID</param>
/// <returns>进程句柄</returns>
public static int GetProcessHandle(int pID)
{
if (pID == -1)
{
return MProcess.GetCurrentProcess();
}
else
{
return MProcess.OpenProcess(PROCESS_POWER_MAX, 0, pID);
}
}
/// <summary>
/// 字节集转小数型
/// </summary>
/// <param name="sourceValue">字节集</param>
/// <param name="index">索引</param>
/// <returns></returns>
public static float GetFloatFromByteSet(byte[] sourceValue, int index)
{
float result = 0f;
MProcess._CopyMemory_ByteSet_Float(ref result, ref sourceValue[index], 4);
return result;
}
/// <summary>
/// 获取字节集
/// </summary>
/// <param name="data">需要转换到字节集的数据</param>
/// <returns></returns>
public static byte[] GetByteSet(float data)
{
return Encoding.UTF8.GetBytes(data.ToString());
}
}
}

13
cs2_chs/HotKeyWinApi.cs Normal file
View File

@@ -0,0 +1,13 @@

using System;
using System.Runtime.InteropServices;
using System.Windows.Input;
using System.Windows.Interop;
namespace cs2_chs
{
class HotKeyWinApi
{
}
}

View File

@@ -5,8 +5,57 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:cs2_chs"
mc:Ignorable="d"
Title="MainWindow" Height="150" Width="450" ResizeMode="NoResize">
<Grid Loaded="Grid_Loaded">
Title="MainWindow" Height="200" Width="600" ResizeMode="NoResize" Visibility="Visible">
<Grid Loaded="Grid_Loaded" MouseUp="Grid_MouseUp" MouseDown="Grid_MouseDown" Unloaded="Grid_Unloaded">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="74*"/>
<ColumnDefinition Width="223*"/>
</Grid.ColumnDefinitions>
<Grid.Background>
<ImageBrush ImageSource="01.jpg"/>
</Grid.Background>
<TextBox x:Name="TEXT_INPUT" HorizontalAlignment="Left" Height="120" Margin="10,10,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Width="574" AcceptsReturn="True" Grid.ColumnSpan="2">
<TextBox.BorderBrush>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFFFB700" Offset="0.027"/>
<GradientStop Color="#FFFF9A9A" Offset="1"/>
</LinearGradientBrush>
</TextBox.BorderBrush>
<TextBox.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="Black" Offset="0"/>
<GradientStop Color="#FFD8FFFB" Offset="1"/>
<GradientStop Color="#99FFFFFF" Offset="0"/>
</LinearGradientBrush>
</TextBox.Background>
</TextBox>
<Button x:Name="apply" Content="Apply" HorizontalAlignment="Left" Height="25" Margin="348.267,135,0,0" VerticalAlignment="Top" Width="88" Click="Button_Click" Grid.Column="1">
<Button.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="Red" Offset="0"/>
<GradientStop Color="#7FFFBBBB" Offset="0.99"/>
</LinearGradientBrush>
</Button.Background>
</Button>
<ProgressBar x:Name="PBS" HorizontalAlignment="Left" Height="25" Margin="103,135,0,0" VerticalAlignment="Top" Width="388" Visibility="Collapsed" Grid.ColumnSpan="2"/>
<Button Content="Show Japanese" HorizontalAlignment="Left" Margin="10,135,0,0" VerticalAlignment="Top" Width="88" Height="25" Click="Button_Click_1">
<Button.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFFFEE00" Offset="0"/>
<GradientStop Color="#8CFFFAB3" Offset="1"/>
</LinearGradientBrush>
</Button.Background>
</Button>
</Grid>
<Window.Resources>
<RoutedUICommand x:Key="ShowMainWindow" Text="ShowMainWindow" />
</Window.Resources>
<Window.InputBindings>
<KeyBinding Modifiers="Alt" Key="N" Command="{StaticResource ShowMainWindow}"/>
</Window.InputBindings>
<Window.CommandBindings>
<CommandBinding Command="{StaticResource ShowMainWindow}"
CanExecute="CommandBinding_ShowMainWindow_CanExecute"
Executed="CommandBinding_ShowMainWindow_Executed"/>
</Window.CommandBindings>
</Window>

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
@@ -14,6 +15,9 @@ using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Runtime.InteropServices;
using System.Windows.Threading;
using System.Messaging;
namespace cs2_chs
{
/// <summary>
@@ -34,59 +38,158 @@ namespace cs2_chs
}
public partial class MainWindow : Window
{
public static string UTF8To16(string str)
[DllImport("Kernel32.dll", EntryPoint = "WaitForSingleObject")]
public extern static int WaitForSingleObject(uint hHandle, uint dwMilliseconds);
[DllImport("cs2_patch.dll", EntryPoint = "InjectSelfTo")]
public static extern uint pStart(string path);
[DllImport("cs2_patch.dll", EntryPoint = "CreateDataExport")]
public static extern void CreateData([MarshalAs(UnmanagedType.LPWStr)] string path);
[DllImport("Kernel32.dll", EntryPoint = "TerminateProcess")]
public static extern bool TerminateProcess(uint hThread, uint dwExitCode);
[DllImport("Kernel32.dll", EntryPoint = "OpenProcess")]
public static extern uint OpenProcess(uint dwDesiredAccess, bool bInheritHandle, uint dwProcessId);
int pSaveProcess = 0;
uint hThread = 0;
int ms_str = 0;
int ptPid = 0;
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
string res;
int i, len, c;
int char2, char3;
res = "";
len = str.Length;
i = 0;
while (i < len)
if(this.Visibility != Visibility.Visible){
e.Cancel = false;
return;
}
MessageBoxResult res = MessageBox.Show("是否要不关闭游戏,而只隐藏文本编辑窗口?", "确认", MessageBoxButton.YesNoCancel);
if (res == MessageBoxResult.Yes)
{
c = Convert.ToByte(str[i++]);
switch (c >> 4)
e.Cancel = true;
this.ShowInTaskbar = false;
this.Visibility = Visibility.Hidden;
}
else if (res == MessageBoxResult.No)
{
e.Cancel = false;
unsafe
{
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
// 0xxxxxxx
res += str.CharAt(i - 1);
break;
case 12:
case 13:
// 110x xxxx 10xx xxxx
char2 = Convert.ToByte(str[i++]);
res += Convert.ToChar(((c & 0x1F) << 6) | (char2 & 0x3F));
break;
case 14:
// 1110 xxxx 10xx xxxx 10xx xxxx
char2 = Convert.ToByte(str[i++]);
char3 = Convert.ToByte(str[i++]);
res += Convert.ToChar(((c & 0x0F) << 12) |
((char2 & 0x3F) << 6) |
((char3 & 0x3F) << 0));
break;
TerminateProcess(OpenProcess(0x0001, false, *(uint*)ptPid), 1);
}
}
return res;
else if (res == MessageBoxResult.Cancel)
{
e.Cancel = true;
}
}
[DllImport("cs2_patch.dll", EntryPoint = "InjectSelfTo")]
public static extern int pStart(string path);
public MainWindow()
{
InitializeComponent();
this.Closing += Window_Closing;
}
private void Grid_Loaded(object sender, RoutedEventArgs e)
{
// char[] a = { '1', '2', '3' };
pStart("cs2.exe");
// char[] a = { '1', '2', '3' };
hThread = pStart("cs2.exe");
int hMod = DllTools.GetModuleHandleA("cs2_patch.dll");
if (hMod == 0)
MessageBox.Show("error");
pSaveProcess = DllTools.GetProcAddress(hMod, "saveProcess");
ms_str = DllTools.GetProcAddress(hMod, "ms_str");
ptPid = DllTools.GetProcAddress(hMod, "tPid");
Thread threadExit = new Thread(delegate ()
{
WaitForSingleObject(hThread, 0xFFFFFFFF);
this.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate ()
{
this.Close();
});
});
threadExit.Start();
}
private void Grid_MouseUp(object sender, MouseButtonEventArgs e)
{
// this.Visibility = Visibility.Visible;
}
private void Grid_MouseDown(object sender, MouseButtonEventArgs e)
{
}
private void Button_Click(object sender, RoutedEventArgs e)
{
Thread thread1 = new Thread(delegate ()
{
string LocalS = "";
this.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate ()
{
LocalS = TEXT_INPUT.Text;
});
CreateData(LocalS);
});
thread1.Start();
Thread thread2 = new Thread(delegate ()
{
unsafe
{
double* saveProcess = (double*)pSaveProcess;
this.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate ()
{
apply.IsEnabled = false;
PBS.Visibility = Visibility.Visible;
});
while (*saveProcess != 1)
{
this.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate ()
{
PBS.Value = ((*saveProcess) * 100.0);
});
Thread.Sleep(15);
}
this.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate ()
{
apply.IsEnabled = true;
PBS.Visibility = Visibility.Collapsed;
});
*saveProcess = 0;
}
});
thread2.Start();
}
private void Button_Click_1(object sender, RoutedEventArgs e)
{
unsafe
{
char* pms_str = (char*)ms_str;
string MsStr = new string(pms_str);
TEXT_INPUT.Text = MsStr;
}
}
private void CommandBinding_ShowMainWindow_CanExecute(object sender, CanExecuteRoutedEventArgs e)
{
e.CanExecute = false;
}
private void CommandBinding_ShowMainWindow_Executed(object sender, ExecutedRoutedEventArgs e)
{
//this.Visibility = Visibility.Visible;
}
private void Grid_Unloaded(object sender, RoutedEventArgs e)
{
// MessageBox.Show("");
}
}
}

View File

@@ -8,7 +8,7 @@
<OutputType>WinExe</OutputType>
<RootNamespace>cs2_chs</RootNamespace>
<AssemblyName>cs2_chs</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
@@ -25,6 +25,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -34,6 +35,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
@@ -45,6 +47,7 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>..\Release\</OutputPath>
@@ -56,10 +59,16 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.IdentityModel.Logging, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.Logging.5.6.0\lib\net461\Microsoft.IdentityModel.Logging.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Messaging" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
@@ -69,6 +78,9 @@
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WebDriver, Version=3.141.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.WebDriver.3.141.0\lib\net45\WebDriver.dll</HintPath>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
@@ -86,6 +98,8 @@
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="DllTools.cs" />
<Compile Include="HotKeyWinApi.cs" />
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
@@ -109,6 +123,7 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -117,5 +132,11 @@
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Resource Include="01.jpg" />
</ItemGroup>
<ItemGroup>
<Resource Include="02.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

Binary file not shown.

View File

@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "47A6ABC1F984D2628127870792B9669A74CD780D5065D75E37A3BA999C302E28"
#pragma checksum "..\..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "5EE4FB2D2750083127A6673A009D2DA762ABE28530F3E6BD3C3684F089511E6B"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
@@ -40,16 +40,29 @@ namespace cs2_chs {
/// </summary>
public partial class App : System.Windows.Application {
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
#line 5 "..\..\..\App.xaml"
this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative);
#line default
#line hidden
System.Uri resourceLocater = new System.Uri("/cs2_chs;component/app.xaml", System.UriKind.Relative);
#line 1 "..\..\..\App.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
#line default
#line hidden
}

View File

@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "47A6ABC1F984D2628127870792B9669A74CD780D5065D75E37A3BA999C302E28"
#pragma checksum "..\..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "5EE4FB2D2750083127A6673A009D2DA762ABE28530F3E6BD3C3684F089511E6B"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
@@ -40,16 +40,29 @@ namespace cs2_chs {
/// </summary>
public partial class App : System.Windows.Application {
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
#line 5 "..\..\..\App.xaml"
this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative);
#line default
#line hidden
System.Uri resourceLocater = new System.Uri("/cs2_chs;component/app.xaml", System.UriKind.Relative);
#line 1 "..\..\..\App.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
#line default
#line hidden
}

View File

@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "F057702BFD72AA7AA90C434C7677C42026F3D87C5998DD20BC1D7D0294BF503E"
#pragma checksum "..\..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "E3D04CBB8BE3DB8E4A418B3C7A26D391DBAAA15D174ECA9E0843C2E91A401268"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
@@ -40,6 +40,30 @@ namespace cs2_chs {
/// </summary>
public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
#line 17 "..\..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox TEXT_INPUT;
#line default
#line hidden
#line 32 "..\..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button apply;
#line default
#line hidden
#line 40 "..\..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ProgressBar PBS;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
@@ -75,6 +99,61 @@ namespace cs2_chs {
#line 9 "..\..\..\MainWindow.xaml"
((System.Windows.Controls.Grid)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Grid_Loaded);
#line default
#line hidden
#line 9 "..\..\..\MainWindow.xaml"
((System.Windows.Controls.Grid)(target)).MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Grid_MouseUp);
#line default
#line hidden
#line 9 "..\..\..\MainWindow.xaml"
((System.Windows.Controls.Grid)(target)).MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Grid_MouseDown);
#line default
#line hidden
#line 9 "..\..\..\MainWindow.xaml"
((System.Windows.Controls.Grid)(target)).Unloaded += new System.Windows.RoutedEventHandler(this.Grid_Unloaded);
#line default
#line hidden
return;
case 2:
this.TEXT_INPUT = ((System.Windows.Controls.TextBox)(target));
return;
case 3:
this.apply = ((System.Windows.Controls.Button)(target));
#line 32 "..\..\..\MainWindow.xaml"
this.apply.Click += new System.Windows.RoutedEventHandler(this.Button_Click);
#line default
#line hidden
return;
case 4:
this.PBS = ((System.Windows.Controls.ProgressBar)(target));
return;
case 5:
#line 41 "..\..\..\MainWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_1);
#line default
#line hidden
return;
case 6:
#line 58 "..\..\..\MainWindow.xaml"
((System.Windows.Input.CommandBinding)(target)).CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.CommandBinding_ShowMainWindow_CanExecute);
#line default
#line hidden
#line 59 "..\..\..\MainWindow.xaml"
((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.CommandBinding_ShowMainWindow_Executed);
#line default
#line hidden
return;

View File

@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "F057702BFD72AA7AA90C434C7677C42026F3D87C5998DD20BC1D7D0294BF503E"
#pragma checksum "..\..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "E3D04CBB8BE3DB8E4A418B3C7A26D391DBAAA15D174ECA9E0843C2E91A401268"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
@@ -40,6 +40,30 @@ namespace cs2_chs {
/// </summary>
public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
#line 17 "..\..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox TEXT_INPUT;
#line default
#line hidden
#line 32 "..\..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button apply;
#line default
#line hidden
#line 40 "..\..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ProgressBar PBS;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
@@ -75,6 +99,61 @@ namespace cs2_chs {
#line 9 "..\..\..\MainWindow.xaml"
((System.Windows.Controls.Grid)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Grid_Loaded);
#line default
#line hidden
#line 9 "..\..\..\MainWindow.xaml"
((System.Windows.Controls.Grid)(target)).MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Grid_MouseUp);
#line default
#line hidden
#line 9 "..\..\..\MainWindow.xaml"
((System.Windows.Controls.Grid)(target)).MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Grid_MouseDown);
#line default
#line hidden
#line 9 "..\..\..\MainWindow.xaml"
((System.Windows.Controls.Grid)(target)).Unloaded += new System.Windows.RoutedEventHandler(this.Grid_Unloaded);
#line default
#line hidden
return;
case 2:
this.TEXT_INPUT = ((System.Windows.Controls.TextBox)(target));
return;
case 3:
this.apply = ((System.Windows.Controls.Button)(target));
#line 32 "..\..\..\MainWindow.xaml"
this.apply.Click += new System.Windows.RoutedEventHandler(this.Button_Click);
#line default
#line hidden
return;
case 4:
this.PBS = ((System.Windows.Controls.ProgressBar)(target));
return;
case 5:
#line 41 "..\..\..\MainWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_1);
#line default
#line hidden
return;
case 6:
#line 58 "..\..\..\MainWindow.xaml"
((System.Windows.Input.CommandBinding)(target)).CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.CommandBinding_ShowMainWindow_CanExecute);
#line default
#line hidden
#line 59 "..\..\..\MainWindow.xaml"
((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.CommandBinding_ShowMainWindow_Executed);
#line default
#line hidden
return;

View File

@@ -0,0 +1,75 @@
#pragma checksum "..\..\..\Moving.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "5E8F2458CC9F4390AACF38269F78C2F2C6AB0646E3267B2430E1F2E557CC34AE"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
using cs2_chs;
namespace cs2_chs {
/// <summary>
/// Moving
/// </summary>
public partial class Moving : System.Windows.Window, System.Windows.Markup.IComponentConnector {
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Uri resourceLocater = new System.Uri("/cs2_chs;component/moving.xaml", System.UriKind.Relative);
#line 1 "..\..\..\Moving.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
#line default
#line hidden
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
this._contentLoaded = true;
}
}
}

View File

@@ -15,3 +15,5 @@ D:\VSProject\cs2\cs2_united\Release\cs2_chs.exe.config
D:\VSProject\cs2\cs2_united\Release\cs2_chs.exe
D:\VSProject\cs2\cs2_united\Release\cs2_chs.pdb
D:\VSProject\cs2\cs2_united\cs2_chs\obj\x86\Release\cs2_chs.csprojAssemblyReference.cache
D:\VSProject\cs2\cs2_united\cs2_chs\obj\x86\Release\cs2_chs.csproj.CopyComplete
D:\VSProject\cs2\cs2_united\cs2_chs\obj\x86\Release\App.baml

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,13 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
[assembly: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("02.png")]

View File

@@ -12,8 +12,8 @@ TRACE
D:\VSProject\cs2\cs2_united\cs2_chs\App.xaml
11151548125
5-2017746502
13152784993
7-1981105727
171117567902
MainWindow.xaml;
False

View File

@@ -12,9 +12,9 @@ TRACE
D:\VSProject\cs2\cs2_united\cs2_chs\App.xaml
11151548125
6-1262306213
13152784993
81203939881
171117567902
MainWindow.xaml;
False
True

View File

@@ -0,0 +1,4 @@

FD:\VSProject\cs2\cs2_united\cs2_chs\App.xaml;;
FD:\VSProject\cs2\cs2_united\cs2_chs\MainWindow.xaml;;

View File

@@ -1,4 +1,4 @@

FD:\VSProject\cs2\cs2_united\cs2_chs\App.xaml;;
FD:\VSProject\cs2\cs2_united\cs2_chs\MainWindow.xaml;;

5
cs2_chs/packages.config Normal file
View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.IdentityModel.Logging" version="5.6.0" targetFramework="net472" />
<package id="Selenium.WebDriver" version="3.141.0" targetFramework="net472" />
</packages>