Dynamic memory
This commit is contained in:
BIN
cs2_chs/04.jpg
Normal file
BIN
cs2_chs/04.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
@@ -23,8 +23,50 @@ namespace cs2_chs
|
||||
{
|
||||
public bool enChanged = false;
|
||||
static public Thread threadRestore;
|
||||
bool enFaileden = false;
|
||||
static bool enFaileden = false;
|
||||
static public void TranSpleteProc(ref string itoc)
|
||||
{
|
||||
string pitoc = itoc;
|
||||
|
||||
|
||||
if (enFaileden)
|
||||
{
|
||||
itoc = "";
|
||||
char lob = '\0';
|
||||
foreach (char t in pitoc)
|
||||
{
|
||||
if (t != lob)
|
||||
{
|
||||
itoc += t;
|
||||
lob = t;
|
||||
}
|
||||
}
|
||||
}
|
||||
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 +81,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,24 +98,9 @@ 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;
|
||||
|
||||
@@ -14,13 +14,7 @@
|
||||
<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" Grid.ColumnSpan="2" FontSize="18" BorderBrush="Red">
|
||||
<TextBox.Background>
|
||||
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
||||
<GradientStop Color="Black" Offset="0"/>
|
||||
@@ -29,16 +23,14 @@
|
||||
</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="Apply" HorizontalAlignment="Left" Height="25" Margin="346,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">
|
||||
<Button Content="Pull" HorizontalAlignment="Left" Margin="10,220,0,0" VerticalAlignment="Top" Width="90" Height="25" Click="Button_Click_1">
|
||||
<Button.Background>
|
||||
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
||||
<GradientStop Color="#FFFFEE00" Offset="0"/>
|
||||
|
||||
@@ -22,22 +22,11 @@ namespace cs2_chs
|
||||
/// 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")]
|
||||
@@ -76,6 +65,8 @@ 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;
|
||||
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
if(this.Visibility != Visibility.Visible){
|
||||
@@ -178,6 +169,8 @@ 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 ()
|
||||
{
|
||||
@@ -203,11 +196,20 @@ namespace cs2_chs
|
||||
//WaitOnAddress(pblockRestoreSrc, (uint)&aloc, sizeof(bool), 0xFFFFFFFF);
|
||||
Thread.Sleep(10);
|
||||
}
|
||||
|
||||
|
||||
char* pms_str = (char*)ms_str;
|
||||
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 +239,10 @@ namespace cs2_chs
|
||||
LocalS = TEXT_INPUT.Text;
|
||||
LocalP = SRC_OUTPUT.Text;
|
||||
});
|
||||
if (initdata.Envio)
|
||||
{
|
||||
Advance.UnTranSpleteProc(ref LocalP);
|
||||
}
|
||||
CreateData(LocalP, LocalS);
|
||||
});
|
||||
|
||||
@@ -274,8 +280,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,5 +160,8 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="03.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="04.jpg" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
#pragma checksum "..\..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "E730C4B41ACFA459AE58B693C6D867B376E7BBEDF7DBBB52809F64EFDB38EDA1"
|
||||
#pragma checksum "..\..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "3762C2C4283F2E5D09EE19D57194D7F3C83E315990F5B1EC6CA5569998B7FBE4"
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 32 "..\..\..\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 41 "..\..\..\MainWindow.xaml"
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
|
||||
internal System.Windows.Controls.TextBox SRC_OUTPUT;
|
||||
|
||||
@@ -134,7 +134,7 @@ namespace cs2_chs {
|
||||
case 3:
|
||||
this.apply = ((System.Windows.Controls.Button)(target));
|
||||
|
||||
#line 32 "..\..\..\MainWindow.xaml"
|
||||
#line 27 "..\..\..\MainWindow.xaml"
|
||||
this.apply.Click += new System.Windows.RoutedEventHandler(this.Button_Click);
|
||||
|
||||
#line default
|
||||
@@ -145,7 +145,7 @@ namespace cs2_chs {
|
||||
return;
|
||||
case 5:
|
||||
|
||||
#line 41 "..\..\..\MainWindow.xaml"
|
||||
#line 33 "..\..\..\MainWindow.xaml"
|
||||
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_1);
|
||||
|
||||
#line default
|
||||
@@ -156,13 +156,13 @@ namespace cs2_chs {
|
||||
return;
|
||||
case 7:
|
||||
|
||||
#line 73 "..\..\..\MainWindow.xaml"
|
||||
#line 65 "..\..\..\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 66 "..\..\..\MainWindow.xaml"
|
||||
((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.CommandBinding_ShowMainWindow_Executed);
|
||||
|
||||
#line default
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma checksum "..\..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "E730C4B41ACFA459AE58B693C6D867B376E7BBEDF7DBBB52809F64EFDB38EDA1"
|
||||
#pragma checksum "..\..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "3762C2C4283F2E5D09EE19D57194D7F3C83E315990F5B1EC6CA5569998B7FBE4"
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 32 "..\..\..\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 41 "..\..\..\MainWindow.xaml"
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
|
||||
internal System.Windows.Controls.TextBox SRC_OUTPUT;
|
||||
|
||||
@@ -134,7 +134,7 @@ namespace cs2_chs {
|
||||
case 3:
|
||||
this.apply = ((System.Windows.Controls.Button)(target));
|
||||
|
||||
#line 32 "..\..\..\MainWindow.xaml"
|
||||
#line 27 "..\..\..\MainWindow.xaml"
|
||||
this.apply.Click += new System.Windows.RoutedEventHandler(this.Button_Click);
|
||||
|
||||
#line default
|
||||
@@ -145,7 +145,7 @@ namespace cs2_chs {
|
||||
return;
|
||||
case 5:
|
||||
|
||||
#line 41 "..\..\..\MainWindow.xaml"
|
||||
#line 33 "..\..\..\MainWindow.xaml"
|
||||
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_1);
|
||||
|
||||
#line default
|
||||
@@ -156,13 +156,13 @@ namespace cs2_chs {
|
||||
return;
|
||||
case 7:
|
||||
|
||||
#line 73 "..\..\..\MainWindow.xaml"
|
||||
#line 65 "..\..\..\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 66 "..\..\..\MainWindow.xaml"
|
||||
((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.CommandBinding_ShowMainWindow_Executed);
|
||||
|
||||
#line default
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -8,6 +8,6 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
[assembly: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("03.png")]
|
||||
[assembly: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("04.jpg")]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user