1 个不稳定版本
0.1.0 | 2021 年 9 月 26 日 |
---|
#13 in #kill
18KB
107 行
superf4-rust
Rust 编写的 superf4 基本实现
alpha:使用 CLI
操作步骤
- 获取所有正在运行进程的列表
- 终止选定的进程
- ???
- 获得收益
待办事项
- 读取 CLI 参数输入,如果没有
- 显示进程后读取用户输入
- 按进程名称获取所有进程 ID
- 终止具有 ID 的所有进程
(一些) 来源
- https://docs.rs/winapi/0.3.8/winapi
- https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-terminateprocess
- https://stackoverflow.com/questions/2443738/c-terminateprocess-function
- https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-openprocess
- https://docs.microsoft.com/en-us/windows/win32/procthread/process-security-and-access-rights
- https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types?redirectedfrom=MSDN
- https://github.com/xu-cheng/howlong/issues/3
- https://github.com/Vlad-Shcherbina/howlong/commit/2b7d42796f656155ceec9f8e6f554d184b4c9481
- https://docs.microsoft.com/en-us/windows/win32/api/tlhelp32/nf-tlhelp32-createtoolhelp32snapshot?redirectedfrom=MSDN
- https://docs.microsoft.com/en-us/windows/win32/api/tlhelp32/nf-tlhelp32-process32first?redirectedfrom=MSDN
- https://stackoverflow.com/questions/3477097/get-full-running-process-list-visual-c
- https://cpp.hotexamples.com/examples/-/-/Process32First/cpp-process32first-function-examples.html
- https://doc.rust-lang.net.cn/std/mem/fn.size_of.html
- https://users.rust-lang.org/t/indexing-in-raw-pointer/58559
- https://stackoverflow.com/questions/2812760/print-tchar-on-console
- https://stackoverflow.com/questions/69146231/printing-tchar-array-as-unicode-string-rust-winapi
- https://docs.microsoft.com/en-us/windows/win32/api/tlhelp32/nf-tlhelp32-process32firstw
- https://doc.rust-lang.net.cn/std/os/windows/ffi/trait.OsStringExt.html#tymethod.from_wide
- https://cli.rust-lang.net.cn/book/tutorial/cli-args.html
- https://egghead.io/lessons/rust-read-user-input-from-stdin-in-rust
依赖关系
~3MB
~52K SLoC