hanmin0822 / MisakaTranslator

御坂翻译器—Galgame/文字游戏/漫画多语种实时机翻工具
GNU General Public License v3.0
4.8k stars 427 forks source link

在Hook过程中关闭软件引起的BUG(附Log) #287

Closed SeikEAnuL closed 1 year ago

SeikEAnuL commented 1 year ago

问题描述 <因为不清楚打算游玩游戏的Hook 方式在Hook阶段关闭软件,之后便报错>

==============System Info================ System:Microsoft Windows NT 10.0.19044.0 CurrentTime:2023/4/3 23:13 dotNetVersion:4.0.30319.42000 MisakaTranslatorVersion:2.12.2.0 ==============Exception Info================ ExceptionType:Non UI Thread ExceptionName:System.ArgumentException ExceptionSource:mscorlib ExceptionMessage:要在此字符串中进行分析,必须指定有效信息。 ExceptionStackTrace: 在 System.Enum.EnumResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument) 在 System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult) 在 System.Enum.Parse(Type enumType, String value, Boolean ignoreCase) 在 System.Enum.Parse(Type enumType, String value) 在 KeyboardMouseHookLibrary.GlobalHotKey.RegisterHotKeyByStr(String str, IntPtr handle, HotKeyCallBackHandler callback) 位置 D:\a\MisakaTranslator\MisakaTranslator\KeyboardMouseHookLibrary\GlobalHotKey.cs:行号 101 在 MisakaTranslator_WPF.MainWindow.MainWindow_SourceInitialized(Object sender, EventArgs e) 位置 D:\a\MisakaTranslator\MisakaTranslator\MisakaTranslator-WPF\MainWindow.xaml.cs:行号 142 在 System.EventHandler.Invoke(Object sender, EventArgs e) 在 System.Windows.Window.OnSourceInitialized(EventArgs e) 在 HandyControl.Controls.Window.OnSourceInitialized(EventArgs e) 在 System.Windows.Window.CreateSourceWindow(Boolean duringShow) 在 System.Windows.Window.CreateSourceWindowDuringShow() 在 System.Windows.Window.SafeCreateWindowDuringShow() 在 System.Windows.Window.ShowHelper(Object booleanBox) 在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) 在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) 在 System.Windows.Threading.DispatcherOperation.InvokeImpl() 在 System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) 在 MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj) 在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 在 MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state) 在 System.Windows.Threading.DispatcherOperation.Invoke() 在 System.Windows.Threading.Dispatcher.ProcessQueue() 在 System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 在 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) 在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) 在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) 在 System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) 在 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) 在 MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) 在 System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) 在 System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) 在 System.Windows.Application.RunDispatcher(Object ignore) 在 System.Windows.Application.RunInternal(Window window) 在 System.Windows.Application.Run(Window window) 在 System.Windows.Application.Run() 在 MisakaTranslator_WPF.App.Main()

SeikEAnuL commented 1 year ago

补充:在启动MisakaTranslator期间同时启动了HookFinder

imba-tjd commented 1 year ago

c6c508b08b71593f66263babb55c24e1bc973f28 Parse失败时软件将不会退出

其它的嘛,无法确定为什么热键设置会出问题,到底是你自己改的,还是确实是某些代码bug。如果能稳定复现再说吧