Skip to content

Commit

Permalink
refactor: 将 ArgvOp 改为 ArgsOp
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxLHy0424 committed Sep 17, 2024
1 parent 4fa60e4 commit c78acd5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ auto main(i32 argc,i8 *args[])->i32{
if(IsUserAnAdmin()){
ui.add(
" > 极域电子教室 ",Mod::op,
new Mod::ArgvOp{'C',Mod::rule.mythware.exe,Mod::rule.mythware.svc}
new Mod::ArgsOp{'C',Mod::rule.mythware.exe,Mod::rule.mythware.svc}
);
ui.add(
" > 联想云教室 ",Mod::op,
new Mod::ArgvOp{'C',Mod::rule.lenovo.exe,Mod::rule.lenovo.svc}
new Mod::ArgsOp{'C',Mod::rule.lenovo.exe,Mod::rule.lenovo.svc}
);
}else{
ui.add(" (i) 需要提权.");
Expand All @@ -64,11 +64,11 @@ auto main(i32 argc,i8 *args[])->i32{
if(IsUserAnAdmin()){
ui.add(
" > 极域电子教室 ",Mod::op,
new Mod::ArgvOp{'R',Mod::rule.mythware.exe,Mod::rule.mythware.svc}
new Mod::ArgsOp{'R',Mod::rule.mythware.exe,Mod::rule.mythware.svc}
);
ui.add(
" > 联想云教室 ",Mod::op,
new Mod::ArgvOp{'R',Mod::rule.lenovo.exe,Mod::rule.lenovo.svc}
new Mod::ArgsOp{'R',Mod::rule.lenovo.exe,Mod::rule.lenovo.svc}
);
}else{
ui.add(" (i) 需要提权.");
Expand Down
12 changes: 6 additions & 6 deletions src/mod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,33 +81,33 @@ namespace Mod{
}
}
};
struct ArgvOp final{
struct ArgsOp final{
i8 f;
std::vector<const i8*> &exe,&svc;
};
auto op(Data data){
std::string cmd;
switch(((ArgvOp*)data.args)->f){
switch(((ArgsOp*)data.args)->f){
case 'C':{
for(const auto &ref:((ArgvOp*)data.args)->exe){
for(const auto &ref:((ArgsOp*)data.args)->exe){
cmd="reg add \"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution options\\"
+(std::string)ref+".exe\" /f /t reg_sz /v debugger /d ?";
system(cmd.c_str());
cmd="taskKill /f /im "+(std::string)ref+".exe";
system(cmd.c_str());
}
for(const auto &ref:((ArgvOp*)data.args)->svc){
for(const auto &ref:((ArgsOp*)data.args)->svc){
cmd="net stop "+(std::string)ref+" /y";
system(cmd.c_str());
}
break;
}case 'R':{
for(const auto &ref:((ArgvOp*)data.args)->exe){
for(const auto &ref:((ArgsOp*)data.args)->exe){
cmd="reg delete \"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution options\\"
+(std::string)ref+".exe\" /f";
system(cmd.c_str());
}
for(const auto &ref:((ArgvOp*)data.args)->svc){
for(const auto &ref:((ArgsOp*)data.args)->svc){
cmd="net start "+(std::string)ref;
system(cmd.c_str());
}
Expand Down

0 comments on commit c78acd5

Please sign in to comment.