├── pc-cleaner.vcxproj.filters
├── README.md
├── LICENSE.txt
├── pc-cleaner.sln
├── .gitattributes
├── pc-cleaner.vcxproj
├── .gitignore
├── Main.cpp
└── color.h
/pc-cleaner.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {8cf77124-bebc-471d-acac-8b9b1ffc2a66}
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Pc-Cleaner
2 |
3 | # Features
4 | - Clean up temp windows files
5 | - Clean up temp app files
6 | - Remove 100% hardware usage
7 | - Remove windows defender and hidden system monitoring
8 | - Remove windows store
9 | - Clean up chrome cookie files
10 | - Remove windows updates
11 | - Enable seconds in clock
12 | - Fix for accessing administrative rules
13 | - Get information about the system
14 | - System file checker
15 | - Registry Checker
16 | #
17 |
18 | # How to use?
19 | 1. Write the number of the function you want to turn off
20 | 2. Wait for 1-5 seconds to apply changes
21 |
22 | 
23 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) [year] [fullname]
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/pc-cleaner.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.29306.81
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pc-cleaner", "pc-cleaner.vcxproj", "{82212CF7-C4EA-436C-ADD5-F7AD56122BF5}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|x64 = Debug|x64
11 | Debug|x86 = Debug|x86
12 | Release|x64 = Release|x64
13 | Release|x86 = Release|x86
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {82212CF7-C4EA-436C-ADD5-F7AD56122BF5}.Debug|x64.ActiveCfg = Debug|x64
17 | {82212CF7-C4EA-436C-ADD5-F7AD56122BF5}.Debug|x64.Build.0 = Debug|x64
18 | {82212CF7-C4EA-436C-ADD5-F7AD56122BF5}.Debug|x86.ActiveCfg = Debug|Win32
19 | {82212CF7-C4EA-436C-ADD5-F7AD56122BF5}.Debug|x86.Build.0 = Debug|Win32
20 | {82212CF7-C4EA-436C-ADD5-F7AD56122BF5}.Release|x64.ActiveCfg = Release|x64
21 | {82212CF7-C4EA-436C-ADD5-F7AD56122BF5}.Release|x64.Build.0 = Release|x64
22 | {82212CF7-C4EA-436C-ADD5-F7AD56122BF5}.Release|x86.ActiveCfg = Release|Win32
23 | {82212CF7-C4EA-436C-ADD5-F7AD56122BF5}.Release|x86.Build.0 = Release|Win32
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {5826AFD4-EB9D-4C95-99FE-FE8B482ABF46}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/pc-cleaner.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Release
10 | Win32
11 |
12 |
13 | Debug
14 | x64
15 |
16 |
17 | Release
18 | x64
19 |
20 |
21 |
22 | 16.0
23 | {82212CF7-C4EA-436C-ADD5-F7AD56122BF5}
24 | ImGui Loader Base
25 | 10.0
26 | pc-cleaner
27 |
28 |
29 |
30 | Application
31 | true
32 | v143
33 | MultiByte
34 |
35 |
36 | Application
37 | false
38 | v143
39 | true
40 | MultiByte
41 |
42 |
43 | Application
44 | true
45 | v143
46 | MultiByte
47 |
48 |
49 | Application
50 | false
51 | v143
52 | true
53 | MultiByte
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 | Level3
77 | Disabled
78 | true
79 | true
80 | stdcpp20
81 |
82 |
83 | Console
84 |
85 |
86 |
87 |
88 | Level3
89 | Disabled
90 | true
91 | true
92 |
93 |
94 | Console
95 |
96 |
97 |
98 |
99 | Level3
100 | MaxSpeed
101 | true
102 | true
103 | true
104 | true
105 | stdcpp20
106 |
107 |
108 | Console
109 | true
110 | true
111 | false
112 |
113 |
114 |
115 |
116 | Level3
117 | MaxSpeed
118 | true
119 | true
120 | true
121 | true
122 |
123 |
124 | Console
125 | true
126 | true
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Aa][Rr][Mm]/
27 | [Aa][Rr][Mm]64/
28 | bld/
29 | [Bb]in/
30 | [Oo]bj/
31 | [Ll]og/
32 | [Ll]ogs/
33 |
34 | # Visual Studio 2015/2017 cache/options directory
35 | .vs/
36 | # Uncomment if you have tasks that create the project's static files in wwwroot
37 | #wwwroot/
38 |
39 | # Visual Studio 2017 auto generated files
40 | Generated\ Files/
41 |
42 | # MSTest test Results
43 | [Tt]est[Rr]esult*/
44 | [Bb]uild[Ll]og.*
45 |
46 | # NUnit
47 | *.VisualState.xml
48 | TestResult.xml
49 | nunit-*.xml
50 |
51 | # Build Results of an ATL Project
52 | [Dd]ebugPS/
53 | [Rr]eleasePS/
54 | dlldata.c
55 |
56 | # Benchmark Results
57 | BenchmarkDotNet.Artifacts/
58 |
59 | # .NET Core
60 | project.lock.json
61 | project.fragment.lock.json
62 | artifacts/
63 |
64 | # StyleCop
65 | StyleCopReport.xml
66 |
67 | # Files built by Visual Studio
68 | *_i.c
69 | *_p.c
70 | *_h.h
71 | *.ilk
72 | *.meta
73 | *.obj
74 | *.iobj
75 | *.pch
76 | *.pdb
77 | *.ipdb
78 | *.pgc
79 | *.pgd
80 | *.rsp
81 | *.sbr
82 | *.tlb
83 | *.tli
84 | *.tlh
85 | *.tmp
86 | *.tmp_proj
87 | *_wpftmp.csproj
88 | *.log
89 | *.vspscc
90 | *.vssscc
91 | .builds
92 | *.pidb
93 | *.svclog
94 | *.scc
95 |
96 | # Chutzpah Test files
97 | _Chutzpah*
98 |
99 | # Visual C++ cache files
100 | ipch/
101 | *.aps
102 | *.ncb
103 | *.opendb
104 | *.opensdf
105 | *.sdf
106 | *.cachefile
107 | *.VC.db
108 | *.VC.VC.opendb
109 |
110 | # Visual Studio profiler
111 | *.psess
112 | *.vsp
113 | *.vspx
114 | *.sap
115 |
116 | # Visual Studio Trace Files
117 | *.e2e
118 |
119 | # TFS 2012 Local Workspace
120 | $tf/
121 |
122 | # Guidance Automation Toolkit
123 | *.gpState
124 |
125 | # ReSharper is a .NET coding add-in
126 | _ReSharper*/
127 | *.[Rr]e[Ss]harper
128 | *.DotSettings.user
129 |
130 | # TeamCity is a build add-in
131 | _TeamCity*
132 |
133 | # DotCover is a Code Coverage Tool
134 | *.dotCover
135 |
136 | # AxoCover is a Code Coverage Tool
137 | .axoCover/*
138 | !.axoCover/settings.json
139 |
140 | # Visual Studio code coverage results
141 | *.coverage
142 | *.coveragexml
143 |
144 | # NCrunch
145 | _NCrunch_*
146 | .*crunch*.local.xml
147 | nCrunchTemp_*
148 |
149 | # MightyMoose
150 | *.mm.*
151 | AutoTest.Net/
152 |
153 | # Web workbench (sass)
154 | .sass-cache/
155 |
156 | # Installshield output folder
157 | [Ee]xpress/
158 |
159 | # DocProject is a documentation generator add-in
160 | DocProject/buildhelp/
161 | DocProject/Help/*.HxT
162 | DocProject/Help/*.HxC
163 | DocProject/Help/*.hhc
164 | DocProject/Help/*.hhk
165 | DocProject/Help/*.hhp
166 | DocProject/Help/Html2
167 | DocProject/Help/html
168 |
169 | # Click-Once directory
170 | publish/
171 |
172 | # Publish Web Output
173 | *.[Pp]ublish.xml
174 | *.azurePubxml
175 | # Note: Comment the next line if you want to checkin your web deploy settings,
176 | # but database connection strings (with potential passwords) will be unencrypted
177 | *.pubxml
178 | *.publishproj
179 |
180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
181 | # checkin your Azure Web App publish settings, but sensitive information contained
182 | # in these scripts will be unencrypted
183 | PublishScripts/
184 |
185 | # NuGet Packages
186 | *.nupkg
187 | # NuGet Symbol Packages
188 | *.snupkg
189 | # The packages folder can be ignored because of Package Restore
190 | **/[Pp]ackages/*
191 | # except build/, which is used as an MSBuild target.
192 | !**/[Pp]ackages/build/
193 | # Uncomment if necessary however generally it will be regenerated when needed
194 | #!**/[Pp]ackages/repositories.config
195 | # NuGet v3's project.json files produces more ignorable files
196 | *.nuget.props
197 | *.nuget.targets
198 |
199 | # Microsoft Azure Build Output
200 | csx/
201 | *.build.csdef
202 |
203 | # Microsoft Azure Emulator
204 | ecf/
205 | rcf/
206 |
207 | # Windows Store app package directories and files
208 | AppPackages/
209 | BundleArtifacts/
210 | Package.StoreAssociation.xml
211 | _pkginfo.txt
212 | *.appx
213 | *.appxbundle
214 | *.appxupload
215 |
216 | # Visual Studio cache files
217 | # files ending in .cache can be ignored
218 | *.[Cc]ache
219 | # but keep track of directories ending in .cache
220 | !?*.[Cc]ache/
221 |
222 | # Others
223 | ClientBin/
224 | ~$*
225 | *~
226 | *.dbmdl
227 | *.dbproj.schemaview
228 | *.jfm
229 | *.pfx
230 | *.publishsettings
231 | orleans.codegen.cs
232 |
233 | # Including strong name files can present a security risk
234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
235 | #*.snk
236 |
237 | # Since there are multiple workflows, uncomment next line to ignore bower_components
238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
239 | #bower_components/
240 |
241 | # RIA/Silverlight projects
242 | Generated_Code/
243 |
244 | # Backup & report files from converting an old project file
245 | # to a newer Visual Studio version. Backup files are not needed,
246 | # because we have git ;-)
247 | _UpgradeReport_Files/
248 | Backup*/
249 | UpgradeLog*.XML
250 | UpgradeLog*.htm
251 | ServiceFabricBackup/
252 | *.rptproj.bak
253 |
254 | # SQL Server files
255 | *.mdf
256 | *.ldf
257 | *.ndf
258 |
259 | # Business Intelligence projects
260 | *.rdl.data
261 | *.bim.layout
262 | *.bim_*.settings
263 | *.rptproj.rsuser
264 | *- [Bb]ackup.rdl
265 | *- [Bb]ackup ([0-9]).rdl
266 | *- [Bb]ackup ([0-9][0-9]).rdl
267 |
268 | # Microsoft Fakes
269 | FakesAssemblies/
270 |
271 | # GhostDoc plugin setting file
272 | *.GhostDoc.xml
273 |
274 | # Node.js Tools for Visual Studio
275 | .ntvs_analysis.dat
276 | node_modules/
277 |
278 | # Visual Studio 6 build log
279 | *.plg
280 |
281 | # Visual Studio 6 workspace options file
282 | *.opt
283 |
284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
285 | *.vbw
286 |
287 | # Visual Studio LightSwitch build output
288 | **/*.HTMLClient/GeneratedArtifacts
289 | **/*.DesktopClient/GeneratedArtifacts
290 | **/*.DesktopClient/ModelManifest.xml
291 | **/*.Server/GeneratedArtifacts
292 | **/*.Server/ModelManifest.xml
293 | _Pvt_Extensions
294 |
295 | # Paket dependency manager
296 | .paket/paket.exe
297 | paket-files/
298 |
299 | # FAKE - F# Make
300 | .fake/
301 |
302 | # CodeRush personal settings
303 | .cr/personal
304 |
305 | # Python Tools for Visual Studio (PTVS)
306 | __pycache__/
307 | *.pyc
308 |
309 | # Cake - Uncomment if you are using it
310 | # tools/**
311 | # !tools/packages.config
312 |
313 | # Tabs Studio
314 | *.tss
315 |
316 | # Telerik's JustMock configuration file
317 | *.jmconfig
318 |
319 | # BizTalk build output
320 | *.btp.cs
321 | *.btm.cs
322 | *.odx.cs
323 | *.xsd.cs
324 |
325 | # OpenCover UI analysis results
326 | OpenCover/
327 |
328 | # Azure Stream Analytics local run output
329 | ASALocalRun/
330 |
331 | # MSBuild Binary and Structured Log
332 | *.binlog
333 |
334 | # NVidia Nsight GPU debugger configuration file
335 | *.nvuser
336 |
337 | # MFractors (Xamarin productivity tool) working folder
338 | .mfractor/
339 |
340 | # Local History for Visual Studio
341 | .localhistory/
342 |
343 | # BeatPulse healthcheck temp database
344 | healthchecksdb
345 |
346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
347 | MigrationBackup/
348 |
349 | # Ionide (cross platform F# VS Code tools) working folder
350 | .ionide/
351 |
--------------------------------------------------------------------------------
/Main.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include "color.h"
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #pragma warning(disable : 4996)
11 |
12 | bool is_admin()
13 | {
14 | HANDLE token;
15 | if (OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
16 | {
17 | TOKEN_ELEVATION elevation{};
18 | DWORD size;
19 |
20 | if (GetTokenInformation(token, TokenElevation, &elevation, sizeof elevation, &size))
21 | return elevation.TokenIsElevated;
22 | }
23 | return false;
24 | }
25 |
26 | BOOL __stdcall stop_dependent_services(const SC_HANDLE& schSCManager, const SC_HANDLE& schService)
27 | {
28 | DWORD bytes_needed;
29 | DWORD count;
30 |
31 | LPENUM_SERVICE_STATUS dependencies = nullptr;
32 | SERVICE_STATUS_PROCESS ssp{};
33 |
34 | const DWORD start_time = GetTickCount();
35 |
36 | // Pass a zero-length buffer to get the required buffer size.
37 | if (EnumDependentServices(schService, SERVICE_ACTIVE,
38 | dependencies, 0, &bytes_needed, &count))
39 | {
40 | // If the Enum call succeeds, then there are no dependent
41 | // services, so do nothing.
42 | return TRUE;
43 | }
44 |
45 | if (GetLastError() != ERROR_MORE_DATA)
46 | return FALSE; // Unexpected error
47 |
48 | // Allocate a buffer for the dependencies.
49 | dependencies = static_cast(HeapAlloc(
50 | GetProcessHeap(), HEAP_ZERO_MEMORY, bytes_needed));
51 |
52 | if (!dependencies)
53 | return FALSE;
54 |
55 | __try
56 | {
57 | // Enumerate the dependencies.
58 | if (!EnumDependentServices(schService, SERVICE_ACTIVE,
59 | dependencies, bytes_needed, &bytes_needed,
60 | &count))
61 | return FALSE;
62 |
63 | for (DWORD i = 0; i < count; i++)
64 | {
65 | const ENUM_SERVICE_STATUS ess = *(dependencies + i);
66 | // Open the service.
67 | const SC_HANDLE dep_service = OpenService(schSCManager,
68 | ess.lpServiceName,
69 | SERVICE_STOP | SERVICE_QUERY_STATUS);
70 |
71 | if (!dep_service)
72 | return FALSE;
73 |
74 | __try
75 | {
76 | // Send a stop code.
77 | if (!ControlService(dep_service,
78 | SERVICE_CONTROL_STOP,
79 | reinterpret_cast(&ssp)))
80 | return FALSE;
81 |
82 | // Wait for the service to stop.
83 | while (ssp.dwCurrentState != SERVICE_STOPPED)
84 | {
85 | Sleep(ssp.dwWaitHint);
86 | if (!QueryServiceStatusEx(
87 | dep_service,
88 | SC_STATUS_PROCESS_INFO,
89 | reinterpret_cast(&ssp),
90 | sizeof(SERVICE_STATUS_PROCESS),
91 | &bytes_needed))
92 | return FALSE;
93 |
94 | if (ssp.dwCurrentState == SERVICE_STOPPED)
95 | break;
96 | constexpr DWORD timeout = 30000;
97 | if (GetTickCount() - start_time > timeout)
98 | return FALSE;
99 | }
100 | }
101 | __finally
102 | {
103 | // Always release the service handle
104 | CloseServiceHandle(dep_service);
105 | }
106 | }
107 | }
108 | __finally
109 | {
110 | // Always free the enumeration buffer
111 | HeapFree(GetProcessHeap(), 0, dependencies);
112 | }
113 | return TRUE;
114 | }
115 |
116 | bool enable_or_disable_service(const char* strServiceName, bool bIsEnable)
117 | {
118 | bool result = false;
119 |
120 | const SC_HANDLE hServiceControlManager = OpenSCManager(nullptr, nullptr, SC_MANAGER_ALL_ACCESS);
121 |
122 | if (nullptr != hServiceControlManager)
123 | {
124 | const SC_HANDLE hService = OpenService(hServiceControlManager, strServiceName, SERVICE_CHANGE_CONFIG);
125 |
126 | if (hService != nullptr)
127 | {
128 | result = ChangeServiceConfig(hService, SERVICE_NO_CHANGE,
129 | bIsEnable ? SERVICE_AUTO_START : SERVICE_DISABLED,
130 | SERVICE_NO_CHANGE,
131 | nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr);
132 |
133 | CloseServiceHandle(hService);
134 | }
135 |
136 | CloseServiceHandle(hServiceControlManager);
137 | }
138 |
139 | return result;
140 | }
141 |
142 | VOID __stdcall do_stop_svc(const char* szSvcName)
143 | {
144 | SERVICE_STATUS_PROCESS ssp{};
145 | const DWORD start_time = GetTickCount();
146 | DWORD bytes_needed;
147 | constexpr DWORD dw_timeout = 30000; // 30-second time-out
148 |
149 | const SC_HANDLE sch_sc_manager = OpenSCManager(
150 | nullptr, // local computer
151 | nullptr, // ServicesActive database
152 | SC_MANAGER_ALL_ACCESS); // full access rights
153 |
154 | if (nullptr == sch_sc_manager)
155 | {
156 | std::cout << color::red("[-] OpenSCManager failed ") << GetLastError() << std::endl;
157 | return;
158 | }
159 |
160 | // Get a handle to the service
161 | const SC_HANDLE sch_service = OpenService(
162 | sch_sc_manager, // SCM database
163 | szSvcName, // name of service
164 | SERVICE_STOP |
165 | SERVICE_QUERY_STATUS |
166 | SERVICE_ENUMERATE_DEPENDENTS);
167 |
168 | if (sch_service == nullptr)
169 | {
170 | std::cout << color::red("[-] OpenService failed ") << GetLastError() << std::endl;
171 | CloseServiceHandle(sch_sc_manager);
172 | return;
173 | }
174 |
175 | // Make sure the service is not already stopped
176 | if (!QueryServiceStatusEx(
177 | sch_service,
178 | SC_STATUS_PROCESS_INFO,
179 | reinterpret_cast(&ssp),
180 | sizeof(SERVICE_STATUS_PROCESS),
181 | &bytes_needed))
182 | {
183 | std::cout << color::red("[-] QueryServiceStatusEx failed ") << GetLastError() << std::endl;
184 | goto stop_cleanup;
185 | }
186 |
187 | if (ssp.dwCurrentState == SERVICE_STOPPED)
188 | {
189 | std::cout << color::red("[!] Service is already stopped\n");
190 | goto stop_cleanup;
191 | }
192 |
193 | // If a stop is pending, wait for it
194 | while (ssp.dwCurrentState == SERVICE_STOP_PENDING)
195 | {
196 | std::cout << color::green("[+] Service stop pending...\n");
197 |
198 | // Do not wait longer than the wait hint. A good interval is
199 | // one-tenth of the wait hint but not less than 1 second
200 | // and not more than 10 seconds.
201 | DWORD wait_time = ssp.dwWaitHint / 10;
202 |
203 | if (wait_time < 1000)
204 | wait_time = 1000;
205 | else if (wait_time > 10000)
206 | wait_time = 10000;
207 |
208 | Sleep(wait_time);
209 |
210 | if (!QueryServiceStatusEx(
211 | sch_service,
212 | SC_STATUS_PROCESS_INFO,
213 | reinterpret_cast(&ssp),
214 | sizeof(SERVICE_STATUS_PROCESS),
215 | &bytes_needed))
216 | {
217 | std::cout << color::red("[-] QueryServiceStatusEx failed ") << GetLastError() << std::endl;
218 | goto stop_cleanup;
219 | }
220 |
221 | if (ssp.dwCurrentState == SERVICE_STOPPED)
222 | {
223 | std::cout << color::green("[+] Service stopped successfully\n");
224 | goto stop_cleanup;
225 | }
226 |
227 | if (GetTickCount() - start_time > dw_timeout)
228 | {
229 | std::cout << color::red("[!] Service stop timed out\n");
230 | goto stop_cleanup;
231 | }
232 | }
233 |
234 | // If the service is running, dependencies must be stopped first
235 | stop_dependent_services(sch_sc_manager, sch_service);
236 |
237 | // Send a stop code to the service
238 | if (!ControlService(
239 | sch_service,
240 | SERVICE_CONTROL_STOP,
241 | reinterpret_cast(&ssp)))
242 | {
243 | std::cout << color::red("[-] ControlService failed ") << GetLastError() << std::endl;
244 | goto stop_cleanup;
245 | }
246 |
247 | while (ssp.dwCurrentState != SERVICE_STOPPED)
248 | {
249 | Sleep(ssp.dwWaitHint);
250 | if (!QueryServiceStatusEx(
251 | sch_service,
252 | SC_STATUS_PROCESS_INFO,
253 | reinterpret_cast(&ssp),
254 | sizeof(SERVICE_STATUS_PROCESS),
255 | &bytes_needed))
256 | {
257 | std::cout << color::red("[-] QueryServiceStatusEx failed ") << GetLastError() << std::endl;
258 | goto stop_cleanup;
259 | }
260 |
261 | if (ssp.dwCurrentState == SERVICE_STOPPED)
262 | break;
263 |
264 | if (GetTickCount() - start_time > dw_timeout)
265 | {
266 | std::cout << color::red("[!] Wait timed out\n");
267 | goto stop_cleanup;
268 | }
269 | }
270 | std::cout << szSvcName << color::green(" service stopped successfully\n");
271 |
272 | stop_cleanup:
273 | CloseServiceHandle(sch_service);
274 | CloseServiceHandle(sch_sc_manager);
275 | }
276 |
277 | void features()
278 | {
279 | do
280 | {
281 | std::cout << " \n";
282 | std::cout << color::yellow("Write the number of the function you want to turn off\n");
283 | std::cout << color::yellow(
284 | " 1 - Clean up temp windows files\n 2 - Clean up temp app files\n 3 - Remove 100% hardware usage\n 4 - Remove windows defender and hidden system monitoring\n 5 - Remove windows store\n 6 - Clean up chrome cookie files\n 7 - Remove windows updates\n 8 - Enable seconds in clock\n 9 - Fix for accessing administrative rules\n 10 - System info\n 11 - System file checker (SFC)\n 12 - Evaluate register based ban risk\n");
285 | int var;
286 | std::cin >> var;
287 |
288 | switch (var)
289 | {
290 | case 1:
291 | {
292 | SHFILEOPSTRUCT file_op{};
293 |
294 | file_op.hwnd = nullptr;
295 | file_op.wFunc = FO_DELETE;
296 | file_op.pFrom = R"(C:\Windows\Temp\)";
297 | file_op.pTo = nullptr;
298 | file_op.fFlags = 0;
299 | file_op.lpszProgressTitle = nullptr;
300 |
301 | SHFileOperation(&file_op);
302 | GetLastError()
303 | ? std::cout << color::red("[-] Temp files removed not successfully\n")
304 | : std::cout << color::green("[+] Temp files removed successfully\n");
305 | }
306 | break;
307 | case 2:
308 | {
309 | system("del /s /f /q %temp%\\*.*");
310 | GetLastError()
311 | ? std::cout << color::red("[-] Temp files removed not successfully\n")
312 | : std::cout << color::green("[+] Temp files removed successfully\n");
313 | }
314 | break;
315 | case 3:
316 | {
317 | //system("sc config SysMain start= disabled");
318 |
319 | do_stop_svc("SysMain");
320 | enable_or_disable_service("SysMain", false);
321 | std::cout << color::red("Plz, reboot your pc !!!\n");
322 | }
323 | break;
324 | case 4:
325 | {
326 | HKEY key;
327 | if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, R"(SOFTWARE\Policies\Microsoft\Windows Defender)", 0,
328 | KEY_ALL_ACCESS, &key))
329 | {
330 | std::cout << color::red("[-] Failed to open registry\n");
331 | system("pause");
332 | return;
333 | }
334 |
335 | std::cout << color::green("[+] Register opened successfully\n");
336 |
337 | uint32_t payload = 1;
338 | if (RegSetValueEx(key, "DisableAntiSpyware", 0, REG_DWORD, reinterpret_cast(&payload),
339 | sizeof payload))
340 | {
341 | std::cout << color::red("[-] Failed to write to reg key \'DisableAntiSpyware'\\n");
342 | system("pause");
343 | return;
344 | }
345 |
346 | std::cout << color::green("[+] The reg key \'DisableAntiSpyware\' value changed to 1\n");
347 |
348 | HKEY new_key;
349 | if (RegCreateKeyEx(key, "Real-Time Protection", 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
350 | nullptr, &new_key, nullptr))
351 | {
352 | std::cout << color::red("[-] Failed to create new key \'Real-Time Protection'\\n");
353 | system("pause");
354 | return;
355 | }
356 | std::cout << color::green("[+] New key \'Real-Time Protection\' created successfully\n");
357 |
358 | key = new_key;
359 |
360 | if (RegSetValueEx(key, "DisableRealtimeMonitoring", 0, REG_DWORD, reinterpret_cast(&payload),
361 | sizeof payload))
362 | {
363 | std::cout << color::red("[-] Failed to write to registry\n");
364 | system("pause");
365 | return;
366 | }
367 | std::cout << color::green("[+] The reg key \'DisableRealtimeMonitoring\' value changed to 1\n");
368 |
369 | if (RegSetValueEx(key, "DisableBehaviorMonitoring", 0, REG_DWORD, reinterpret_cast(&payload),
370 | sizeof payload))
371 | {
372 | std::cout << color::red("[-] Failed to write to registry\n");
373 | system("pause");
374 | return;
375 | }
376 | std::cout << color::green("[+] The reg key \'DisableBehaviorMonitoring\' value changed to 1\n");
377 |
378 | if (RegSetValueEx(key, "DisableOnAccessProtection", 0, REG_DWORD, reinterpret_cast(&payload),
379 | sizeof payload))
380 | {
381 | std::cout << color::red("[-] Failed to write to registry\n");
382 | system("pause");
383 | return;
384 | }
385 | std::cout << color::green("[+] The reg key \'DisableOnAccessProtection\' value changed to 1\n");
386 |
387 | if (RegSetValueEx(key, "DisableScanOnRealtimeEnable", 0, REG_DWORD, reinterpret_cast(&payload),
388 | sizeof payload))
389 | {
390 | std::cout << color::red("[-] Failed to write to registry\n");
391 | system("pause");
392 | return;
393 | }
394 |
395 | std::cout << color::green("[+] The reg key \'DisableScanOnRealtimeEnable\' value changed to 1\n");
396 |
397 | if (RegSetValueEx(key, "DisableIOAVProtection", 0, REG_DWORD, reinterpret_cast(&payload),
398 | sizeof payload))
399 | {
400 | std::cout << color::red("[-] Failed to write to registry\n");
401 | system("pause");
402 | return;
403 | }
404 | std::cout << color::green("[+] The reg key \'DisableIOAVProtection\' value changed to 1\n");
405 |
406 | RegCloseKey(key);
407 |
408 | std::cout << color::green("[+] Registry values written\n");
409 |
410 | //DoStopSvc(("mpssvc"));
411 | //EnableOrDisableService(("mpssvc"), false);
412 |
413 | //DoStopSvc(("wscsvc"));
414 | //EnableOrDisableService(("wscsvc"), false);
415 |
416 | std::cout << color::red("[!] Plz, reboot your pc \n");
417 | }
418 | break;
419 | case 5:
420 | {
421 | do_stop_svc("InstallService");
422 | enable_or_disable_service("InstallService", false);
423 | std::cout << color::red("Plz, reboot your pc !!!\n");
424 | }
425 | break;
426 | case 6:
427 | {
428 | system(R"(del /s /f /q %appdata%\Local\Google\Chrome\User Data\Default\Cookies)");
429 |
430 | GetLastError()
431 | ? std::cout << color::red("[-] Cookies cleaned not successfully\n")
432 | : std::cout << color::green("[+] Cookies cleaned removed successfully\n");
433 | }
434 | break;
435 | case 7:
436 | {
437 | do_stop_svc("wuauserv");
438 | enable_or_disable_service("wuauserv", false);
439 |
440 | do_stop_svc("msiserver");
441 | enable_or_disable_service("msiserver", false);
442 |
443 | system(R"(del /s /f /q C:\Windows\SoftwareDistribution\*.*)");
444 | std::cout << color::green("Deleted windows updates\n");
445 |
446 | std::ofstream file(R"(C:\Windows\SoftwareDistribution\Download)");
447 | file.close();
448 | std::cout << color::green("Created Download file\n");
449 | }
450 | break;
451 | case 8:
452 | {
453 | HKEY key;
454 | if (RegOpenKeyEx(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft", 0,
455 | KEY_ALL_ACCESS, &key))
456 | {
457 | std::cout << color::red("[-] Failed to open registry\n");
458 | system("pause");
459 | return;
460 | }
461 |
462 | std::cout << color::green("[+] Register opened successfully\n");
463 |
464 | HKEY new_key;
465 |
466 | if (RegCreateKeyEx(key, "Windows", 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
467 | nullptr, &new_key, nullptr))
468 | {
469 | std::cout << color::red("[-] Failed to create new key \'Windows'\\n");
470 | system("pause");
471 | return;
472 | }
473 |
474 | std::cout << color::green("[+] New key \'Windows\' created successfully\n");
475 | key = new_key;
476 |
477 | if (RegCreateKeyEx(key, "CurrentVersion", 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
478 | nullptr, &new_key, nullptr))
479 | {
480 | std::cout << color::red("[-] Failed to create new key \'CurrentVersion'\\n");
481 | system("pause");
482 | return;
483 | }
484 |
485 | std::cout << color::green("[+] New key \'CurrentVersion\' created successfully\n");
486 | key = new_key;
487 |
488 | if (RegCreateKeyEx(key, "Explorer", 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
489 | nullptr, &new_key, nullptr))
490 | {
491 | std::cout << color::red("[-] Failed to create new key \'Explorer'\\n");
492 | system("pause");
493 | return;
494 | }
495 |
496 | std::cout << color::green("[+] New key \'Explorer\' created successfully\n");
497 | key = new_key;
498 |
499 | if (RegCreateKeyEx(key, "Advanced", 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
500 | nullptr, &new_key, nullptr))
501 | {
502 | std::cout << color::red("[-] Failed to create new key \'Advanced'\\n");
503 | system("pause");
504 | return;
505 | }
506 |
507 | std::cout << color::green("[+] New key \'Advanced\' created successfully\n");
508 | key = new_key;
509 |
510 | uint32_t payload = 1;
511 | if (RegSetValueEx(key, "ShowSecondsInSystemClock", 0, REG_DWORD, reinterpret_cast(&payload),
512 | sizeof payload))
513 | {
514 | std::cout << color::red("[-] Failed to write to reg key \'ShowSecondsInSystemClock'\\n");
515 | system("pause");
516 | return;
517 | }
518 |
519 | std::cout << color::green("[+] The reg key \'ShowSecondsInSystemClock\' value changed to 1\n");
520 |
521 | /* std::cout << color::red(("[+] Updating explorer..."));
522 | system(("taskkill /F /IM explorer.exe"));
523 | std::this_thread::sleep_for(std::chrono::seconds(3));
524 | system(("start explorer")); */
525 |
526 | std::cout << color::red("[!] Restart explorer\n");
527 | }
528 | break;
529 | case 9:
530 | {
531 | HKEY key;
532 | if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, R"(SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System)",
533 | 0,
534 | KEY_ALL_ACCESS, &key))
535 | {
536 | std::cout << color::red("[-] Failed to open registry\n");
537 | system("pause");
538 | return;
539 | }
540 |
541 | std::cout << color::green("[+] Register opened successfully\n");
542 |
543 | uint32_t payload = 0;
544 | if (RegSetValueEx(key, "FilterAdministratorToken", 0, REG_DWORD, reinterpret_cast(&payload),
545 | sizeof payload))
546 | {
547 | std::cout << color::red("[-] Failed to write to reg key \'FilterAdministratorToken'\\n");
548 | system("pause");
549 | return;
550 | }
551 |
552 | std::cout << color::green("[+] The reg key \'FilterAdministratorToken\' value changed to 0\n");
553 |
554 | if (RegSetValueEx(key, "PromptOnSecureDesktop", 0, REG_DWORD, reinterpret_cast(&payload),
555 | sizeof payload))
556 | {
557 | std::cout << color::red("[-] Failed to write to reg key \'PromptOnSecureDesktop'\\n");
558 | system("pause");
559 | return;
560 | }
561 |
562 | if (RegSetValueEx(key, "EnableInstallerDetection", 0, REG_DWORD, reinterpret_cast(&payload),
563 | sizeof payload))
564 | {
565 | std::cout << color::red("[-] Failed to write to reg key \'EnableInstallerDetection'\\n");
566 | system("pause");
567 | return;
568 | }
569 |
570 | std::cout << color::green("[+] The reg key \'EnableInstallerDetection\' value changed to 0\n");
571 |
572 | if (RegSetValueEx(key, "EnableSecureUIAPaths", 0, REG_DWORD, reinterpret_cast(&payload),
573 | sizeof payload))
574 | {
575 | std::cout << color::red("[-] Failed to write to reg key \'EnableSecureUIAPaths'\\n");
576 | system("pause");
577 | return;
578 | }
579 |
580 | std::cout << color::green("[+] The reg key \'EnableSecureUIAPaths\' value changed to 0\n");
581 |
582 | if (RegSetValueEx(key, "EnableVirtualization", 0, REG_DWORD, reinterpret_cast(&payload),
583 | sizeof payload))
584 | {
585 | std::cout << color::red("[-] Failed to write to reg key \'EnableVirtualization'\\n");
586 | system("pause");
587 | return;
588 | }
589 |
590 | std::cout << color::green("[+] The reg key \'EnableVirtualization\' value changed to 0\n");
591 |
592 | if (RegSetValueEx(key, "EnableUIADesktopToggle", 0, REG_DWORD, reinterpret_cast(&payload),
593 | sizeof payload))
594 | {
595 | std::cout << color::red("[-] Failed to write to reg key \'EnableUIADesktopToggle'\\n");
596 | system("pause");
597 | return;
598 | }
599 |
600 | std::cout << color::green("[+] The reg key \'EnableUIADesktopToggle\' value changed to 0\n");
601 |
602 | if (RegSetValueEx(key, "EnableLUA", 0, REG_DWORD, reinterpret_cast(&payload),
603 | sizeof payload))
604 | {
605 | std::cout << color::red("[-] Failed to write to reg key \'EnableLUA'\\n");
606 | system("pause");
607 | return;
608 | }
609 |
610 | std::cout << color::green("[+] The reg key \'EnableLUA\' value changed to 0\n");
611 | uintptr_t logon = 1;
612 | if (RegSetValueEx(key, "undockwithoutlogon", 0, REG_DWORD, reinterpret_cast(&logon),
613 | sizeof logon))
614 | {
615 | std::cout << color::red("[-] Failed to write to reg key \'undockwithoutlogon'\\n");
616 | system("pause");
617 | return;
618 | }
619 |
620 | std::cout << color::green("[+] The reg key \'undockwithoutlogon\' value changed to 1\n");
621 |
622 | if (RegSetValueEx(key, "shutdownwithoutlogon", 0, REG_DWORD, reinterpret_cast(&logon),
623 | sizeof logon))
624 | {
625 | std::cout << color::red("[-] Failed to write to reg key \'shutdownwithoutlogon'\\n");
626 | system("pause");
627 | return;
628 | }
629 |
630 | std::cout << color::green("[+] The reg key \'shutdownwithoutlogon\' value changed to 1\n");
631 |
632 | if (RegSetValueEx(key, "scforceoption", 0, REG_DWORD, reinterpret_cast(&payload),
633 | sizeof payload))
634 | {
635 | std::cout << color::red("[-] Failed to write to reg key \'scforceoption'\\n");
636 | system("pause");
637 | return;
638 | }
639 |
640 | std::cout << color::green("[+] The reg key \'scforceoption\' value changed to 0\n");
641 |
642 | if (RegSetValueEx(key, "legalnoticetext", 0, REG_DWORD, reinterpret_cast(&payload),
643 | sizeof payload))
644 | {
645 | std::cout << color::red("[-] Failed to write to reg key \'legalnoticetext'\\n");
646 | system("pause");
647 | return;
648 | }
649 |
650 | //std::cout << color::green(("[+] The reg key \'legalnoticetext\' value changed to 0\n"));
651 |
652 | //if (RegSetValueEx(key, ("legalnoticecaption"), 0, REG_DWORD, reinterpret_cast(&payload),
653 | // sizeof(payload)))
654 | //{
655 | // std::cout << color::red(("[-] Failed to write to reg key \'legalnoticecaption'\\n"));
656 | // system(("pause"));
657 | // return;
658 | //}
659 |
660 | //std::cout << color::green(("[+] The reg key \'legalnoticecaption\' value changed to 0\n"));
661 |
662 | //if (RegSetValueEx(key, ("dontdisplaylastusername"), 0, REG_DWORD, reinterpret_cast(&payload),
663 | // sizeof(payload)))
664 | //{
665 | // std::cout << color::red(("[-] Failed to write to reg key \'dontdisplaylastusername'\\n"));
666 | // system(("pause"));
667 | // return;
668 | //}
669 |
670 | //std::cout << color::green(("[+] The reg key \'dontdisplaylastusername\' value changed to 0\n"));
671 |
672 | if (RegSetValueEx(key, "ValidateAdminCodeSignatures", 0, REG_DWORD, reinterpret_cast(&payload),
673 | sizeof payload))
674 | {
675 | std::cout << color::red("[-] Failed to write to reg key \'ValidateAdminCodeSignatures'\\n");
676 | system("pause");
677 | return;
678 | }
679 |
680 | std::cout << color::green("[+] The reg key \'ValidateAdminCodeSignatures\' value changed to 0\n");
681 |
682 | uintptr_t curs = 1;
683 | if (RegSetValueEx(key, "EnableCursorSuppression", 0, REG_DWORD, reinterpret_cast(&curs),
684 | sizeof curs))
685 | {
686 | std::cout << color::red("[-] Failed to write to reg key \'EnableCursorSuppression'\\n");
687 | system("pause");
688 | return;
689 | }
690 |
691 | std::cout << color::green("[+] The reg key \'EnableCursorSuppression\' value changed to 1\n");
692 |
693 | uintptr_t dsc = 2;
694 | if (RegSetValueEx(key, "DSCAutomationHostEnabled", 0, REG_DWORD, reinterpret_cast(&dsc),
695 | sizeof dsc))
696 | {
697 | std::cout << color::red("[-] Failed to write to reg key \'DSCAutomationHostEnabled'\\n");
698 | system("pause");
699 | return;
700 | }
701 |
702 | std::cout << color::green("[+] The reg key \'DSCAutomationHostEnabled\' value changed to 2\n");
703 |
704 | uintptr_t beusr = 3;
705 | if (RegSetValueEx(key, "ConsentPromptBehaviorUser", 0, REG_DWORD, reinterpret_cast(&beusr),
706 | sizeof beusr))
707 | {
708 | std::cout << color::red("[-] Failed to write to reg key \'ConsentPromptBehaviorUser'\\n");
709 | system("pause");
710 | return;
711 | }
712 |
713 | std::cout << color::green("[+] The reg key \'ConsentPromptBehaviorUser\' value changed to 3\n");
714 |
715 | if (RegSetValueEx(key, "ConsentPromptBehaviorAdmin", 0, REG_DWORD, reinterpret_cast(&payload),
716 | sizeof payload))
717 | {
718 | std::cout << color::red("[-] Failed to write to reg key \'ConsentPromptBehaviorAdmin'\\n");
719 | system("pause");
720 | return;
721 | }
722 |
723 | std::cout << color::green("[+] The reg key \'ConsentPromptBehaviorAdmin\' value changed to 0\n");
724 |
725 | HKEY new_key;
726 |
727 | if (RegOpenKeyEx(
728 | HKEY_LOCAL_MACHINE,
729 | R"(SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\UIPI\Clipboard\ExceptionFormats)",
730 | 0,
731 | KEY_ALL_ACCESS, &new_key))
732 | {
733 | std::cout << color::red("[-] Failed to create new key \'Windows'\\n");
734 | system("pause");
735 | return;
736 | }
737 |
738 | key = new_key;
739 | std::cout << color::green("[+] Register opened successfully\n");
740 |
741 | uint32_t bitmap = 2;
742 |
743 | if (RegSetValueEx(key, "CF_BITMAP", 0, REG_DWORD, reinterpret_cast(&bitmap),
744 | sizeof bitmap))
745 | {
746 | std::cout << color::red("[-] Failed to write to reg key \'CF_BITMAP'\\n");
747 | system("pause");
748 | return;
749 | }
750 |
751 | std::cout << color::green("[+] The reg key \'CF_BITMAP\' value changed to 2\n");
752 |
753 | uint32_t dib = 8;
754 |
755 | if (RegSetValueEx(key, "CF_DIB", 0, REG_DWORD, reinterpret_cast(&dib),
756 | sizeof dib))
757 | {
758 | std::cout << color::red("[-] Failed to write to reg key \'CF_DIB'\\n");
759 | system("pause");
760 | return;
761 | }
762 |
763 | std::cout << color::green("[+] The reg key \'CF_DIB\' value changed to 8\n");
764 |
765 | uint32_t dib5 = 17;
766 |
767 | if (RegSetValueEx(key, "CF_DIBV5", 0, REG_DWORD, reinterpret_cast(&dib5),
768 | sizeof dib5))
769 | {
770 | std::cout << color::red("[-] Failed to write to reg key \'CF_DIBV5'\\n");
771 | system("pause");
772 | return;
773 | }
774 |
775 | std::cout << color::green("[+] The reg key \'CF_DIBV5\' value changed to 17\n");
776 |
777 | uint32_t oemtext = 7;
778 |
779 | if (RegSetValueEx(key, "CF_OEMTEXT", 0, REG_DWORD, reinterpret_cast(&oemtext),
780 | sizeof oemtext))
781 | {
782 | std::cout << color::red("[-] Failed to write to reg key \'CF_OEMTEXT'\\n");
783 | system("pause");
784 | return;
785 | }
786 |
787 | std::cout << color::green("[+] The reg key \'CF_OEMTEXT\' value changed to 7\n");
788 |
789 | uint32_t palette = 9;
790 |
791 | if (RegSetValueEx(key, "CF_PALETTE", 0, REG_DWORD, reinterpret_cast(&palette),
792 | sizeof palette))
793 | {
794 | std::cout << color::red("[-] Failed to write to reg key \'CF_PALETTE'\\n");
795 | system("pause");
796 | return;
797 | }
798 |
799 | std::cout << color::green("[+] The reg key \'CF_PALETTE\' value changed to 9\n");
800 |
801 | uint32_t text = 1;
802 |
803 | if (RegSetValueEx(key, "CF_TEXT", 0, REG_DWORD, reinterpret_cast(&palette),
804 | sizeof palette))
805 | {
806 | std::cout << color::red("[-] Failed to write to reg key \'CF_TEXT'\\n");
807 | system("pause");
808 | return;
809 | }
810 |
811 | std::cout << color::green("[+] The reg key \'CF_TEXT\' value changed to 1\n");
812 |
813 | uint32_t textu = 13;
814 |
815 | if (RegSetValueEx(key, "CF_UNICODETEXT", 0, REG_DWORD, reinterpret_cast(&textu),
816 | sizeof textu))
817 | {
818 | std::cout << color::red("[-] Failed to write to reg key \'CF_UNICODETEXT'\\n");
819 | system("pause");
820 | return;
821 | }
822 |
823 | std::cout << color::green("[+] The reg key \'CF_UNICODETEXT\' value changed to 13\n");
824 | std::cout << color::red("[!] Plz, reboot your pc \n");
825 | }
826 | break;
827 | case 10:
828 | {
829 | MEMORYSTATUSEX statex{};
830 | statex.dwLength = sizeof statex;
831 | GlobalMemoryStatusEx(&statex);
832 |
833 | std::cout << color::green("System Info:\n");
834 | std::cout << color::red(
835 | "-----------------------------------------MEM---------------------------------------\n");
836 | {
837 | std::cout << color::green("Memory in use: ") << statex.dwMemoryLoad << "%\n";
838 | std::cout << color::green("Total MB of physical memory: ") << statex.ullTotalPhys / 1024 / 1024 <<
839 | std::endl;
840 | std::cout << color::green("Free MB of physical memory: ") << statex.ullAvailPhys / 1024 / 1024 <<
841 | std::endl;
842 | }
843 | std::cout << color::red(
844 | "-----------------------------------------CPU---------------------------------------\n");
845 | {
846 | SYSTEM_INFO lpSystemInfo;
847 | GetSystemInfo(&lpSystemInfo);
848 | std::cout << color::green("Active processor mask: ") << lpSystemInfo.dwActiveProcessorMask <<
849 | std::endl;
850 | std::cout << color::green("Number of processors: ") << lpSystemInfo.dwNumberOfProcessors <<
851 | std::endl;
852 | std::cout << color::green("Processor type: ") << lpSystemInfo.dwProcessorType << std::endl;
853 |
854 | DWORD buffer_size = _MAX_PATH;
855 | DWORD dwMHz = _MAX_PATH;
856 | HKEY hkey;
857 |
858 | // open the key where the proc speed is hidden:
859 | long error = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
860 | R"(HARDWARE\DESCRIPTION\System\CentralProcessor\0)",
861 | 0,
862 | KEY_READ,
863 | &hkey);
864 |
865 | if (error != ERROR_SUCCESS)
866 | {
867 | wchar_t constexpr buffer[260]{};
868 |
869 | FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
870 | nullptr,
871 | error,
872 | 0,
873 | (CHAR*)buffer,
874 | _MAX_PATH,
875 | nullptr);
876 | wprintf(buffer);
877 | system("pause");
878 | return;
879 | }
880 |
881 | RegQueryValueEx(hkey, "~MHz", nullptr, nullptr, reinterpret_cast(&dwMHz), &buffer_size);
882 | std::cout << color::green("CPU speed: ") << dwMHz << "Mhz\n";
883 | }
884 | std::cout << color::red(
885 | "-----------------------------------------VC---------------------------------------\n");
886 | {
887 | for (int i = 0; ; i++)
888 | {
889 | DISPLAY_DEVICE dd = {sizeof dd, {0}};
890 | BOOL f = EnumDisplayDevices(nullptr, i, &dd, EDD_GET_DEVICE_INTERFACE_NAME);
891 | if (!f)
892 | break;
893 |
894 | std::cout << color::green(dd.DeviceString) << std::endl;
895 | }
896 | }
897 | std::cout << color::red(
898 | "-----------------------------------------WIN---------------------------------------\n");
899 | {
900 | DWORD version = 0;
901 | DWORD major_version = 0;
902 | DWORD minor_version = 0;
903 | DWORD build = 0;
904 |
905 | version = GetVersion();
906 |
907 | major_version = static_cast(LOBYTE(LOWORD(version)));
908 | minor_version = static_cast(HIBYTE(LOWORD(version)));
909 |
910 | if (version < 0x80000000)
911 | build = static_cast(HIWORD(version));
912 |
913 | std::cout << color::green("Version is ") << major_version << "." << minor_version << " " << build <<
914 | std::endl;
915 | }
916 | }
917 | break;
918 | case 11:
919 | {
920 | /* @TODO: Working only on x64 solution platform */
921 | system("sfc.exe /scannow");
922 |
923 | /* lol */
924 | //if (GetLastError())
925 | // system(R"(C:\Windows\System32\sfc.exe /scannow)");
926 | } break;
927 | case 12:
928 | {
929 | /* evaluates reg */
930 | std::cout << color::green("Analyzing Registry...") << std::endl;
931 |
932 | char selection = ' ';
933 |
934 | HKEY reg_key;
935 | LSTATUS status = 0;
936 | status = RegOpenKeyExA(HKEY_CURRENT_USER, "SOFTWARE\\Hex-Rays\\IDA\\History64", 0, KEY_ALL_ACCESS, ®_key);
937 | if (status == ERROR_SUCCESS)
938 | {
939 | DWORD values = 0;
940 | if (ERROR_SUCCESS == (RegQueryInfoKeyA(reg_key, NULL, NULL, NULL, NULL, NULL, NULL, &values, NULL, NULL, NULL, NULL)))
941 | {
942 | std::cout << color::light_yellow("[IDA] Found ") << values << color::light_yellow(" potentially risky value(s).") << std::endl;
943 | if (values > 0)
944 | {
945 | std::cout << color::light_yellow("[IDA] Analyzing value(s)...") << std::endl;
946 |
947 | //checking strings for suspicious names
948 | std::string sus_names[] = { "modern", "warfare", "black", "ops", "call", "duty", "cod", "mw", "bocw", "war", "cold", "dump" };
949 | size_t found = 0;
950 | TCHAR data[MAX_PATH];
951 | DWORD dwSize = sizeof(data);
952 | for (unsigned int i = 0; i < values; i++)
953 | {
954 | status = RegGetValueA(reg_key, NULL, std::to_string(i).c_str(), RRF_RT_REG_SZ, NULL, &data, &dwSize);
955 | if (status == ERROR_SUCCESS)
956 | {
957 | std::string str = data;
958 | for (int j = 0; j < sizeof(sus_names); j++)
959 | {
960 | found = str.find(sus_names[i]);
961 | if (found != str.npos)
962 | {
963 | if (ERROR_SUCCESS != (RegDeleteValueA(reg_key, std::to_string(i).c_str())))
964 | std::cout << color::red("[IDA] Could not delete dangerous element. Error: ") << GetLastError() << std::endl;
965 | else {
966 | std::cout << color::green("[IDA] Deleted Element ") << i << color::green(" - found ") << sus_names[j] << color::green(" inside of data: ") << str << std::endl;
967 | break;
968 | }
969 | }
970 | }
971 | }
972 | else
973 | std::cout << color::red("[IDA] Error: ") << GetLastError() << color::red(" while trying to obtain data of value ") << i << std::endl;
974 | }
975 |
976 | std::cout << color::green("[IDA] Key values analyzed. Moderate Risk caused by IDA keys inside of current users registry.") << std::endl;
977 | }
978 | }
979 | else
980 | std::cout << color::red("Unable to get key info! Extended Error Information: ") << GetLastError() << std::endl;
981 | RegCloseKey(reg_key);
982 | }
983 | else
984 | {
985 | if (GetLastError() != 0x0) //do not display an error if the key doesn't even exist.
986 | std::cout << color::red("Can not open registry key. Error Information: ") << GetLastError() << std::endl;
987 | }
988 | status = RegOpenKeyExA(HKEY_CURRENT_USER, "SOFTWARE\\Hex-Rays\\IDA\\History\\UIFLTR", 0, KEY_ALL_ACCESS, ®_key);
989 | if (status == ERROR_SUCCESS)
990 | {
991 | DWORD values = 0;
992 | if (ERROR_SUCCESS == (RegQueryInfoKeyA(reg_key, NULL, NULL, NULL, NULL, NULL, NULL, &values, NULL, NULL, NULL, NULL)))
993 | {
994 | std::cout << color::light_yellow("[IDA] Found ") << values << color::light_yellow(" search histories.") << std::endl;
995 | if (values > 0)
996 | {
997 | std::cout << color::light_yellow("[IDA] Cleanup search histories? [y/n]\n >");
998 | std::cin >> selection;
999 | if (selection == 'y')
1000 | {
1001 | for (unsigned int i = 0; i < values; i++)
1002 | {
1003 | status = RegDeleteValueA(reg_key, std::to_string(i).c_str());
1004 | if (status == ERROR_SUCCESS)
1005 | std::cout << color::green("[IDA] Element ") << i << color::green(" deleted!") << std::endl;
1006 | else
1007 | std::cout << color::red("[IDA] Error: ") << GetLastError() << color::red(" while trying to delete ") << i << std::endl;
1008 | }
1009 | }
1010 | }
1011 | }
1012 | else
1013 | std::cout << color::red("[IDA] Unable to get key info! Extended Error Information: ") << GetLastError() << std::endl;
1014 | RegCloseKey(reg_key);
1015 | }
1016 | else
1017 | {
1018 | if (GetLastError() != 0x0)
1019 | std::cout << color::red("[IDA] Can not open registry key. Error Information: ") << GetLastError() << std::endl;
1020 | }
1021 |
1022 | std::cout << color::green("===Done!===") << std::endl;
1023 |
1024 | } break;
1025 | default: break;
1026 | }
1027 | }
1028 | while (FindWindow(nullptr, "pc-cleaner"));
1029 | }
1030 |
1031 | int main()
1032 | {
1033 | if (!is_admin())
1034 | {
1035 | std::cout << color::red("[-] Run the program as admin\n");
1036 | system("pause");
1037 | return 0;
1038 | }
1039 |
1040 | SetConsoleTitleA("pc-cleaner");
1041 |
1042 | std::cout << " \n";
1043 | std::cout << color::aqua(
1044 | "Hello, World!\n developer contacts:\n @tg: https://t.me/kernel_mode2\n @ds: william_coder#8276\n @github: https://github.com/W1lliam1337\n");
1045 |
1046 | features();
1047 |
1048 | return 0;
1049 | }
1050 |
--------------------------------------------------------------------------------
/color.h:
--------------------------------------------------------------------------------
1 | #ifndef COLOR_HPP
2 | #define COLOR_HPP
3 |
4 | #include
5 | #include
6 | #include
7 | #include