Compare commits

...

10 Commits

Author SHA1 Message Date
世元 李
08a24a698a Com 2020-03-25 17:54:37 +08:00
世元 李
4c96cb0c24 new 2020-03-24 22:07:27 +08:00
世元 李
331e8c81bd Asa 2020-03-23 15:02:48 +08:00
世元 李
691de30f58 Merge branch 'master' of https://github.com/rootacite/cs2_united 2020-03-23 09:41:03 +08:00
世元 李
e84d435499 Abrot 2020-03-23 09:38:30 +08:00
Shina Li
0c5bf985f4 Create LICENSE 2020-03-22 18:58:24 +08:00
世元 李
ab9535dc03 last 2020-03-22 18:44:07 +08:00
世元 李
f46573572a none 2020-03-20 16:27:30 +08:00
世元 李
06d419e563 data 2020-03-20 16:13:48 +08:00
世元 李
6ba09c63be Dynamic memory 2020-03-19 23:31:22 +08:00
74 changed files with 1092 additions and 252 deletions

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 Shina Li
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

BIN
cs2_chs/04.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -5,8 +5,8 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:cs2_chs"
mc:Ignorable="d"
Title="Advance" Height="389.052" Width="712.641" ResizeMode="NoResize" MouseMove="Window_MouseMove">
<Grid Margin="0,0,0,0.2" HorizontalAlignment="Left" Width="703">
Topmost="True" Title="Advance" Height="389.052" Width="712.641" ResizeMode="NoResize" MouseMove="Window_MouseMove">
<Grid Margin="0,0,0,0.2" HorizontalAlignment="Left" Width="703" MouseWheel="Grid_MouseWheel">
<Grid.Background>
<ImageBrush ImageSource="03.png"/>
</Grid.Background>
@@ -45,5 +45,7 @@
</TextBox>
<TextBlock HorizontalAlignment="Left" Margin="292,57,0,0" TextWrapping="Wrap" Text="转换后的文本:" VerticalAlignment="Top" Height="29" FontSize="16"/>
<CheckBox x:Name="REASE" Content="去除重复字符(ああー>あ)" HorizontalAlignment="Left" Margin="497,198,0,0" VerticalAlignment="Top" Checked="CheckBox_Checked" Unchecked="REASE_Unchecked"/>
<CheckBox x:Name="ENREP" Content="启用暴力替换" HorizontalAlignment="Left" Margin="292,99,0,0" VerticalAlignment="Top" Checked="ENREP_Checked" Unchecked="ENREP_Unchecked"/>
<CheckBox Content="多字节字符集" HorizontalAlignment="Left" Margin="292,136,0,0" VerticalAlignment="Top"/>
</Grid>
</Window>

View File

@@ -13,6 +13,8 @@ using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Threading;
using System.Windows.Threading;
using System.Runtime.InteropServices;
using System.Windows.Interop;
namespace cs2_chs
{
@@ -21,10 +23,64 @@ namespace cs2_chs
/// </summary>
public partial class Advance : Window
{
public TextView tv = new TextView();
public bool enChanged = false;
static public Thread threadRestore;
bool enFaileden = false;
static bool enFaileden = false;
[DllImport("cs2_patch.dll", EntryPoint = "GetResultData")]
public static extern uint GetResultData();
[DllImport("user32", EntryPoint = "SetWindowLong")]
private static extern uint SetWindowLong(IntPtr hwnd, int nIndex, int NewLong);
static public void TranSpleteProc(ref string itoc)
{
string pitoc = itoc;
bool repeatflag = false;
if (enFaileden)
{
itoc = "";
char lob = '\0';
foreach (char t in pitoc)
{
if (t != lob|| repeatflag)
{
itoc += t;
lob = t;
repeatflag = false;
}
else
{
repeatflag = true;
}
}
}
else
{
return;
}
}
static public void UnTranSpleteProc(ref string itoc)
{
string pitoc = itoc;
if (enFaileden)
{
itoc = "";
foreach (char t in pitoc)
{
itoc += t;
itoc += t;
}
}
else
{
return;
}
}
public Advance()
{
InitializeComponent();
@@ -39,7 +95,7 @@ namespace cs2_chs
this.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate ()
{
if (MainWindow.nID != 0)
IDnPut.Text = Convert.ToString((*(uint*)MainWindow.nID) - 1, 10);
IDnPut.Text = Convert.ToString(*(int*)MainWindow.nID, 10);
});
Thread.Sleep(100);
}
@@ -56,28 +112,14 @@ namespace cs2_chs
{
string loacl = new string((char*)MainWindow.ns_str);
string lobnob = "";
if (enFaileden)
{
char lob = '\0';
foreach (char t in loacl)
{
if (t != lob)
{
lobnob += t;
lob = t;
}
}
}
else
{
lobnob = loacl;
//MessageBox.Show("");
}
string lobnob = loacl;
TranSpleteProc(ref lobnob);
this.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate ()
{
TRAN_OPT.Text = lobnob;
OutPutLog.Text = loacl;
});
Thread.Sleep(50);
}
@@ -115,6 +157,8 @@ namespace cs2_chs
OM_GPY.IsEnabled = true;
OM_TOT.IsEnabled = true;
OutPutLog.IsEnabled = true;
IDnPut.IsEnabled = false;
ENREP.IsEnabled = true;
MainWindow.EndReplace();
MainWindow.thisPfc.SRC_OUTPUT.IsReadOnly = false;
unsafe
@@ -127,6 +171,8 @@ namespace cs2_chs
OM_GPY.IsEnabled = false;
OM_TOT.IsEnabled = false;
OutPutLog.IsEnabled = false;
IDnPut.IsEnabled = true;
ENREP.IsEnabled = false;
MainWindow.StartReplace();
MainWindow.thisPfc.SRC_OUTPUT.IsReadOnly = true;
unsafe
@@ -195,5 +241,33 @@ namespace cs2_chs
{
enFaileden = false;
}
private void ENREP_Checked(object sender, RoutedEventArgs e)
{
tv.Show();
unsafe
{
(*(bool*)MainWindow.enReplace) = true;
MainWindow.initdata.EnRep = true;
}
}
private void ENREP_Unchecked(object sender, RoutedEventArgs e)
{
tv.Hide();
unsafe
{
(*(bool*)MainWindow.enReplace) = false;
MainWindow.initdata.EnRep = false;
}
}
private void Grid_MouseWheel(object sender, MouseWheelEventArgs e)
{
unsafe
{
tv.textbar.Text = new string((char*)GetResultData());
}
}
}
}

View File

@@ -1,5 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<Init>
<StartUp>cs2.exe</StartUp>
<Addr>5FC1C0</Addr>
<Addr>5fc1c0</Addr>
<vio>false</vio>
<viom>0</viom>
<rep>false</rep>
<x>752</x>
<y>230</y>
<w>743</w>
<h>88</h>
</Init>

View File

@@ -6,6 +6,13 @@ using System.Threading.Tasks;
using System.Xml.Linq;
namespace cs2_chs
{
public struct LocationData
{
public int X;
public int Y;
public int Height;
public int Width;
}
public class InitData
{
public XDocument doc;
@@ -14,8 +21,44 @@ namespace cs2_chs
private string startUp;
private bool enVio;
private int vioMode;
private bool enRep;
private LocationData loct;
public bool successedLoad = false;
public LocationData Loct
{
get
{
return loct;
}
set
{
loct = value;
doc.Root.Element("x").Value = Convert.ToString(value.X, 10);
doc.Root.Element("y").Value = Convert.ToString(value.Y, 10);
doc.Root.Element("w").Value = Convert.ToString(value.Width, 10);
doc.Root.Element("h").Value = Convert.ToString(value.Height, 10);
doc.Save("Init.xml");
}
}
public bool EnRep
{
get
{
return enRep;
}
set
{
enRep = value;
doc.Root.Element("rep").Value = value ? "true" : "false";
doc.Save("Init.xml");
}
}
public int VioMode
{
get
@@ -77,6 +120,12 @@ namespace cs2_chs
addr = Convert.ToUInt32(doc.Root.Element("Addr").Value, 16);
enVio = (doc.Root.Element("vio").Value == "true" ? true : false);
vioMode = Convert.ToInt32(doc.Root.Element("viom").Value, 10);
enRep = (doc.Root.Element("rep").Value == "true" ? true : false);
loct.X= Convert.ToInt32(doc.Root.Element("x").Value, 10);
loct.Y = Convert.ToInt32(doc.Root.Element("y").Value, 10);
loct.Width = Convert.ToInt32(doc.Root.Element("w").Value, 10);
loct.Height = Convert.ToInt32(doc.Root.Element("h").Value, 10);
}
catch (Exception e)
{

View File

@@ -5,22 +5,16 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:cs2_chs"
mc:Ignorable="d"
Title="Text Controler" Height="284.5" Width="600" ResizeMode="NoResize" Visibility="Visible" UseLayoutRounding="False">
Topmost="True" Title="Text Controler" Height="284.5" Width="600" ResizeMode="NoResize" Visibility="Visible" UseLayoutRounding="False">
<Grid Loaded="Grid_Loaded" MouseUp="Grid_MouseUp" MouseDown="Grid_MouseDown" Unloaded="Grid_Unloaded">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="74*"/>
<ColumnDefinition Width="223*"/>
<ColumnDefinition Width="145*"/>
<ColumnDefinition Width="449*"/>
</Grid.ColumnDefinitions>
<Grid.Background>
<ImageBrush ImageSource="01.jpg"/>
</Grid.Background>
<TextBox x:Name="TEXT_INPUT" HorizontalAlignment="Left" Height="100" Margin="10,115,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="573" AcceptsReturn="True" Grid.ColumnSpan="2" FontSize="18">
<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 x:Name="TEXT_INPUT" HorizontalAlignment="Left" Height="100" Margin="10,115,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="574" AcceptsReturn="True" FontSize="18" BorderBrush="Red" MouseRightButtonUp="TEXT_INPUT_MouseRightButtonUp" MouseRightButtonDown="TEXT_INPUT_MouseRightButtonDown" Grid.ColumnSpan="2">
<TextBox.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="Black" Offset="0"/>
@@ -29,16 +23,15 @@
</LinearGradientBrush>
</TextBox.Background>
</TextBox>
<Button x:Name="apply" Content="Apply" HorizontalAlignment="Left" Height="25" Margin="348,220,0,0" VerticalAlignment="Top" Width="88" Click="Button_Click" Grid.Column="1">
<Button x:Name="apply" Content="Commit
" HorizontalAlignment="Left" Height="25" Margin="349.2,220,0,0" VerticalAlignment="Top" Width="90
" 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>
<ImageBrush ImageSource="04.jpg"/>
</Button.Background>
</Button>
<ProgressBar x:Name="PBS" HorizontalAlignment="Left" Height="25" Margin="103,220,0,0" Visibility="Collapsed" VerticalAlignment="Top" Width="388" Grid.ColumnSpan="2"/>
<Button Content="Show Japanese" HorizontalAlignment="Left" Margin="10,220,0,0" VerticalAlignment="Top" Width="88" Height="25" Click="Button_Click_1">
<ProgressBar x:Name="PBS" HorizontalAlignment="Left" Height="25" Margin="103,220,0,0" Visibility="Collapsed" VerticalAlignment="Top" Width="388" Grid.ColumnSpan="2"/>
<Button Content="Pull" HorizontalAlignment="Left" Margin="10,220,0,0" VerticalAlignment="Top" Width="90" Height="25" Click="Button_Click_1" MouseRightButtonUp="Button_MouseRightButtonUp">
<Button.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFFFEE00" Offset="0"/>
@@ -46,7 +39,7 @@
</LinearGradientBrush>
</Button.Background>
</Button>
<TextBox x:Name="SRC_OUTPUT" IsReadOnly="True" HorizontalAlignment="Left" Height="100" Margin="10,10,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="574" Grid.ColumnSpan="2" FontSize="18">
<TextBox x:Name="SRC_OUTPUT" IsReadOnly="True" HorizontalAlignment="Left" Height="100" Margin="10,10,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="574" FontSize="18" MouseRightButtonUp="SRC_OUTPUT_MouseRightButtonUp" Grid.ColumnSpan="2">
<TextBox.BorderBrush>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF05FF6B" Offset="1"/>

View File

@@ -16,28 +16,20 @@ using System.Windows.Shapes;
using System.Runtime.InteropServices;
using System.Windows.Threading;
using System.Messaging;
using System.Windows.Interop;
using System.Activities;
namespace cs2_chs
{
/// <summary>
/// MainWindow.xaml 的交互逻辑
/// </summary>
///
public static class StrMop
{
public static char CharAt(this string str, int index)
{
if (index > str.Length)
return ' ';
string res = str.Substring(index, 1);
return Convert.ToChar(res);
}
}
public partial class MainWindow : Window
{
//TestA
public static InitData initdata = new InitData();
public Advance AdvanceSetting = new Advance();//ChangeGToT
public static InitData initdata = new InitData();//加载初始化信息
public Advance AdvanceSetting = new Advance();//加载高级设置窗口
public static MainWindow thisPfc;
[DllImport("cs2_patch.dll", EntryPoint = "ChangeGToT")]
@@ -58,8 +50,12 @@ namespace cs2_chs
[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);
public static extern uint pStart([MarshalAs(UnmanagedType.LPStr)] string path);
[DllImport("cs2_patch.dll", EntryPoint = "CreateDataExport")]
public static extern void CreateData([MarshalAs(UnmanagedType.LPWStr)] string src,[MarshalAs(UnmanagedType.LPWStr)] string path);
[DllImport("Kernel32.dll", EntryPoint = "TerminateProcess")]
@@ -68,6 +64,8 @@ namespace cs2_chs
public static extern uint OpenProcess(uint dwDesiredAccess, bool bInheritHandle, uint dwProcessId);
[DllImport("Kernel32.dll", EntryPoint = "GetCurrentProcess")]
public static extern uint GetCurrentProcess();
[DllImport("user32", EntryPoint = "SetWindowLong")]
private static extern uint SetWindowLong(IntPtr hwnd, int nIndex, int NewLong);
public static uint pSaveProcess = 0;
public static uint hThread = 0;
public static uint ms_str = 0;
@@ -76,6 +74,9 @@ namespace cs2_chs
public static uint ppMode;
public static uint nID;
public static uint pblockRestoreSrc;
public static uint cn_str = 0;
public static uint IsSuccess = 0;
public static uint enReplace = 0;
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
if(this.Visibility != Visibility.Visible){
@@ -136,12 +137,18 @@ namespace cs2_chs
AdvanceSetting.EnvioMode.Foreground = new SolidColorBrush(Colors.Black);
pblockRestoreSrc = (uint)DllTools.GetProcAddress(hMod, "blockRestoreSrc");
enReplace = (uint)DllTools.GetProcAddress(hMod, "enReplace");
unsafe
{
(*(bool*)pblockRestoreSrc) = initdata.Envio;
(*(bool*)enReplace) = initdata.EnRep;
}
// MessageBox.Show("");
AdvanceSetting.ENREP.IsChecked = initdata.EnRep;
if (initdata.EnRep)
{
AdvanceSetting.tv.Show();
}
switch (initdata.VioMode)
{
case 0:
@@ -161,6 +168,8 @@ namespace cs2_chs
AdvanceSetting.OM_GPY.IsEnabled = true;
AdvanceSetting.OM_TOT.IsEnabled = true;
AdvanceSetting.OutPutLog.IsEnabled = true;
AdvanceSetting.IDnPut.IsEnabled = false;
AdvanceSetting.ENREP.IsEnabled = true;
SRC_OUTPUT.IsReadOnly = false;
EndReplace();
}
@@ -169,6 +178,10 @@ namespace cs2_chs
AdvanceSetting.OM_GPY.IsEnabled = false;
AdvanceSetting.OM_TOT.IsEnabled = false;
AdvanceSetting.OutPutLog.IsEnabled = false;
AdvanceSetting.IDnPut.IsEnabled = true;
AdvanceSetting.ENREP.IsEnabled = false;
StartReplace();
}
if (hMod == 0)
@@ -178,6 +191,9 @@ namespace cs2_chs
ns_str = (uint)DllTools.GetProcAddress(hMod, "ns_str");
ptPid = (uint)DllTools.GetProcAddress(hMod, "tPid");
nID= (uint)DllTools.GetProcAddress(hMod, "nID");
cn_str = (uint)DllTools.GetProcAddress(hMod, "cn_str");
IsSuccess= (uint)DllTools.GetProcAddress(hMod, "IsSuccess");
Thread threadExit = new Thread(delegate ()
{
@@ -208,6 +224,15 @@ namespace cs2_chs
string MsStr = new string(pms_str);
this.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate ()
{
if (*(bool*)IsSuccess)
{
// MessageBox.Show("");
TEXT_INPUT.BorderBrush = new SolidColorBrush(Colors.Green);
}
else
{
TEXT_INPUT.BorderBrush = new SolidColorBrush(Colors.Red);
}
SRC_OUTPUT.Text = MsStr;
});
}
@@ -237,6 +262,10 @@ namespace cs2_chs
LocalS = TEXT_INPUT.Text;
LocalP = SRC_OUTPUT.Text;
});
if (initdata.Envio)
{
Advance.UnTranSpleteProc(ref LocalP);
}
CreateData(LocalP, LocalS);
});
@@ -274,8 +303,8 @@ namespace cs2_chs
{
unsafe
{
char* pms_str = (char*)ms_str;
string MsStr = new string(pms_str);
char* pcn_str = (char*)cn_str;
string MsStr = new string(pcn_str);
TEXT_INPUT.Text = MsStr;
}
}
@@ -292,5 +321,38 @@ namespace cs2_chs
{
// MessageBox.Show("");
}
private void Button_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
{
unsafe
{
char* pcn_str = (char*)ms_str;
string MsStr = new string(pcn_str);
TEXT_INPUT.Text = MsStr;
string BMS = "";
foreach (char i in MsStr)
if (i != '\n') BMS += i;
Clipboard.SetDataObject(BMS);
}
}
private void SRC_OUTPUT_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
{
}
private void TEXT_INPUT_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
{
string data = Clipboard.GetText();
TEXT_INPUT.Text = data;
e.Handled = true;
}
private void TEXT_INPUT_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
{
e.Handled = true;
}
}
}

13
cs2_chs/TextView.xaml Normal file
View File

@@ -0,0 +1,13 @@
<Window x:Class="cs2_chs.TextView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:cs2_chs"
mc:Ignorable="d"
Topmost="True" AllowsTransparency="True" Title="TextView" Height="189.956" Width="1070.203" WindowStyle="None" ResizeMode="NoResize" ShowInTaskbar="False" Background="#00000000">
<Grid Background="#00000000" MouseDown="Grid_MouseDown" MouseUp="Grid_MouseUp" MouseWheel="Grid_MouseWheel">
<TextBlock x:Name="textbar" HorizontalAlignment="Left" Height="170" Margin="10,10,0,0" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Top" Width="1050" FontSize="36" Background="Transparent" Foreground="White" KeyDown="textbar_KeyDown" KeyUp="textbar_KeyUp"/>
</Grid>
</Window>

84
cs2_chs/TextView.xaml.cs Normal file
View File

@@ -0,0 +1,84 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
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.Interop;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace cs2_chs
{
/// <summary>
/// TextView.xaml 的交互逻辑
/// </summary>
public partial class TextView : Window
{
[DllImport("user32", EntryPoint = "SetWindowLong")]
private static extern uint SetWindowLong(IntPtr hwnd, int nIndex, int NewLong);
public TextView()
{
InitializeComponent();
Show();
IntPtr hwnd = new WindowInteropHelper(this).Handle;
// SetWindowLong(hwnd, (-20), 0x20);
Hide();
this.Top = MainWindow.initdata.Loct.Y;
this.Left = MainWindow.initdata.Loct.X;
this.Height = MainWindow.initdata.Loct.Height;
this.Width = MainWindow.initdata.Loct.Width;
}
private void Grid_MouseDown(object sender, MouseButtonEventArgs e)
{
if (Keyboard.IsKeyDown(Key.LeftAlt))
{
this.DragMove();
}
}
private void textbar_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key != Key.LeftAlt)
return;
textbar.Background = new SolidColorBrush(Colors.Pink);
IntPtr hwnd = new WindowInteropHelper(this).Handle;
// SetWindowLong(hwnd, (-20), ~0x20);
}
private void textbar_KeyUp(object sender, KeyEventArgs e)
{
if (e.Key != Key.LeftAlt)
return;
textbar.Background = new SolidColorBrush(Colors.Transparent);
IntPtr hwnd = new WindowInteropHelper(this).Handle;
// SetWindowLong(hwnd, (-20), 0x20);
}
private void Grid_MouseUp(object sender, MouseButtonEventArgs e)
{
LocationData bData;
bData.X = (int)Left;
bData.Y = (int)Top;
bData.Height = (int)Height;
bData.Width = (int)Width;
MainWindow.initdata.Loct = bData;
}
private void Grid_MouseWheel(object sender, MouseWheelEventArgs e)
{
}
}
}

View File

@@ -50,7 +50,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>..\Release\</OutputPath>
<OutputPath>C:\Users\14980\Desktop\Tran_Tools\aikotoba\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
@@ -69,6 +69,7 @@
<HintPath>..\packages\Microsoft.IdentityModel.Logging.5.6.0\lib\net461\Microsoft.IdentityModel.Logging.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Activities" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Messaging" />
@@ -93,6 +94,9 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="TextView.xaml.cs">
<DependentUpon>TextView.xaml</DependentUpon>
</Compile>
<Page Include="Advance.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -115,6 +119,10 @@
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="TextView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
@@ -160,5 +168,8 @@
<ItemGroup>
<Resource Include="03.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="04.jpg" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

Binary file not shown.

View File

@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\Advance.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "14B36F89504AB322533CA92CB6E5863D180B432811F8A590F6262841788C94E3"
#pragma checksum "..\..\..\Advance.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "4086118BC3A2ED0FEBC5AB9C32B57D03818AE03DF764A269847A893F690582F4"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
@@ -112,6 +112,14 @@ namespace cs2_chs {
#line default
#line hidden
#line 48 "..\..\..\Advance.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.CheckBox ENREP;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
@@ -151,6 +159,14 @@ namespace cs2_chs {
#line hidden
return;
case 2:
#line 9 "..\..\..\Advance.xaml"
((System.Windows.Controls.Grid)(target)).MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.Grid_MouseWheel);
#line default
#line hidden
return;
case 3:
this.StartUpEdit = ((System.Windows.Controls.TextBox)(target));
#line 15 "..\..\..\Advance.xaml"
@@ -159,7 +175,7 @@ namespace cs2_chs {
#line default
#line hidden
return;
case 3:
case 4:
#line 17 "..\..\..\Advance.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click);
@@ -167,7 +183,7 @@ namespace cs2_chs {
#line default
#line hidden
return;
case 4:
case 5:
this.AddressEdit = ((System.Windows.Controls.TextBox)(target));
#line 23 "..\..\..\Advance.xaml"
@@ -176,7 +192,7 @@ namespace cs2_chs {
#line default
#line hidden
return;
case 5:
case 6:
this.EnvioMode = ((System.Windows.Controls.CheckBox)(target));
#line 24 "..\..\..\Advance.xaml"
@@ -185,7 +201,7 @@ namespace cs2_chs {
#line default
#line hidden
return;
case 6:
case 7:
this.OM_GPY = ((System.Windows.Controls.RadioButton)(target));
#line 25 "..\..\..\Advance.xaml"
@@ -194,7 +210,7 @@ namespace cs2_chs {
#line default
#line hidden
return;
case 7:
case 8:
this.OM_TOT = ((System.Windows.Controls.RadioButton)(target));
#line 26 "..\..\..\Advance.xaml"
@@ -203,16 +219,16 @@ namespace cs2_chs {
#line default
#line hidden
return;
case 8:
case 9:
this.OutPutLog = ((System.Windows.Controls.TextBox)(target));
return;
case 9:
case 10:
this.IDnPut = ((System.Windows.Controls.TextBox)(target));
return;
case 10:
case 11:
this.TRAN_OPT = ((System.Windows.Controls.TextBox)(target));
return;
case 11:
case 12:
this.REASE = ((System.Windows.Controls.CheckBox)(target));
#line 47 "..\..\..\Advance.xaml"
@@ -224,6 +240,21 @@ namespace cs2_chs {
#line 47 "..\..\..\Advance.xaml"
this.REASE.Unchecked += new System.Windows.RoutedEventHandler(this.REASE_Unchecked);
#line default
#line hidden
return;
case 13:
this.ENREP = ((System.Windows.Controls.CheckBox)(target));
#line 48 "..\..\..\Advance.xaml"
this.ENREP.Checked += new System.Windows.RoutedEventHandler(this.ENREP_Checked);
#line default
#line hidden
#line 48 "..\..\..\Advance.xaml"
this.ENREP.Unchecked += new System.Windows.RoutedEventHandler(this.ENREP_Unchecked);
#line default
#line hidden
return;

View File

@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\Advance.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "14B36F89504AB322533CA92CB6E5863D180B432811F8A590F6262841788C94E3"
#pragma checksum "..\..\..\Advance.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "4086118BC3A2ED0FEBC5AB9C32B57D03818AE03DF764A269847A893F690582F4"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
@@ -112,6 +112,14 @@ namespace cs2_chs {
#line default
#line hidden
#line 48 "..\..\..\Advance.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.CheckBox ENREP;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
@@ -151,6 +159,14 @@ namespace cs2_chs {
#line hidden
return;
case 2:
#line 9 "..\..\..\Advance.xaml"
((System.Windows.Controls.Grid)(target)).MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.Grid_MouseWheel);
#line default
#line hidden
return;
case 3:
this.StartUpEdit = ((System.Windows.Controls.TextBox)(target));
#line 15 "..\..\..\Advance.xaml"
@@ -159,7 +175,7 @@ namespace cs2_chs {
#line default
#line hidden
return;
case 3:
case 4:
#line 17 "..\..\..\Advance.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click);
@@ -167,7 +183,7 @@ namespace cs2_chs {
#line default
#line hidden
return;
case 4:
case 5:
this.AddressEdit = ((System.Windows.Controls.TextBox)(target));
#line 23 "..\..\..\Advance.xaml"
@@ -176,7 +192,7 @@ namespace cs2_chs {
#line default
#line hidden
return;
case 5:
case 6:
this.EnvioMode = ((System.Windows.Controls.CheckBox)(target));
#line 24 "..\..\..\Advance.xaml"
@@ -185,7 +201,7 @@ namespace cs2_chs {
#line default
#line hidden
return;
case 6:
case 7:
this.OM_GPY = ((System.Windows.Controls.RadioButton)(target));
#line 25 "..\..\..\Advance.xaml"
@@ -194,7 +210,7 @@ namespace cs2_chs {
#line default
#line hidden
return;
case 7:
case 8:
this.OM_TOT = ((System.Windows.Controls.RadioButton)(target));
#line 26 "..\..\..\Advance.xaml"
@@ -203,16 +219,16 @@ namespace cs2_chs {
#line default
#line hidden
return;
case 8:
case 9:
this.OutPutLog = ((System.Windows.Controls.TextBox)(target));
return;
case 9:
case 10:
this.IDnPut = ((System.Windows.Controls.TextBox)(target));
return;
case 10:
case 11:
this.TRAN_OPT = ((System.Windows.Controls.TextBox)(target));
return;
case 11:
case 12:
this.REASE = ((System.Windows.Controls.CheckBox)(target));
#line 47 "..\..\..\Advance.xaml"
@@ -224,6 +240,21 @@ namespace cs2_chs {
#line 47 "..\..\..\Advance.xaml"
this.REASE.Unchecked += new System.Windows.RoutedEventHandler(this.REASE_Unchecked);
#line default
#line hidden
return;
case 13:
this.ENREP = ((System.Windows.Controls.CheckBox)(target));
#line 48 "..\..\..\Advance.xaml"
this.ENREP.Checked += new System.Windows.RoutedEventHandler(this.ENREP_Checked);
#line default
#line hidden
#line 48 "..\..\..\Advance.xaml"
this.ENREP.Unchecked += new System.Windows.RoutedEventHandler(this.ENREP_Unchecked);
#line default
#line hidden
return;

Binary file not shown.

View File

@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "E730C4B41ACFA459AE58B693C6D867B376E7BBEDF7DBBB52809F64EFDB38EDA1"
#pragma checksum "..\..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "9C0A69ED616F64906BBA693AC0D9DF77D16D80985CEA89DB342BEC5391CE52FD"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
@@ -49,7 +49,7 @@ namespace cs2_chs {
#line hidden
#line 32 "..\..\..\MainWindow.xaml"
#line 26 "..\..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button apply;
@@ -57,7 +57,7 @@ namespace cs2_chs {
#line hidden
#line 40 "..\..\..\MainWindow.xaml"
#line 33 "..\..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ProgressBar PBS;
@@ -65,7 +65,7 @@ namespace cs2_chs {
#line hidden
#line 49 "..\..\..\MainWindow.xaml"
#line 42 "..\..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox SRC_OUTPUT;
@@ -130,11 +130,23 @@ namespace cs2_chs {
return;
case 2:
this.TEXT_INPUT = ((System.Windows.Controls.TextBox)(target));
#line 17 "..\..\..\MainWindow.xaml"
this.TEXT_INPUT.MouseRightButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.TEXT_INPUT_MouseRightButtonUp);
#line default
#line hidden
#line 17 "..\..\..\MainWindow.xaml"
this.TEXT_INPUT.MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.TEXT_INPUT_MouseRightButtonDown);
#line default
#line hidden
return;
case 3:
this.apply = ((System.Windows.Controls.Button)(target));
#line 32 "..\..\..\MainWindow.xaml"
#line 28 "..\..\..\MainWindow.xaml"
this.apply.Click += new System.Windows.RoutedEventHandler(this.Button_Click);
#line default
@@ -145,24 +157,36 @@ namespace cs2_chs {
return;
case 5:
#line 41 "..\..\..\MainWindow.xaml"
#line 34 "..\..\..\MainWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_1);
#line default
#line hidden
#line 34 "..\..\..\MainWindow.xaml"
((System.Windows.Controls.Button)(target)).MouseRightButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.Button_MouseRightButtonUp);
#line default
#line hidden
return;
case 6:
this.SRC_OUTPUT = ((System.Windows.Controls.TextBox)(target));
#line 42 "..\..\..\MainWindow.xaml"
this.SRC_OUTPUT.MouseRightButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.SRC_OUTPUT_MouseRightButtonUp);
#line default
#line hidden
return;
case 7:
#line 73 "..\..\..\MainWindow.xaml"
#line 66 "..\..\..\MainWindow.xaml"
((System.Windows.Input.CommandBinding)(target)).CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.CommandBinding_ShowMainWindow_CanExecute);
#line default
#line hidden
#line 74 "..\..\..\MainWindow.xaml"
#line 67 "..\..\..\MainWindow.xaml"
((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.CommandBinding_ShowMainWindow_Executed);
#line default

View File

@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "E730C4B41ACFA459AE58B693C6D867B376E7BBEDF7DBBB52809F64EFDB38EDA1"
#pragma checksum "..\..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "9C0A69ED616F64906BBA693AC0D9DF77D16D80985CEA89DB342BEC5391CE52FD"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
@@ -49,7 +49,7 @@ namespace cs2_chs {
#line hidden
#line 32 "..\..\..\MainWindow.xaml"
#line 26 "..\..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button apply;
@@ -57,7 +57,7 @@ namespace cs2_chs {
#line hidden
#line 40 "..\..\..\MainWindow.xaml"
#line 33 "..\..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ProgressBar PBS;
@@ -65,7 +65,7 @@ namespace cs2_chs {
#line hidden
#line 49 "..\..\..\MainWindow.xaml"
#line 42 "..\..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox SRC_OUTPUT;
@@ -130,11 +130,23 @@ namespace cs2_chs {
return;
case 2:
this.TEXT_INPUT = ((System.Windows.Controls.TextBox)(target));
#line 17 "..\..\..\MainWindow.xaml"
this.TEXT_INPUT.MouseRightButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.TEXT_INPUT_MouseRightButtonUp);
#line default
#line hidden
#line 17 "..\..\..\MainWindow.xaml"
this.TEXT_INPUT.MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.TEXT_INPUT_MouseRightButtonDown);
#line default
#line hidden
return;
case 3:
this.apply = ((System.Windows.Controls.Button)(target));
#line 32 "..\..\..\MainWindow.xaml"
#line 28 "..\..\..\MainWindow.xaml"
this.apply.Click += new System.Windows.RoutedEventHandler(this.Button_Click);
#line default
@@ -145,24 +157,36 @@ namespace cs2_chs {
return;
case 5:
#line 41 "..\..\..\MainWindow.xaml"
#line 34 "..\..\..\MainWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_1);
#line default
#line hidden
#line 34 "..\..\..\MainWindow.xaml"
((System.Windows.Controls.Button)(target)).MouseRightButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.Button_MouseRightButtonUp);
#line default
#line hidden
return;
case 6:
this.SRC_OUTPUT = ((System.Windows.Controls.TextBox)(target));
#line 42 "..\..\..\MainWindow.xaml"
this.SRC_OUTPUT.MouseRightButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.SRC_OUTPUT_MouseRightButtonUp);
#line default
#line hidden
return;
case 7:
#line 73 "..\..\..\MainWindow.xaml"
#line 66 "..\..\..\MainWindow.xaml"
((System.Windows.Input.CommandBinding)(target)).CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.CommandBinding_ShowMainWindow_CanExecute);
#line default
#line hidden
#line 74 "..\..\..\MainWindow.xaml"
#line 67 "..\..\..\MainWindow.xaml"
((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.CommandBinding_ShowMainWindow_Executed);
#line default

View File

@@ -0,0 +1,121 @@
#pragma checksum "..\..\..\TextView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "AE5EA01DD49E2B60AB9C47B22912BFAC127F24711B12D12BC295E963D2FF20C3"
//------------------------------------------------------------------------------
// <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>
/// TextView
/// </summary>
public partial class TextView : System.Windows.Window, System.Windows.Markup.IComponentConnector {
#line 10 "..\..\..\TextView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock textbar;
#line default
#line hidden
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/textview.xaml", System.UriKind.Relative);
#line 1 "..\..\..\TextView.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) {
switch (connectionId)
{
case 1:
#line 9 "..\..\..\TextView.xaml"
((System.Windows.Controls.Grid)(target)).MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Grid_MouseDown);
#line default
#line hidden
#line 9 "..\..\..\TextView.xaml"
((System.Windows.Controls.Grid)(target)).MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Grid_MouseUp);
#line default
#line hidden
#line 9 "..\..\..\TextView.xaml"
((System.Windows.Controls.Grid)(target)).MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.Grid_MouseWheel);
#line default
#line hidden
return;
case 2:
this.textbar = ((System.Windows.Controls.TextBlock)(target));
#line 10 "..\..\..\TextView.xaml"
this.textbar.KeyDown += new System.Windows.Input.KeyEventHandler(this.textbar_KeyDown);
#line default
#line hidden
#line 10 "..\..\..\TextView.xaml"
this.textbar.KeyUp += new System.Windows.Input.KeyEventHandler(this.textbar_KeyUp);
#line default
#line hidden
return;
}
this._contentLoaded = true;
}
}
}

View File

@@ -0,0 +1,121 @@
#pragma checksum "..\..\..\TextView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "AE5EA01DD49E2B60AB9C47B22912BFAC127F24711B12D12BC295E963D2FF20C3"
//------------------------------------------------------------------------------
// <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>
/// TextView
/// </summary>
public partial class TextView : System.Windows.Window, System.Windows.Markup.IComponentConnector {
#line 10 "..\..\..\TextView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock textbar;
#line default
#line hidden
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/textview.xaml", System.UriKind.Relative);
#line 1 "..\..\..\TextView.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) {
switch (connectionId)
{
case 1:
#line 9 "..\..\..\TextView.xaml"
((System.Windows.Controls.Grid)(target)).MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Grid_MouseDown);
#line default
#line hidden
#line 9 "..\..\..\TextView.xaml"
((System.Windows.Controls.Grid)(target)).MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Grid_MouseUp);
#line default
#line hidden
#line 9 "..\..\..\TextView.xaml"
((System.Windows.Controls.Grid)(target)).MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.Grid_MouseWheel);
#line default
#line hidden
return;
case 2:
this.textbar = ((System.Windows.Controls.TextBlock)(target));
#line 10 "..\..\..\TextView.xaml"
this.textbar.KeyDown += new System.Windows.Input.KeyEventHandler(this.textbar_KeyDown);
#line default
#line hidden
#line 10 "..\..\..\TextView.xaml"
this.textbar.KeyUp += new System.Windows.Input.KeyEventHandler(this.textbar_KeyUp);
#line default
#line hidden
return;
}
this._contentLoaded = true;
}
}
}

View File

@@ -0,0 +1 @@
13037deefd7b2bcb290d940d5795e4320ac588ef

View File

@@ -22,3 +22,9 @@ D:\VSProject\cs2\cs2_united\cs2_chs\obj\x86\Release\cs2_chs.csproj.CopyComplete
D:\VSProject\cs2\cs2_united\cs2_chs\obj\x86\Release\cs2_chs.exe
D:\VSProject\cs2\cs2_united\cs2_chs\obj\x86\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.CoreCompileInputs.cache
C:\Users\14980\Desktop\Tran_Tools\aikotoba\cs2_chs.exe.config
C:\Users\14980\Desktop\Tran_Tools\aikotoba\cs2_chs.exe
C:\Users\14980\Desktop\Tran_Tools\aikotoba\cs2_chs.pdb
D:\VSProject\cs2\cs2_united\cs2_chs\obj\x86\Release\TextView.g.cs
D:\VSProject\cs2\cs2_united\cs2_chs\obj\x86\Release\TextView.baml

Binary file not shown.

Binary file not shown.

View File

@@ -8,6 +8,6 @@
// </auto-generated>
//------------------------------------------------------------------------------
[assembly: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("03.png")]
[assembly: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("04.jpg")]

View File

@@ -10,11 +10,11 @@ none
false
TRACE
D:\VSProject\cs2\cs2_united\cs2_chs\App.xaml
2-1834107634
360698734
9-330204798
171117567902
Advance.xaml;MainWindow.xaml;
111053777973
18-1702095681
Advance.xaml;MainWindow.xaml;TextView.xaml;
False
True

View File

@@ -10,11 +10,11 @@ none
false
TRACE
D:\VSProject\cs2\cs2_united\cs2_chs\App.xaml
2-1834107634
360698734
10-1440126486
171117567902
Advance.xaml;MainWindow.xaml;
111053777973
18-1702095681
Advance.xaml;MainWindow.xaml;TextView.xaml;
False
True

View File

@@ -0,0 +1,6 @@

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

View File

@@ -2,4 +2,5 @@
FD:\VSProject\cs2\cs2_united\cs2_chs\App.xaml;;
FD:\VSProject\cs2\cs2_united\cs2_chs\Advance.xaml;;
FD:\VSProject\cs2\cs2_united\cs2_chs\MainWindow.xaml;;
FD:\VSProject\cs2\cs2_united\cs2_chs\TextView.xaml;;

View File

@@ -1,17 +1,22 @@
#include "pch.h"
#include "BuildIn.h"
#include "Data.h"
#include "Replace.h"
/*********声明符号***********/
extern "C" extern DLLAPI wchar_t resultstr[1024];
extern "C" extern DLLAPI wchar_t ns_str[6192];
extern HMODULE hMod;
extern "C" extern DLLAPI wchar_t ms_str[3096];
extern "C" extern DLLAPI int nID;
extern "C" extern DLLAPI DWORD tPid;
extern MicroData* Index;
extern MicroBinary* Data;
extern "C" extern DLLAPI DWORD m_Addr;
extern "C" extern DLLAPI DWORD VioMode;
extern "C" extern DLLAPI bool IsSuccess;
signed int (*Sur_Sub)() = (signed int(*)(void))m_Addr;//real function point
HMODULE SelfHandle = NULL;
@@ -19,6 +24,11 @@ bool start_falg = false;
bool start_g_flag = false;
bool start_t_flag = false;
extern char IpfData[16];
#define PutInt(a) _itoa_s(a,IpfData,10);MessageBoxA(0,IpfData,"num",0);
extern "C" extern DLLAPI bool enReplace;
TESTDATA* pNewDf = NULL;
PVOID GetProcAddressEx(HANDLE hProc, HMODULE hModule, LPCSTR lpProcName)
{
PVOID pAddress = NULL;
@@ -97,9 +107,6 @@ BOOL InjectDLL(HANDLE hProcess, LPCWSTR dllFilePathName)
return TRUE;
}
extern char IpfData[16];
#define PutInt(a) _itoa_s(a,IpfData,10);MessageBoxA(0,IpfData,"num",0);
DWORD(WINAPI* pGetGlyphOutlineW)(
_In_ HDC hdc,
_In_ UINT uChar,
@@ -111,7 +118,14 @@ DWORD(WINAPI* pGetGlyphOutlineW)(
) = GetGlyphOutlineW;
BOOL(WINAPI* pTextOutW)(_In_ HDC hdc, _In_ int x, _In_ int y, _In_reads_(c) LPCWSTR lpString, _In_ int c) = TextOutW;
HANDLE InjectSelfTo(LPCSTR inptr)
WCHAR* GetResultData(){
return resultstr;
}
/*****************************/
int(*TranSpt)(DWORD);
HANDLE InjectSelfTo(char inptr[])
{
// MessageBoxA(0, inptr,"",0);
HANDLE currentThread = NULL;
@@ -148,29 +162,24 @@ HANDLE InjectSelfTo(LPCSTR inptr)
delete info;
lstrcpyW(ms_str, L" ");
ns_str[0] = L'\0';
return currentThread;
}
DWORD lecx;
signed int Fake_Sub()
{
DWORD leax, lebx, lecx, ledx, lesi, ledi;
__asm {
mov dword ptr[leax], eax
mov dword ptr[lebx], ebx
mov dword ptr[lecx], ecx
mov dword ptr[ledx], edx
mov dword ptr[lesi], esi
mov dword ptr[ledi], edi
}
// SetWindowTextW(m_hWnd, L"<22><><EFBFBD><EFBFBD>hook");
((int(*)(DWORD))::GetProcAddress(SelfHandle, "TranSplete"))(lecx);
// MessageBoxA(0,"","",0);
TranSpt(lecx);
// SetWindowTextW(m_hWnd, L"hook<6F><6B><EFBFBD><EFBFBD>");
__asm {
mov eax, dword ptr[leax]
mov ebx, dword ptr[lebx]
mov ecx, dword ptr[lecx]
mov edx, dword ptr[ledx]
mov esi, dword ptr[lesi]
mov edi, dword ptr[ledi]
}
return Sur_Sub();
}
@@ -195,15 +204,43 @@ DWORD WINAPI fGetGlyphOutlineW(
{
wstring loca = L"";
loca += (WCHAR)uChar;
if(lstrlenW(ns_str)>=5999)
ns_str[0] = L'\0';
lstrcatW(ns_str, loca.c_str());
return pGetGlyphOutlineW(hdc, L' ', fuFormat, lpgm, cjBuffer, pvBuffer, lpmat2);
loca = ns_str;
/********调用数据********/
int nSize = GEtLargestID()+1;
WCHAR cns[1024];
WCHAR jps[1024];
for (int i = 0; i < nSize; i++) {
if (loca == L"")
break;
GetDataByID(i, jps, cns);
if (wcsstr(loca.c_str(), jps)) {
ns_str[0] = L'\0';
// MessageBox(0, cns, L"", 0);
lstrcpyW(resultstr, cns);
break;
}
}
if (lstrlenW(ns_str) >= 1024)
ns_str[0] = L'\0';
if (enReplace)
return pGetGlyphOutlineW(hdc, L' ', fuFormat, lpgm, cjBuffer, pvBuffer, lpmat2);
else
return pGetGlyphOutlineW(hdc, uChar, fuFormat, lpgm, cjBuffer, pvBuffer, lpmat2);
}
BOOL WINAPI fTextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_reads_(c) LPCWSTR lpString, _In_ int c)
{
return pTextOutW(hdc, x, y, L"\0", c);
}
void start()
{
// MessageBoxA(0,"b","",0);
@@ -251,7 +288,6 @@ void end()
DetourDetach(&(PVOID&)pGetGlyphOutlineW, fGetGlyphOutlineW);
DetourTransactionCommit();
}
void start_t()
{
if (start_t_flag)
@@ -311,7 +347,7 @@ void StartReplace()
CloseHandle(terp);
}
void EndReplace()
void EndReplace()
{
HANDLE terp = OpenProcess(PROCESS_ALL_ACCESS, FALSE, tPid);
HANDLE hHookStart = CreateRemoteThread(terp, NULL, 0, (LPTHREAD_START_ROUTINE)
@@ -347,7 +383,7 @@ void StartReplace()
}
CloseHandle(terp);
}
void ChangeGToT()
void ChangeGToT()
{
HANDLE terp = OpenProcess(PROCESS_ALL_ACCESS, FALSE, tPid);
HANDLE hgHookStart = CreateRemoteThread(terp, NULL, 0, (LPTHREAD_START_ROUTINE)
@@ -369,7 +405,7 @@ void StartReplace()
WaitForSingleObject(htHookStart, 0xFFFFFFFF);
CloseHandle(terp);
}
void ChangeTToG()
void ChangeTToG()
{
HANDLE terp = OpenProcess(PROCESS_ALL_ACCESS, FALSE, tPid);
HANDLE hgHookStart = CreateRemoteThread(terp, NULL, 0, (LPTHREAD_START_ROUTINE)
@@ -391,10 +427,12 @@ void StartReplace()
WaitForSingleObject(htHookStart, 0xFFFFFFFF);
CloseHandle(terp);
}
void LoadExerte()
void LoadExerte()
{
Index = new MicroData(L"Index.ax", sizeof(IndexData));
Data = new MicroBinary(L"Data.ax");
Index->Load();
Data->Load();
TranSpt = (int(*)(DWORD))::GetProcAddress(SelfHandle, "TranSplete");
}

View File

@@ -2,7 +2,7 @@
#include <Windows.h>
#define DLLAPI __declspec(dllexport)
BOOL InjectDLL(HANDLE hProcess, LPCWSTR dllFilePathName);//Inject dll to the signal process
extern "C" DLLAPI HANDLE InjectSelfTo(LPCSTR inptr);//Inject self
extern "C" DLLAPI HANDLE InjectSelfTo(char inptr[]);//Inject self
signed int Fake_Sub();//hooked function point
@@ -35,4 +35,6 @@ extern "C" DLLAPI void ChangeTToG();
extern "C" DLLAPI void LoadExerte();
extern "C" DLLAPI WCHAR * GetResultData();
PVOID GetProcAddressEx(HANDLE hProc, HMODULE hModule, LPCSTR lpProcName);

View File

@@ -4,7 +4,9 @@ extern MicroData* Index;
extern MicroBinary* Data;
extern "C" extern DLLAPI double saveProcess;
extern HMODULE hMod;
extern "C" extern DLLAPI wchar_t ms_str[3096];
extern "C" extern DLLAPI wchar_t cn_str[1024];
extern "C" extern DLLAPI int nID;
extern "C" extern DLLAPI DWORD tPid;
extern "C" extern DLLAPI bool blockRestoreSrc;
@@ -12,29 +14,30 @@ struct ExportParam {
WCHAR data[1024];
WCHAR src[1024];
};
DWORD CreateDataExportEx(LPVOID data)
int CreateDataExportEx(LPVOID data)
{
ExportParam* bData = (ExportParam*)data;
if (!blockRestoreSrc) {
// MessageBoxW(0, data,L"",0);
WCHAR sjp[3096];
WCHAR scn[3096];
WCHAR sjp[1024];
WCHAR scn[1024];
int lasger = GEtLargestID();
if (nID == 0) {
MessageBox(0, L"the ID value seems not available,therefore this action has been refused", L"error", MB_ICONERROR);
if (nID == -1) {
MessageBox(0, L"the ID value seems not available,therefore this action has been refused", L"error", MB_ICONERROR | MB_MODEMASK);
saveProcess = 1.0;
return 1;
return -1;
}
if (nID - lasger > 2) {
MessageBox(0, L"the ID value seems not available,therefore this action has been refused", L"error", MB_ICONERROR);
if (nID - lasger > 1) {
MessageBox(0, L"the ID value seems not available,therefore this action has been refused", L"error", MB_ICONERROR | MB_MODEMASK);
saveProcess = 1.0;
return 1;
return -1;
}
if (!GetDataByID(nID - 1, sjp, scn)) {
CreateDataByID(nID - 1, bData->src, 2 * (lstrlenW(bData->src) + 1), bData->data, 2 * (lstrlenW(bData->data) + 1));
if (!GetDataByID(nID, sjp, scn)) {
CreateDataByID(nID, bData->src, 2 * (lstrlenW(bData->src) + 1), bData->data, 2 * (lstrlenW(bData->data) + 1));
WCHAR abv[16];
_itow_s(nID - 1, abv, 10);
_itow_s(nID, abv, 10);
wstring str;
str += L"Apply ID:";
str += abv;
@@ -42,20 +45,20 @@ DWORD CreateDataExportEx(LPVOID data)
str += bData->src;
str += L"->";
str += bData->data;
MessageBoxW(NULL, str.c_str(), L"successed to add rule", MB_ICONINFORMATION);
// MessageBoxW(NULL, str.c_str(), L"successed to add rule", MB_ICONINFORMATION | MB_MODEMASK);
saveProcess = 1.0;
return 1;
}
else {
wstring nString = L"This rule is already exist,do you want still to replace it?(according to your PC,it may take you a short time)\n";
WCHAR abv[16];
_itow_s(nID - 1, abv, 10);
_itow_s(nID, abv, 10);
nString += L"ID:";
nString += abv;
nString += L"\n";
nString += sjp;
saveProcess = 0.0;
int result = MessageBoxW(NULL, nString.c_str(), L"information", MB_ICONINFORMATION | MB_OKCANCEL);
int result = MessageBoxW(NULL, nString.c_str(), L"information", MB_ICONINFORMATION | MB_OKCANCEL | MB_MODEMASK);
if (result != IDOK) {
saveProcess = 1.0;
return 1;
@@ -65,7 +68,7 @@ DWORD CreateDataExportEx(LPVOID data)
MicroBinary* _Data = new MicroBinary(L"~Data.ax");
IndexData createData;
while (GetDataByID(p, sjp, scn)) {
if (p == (nID - 1)) {
if (p == nID) {
createData.Id = p;
createData.JpLength = 2 * (lstrlenW(sjp) + 1);
createData.CnLength = 2 * (lstrlenW(bData->data) + 1);
@@ -74,8 +77,7 @@ DWORD CreateDataExportEx(LPVOID data)
createData.CnBass = _Data->Size();
_Data->Push(bData->data, 2 * (lstrlenW(bData->data) + 1));
_Index->Push(&createData);
_Index->Save();
_Data->Save();
}
else
{
@@ -87,13 +89,13 @@ DWORD CreateDataExportEx(LPVOID data)
createData.CnBass = _Data->Size();
_Data->Push(scn, 2 * (lstrlenW(scn) + 1));
_Index->Push(&createData);
_Index->Save();
_Data->Save();
}
saveProcess = (double)p / (double)(lasger);
p++;
}
_Index->Save();
_Data->Save();
delete _Index;
delete _Data;
delete Index;
@@ -112,8 +114,8 @@ DWORD CreateDataExportEx(LPVOID data)
}
}
else {
WCHAR sjp[3096];
WCHAR scn[3096];
WCHAR sjp[1024];
WCHAR scn[1024];
int lasger = GEtLargestID();
int jkID;
@@ -128,7 +130,7 @@ DWORD CreateDataExportEx(LPVOID data)
str += bData->src;
str += L"->";
str += bData->data;
MessageBoxW(NULL, str.c_str(), L"successed to add rule", MB_ICONINFORMATION);
MessageBoxW(NULL, str.c_str(), L"successed to add rule", MB_ICONINFORMATION | MB_MODEMASK);
saveProcess = 1.0;
return 1;
}
@@ -141,7 +143,7 @@ DWORD CreateDataExportEx(LPVOID data)
nString += L"\n";
nString += bData->src;
int result = MessageBoxW(NULL, nString.c_str(), L"information", MB_ICONINFORMATION | MB_OKCANCEL);
int result = MessageBoxW(NULL, nString.c_str(), L"information", MB_ICONINFORMATION | MB_OKCANCEL | MB_MODEMASK);
if (result != IDOK) {
saveProcess = 1.0;
return 1;
@@ -161,8 +163,7 @@ DWORD CreateDataExportEx(LPVOID data)
createData.CnBass = _Data->Size();
_Data->Push(bData->data, 2 * (lstrlenW(bData->data) + 1));
_Index->Push(&createData);
_Index->Save();
_Data->Save();
}
else
{
@@ -174,13 +175,13 @@ DWORD CreateDataExportEx(LPVOID data)
createData.CnBass = _Data->Size();
_Data->Push(scn, 2 * (lstrlenW(scn) + 1));
_Index->Push(&createData);
_Index->Save();
_Data->Save();
}
saveProcess = (double)p / (double)(lasger);
p++;
}
_Index->Save();
_Data->Save();
delete _Index;
delete _Data;
delete Index;
@@ -207,24 +208,33 @@ void CreateDataExport(WCHAR src[],WCHAR data[])
DWORD dwOld;
HANDLE hTr = OpenProcess(PROCESS_ALL_ACCESS, FALSE, tPid);
if (!hTr) {
MessageBoxA(0, "", "", 0);
return;
}
BYTE* PszLibFileRemote = (PBYTE)VirtualAllocEx(hTr, NULL, sizeof(ExportParam), MEM_COMMIT, PAGE_READWRITE);
if (!PszLibFileRemote) {
MessageBoxA(0, "", "", 0);
return;
}
WriteProcessMemory(hTr, PszLibFileRemote, &alc, sizeof(ExportParam), &dwOld);
HANDLE hHookStart = CreateRemoteThread(hTr, NULL, 0, (LPTHREAD_START_ROUTINE)
::GetProcAddress(hMod, "CreateDataExportEx"), PszLibFileRemote, 0, NULL);
if (!hHookStart)
if (!hHookStart) {
MessageBoxA(0, "", "", 0);
return;
}
WaitForSingleObject(hHookStart, INFINITE);
VirtualFreeEx(hTr, PszLibFileRemote, sizeof(ExportParam), MEM_RELEASE);
VirtualFreeEx(hTr, PszLibFileRemote, 0, MEM_RELEASE);
CloseHandle(hTr);
}
BOOL CreateDataByID(int ID, LPCWSTR jpBuff, int ljp, LPCWSTR cnBuffer, int lcn)
{
// MessageBoxA(0,"","",0);
IndexData createData;
createData.Id = ID;
createData.JpLength = ljp;
@@ -240,12 +250,17 @@ BOOL CreateDataByID(int ID, LPCWSTR jpBuff, int ljp, LPCWSTR cnBuffer, int lcn)
}
BOOL GetDataByJP(int* ID, LPCWSTR jpBuff, LPWSTR cnBuffer)
{
if (Index->Size() == 0) {
return 0;
}
IndexData index;
WCHAR njp[3096];
WCHAR ncn[3096];
(*Index) = 0;
do {
Index->Get(&index);
if (index.CnLength > 1024 || index.JpLength > 1024)
MessageBox(0, L"error", L"", 0);
( *Data) = index.JpBass;
Data->Sub(njp, index.JpLength);
(* Data) = index.CnBass;
@@ -270,7 +285,12 @@ BOOL GetDataByJP(int* ID, LPCWSTR jpBuff, LPWSTR cnBuffer)
BOOL GetDataByID(int ID, LPWSTR jpBuff, LPWSTR cnBuffer)
{
//
if (ID < 0)return 0;
if (ID == -1) {
return 0;
}
if (Index->Size() == 0) {
return 0;
}
IndexData index;
(*Index) = ID;
Index->Get(&index);
@@ -289,6 +309,10 @@ BOOL GetDataByID(int ID, LPWSTR jpBuff, LPWSTR cnBuffer)
}
} while (1);
}
if (index.CnLength > 1024 || index.JpLength > 1024)
MessageBox(0,L"error",L"",0);
(*Data) = index.JpBass;
Data->Sub(jpBuff, index.JpLength);
(*Data) = index.CnBass;
@@ -299,6 +323,8 @@ BOOL GetDataByID(int ID, LPWSTR jpBuff, LPWSTR cnBuffer)
}
int GEtLargestID()
{
if (Index->Size() == 0)
return -1;
IndexData index;
int result = 0;
do {

View File

@@ -6,4 +6,4 @@ BOOL CreateDataByID(int ID, LPCWSTR jpBuff, int ljp, LPCWSTR cnBuffer, int lcn);
BOOL GetDataByJP(int* ID, LPCWSTR jpBuff, LPWSTR cnBuffer);
BOOL GetDataByID(int ID, LPWSTR jpBuff, LPWSTR cnBuffer);
int GEtLargestID();
extern "C" DLLAPI DWORD CreateDataExportEx(LPVOID path);
extern "C" DLLAPI int CreateDataExportEx(LPVOID path);

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,9 +1,2 @@
 pch.cpp
BuildIn.cpp
Data.cpp
dllmain.cpp
Replace.cpp
D:\VSProject\cs2\cs2_united\cs2_patch\Replace.cpp(56,23): warning C4018: “<”: 有符号/无符号不匹配
正在生成代码...
正在创建库 D:\VSProject\cs2\cs2_united\Debug\cs2_patch.lib 和对象 D:\VSProject\cs2\cs2_united\Debug\cs2_patch.exp
 BuildIn.cpp
cs2_patch.vcxproj -> D:\VSProject\cs2\cs2_united\Debug\cs2_patch.dll

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,8 +1,13 @@
 BuildIn.cpp
正在创建库 D:\VSProject\cs2\cs2_united\Release\cs2_patch.lib 和对象 D:\VSProject\cs2\cs2_united\Release\cs2_patch.exp
D:\Visual Studio\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(453,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
BuildIn.cpp
D:\VSProject\cs2\cs2_united\cs2_patch\BuildIn.cpp(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
Replace.cpp
D:\VSProject\cs2\cs2_united\cs2_patch\Replace.cpp(74,23): warning C4018: “<”: 有符号/无符号不匹配
dllmain.cpp
正在创建库 C:\Users\14980\Desktop\Tran_Tools\aikotoba\cs2_patch.lib 和对象 C:\Users\14980\Desktop\Tran_Tools\aikotoba\cs2_patch.exp
正在生成代码
1 of 129 functions ( 0.8%) were compiled, the rest were copied from previous compilation.
0 of 169 functions ( 0.0%) were compiled, the rest were copied from previous compilation.
0 functions were new in current compilation
2 functions had inline decision re-evaluated but remain unchanged
0 functions had inline decision re-evaluated but remain unchanged
已完成代码的生成
cs2_patch.vcxproj -> D:\VSProject\cs2\cs2_united\Release\cs2_patch.dll
cs2_patch.vcxproj -> C:\Users\14980\Desktop\Tran_Tools\aikotoba\cs2_patch.dll

Binary file not shown.

View File

@@ -1,2 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v142:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0
PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.25.28610:TargetPlatformVersion=10.0.18362.0:
Release|Win32|D:\VSProject\cs2\cs2_united\|

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,17 +1,31 @@
#include "pch.h"
#include "pch.h"
#include "Replace.h"
int npID = 0;
#include<algorithm>
#include<iostream>
#include<set>
extern HMODULE hModL;
extern "C" extern DLLAPI wchar_t ms_str[3096];
extern "C" extern DLLAPI int nID;
void BuildCV(TESTDATA* pcv, TESTDATA flt, DWORD posinCross, DWORD posInLine, DWORD m_count, WCHAR nchar)
extern "C" extern DLLAPI wchar_t cn_str[1024];
extern "C" extern DLLAPI bool IsSuccess;
extern TESTDATA* pNewDf;
extern char IpfData[16];
#define PutInt(a) _itoa_s(a,IpfData,16);MessageBoxA(0,IpfData,"num",0);
multiset<DWORD> AddrList;
extern "C" DLLAPI void BuildCV(TESTDATA* pcv, TESTDATA flt, DWORD posinCross, DWORD posInLine, DWORD m_count, WCHAR nchar)
{
pcv->ForCast = flt.ForCast;
pcv->nLine = posinCross;
pcv->nChar = nchar;
pcv->nCross = posInLine;
pcv->Flag1 = flt.Flag1;
pcv->Flag2 = flt.Flag2;
pcv->Flag2 = 0xFFC8C8C8;
pcv->Flag3 = flt.Flag3;
pcv->Flag4 = flt.Flag4;
pcv->Flagn4 = flt.Flagn4;
@@ -30,59 +44,92 @@ void BuildCV(TESTDATA* pcv, TESTDATA flt, DWORD posinCross, DWORD posInLine, DWO
pcv->Over2 = flt.Over2;
return;
}
void ApplyStringToCV(LPCWSTR ws, DWORD pDf, int id)
void ApplyStringToCV(LPCWSTR ws, DWORD pDf)
{
// return;
// SetWindowTextW(GetForegroundWindow(),ws);
TESTDATA loadFirst = *((TESTDATA*)(*(DWORD*)pDf));
if (pNewDf&& pNewDf== (TESTDATA*)*(DWORD*)pDf)
free(pNewDf);
pNewDf = (TESTDATA*)malloc(1024 * 96);
for (int i = 0; i < 1024; i++)
BuildCV(&pNewDf[i], loadFirst, 0XD, 0, 0, 0);
wstring localString = ws;
if (!pDf)return;
if (!ws)return;
DWORD Df = *(DWORD*)pDf;//Df <20><><EFBFBD>ݵ<EFBFBD>ָ<EFBFBD><D6B8>
if (!Df)return;//Ϊ<><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD>
TESTDATA* nCView = (TESTDATA*)Df;//ʹһ<CAB9><D2BB>TESTDATA*ָ<><D6B8>Df
DWORD pOld;
VirtualProtect(nCView, 10 + (localString.length() * 2), PAGE_READWRITE, &pOld);
TESTDATA loadFirst = *nCView;//<2F><><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*(DWORD*)pDf = (DWORD)pNewDf;
int posInLine = 0;//<2F><><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
int posinCross = 0xD;//<2F><><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
// SetWindowTextW(m_hWnd, L"<22><><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD>");
int PJ = 0;
for (int i = 0; i < localString.length(); i++)
{
if (localString[i] == L'\n')
{
BuildCV(nCView, loadFirst, posinCross, posInLine, i * 2, 0);
nCView++;
BuildCV(nCView, loadFirst, posinCross, posInLine, i * 2, 0XFFFF);
nCView++;
BuildCV(&pNewDf[PJ], loadFirst, posinCross, posInLine, i * 2, 0);
PJ++;
BuildCV(&pNewDf[PJ], loadFirst, posinCross, posInLine, i * 2, 0XFFFF);
PJ++;
posinCross += 0x28;
posInLine = 0;
}
else
{
BuildCV(nCView, loadFirst, posinCross, posInLine, i * 2, localString[i]);
nCView++;
BuildCV(&pNewDf[PJ], loadFirst, posinCross, posInLine, i * 2, localString[i]);
PJ++;
posInLine += 0X1A;
}
}
PJ++;
// SetWindowTextW(m_hWnd, L"<22><><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD>");
*(DWORD*)(pDf + 4) = (DWORD)nCView;
VirtualProtect(nCView, 10 + (localString.length() * 2), pOld, NULL);
*(DWORD*)(pDf + 4) = (DWORD)&pNewDf[PJ];
int sized = *(DWORD*)(pDf + 4) - *(DWORD*)pDf;
// PutInt(sized);
lstrcpyW(cn_str, ws);
}
static bool InitOnce = true;
int TranSplete(DWORD lp)
{
// MessageBox(0,L"Transplete start",L"",0);
if (!lp)return -1;
// MessageBoxA(0,"","",0);
//定义缓冲区
WCHAR sjp[1024];
WCHAR scn[1024];
wstring nStr;
/*第一部分 排除无效的调用*/
if (!lp)return 1;
DWORD ppDf = *(DWORD*)(lp + 0x2B0);
if (!ppDf)return -1;
if (!ppDf)return 1;
DWORD pDf = *(DWORD*)(ppDf + 8);
if (!pDf)return -1;
if (!pDf)return 1;
DWORD Df = *(DWORD*)pDf;
if (!Df)return -1;
if (!Df)return 1;
DWORD pEnd = *(DWORD*)(pDf + 4);
if (!pEnd)return -1;
WCHAR sjp[1024];
WCHAR scn[1024];
DWORD Num = (pEnd - Df) / 96;
wstring nStr;
TESTDATA* nCView = (TESTDATA*)Df;
if (!pEnd)return 1;
/*************************/
TESTDATA* nCView = (TESTDATA*)Df;//定义指向当前数据的指针
DWORD Num = (pEnd - Df) / 96;//定义长度
if (Num == 0) {
return 1;
}
/*先扫描一次数据内存把字符逐一加入nStr*/
for (DWORD i = 0; i < Num; i++) {
if (nCView->nChar == 0xFFFF) {
}
@@ -94,55 +141,84 @@ void ApplyStringToCV(LPCWSTR ws, DWORD pDf, int id)
}
nCView++;
}
npID++;
// MessageBoxW(0,L"0",L"",0);
WCHAR csjp[1024];
WCHAR cscn[1024];
int ppId = 0;
if (!GetDataByID(nID - 1, csjp, cscn)) {
if (nID != 0)
if (!GetDataByJP(&ppId, nStr.c_str(), cscn))
return -1;
}
// MessageBoxW(0, L"1", L"", 0);
if (lstrcmpW(nStr.c_str(), cscn) == 0) {
// MessageBoxW(0, nStr.c_str(), L"", 0);
/***************************************/
if (lstrcmpW(nStr.c_str(), cn_str) == 0) {//如果和上一句的中文相同,则直接返回。
return -1;
}
// MessageBoxW(0, L"2", L"", 0);
if (wcsstr(nStr.c_str(), L"………")) {
// PutInt(*(DWORD*)pDf);
// PutInt(Num);
// MessageBoxW(0, nStr.c_str(), L"", 0);
/******排除较短的语气词******/
if (wcsstr(nStr.c_str(), L"………") && lstrlenW(nStr.c_str()) < 8)
return -1;
}
if (wcsstr(nStr.c_str(), L"…ああ"))
if (wcsstr(nStr.c_str(), L"…ああ")&&lstrlenW(nStr.c_str())<8)
return -1;
if (wcsstr(nStr.c_str(), L"ふふふっ"))
if (wcsstr(nStr.c_str(), L"ふふふっ") && lstrlenW(nStr.c_str()) < 8)
return -1;
/****************************/
//应用当前句到msstr
lstrcpyW(ms_str, nStr.c_str());
if (!GetDataByID(nID, sjp, scn)) {
// MessageBoxA(0,"","",0);
int ppdid = nID + 1;
if (!GetDataByID(ppdid, sjp, scn)) {//尝试获取当前ID的数据
//如果失败
int pID = 0;
if (GetDataByJP(&pID, nStr.c_str(), scn)) {
nID = pID + 1;
ApplyStringToCV(scn, pDf, pID);
return 0;
if (GetDataByJP(&pID, nStr.c_str(), scn)) {//尝试从原文获取翻译
//成功
nID = pID;
// MessageBoxW(0,scn,L"",0);
ApplyStringToCV(scn, pDf);
// MessageBoxA(0,"0","",0);
return 0;//直接返回
}
else {
//失败
if (nID == -1) {
nID = 0;
return -1;
}
if (GetDataByID(nID, sjp, scn))
nID = GEtLargestID() + 1;
// MessageBoxA(0, "1", "", 0);
return -1;
}
}
else
{
if (lstrcmpW(sjp, nStr.c_str()) == 0) {
ApplyStringToCV(scn, pDf, nID);
//如果成功
if (lstrcmpW(sjp, nStr.c_str()) == 0) {//检查是否是正确的翻译
//如果是则直接应用
// MessageBoxW(0, scn, L"", 0);
ApplyStringToCV(scn, pDf);
nID = ppdid;
// MessageBoxA(0, "2", "", 0);
return 0;
}
else
{
//如果不是则
int pID = 0;
if (GetDataByJP(&pID, nStr.c_str(), scn)) {
nID = pID + 1;
ApplyStringToCV(scn, pDf, pID);
return 0;
}
else
if (GetDataByJP(&pID, nStr.c_str(), scn)) {//再次尝试用原文获取数据
//如果成功
// MessageBoxW(0, scn, L"", 0);
ApplyStringToCV(scn, pDf);
nID = pID;
// MessageBoxA(0, "3", "", 0);
return 0;//直接返回
}
else {
//如果不是
nID = GEtLargestID()+1;
// MessageBoxA(0, "4", "", 0);
return -1;
}
}
}
nID++;
return 0;
return -1;
}

View File

@@ -27,6 +27,6 @@ struct TESTDATA {
DWORD Over1;
QWORD Over2;
};
void BuildCV(TESTDATA* pcv, TESTDATA flt, DWORD posinCross, DWORD posInLine, DWORD m_count, WCHAR nchar);
void ApplyStringToCV(LPCWSTR ws, DWORD pDf, int id);
extern "C" DLLAPI void BuildCV(TESTDATA* pcv, TESTDATA flt, DWORD posinCross, DWORD posInLine, DWORD m_count, WCHAR nchar);
void ApplyStringToCV(LPCWSTR ws, DWORD pDf);
extern "C" DLLAPI int TranSplete(DWORD lp);

View File

@@ -78,6 +78,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>C:\Users\14980\Desktop\Tran_Tools\aikotoba</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>

View File

@@ -4,19 +4,36 @@
#include "BuildIn.h"
#pragma data_seg("PublicData") // 声明共享数据段,并命名该数据段
//代表储存数据的进度
extern "C" DLLAPI double saveProcess = 0.0;
//共享模块句柄
HMODULE hMod = NULL;
//储存原文字符串
extern "C" DLLAPI wchar_t ms_str[3096] = { 0 };
//储存GetGlyphoutLine的输出记录
extern "C" DLLAPI wchar_t ns_str[6192] = { 0 };
extern "C" DLLAPI int nID = 0;
//储存译文字符串
extern "C" DLLAPI wchar_t cn_str[1024] = { 0 };
//当前的ID
extern "C" DLLAPI int nID = -1;
//目标进程PID
extern "C" DLLAPI DWORD tPid = 0;
//函数地址
extern "C" DLLAPI DWORD m_Addr = 0xFFFFFFFF;
//暴力提取的模式
extern "C" DLLAPI DWORD VioMode = 0;
//是否成功获取到译文
extern "C" DLLAPI bool IsSuccess = false;
//框架备用
extern "C" DLLAPI bool blockRestoreSrc = false;
extern "C" DLLAPI bool enReplace = false;
extern "C" DLLAPI wchar_t resultstr[1024] = { 0 };
#pragma data_seg()
#pragma comment(linker, "/section:PublicData,rws")
MicroData* Index = NULL;
MicroBinary* Data = NULL;
char IpfData[16];