コード例 #1
0
ファイル: TritonHs.cs プロジェクト: wangfujia/HearthstoneBot
 internal static bool smethod_0(Process process_0, Delegate6 delegate6_0, out string string_0)
 {
     if (Initialized)
     {
         string_0 = "SmartInitialize has already been called.";
         return(false);
     }
     if (process_0 == null)
     {
         string_0 = "process == null";
         return(false);
     }
     if (delegate6_0 == null)
     {
         string_0 = "getOffsetsDelegate == null";
         return(false);
     }
     if (Class247.smethod_1(process_0.MainModule.FileName) == Class247.UInt32_0)
     {
         string_0 = "This client version is unsupported.";
         return(false);
     }
     if (delegate6_0(String_0, out string_0) != null)
     {
         if (!string.IsNullOrEmpty(string_0))
         {
             string_0 = string.Format("The data required to run the bot was not successfully obtained. Please make sure your key is still valid at the Buddy Auth Portal: http://buddyauth.com/User/Keys {0}{0}For any further assistance, please contact support: https://bosslandgmbh.zendesk.com/home", Environment.NewLine);
         }
         return(false);
     }
     try
     {
         ExternalProcessMemoryInitParams externalProcessMemoryInitParams = new ExternalProcessMemoryInitParams
         {
             Process           = process_0,
             StartupRasm       = false,
             DefaultCacheValue = true,
             Executor          = ExecutorInitParams.DX9()
         };
         externalProcessMemoryInitParams.Executor.MinSkipBytes = 8;
         try
         {
             externalProcessMemory_0 = new ExternalProcessMemory(externalProcessMemoryInitParams);
         }
         catch (Exception ex)
         {
             if (!ex.Message.Equals("Could not find DX9 in process!"))
             {
                 throw;
             }
             //TritonHs.ilog_0.Info("Process is not using DX9, now trying DX11...");
             externalProcessMemoryInitParams = new ExternalProcessMemoryInitParams
             {
                 Process           = process_0,
                 StartupRasm       = false,
                 DefaultCacheValue = true,
                 Executor          = ExecutorInitParams.DX11()
             };
             externalProcessMemoryInitParams.Executor.MinSkipBytes = 8;
             externalProcessMemory_0 = new ExternalProcessMemory(externalProcessMemoryInitParams);
         }
         externalProcessMemory_0.ProcessExited += Class246.ChuckInstance9.method_0;
         class276_0 = new Class276(externalProcessMemory_0);
         using (AcquireFrame())
         {
             intptr_1 = class276_0.method_2();
         }
         ProcessHookManager.smethod_3();
         Hotkeys.Initialize(ClientWindowHandle);
         Input.DebugMouseCursorPos = false;
         Initialized     = true;
         TritonHs.bool_0 = false;
     }
     catch (Exception ex2)
     {
         string_0 = ex2.ToString();
         return(false);
     }
     string_0 = string.Empty;
     return(true);
 }