配置的加载

// Hearthbuddy.Windows.ConfigurationWindow
// Token: 0x060001DB RID: 475 RVA: 0x00088A3C File Offset: 0x00086C3C
public ConfigurationWindow()
{
this.InitializeComponent();
if (!CommandLine.Arguments.Exists("config"))
{
Configuration.Instance.Name = "Default";
return;
}
string text = CommandLine.Arguments.Single("config");
if (new Regex("^[a-zA-Z0-9_]*$").IsMatch(text))
{
Configuration.Instance.Name = text;
this.bool_0 = true;
return;
}
Configuration.Instance.Name = "Default";
}
// Hearthbuddy.Windows.ConfigurationWindow
// Token: 0x060001DD RID: 477 RVA: 0x00088B90 File Offset: 0x00086D90
private void button_0_Click(object sender, RoutedEventArgs e)
{
string text = this.comboBox_0.Text;
if (string.IsNullOrEmpty(text))
{
MessageBox.Show("Please select or enter a valid configuration to use.", "Hearthbuddy", MessageBoxButton.OK, MessageBoxImage.Hand);
return;
}
if (!new Regex("^[a-zA-Z0-9_\\-]*$").IsMatch(text))
{
MessageBox.Show("The configuration name is invalid. Please use only alphanumeric, the underscore, or a dash characters (a-z, A-Z, 0-9, _, -).", "Hearthbuddy", MessageBoxButton.OK, MessageBoxImage.Hand);
return;
}
this.method_0(text);
}

string_0是"Default"

// Hearthbuddy.Windows.ConfigurationWindow
// Token: 0x060001DC RID: 476 RVA: 0x00088ABC File Offset: 0x00086CBC
private void method_0(string string_0)
{
if (!GlobalSettings.Instance.Configurations.Contains(string_0))
{
GlobalSettings.Instance.Configurations.Add(string_0);
}
GlobalSettings.Instance.LastUsedConfiguration = string_0;
Configuration.Instance.Name = string_0;
try
{
base.Visibility = Visibility.Hidden;
LoginWindow loginWindow = new LoginWindow();
int num = ;
while (loginWindow.NeedsToShow)
{
Application.Current.MainWindow = loginWindow;
loginWindow.ShowDialog();
if (Application.Current.MainWindow == null || num > )
{
if (num > )
{
MessageBox.Show("Hearthbuddy has tried to login too many times. Please wait a short while and try again. Hearthbuddy will now close.", "Hearthbuddy", MessageBoxButton.OK, MessageBoxImage.Hand);
}
Environment.Exit();
}
num++;
}
base.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "Hearthbuddy", MessageBoxButton.OK, MessageBoxImage.Hand);
Environment.Exit();
}
}
// Hearthbuddy.Windows.MainWindow
// Token: 0x060001FF RID: 511 RVA: 0x00089530 File Offset: 0x00087730
private void method_1(object sender, RoutedEventArgs e)
{
try
{
base.Title = "Hearthbuddy-20190818-005(https://github.com/ChuckHearthBuddy/SilverFish)";
base.SetBinding(Window.LeftProperty, new Binding("WindowX")
{
Source = MainSettings.Instance,
Mode = BindingMode.TwoWay
});
base.SetBinding(Window.TopProperty, new Binding("WindowY")
{
Source = MainSettings.Instance,
Mode = BindingMode.TwoWay
});
base.SetBinding(FrameworkElement.WidthProperty, new Binding("WindowWidth")
{
Source = MainSettings.Instance,
Mode = BindingMode.TwoWay
});
base.SetBinding(FrameworkElement.HeightProperty, new Binding("WindowHeight")
{
Source = MainSettings.Instance,
Mode = BindingMode.TwoWay
});
MainSettings.Instance.LoadRowDefinitions(this.rowDefinition_0, this.rowDefinition_1, this.rowDefinition_2);
this.method_3();
this.textBox_0.Text = Logger.FileName;
this.method_17();
this.method_18();
this.method_19();
this.method_20();
}
catch (Exception exception)
{
MainWindow.ilog_0.Error("[Ui] An exception occurred.", exception);
}
}
// Hearthbuddy.Windows.MainWindow
// Token: 0x06000201 RID: 513 RVA: 0x00003C51 File Offset: 0x00001E51
private void method_3()
{
ThreadPool.QueueUserWorkItem(new WaitCallback(this.method_21));
}
// Hearthbuddy.Windows.MainWindow
// Token: 0x06000231 RID: 561 RVA: 0x0008AC34 File Offset: 0x00088E34
[CompilerGenerated]
private void method_21(object object_0)
{
try
{
base.Dispatcher.Invoke(new Action(this.method_22));
string text;
if (this.process_0 == null)
{
base.Dispatcher.BeginInvoke(new Action(base.Close), Array.Empty<object>());
}
else if (!TritonHs.smethod_0(this.process_0, new TritonHs.Delegate6(Class12.smethod_4), out text))
{
MainWindow.ilog_0.Error(text);
System.Windows.MessageBox.Show(text, "Error", MessageBoxButton.OK, MessageBoxImage.Hand);
base.Dispatcher.BeginInvoke(new Action(base.Close), Array.Empty<object>());
}
else
{
TritonHs.Memory.ProcessExited += MainWindow.Class25.ChuckInstance9.method_1;
TritonHs.Memory.Executor.FrameDropWaitTime = 15000u;
TritonHs.Memory.Executor.ExecuteWaitTime = ;
TritonHs.Memory.DisableCache();
TritonHs.Memory.ClearCache();
int version;
int clientChangelist;
using (TritonHs.AcquireFrame())
{
version = Triton.Game.Mapping.Version.version;
clientChangelist = Triton.Game.Mapping.Version.clientChangelist;
}
if ((long)version != (long)((ulong)Class247.UInt32_1) && (long)clientChangelist != (long)((ulong)Class247.UInt32_2))
{
MainWindow.ilog_0.InfoFormat("Hearthstone client version ({0}, {1})", version, clientChangelist);
new Coroutine(new Func<Task>(MainWindow.Class25.ChuckInstance9.method_2));
Configuration.Instance.AddSettings(MainSettings.Instance);
Configuration.Instance.AddSettings(DevSettings.Instance);
Configuration.Instance.SaveAll();
base.Dispatcher.Invoke(new Action(this.method_23));
BotManager.PreStart += this.method_11;
BotManager.PostStop += this.method_10;
BotManager.Load();
base.Dispatcher.Invoke(new Action(this.method_24));
this.comboBox_0.Dispatcher.BeginInvoke(new Action(this.method_25), Array.Empty<object>());
BotManager.OnBotChanged += this.method_6;
RoutineManager.Load();
base.Dispatcher.Invoke(new Action(this.method_26));
this.comboBox_1.Dispatcher.BeginInvoke(new Action(this.method_27), Array.Empty<object>());
RoutineManager.OnRoutineChanged += this.method_7;
PluginManager.Load();
foreach (IPlugin plugin in PluginManager.Plugins)
{
if (MainSettings.Instance.EnabledPlugins.Contains(plugin.Name))
{
using (TritonHs.AcquireFrame())
{
PluginManager.Enable(plugin);
}
Thread.Sleep();
}
else
{
using (TritonHs.AcquireFrame())
{
PluginManager.Disable(plugin);
}
Thread.Sleep();
}
}
this.listBox_0.Dispatcher.Invoke<IEnumerable>(new Func<IEnumerable>(this.method_28), DispatcherPriority.Normal);
base.Dispatcher.Invoke(new Action(this.method_29));
PluginManager.PluginEnabled += this.method_5;
PluginManager.PluginDisabled += this.method_4;
MainWindow.ilog_0.ErrorFormat("{0}Please read the following guide before using this program:{0}https://github.com/ChuckHearthBuddy/SilverFish/blob/master/ReadMe.md", Environment.NewLine);
base.Dispatcher.Invoke(new Action(this.method_30));
base.Dispatcher.Invoke(new Action(this.method_31));
this.stopwatch_0.Restart();
RoutineManager.OnRoutineChanged += this.method_7;
BotManager.OnBotChanged += this.method_6;
TritonHs.IsBotFullyLoaded = true;
Hotkeys.Register("BotManager.StartStop", Keys.S, ModifierKeys.Alt | ModifierKeys.Shift, new Action<Hotkey>(MainWindow.Class25.ChuckInstance9.method_3));
if (CommandLine.Arguments.Exists("autostart"))
{
BotManager.Start();
}
}
else
{
text = string.Format("This client version ({0}, {1}) is unsupported. Hearthbuddy currently supports client version ({2}, {3}). Please check the forums for more information: https://www.thebuddyforum.com/hearthbuddy-forum/", new object[]
{
version,
clientChangelist,
Class247.UInt32_1,
Class247.UInt32_2
});
MainWindow.ilog_0.ErrorFormat(text, Array.Empty<object>());
System.Windows.MessageBox.Show(text, "Error", MessageBoxButton.OK, MessageBoxImage.Hand);
base.Dispatcher.BeginInvoke(new Action(base.Close), Array.Empty<object>());
}
}
}
catch (Exception exception)
{
MainWindow.ilog_0.Error("[OnStartup] A top-level exception has been caught.", exception);
}
}
// Hearthbuddy.Windows.MainWindow
// Token: 0x06000232 RID: 562 RVA: 0x0008B13C File Offset: 0x0008933C
[CompilerGenerated]
private void method_22()
{
if (!Class9.smethod_4(out this.mutex_0, out this.process_0))
{
MainWindow.ilog_0.Error("Could not attach to a Hearthstone process. Please make sure an available Hearthstone process is running.");
MessageBox.Show(string.Format("Could not attach to a Hearthstone process. Please make sure an available Hearthstone process is running.{0}{0}Hearthbuddy will now close.", Environment.NewLine), "Hearthbuddy", MessageBoxButton.OK, MessageBoxImage.Hand);
return;
}
this.dispatcherTimer_0 = new DispatcherTimer(TimeSpan.FromSeconds(1.0), DispatcherPriority.Normal, new EventHandler(this.method_9), base.Dispatcher);
this.dispatcherTimer_0.Start();
}
// ns3.Class9
// Token: 0x06000116 RID: 278 RVA: 0x00003359 File Offset: 0x00001559
internal static bool smethod_4(out Mutex mutex_0, out Process process_0)
{
if (!Class9.smethod_5(out mutex_0, out process_0))
{
return false;
}
Path.Combine(Path.GetDirectoryName(process_0.MainModule.FileName), "Hearthstone_Data", "Mono");
return true;
}
// ns3.Class9
// Token: 0x06000117 RID: 279 RVA: 0x00086200 File Offset: 0x00084400
internal static bool smethod_5(out Mutex mutex_0, out Process process_0)
{
mutex_0 = null;
process_0 = null;
Arguments arguments = CommandLine.Arguments;
if (arguments.Exists("pid"))
{
try
{
int num = int.Parse(arguments.Single("pid"));
process_0 = Process.GetProcessById(num);
if (!Class9.smethod_6(process_0))
{
Class9.ilog_0.Error("Invalid PID specifier passed to the command line: " + arguments.Single("pid") + ". This process is not a Hearthstone client.");
return false;
}
bool flag;
mutex_0 = Class9.smethod_1(num, out flag);
if (!flag)
{
mutex_0 = null;
process_0 = null;
Class9.ilog_0.Error("Invalid PID specifier passed to the command line: " + arguments.Single("pid") + ". This process has already been attached to.");
return false;
}
return true;
}
catch
{
Class9.ilog_0.Error("Invalid PID specifier passed to the command line: " + arguments.Single("pid"));
return false;
}
}
bool result;
if (arguments.Exists("pname"))
{
try
{
string processName = arguments.Single("pname");
process_0 = Process.GetProcessesByName(processName).FirstOrDefault<Process>();
if (process_0 != null && Class9.smethod_6(process_0))
{
bool flag2;
mutex_0 = Class9.smethod_1(process_0.Id, out flag2);
if (!flag2)
{
mutex_0 = null;
process_0 = null;
Class9.ilog_0.Error("Invalid PNAME specifier passed to the command line: " + arguments.Single("pname") + ". This process has already been attached to.");
result = false;
}
else
{
result = true;
}
}
else
{
Class9.ilog_0.Error("Invalid PNAME specifier passed to the command line: " + arguments.Single("pname") + ". This process is not a Hearthstone client.");
result = false;
}
}
catch
{
Class9.ilog_0.Error("Invalid PNAME specifier passed to the command line: " + arguments.Single("pname"));
result = false;
}
}
else
{
List<Process> list = Class9.smethod_7().ToList<Process>();
if (list.Count == )
{
return false;
}
if (!arguments.Exists("noautoattach") && list.Count == )
{
bool flag3;
mutex_0 = Class9.smethod_1(list[].Id, out flag3);
if (flag3)
{
process_0 = list[];
return true;
}
mutex_0.Dispose();
}
Dictionary<Process, string> dictionary = new Dictionary<Process, string>();
foreach (Process process in list)
{
bool flag4;
mutex_0 = Class9.smethod_1(process.Id, out flag4);
if (flag4 && mutex_0 != null)
{
using (ExternalProcessMemory externalProcessMemory = new ExternalProcessMemory(process, false, false, false))
{
dictionary.Add(process, Class9.smethod_0(externalProcessMemory));
mutex_0.ReleaseMutex();
mutex_0.Dispose();
}
}
}
ProcessSelectorWindow processSelectorWindow = new ProcessSelectorWindow(dictionary)
{
Topmost = true
};
if (processSelectorWindow.ShowDialog() == true)
{
process_0 = processSelectorWindow.Selected;
bool flag5;
mutex_0 = Class9.smethod_1(process_0.Id, out flag5);
return true;
}
return false;
}
return result;
}
// ns3.Class9
// Token: 0x06000112 RID: 274 RVA: 0x00003352 File Offset: 0x00001552
private static string smethod_0(ExternalProcessMemory externalProcessMemory_0)
{
return "(Hearthstone)";
}
// ns3.Class9
// Token: 0x06000113 RID: 275 RVA: 0x0008608C File Offset: 0x0008428C
private static Mutex smethod_1(int int_0, out bool bool_0)
{
return new Mutex(true, "Local\\" + (Environment.MachineName.GetHashCode() ^ int_0.GetHashCode() ^ TimeZone.CurrentTimeZone.StandardName.GetHashCode() ^ "Blizz_HS_BuddyTeam".GetHashCode() + ), ref bool_0);
}

Could not attach to a Hearthstone process.的更多相关文章

  1. 无法Debug SQL: Unable to start T-SQL Debugging. Could not attach to SQL Server process on

    今天SSMS debug SQL当脚本,突然错误: Unable to start T-SQL Debugging. Could not attach to SQL Server process on ...

  2. 【转】IDA远程调试 The debugger could not attach to the selected process. irs_recv 等待的操作过时

    IDA连接android_server 选中进程点ok之后 连接不上报错 The debugger could not attach to the selected process. This can ...

  3. 如何解决Visual Studio调试Debug很卡很慢

    http://brightguo.com/make-debugging-faster-with-visual-studio/ Have you ever been frustrated by slow ...

  4. 【原创】如何在Android Studio下调试原生安卓Framework层面的源代码

    1. Open Existing Android Studio Project. 2. 打开后, Projects -> Android 里面是空的. 这时候,需要选到 Projects-> ...

  5. GDB配置与.gdbinit的编写

    GDB配置与.gdbinit的编写 当 GDB(即 GNU Project Debugger)启动时,它在当前用户的主目录中寻找一个名为 .gdbinit 的文件:如果该文件存在,则 GDB 就执行该 ...

  6. Microsoft Win32 to Microsoft .NET Framework API Map

    Microsoft Win32 to Microsoft .NET Framework API Map .NET Development (General) Technical Articles   ...

  7. 如何使用Android Studio开发/调试Android源码

    本文是以源码中development/tools/idegen/README作为指导文档. 环境: Ubuntu 14.10,openJdk 1.7,Android Studio 1.0.2,andr ...

  8. Android Studio 经常使用功能介绍

    为了简化 Android 的开发力度,Google 决定将重点建设 Android Studio 工具.Google 会在今年年底停止支持其它集成开发环境.比方 Eclipse. Android St ...

  9. Debugging Chromium on Windows

    转自:https://www.chromium.org/developers/how-tos/debugging-on-windows For Developers‎ > ‎How-Tos‎ & ...

随机推荐

  1. 【php设计模式】适配器模式

    适配器模式(对象适配器.类适配器): 将一个类的接口转换成客户希望的另一个接口.适配器模式让那些接口不兼容的类可以一起工作. 在适配器模式定义中所提及的接口是指广义的接口,它可以表示一个方法或者方法的 ...

  2. js之数据类型(对象类型——单体内置对象——Math)

    Math是一个内置对象,它具有数学常数和函数的属性和方法.Math对象用于执行数学任务,和其它对象不同,Math只是一个静态对象并没有Math()构造函数,实际上,Math()只是一个由js设置的对象 ...

  3. 【小知识点】input输入框在安卓以及IOS手机中光标及字体不居中解决方法

    问题根本:不要使用line-height垂直居中. 解决方法:可直接定义height,然后高度由上下padding值撑开. input { height: 1rem; padding: 1rem 0; ...

  4. java Calendar Date 获取指定日期所在月或年的第一天和最后一天

    一.获取传入日期所在月的第一天 public static Date getFirstDayDateOfMonth(final Date date) { final Calendar cal = Ca ...

  5. paypal支付 NVP支付 paypal 手续费 GetTransactionDetails

    主要内容: 本文章主要讲解的是NVP的对接,以最简单的接口案例,讲解一下对接NVP的方案. 先提供下paypal 官方文档的主要功能对接说明,如下 1.请求API 服务器端点 描述 https://a ...

  6. websocket + TP5.1 + apache 配置步骤

    websocket + TP5.1 + apache 配置步骤 1. https ssl配置好 2. 检查php环境是否满足Workerman要求 curl -Ss http://www.worker ...

  7. SQLite3学习笔记(2)

      SQLite 创建表 SQLite 的CREATE TABLE 语句用于在任何指定的数据库创建一个新表. 创建新表,涉及到命名表.定义列及每一行的数据类型. CREATE TABLE 的基本语法如 ...

  8. Java&Selenium 鼠标键盘及滚动条控制相关方法封装

    一.摘要 本片博文主要展示在使用Selenium with java做web自动化时,一些不得不模拟鼠标操作.模拟键盘操作和控制滚动条的java代码 二.模拟鼠标操作 package util; im ...

  9. python Pillow 图片处理模块,好强大有没有

    python Pillow 图片处理模块,好强大有没有 Pillow 需要给 python 另外安装 第一个用法:https://www.cnblogs.com/ibingshan/p/1105739 ...

  10. JSP常用标签

    JSP常用标签可以理解为JSTL user:普通用户 admin:站点管理员 JSTL1.1.2下载地址:http://archive.apache.org/dist/jakarta/taglibs/ ...