@@ -2,7 +2,8 @@ use std::error::Error;
22use std:: ffi:: OsString ;
33
44use ahash:: AHashSet ;
5- use spdlog:: { Level , LevelFilter , debug, info} ;
5+ use rustystar:: privilege:: try_enable_se_debug_privilege;
6+ use spdlog:: { Level , LevelFilter , debug, info, warn} ;
67use win32_ecoqos:: process:: toggle_efficiency_mode;
78
89use rustystar:: bypass:: should_bypass;
@@ -17,20 +18,44 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
1718
1819 let _ = WHITELIST . set ( AHashSet :: from_iter (
1920 [
21+ // ourself
22+ "RustyStar.exe" ,
2023 // System processes
2124 "explorer.exe" ,
25+ // Windows Manager of Windows
2226 "dwm.exe" ,
27+ // CSRSS core process
2328 "csrss.exe" ,
29+ // Windows services process
2430 "svchost.exe" ,
31+ // Task Manager
2532 "Taskmgr.exe" ,
33+ // Session Manager Subsystem
2634 "smss.exe" ,
35+ // Chinese input method
2736 "ChsIME.exe" ,
37+ // Speech-To-Text, Screen keyboard, handwrite input, e.g.
2838 "ctfmon.exe" ,
39+ // Windows User Mode Driver Framework
2940 "WUDFRd.exe" ,
41+ "WUDFHost.exe" ,
3042 // Edge is energy aware
3143 "msedge.exe" ,
3244 // UWP special handle
3345 "ApplicationFrameHost.exe" ,
46+ // system itself
47+ "[System Process]" ,
48+ "System" ,
49+ "Registry" ,
50+ // parent of "services.exe"
51+ "wininit.exe" ,
52+ // parent of "svchost.exe", "wudfhost.exe", e.g.
53+ "services.exe" ,
54+ // Local Security Authority Subsystem Service
55+ "lsass.exe" ,
56+ // part of the Windows Security Center,
57+ // responsible for monitoring and reporting the security status of your system
58+ "SecurityHealthService.exe" ,
3459 ]
3560 . map ( OsString :: from) ,
3661 ) ) ;
@@ -41,6 +66,15 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
4166 std:: process:: exit ( 0 ) ;
4267 } ) ?;
4368
69+ match try_enable_se_debug_privilege ( ) {
70+ Ok ( _) => {
71+ info ! ( "SeDebugPriviledge enabled!" ) ;
72+ }
73+ Err ( e) => {
74+ warn ! ( "SeDebugPriviledge enable failed: {e}" ) ;
75+ }
76+ }
77+
4478 info ! ( "throtting all processes..." ) ;
4579 tokio:: task:: spawn_blocking ( || toggle_all ( Some ( true ) ) ) . await ??;
4680
0 commit comments