diff --git a/cs2_chs/Advance.xaml b/cs2_chs/Advance.xaml index d0f051a..db8a243 100644 --- a/cs2_chs/Advance.xaml +++ b/cs2_chs/Advance.xaml @@ -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"> - + Topmost="True" Title="Advance" Height="389.052" Width="712.641" ResizeMode="NoResize" MouseMove="Window_MouseMove"> + @@ -45,5 +45,6 @@ + diff --git a/cs2_chs/Advance.xaml.cs b/cs2_chs/Advance.xaml.cs index f8d6ff7..dd83b71 100644 --- a/cs2_chs/Advance.xaml.cs +++ b/cs2_chs/Advance.xaml.cs @@ -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,24 +23,36 @@ namespace cs2_chs /// public partial class Advance : Window { + public TextView tv = new TextView(); public bool enChanged = false; static public Thread threadRestore; 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) + if (t != lob|| repeatflag) { itoc += t; lob = t; + + repeatflag = false; + } + else + { + repeatflag = true; } } } @@ -105,6 +119,7 @@ namespace cs2_chs { TRAN_OPT.Text = lobnob; OutPutLog.Text = loacl; + }); Thread.Sleep(50); } @@ -142,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 @@ -154,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 @@ -222,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()); + } + } } } diff --git a/cs2_chs/InitData.cs b/cs2_chs/InitData.cs index 8977450..7826997 100644 --- a/cs2_chs/InitData.cs +++ b/cs2_chs/InitData.cs @@ -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) { diff --git a/cs2_chs/MainWindow.xaml b/cs2_chs/MainWindow.xaml index 8582ecb..273d933 100644 --- a/cs2_chs/MainWindow.xaml +++ b/cs2_chs/MainWindow.xaml @@ -5,16 +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"> - - + + - + @@ -23,14 +23,14 @@ - - - - + diff --git a/cs2_chs/MainWindow.xaml.cs b/cs2_chs/MainWindow.xaml.cs index cf8bdc4..90e83cf 100644 --- a/cs2_chs/MainWindow.xaml.cs +++ b/cs2_chs/MainWindow.xaml.cs @@ -16,6 +16,8 @@ using System.Windows.Shapes; using System.Runtime.InteropServices; using System.Windows.Threading; using System.Messaging; +using System.Windows.Interop; + namespace cs2_chs { /// @@ -48,7 +50,7 @@ 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")] @@ -57,6 +59,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; @@ -67,6 +71,7 @@ namespace cs2_chs 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){ @@ -127,12 +132,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; + } + + AdvanceSetting.ENREP.IsChecked = initdata.EnRep; + if (initdata.EnRep) + { + AdvanceSetting.tv.Show(); } - - // MessageBox.Show(""); switch (initdata.VioMode) { case 0: @@ -152,6 +163,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(); } @@ -160,6 +173,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) @@ -172,6 +189,7 @@ namespace cs2_chs cn_str = (uint)DllTools.GetProcAddress(hMod, "cn_str"); IsSuccess= (uint)DllTools.GetProcAddress(hMod, "IsSuccess"); + Thread threadExit = new Thread(delegate () { WaitForSingleObject(hThread, 0xFFFFFFFF); @@ -298,5 +316,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; + } } } diff --git a/cs2_chs/TextView.xaml b/cs2_chs/TextView.xaml new file mode 100644 index 0000000..2a84f32 --- /dev/null +++ b/cs2_chs/TextView.xaml @@ -0,0 +1,13 @@ + + + + + + diff --git a/cs2_chs/TextView.xaml.cs b/cs2_chs/TextView.xaml.cs new file mode 100644 index 0000000..048adbd --- /dev/null +++ b/cs2_chs/TextView.xaml.cs @@ -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 +{ + /// + /// TextView.xaml 的交互逻辑 + /// + 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) + { + + } + } +} diff --git a/cs2_chs/cs2_chs.csproj b/cs2_chs/cs2_chs.csproj index da7d11b..910b09b 100644 --- a/cs2_chs/cs2_chs.csproj +++ b/cs2_chs/cs2_chs.csproj @@ -50,7 +50,7 @@ true - ..\Release\ + C:\Users\14980\Desktop\Tran_Tools\aikotoba\ TRACE true pdbonly @@ -93,6 +93,9 @@ MSBuild:Compile Designer + + TextView.xaml + Designer MSBuild:Compile @@ -115,6 +118,10 @@ MainWindow.xaml Code + + Designer + MSBuild:Compile + diff --git a/cs2_chs/obj/x86/Release/Advance.baml b/cs2_chs/obj/x86/Release/Advance.baml index 46e1403..eadd17d 100644 Binary files a/cs2_chs/obj/x86/Release/Advance.baml and b/cs2_chs/obj/x86/Release/Advance.baml differ diff --git a/cs2_chs/obj/x86/Release/Advance.g.cs b/cs2_chs/obj/x86/Release/Advance.g.cs index 37da883..0f93b03 100644 --- a/cs2_chs/obj/x86/Release/Advance.g.cs +++ b/cs2_chs/obj/x86/Release/Advance.g.cs @@ -1,4 +1,4 @@ -#pragma checksum "..\..\..\Advance.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "14B36F89504AB322533CA92CB6E5863D180B432811F8A590F6262841788C94E3" +#pragma checksum "..\..\..\Advance.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "4086118BC3A2ED0FEBC5AB9C32B57D03818AE03DF764A269847A893F690582F4" //------------------------------------------------------------------------------ // // 此代码由工具生成。 @@ -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; /// @@ -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; diff --git a/cs2_chs/obj/x86/Release/Advance.g.i.cs b/cs2_chs/obj/x86/Release/Advance.g.i.cs index 37da883..0f93b03 100644 --- a/cs2_chs/obj/x86/Release/Advance.g.i.cs +++ b/cs2_chs/obj/x86/Release/Advance.g.i.cs @@ -1,4 +1,4 @@ -#pragma checksum "..\..\..\Advance.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "14B36F89504AB322533CA92CB6E5863D180B432811F8A590F6262841788C94E3" +#pragma checksum "..\..\..\Advance.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "4086118BC3A2ED0FEBC5AB9C32B57D03818AE03DF764A269847A893F690582F4" //------------------------------------------------------------------------------ // // 此代码由工具生成。 @@ -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; /// @@ -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; diff --git a/cs2_chs/obj/x86/Release/DesignTimeResolveAssemblyReferences.cache b/cs2_chs/obj/x86/Release/DesignTimeResolveAssemblyReferences.cache index 6a36b0b..3ea01ce 100644 Binary files a/cs2_chs/obj/x86/Release/DesignTimeResolveAssemblyReferences.cache and b/cs2_chs/obj/x86/Release/DesignTimeResolveAssemblyReferences.cache differ diff --git a/cs2_chs/obj/x86/Release/DesignTimeResolveAssemblyReferencesInput.cache b/cs2_chs/obj/x86/Release/DesignTimeResolveAssemblyReferencesInput.cache index 7f598d7..457396a 100644 Binary files a/cs2_chs/obj/x86/Release/DesignTimeResolveAssemblyReferencesInput.cache and b/cs2_chs/obj/x86/Release/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/cs2_chs/obj/x86/Release/MainWindow.baml b/cs2_chs/obj/x86/Release/MainWindow.baml index a976198..b49e110 100644 Binary files a/cs2_chs/obj/x86/Release/MainWindow.baml and b/cs2_chs/obj/x86/Release/MainWindow.baml differ diff --git a/cs2_chs/obj/x86/Release/MainWindow.g.cs b/cs2_chs/obj/x86/Release/MainWindow.g.cs index 2f248ed..cfcf366 100644 --- a/cs2_chs/obj/x86/Release/MainWindow.g.cs +++ b/cs2_chs/obj/x86/Release/MainWindow.g.cs @@ -1,4 +1,4 @@ -#pragma checksum "..\..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "3762C2C4283F2E5D09EE19D57194D7F3C83E315990F5B1EC6CA5569998B7FBE4" +#pragma checksum "..\..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "F04B42CA40D1146EA344AEDB60ADCFC400A88DF0B94E1795A45B0787A037611F" //------------------------------------------------------------------------------ // // 此代码由工具生成。 @@ -130,6 +130,18 @@ 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)); @@ -148,11 +160,23 @@ namespace cs2_chs { #line 33 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_1); + #line default + #line hidden + + #line 33 "..\..\..\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 41 "..\..\..\MainWindow.xaml" + this.SRC_OUTPUT.MouseRightButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.SRC_OUTPUT_MouseRightButtonUp); + + #line default + #line hidden return; case 7: diff --git a/cs2_chs/obj/x86/Release/MainWindow.g.i.cs b/cs2_chs/obj/x86/Release/MainWindow.g.i.cs index 2f248ed..cfcf366 100644 --- a/cs2_chs/obj/x86/Release/MainWindow.g.i.cs +++ b/cs2_chs/obj/x86/Release/MainWindow.g.i.cs @@ -1,4 +1,4 @@ -#pragma checksum "..\..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "3762C2C4283F2E5D09EE19D57194D7F3C83E315990F5B1EC6CA5569998B7FBE4" +#pragma checksum "..\..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "F04B42CA40D1146EA344AEDB60ADCFC400A88DF0B94E1795A45B0787A037611F" //------------------------------------------------------------------------------ // // 此代码由工具生成。 @@ -130,6 +130,18 @@ 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)); @@ -148,11 +160,23 @@ namespace cs2_chs { #line 33 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_1); + #line default + #line hidden + + #line 33 "..\..\..\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 41 "..\..\..\MainWindow.xaml" + this.SRC_OUTPUT.MouseRightButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.SRC_OUTPUT_MouseRightButtonUp); + + #line default + #line hidden return; case 7: diff --git a/cs2_chs/obj/x86/Release/TextView.baml b/cs2_chs/obj/x86/Release/TextView.baml new file mode 100644 index 0000000..e510f73 Binary files /dev/null and b/cs2_chs/obj/x86/Release/TextView.baml differ diff --git a/cs2_chs/obj/x86/Release/TextView.g.cs b/cs2_chs/obj/x86/Release/TextView.g.cs new file mode 100644 index 0000000..36f1e57 --- /dev/null +++ b/cs2_chs/obj/x86/Release/TextView.g.cs @@ -0,0 +1,121 @@ +#pragma checksum "..\..\..\TextView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "AE5EA01DD49E2B60AB9C47B22912BFAC127F24711B12D12BC295E963D2FF20C3" +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +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 { + + + /// + /// TextView + /// + 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; + + /// + /// InitializeComponent + /// + [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; + } + } +} + diff --git a/cs2_chs/obj/x86/Release/TextView.g.i.cs b/cs2_chs/obj/x86/Release/TextView.g.i.cs new file mode 100644 index 0000000..36f1e57 --- /dev/null +++ b/cs2_chs/obj/x86/Release/TextView.g.i.cs @@ -0,0 +1,121 @@ +#pragma checksum "..\..\..\TextView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "AE5EA01DD49E2B60AB9C47B22912BFAC127F24711B12D12BC295E963D2FF20C3" +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +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 { + + + /// + /// TextView + /// + 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; + + /// + /// InitializeComponent + /// + [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; + } + } +} + diff --git a/cs2_chs/obj/x86/Release/cs2_chs.csproj.CoreCompileInputs.cache b/cs2_chs/obj/x86/Release/cs2_chs.csproj.CoreCompileInputs.cache index 901038d..af0d64b 100644 --- a/cs2_chs/obj/x86/Release/cs2_chs.csproj.CoreCompileInputs.cache +++ b/cs2_chs/obj/x86/Release/cs2_chs.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -98f2780c0c3c7c5ee3745f5d099f33acbb6379f0 +2be805b5b109991f8cd375e426d41b98980631b6 diff --git a/cs2_chs/obj/x86/Release/cs2_chs.csproj.FileListAbsolute.txt b/cs2_chs/obj/x86/Release/cs2_chs.csproj.FileListAbsolute.txt index f325325..68c231d 100644 --- a/cs2_chs/obj/x86/Release/cs2_chs.csproj.FileListAbsolute.txt +++ b/cs2_chs/obj/x86/Release/cs2_chs.csproj.FileListAbsolute.txt @@ -23,3 +23,8 @@ 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 diff --git a/cs2_chs/obj/x86/Release/cs2_chs.csprojAssemblyReference.cache b/cs2_chs/obj/x86/Release/cs2_chs.csprojAssemblyReference.cache index 0689c39..5fd7168 100644 Binary files a/cs2_chs/obj/x86/Release/cs2_chs.csprojAssemblyReference.cache and b/cs2_chs/obj/x86/Release/cs2_chs.csprojAssemblyReference.cache differ diff --git a/cs2_chs/obj/x86/Release/cs2_chs.exe b/cs2_chs/obj/x86/Release/cs2_chs.exe index ecd54e6..51f482b 100644 Binary files a/cs2_chs/obj/x86/Release/cs2_chs.exe and b/cs2_chs/obj/x86/Release/cs2_chs.exe differ diff --git a/cs2_chs/obj/x86/Release/cs2_chs.g.resources b/cs2_chs/obj/x86/Release/cs2_chs.g.resources index 905571c..8025757 100644 Binary files a/cs2_chs/obj/x86/Release/cs2_chs.g.resources and b/cs2_chs/obj/x86/Release/cs2_chs.g.resources differ diff --git a/cs2_chs/obj/x86/Release/cs2_chs.pdb b/cs2_chs/obj/x86/Release/cs2_chs.pdb index 8c57817..3c76d52 100644 Binary files a/cs2_chs/obj/x86/Release/cs2_chs.pdb and b/cs2_chs/obj/x86/Release/cs2_chs.pdb differ diff --git a/cs2_chs/obj/x86/Release/cs2_chs_MarkupCompile.cache b/cs2_chs/obj/x86/Release/cs2_chs_MarkupCompile.cache index c301fe4..5248b9f 100644 --- a/cs2_chs/obj/x86/Release/cs2_chs_MarkupCompile.cache +++ b/cs2_chs/obj/x86/Release/cs2_chs_MarkupCompile.cache @@ -10,11 +10,11 @@ none false TRACE D:\VSProject\cs2\cs2_united\cs2_chs\App.xaml -2-1834107634 +360698734 -9-330204798 +10-2131267635 171117567902 -Advance.xaml;MainWindow.xaml; +Advance.xaml;MainWindow.xaml;TextView.xaml; False diff --git a/cs2_chs/obj/x86/Release/cs2_chs_MarkupCompile.i.cache b/cs2_chs/obj/x86/Release/cs2_chs_MarkupCompile.i.cache index 7274c9e..6d29d53 100644 --- a/cs2_chs/obj/x86/Release/cs2_chs_MarkupCompile.i.cache +++ b/cs2_chs/obj/x86/Release/cs2_chs_MarkupCompile.i.cache @@ -10,11 +10,11 @@ none false TRACE D:\VSProject\cs2\cs2_united\cs2_chs\App.xaml -2-1834107634 +360698734 -10-1440126486 +111053777973 171117567902 -Advance.xaml;MainWindow.xaml; +Advance.xaml;MainWindow.xaml;TextView.xaml; -False +True diff --git a/cs2_chs/obj/x86/Release/cs2_chs_MarkupCompile.i.lref b/cs2_chs/obj/x86/Release/cs2_chs_MarkupCompile.i.lref new file mode 100644 index 0000000..b38894f --- /dev/null +++ b/cs2_chs/obj/x86/Release/cs2_chs_MarkupCompile.i.lref @@ -0,0 +1,6 @@ + + +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;; + diff --git a/cs2_chs/obj/x86/Release/cs2_chs_MarkupCompile.lref b/cs2_chs/obj/x86/Release/cs2_chs_MarkupCompile.lref index 16bb52a..334c810 100644 --- a/cs2_chs/obj/x86/Release/cs2_chs_MarkupCompile.lref +++ b/cs2_chs/obj/x86/Release/cs2_chs_MarkupCompile.lref @@ -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;; diff --git a/cs2_patch/BuildIn.cpp b/cs2_patch/BuildIn.cpp index 92471a4..f6353b1 100644 --- a/cs2_patch/BuildIn.cpp +++ b/cs2_patch/BuildIn.cpp @@ -4,7 +4,7 @@ #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]; @@ -27,7 +27,7 @@ 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) { @@ -118,9 +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; + + +WCHAR* GetResultData(){ + return resultstr; +} /*****************************/ int(*TranSpt)(DWORD); -HANDLE InjectSelfTo(LPCSTR inptr) +HANDLE InjectSelfTo(char inptr[]) { // MessageBoxA(0, inptr,"",0); HANDLE currentThread = NULL; @@ -158,6 +163,8 @@ HANDLE InjectSelfTo(LPCSTR inptr) lstrcpyW(ms_str, L" "); ns_str[0] = L'\0'; + + return currentThread; } DWORD lecx; @@ -197,10 +204,36 @@ 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) { diff --git a/cs2_patch/BuildIn.h b/cs2_patch/BuildIn.h index 0879e0f..81a9f73 100644 --- a/cs2_patch/BuildIn.h +++ b/cs2_patch/BuildIn.h @@ -2,7 +2,7 @@ #include #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); \ No newline at end of file diff --git a/cs2_patch/Data.cpp b/cs2_patch/Data.cpp index e858240..f04318f 100644 --- a/cs2_patch/Data.cpp +++ b/cs2_patch/Data.cpp @@ -236,6 +236,7 @@ void CreateDataExport(WCHAR src[],WCHAR data[]) } BOOL CreateDataByID(int ID, LPCWSTR jpBuff, int ljp, LPCWSTR cnBuffer, int lcn) { + // MessageBoxA(0,"","",0); IndexData createData; createData.Id = ID; createData.JpLength = ljp; @@ -251,6 +252,9 @@ 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]; @@ -286,6 +290,9 @@ BOOL GetDataByID(int ID, LPWSTR jpBuff, LPWSTR cnBuffer) if (ID == -1) { return 0; } + if (Index->Size() == 0) { + return 0; + } IndexData index; (*Index) = ID; Index->Get(&index); @@ -318,6 +325,8 @@ BOOL GetDataByID(int ID, LPWSTR jpBuff, LPWSTR cnBuffer) } int GEtLargestID() { + if (Index->Size() == 0) + return -1; IndexData index; int result = 0; do { diff --git a/cs2_patch/Release/BuildIn.obj b/cs2_patch/Release/BuildIn.obj index 646a2ed..940e527 100644 Binary files a/cs2_patch/Release/BuildIn.obj and b/cs2_patch/Release/BuildIn.obj differ diff --git a/cs2_patch/Release/Data.obj b/cs2_patch/Release/Data.obj index 07c6e09..54a1e63 100644 Binary files a/cs2_patch/Release/Data.obj and b/cs2_patch/Release/Data.obj differ diff --git a/cs2_patch/Release/cs2_patch.log b/cs2_patch/Release/cs2_patch.log index a3d1161..967f3bd 100644 --- a/cs2_patch/Release/cs2_patch.log +++ b/cs2_patch/Release/cs2_patch.log @@ -1,9 +1,10 @@ - Replace.cpp -D:\VSProject\cs2\cs2_united\cs2_patch\Replace.cpp(74,23): warning C4018: “<”: 有符号/无符号不匹配 - 正在创建库 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 + dllmain.cpp + 正在创建库 C:\Users\14980\Desktop\Tran_Tools\aikotoba\cs2_patch.lib 和对象 C:\Users\14980\Desktop\Tran_Tools\aikotoba\cs2_patch.exp 正在生成代码 - 1 of 162 functions ( 0.6%) were compiled, the rest were copied from previous compilation. - 0 functions were new in current compilation + 4 of 169 functions ( 2.4%) were compiled, the rest were copied from previous compilation. + 1 functions were new in current compilation 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 diff --git a/cs2_patch/Release/cs2_patch.tlog/CL.command.1.tlog b/cs2_patch/Release/cs2_patch.tlog/CL.command.1.tlog index d32294d..e225f11 100644 Binary files a/cs2_patch/Release/cs2_patch.tlog/CL.command.1.tlog and b/cs2_patch/Release/cs2_patch.tlog/CL.command.1.tlog differ diff --git a/cs2_patch/Release/cs2_patch.tlog/CL.read.1.tlog b/cs2_patch/Release/cs2_patch.tlog/CL.read.1.tlog index 93d59e1..fce75a0 100644 Binary files a/cs2_patch/Release/cs2_patch.tlog/CL.read.1.tlog and b/cs2_patch/Release/cs2_patch.tlog/CL.read.1.tlog differ diff --git a/cs2_patch/Release/cs2_patch.tlog/CL.write.1.tlog b/cs2_patch/Release/cs2_patch.tlog/CL.write.1.tlog index 779598f..3559ba1 100644 Binary files a/cs2_patch/Release/cs2_patch.tlog/CL.write.1.tlog and b/cs2_patch/Release/cs2_patch.tlog/CL.write.1.tlog differ diff --git a/cs2_patch/Release/cs2_patch.tlog/cs2_patch.write.1u.tlog b/cs2_patch/Release/cs2_patch.tlog/cs2_patch.write.1u.tlog index 5a8a75f..0a8e4c4 100644 Binary files a/cs2_patch/Release/cs2_patch.tlog/cs2_patch.write.1u.tlog and b/cs2_patch/Release/cs2_patch.tlog/cs2_patch.write.1u.tlog differ diff --git a/cs2_patch/Release/cs2_patch.tlog/link.command.1.tlog b/cs2_patch/Release/cs2_patch.tlog/link.command.1.tlog index b606373..f2c47b3 100644 Binary files a/cs2_patch/Release/cs2_patch.tlog/link.command.1.tlog and b/cs2_patch/Release/cs2_patch.tlog/link.command.1.tlog differ diff --git a/cs2_patch/Release/cs2_patch.tlog/link.delete.1.tlog b/cs2_patch/Release/cs2_patch.tlog/link.delete.1.tlog index 89d5026..3d7483a 100644 Binary files a/cs2_patch/Release/cs2_patch.tlog/link.delete.1.tlog and b/cs2_patch/Release/cs2_patch.tlog/link.delete.1.tlog differ diff --git a/cs2_patch/Release/cs2_patch.tlog/link.write.1.tlog b/cs2_patch/Release/cs2_patch.tlog/link.write.1.tlog index 1ae3991..335453b 100644 Binary files a/cs2_patch/Release/cs2_patch.tlog/link.write.1.tlog and b/cs2_patch/Release/cs2_patch.tlog/link.write.1.tlog differ diff --git a/cs2_patch/Release/dllmain.obj b/cs2_patch/Release/dllmain.obj index b75e9ce..01a9ca0 100644 Binary files a/cs2_patch/Release/dllmain.obj and b/cs2_patch/Release/dllmain.obj differ diff --git a/cs2_patch/Release/vc142.pdb b/cs2_patch/Release/vc142.pdb index c232585..f71a73a 100644 Binary files a/cs2_patch/Release/vc142.pdb and b/cs2_patch/Release/vc142.pdb differ diff --git a/cs2_patch/cs2_patch.vcxproj b/cs2_patch/cs2_patch.vcxproj index 3680e84..99fd969 100644 --- a/cs2_patch/cs2_patch.vcxproj +++ b/cs2_patch/cs2_patch.vcxproj @@ -78,6 +78,7 @@ false + C:\Users\14980\Desktop\Tran_Tools\aikotoba false diff --git a/cs2_patch/dllmain.cpp b/cs2_patch/dllmain.cpp index 5dfa708..d5932aa 100644 --- a/cs2_patch/dllmain.cpp +++ b/cs2_patch/dllmain.cpp @@ -26,6 +26,10 @@ 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")