Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@

All notable project changes are documented here. The project follows semantic versioning after the first generally available release.

## [0.4.0-rc2] - 2026-08-20

### Fixed

- Replaced `RegLoadAppKey` for disconnected Windows system/user hives with privileged temporary `RegLoadKey` mounts and guaranteed `RegUnLoadKey` cleanup. A saved system `SOFTWARE` hive reproducibly returned `ERROR_BADDB` through the former API but opens correctly through the new loader.
- Offline public-certificate discovery now parses serialized certificate files under each profile's `AppData\Roaming\Microsoft\SystemCertificates\My\Certificates`, in addition to registry-backed Personal stores.
- Inactive-profile cleanup on the running system uses the same system-hive-capable loader.

### Added

- Copyable offline diagnostics in the GUI, opened automatically after an unrecognized or completely empty scan.
- Safe `--offline-scan <Windows path> --report <text path>` diagnostic command.
- Stage-by-stage offline diagnostics with resolved paths, API result codes, counts, and mount/unmount results; full licenses and certificate contents are excluded.

### Validation

- A synthetic disconnected-Windows fixture built from saved system hives passed the full read-only pipeline with two CryptoPro products, four license candidates, one inactive profile, and seven file-backed public certificates.
- A repeat test on the user's connected Windows 7 x86 disk remains mandatory.

## [0.4.0-rc1] - 2026-08-20

### Added
Expand Down
2 changes: 1 addition & 1 deletion CryptoProCleanup.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<ClInclude Include="src\cleanup.hpp" /><ClInclude Include="src\resource.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\core.cpp" /><ClCompile Include="src\certificates.cpp" /><ClCompile Include="src\offline.cpp" /><ClCompile Include="src\gui.cpp" /><ClCompile Include="src\main.cpp" />
<ClCompile Include="src\core.cpp" /><ClCompile Include="src\certificates.cpp" /><ClCompile Include="src\offline_registry.cpp" /><ClCompile Include="src\offline.cpp" /><ClCompile Include="src\gui.cpp" /><ClCompile Include="src\main.cpp" />
</ItemGroup>
<ItemGroup><ResourceCompile Include="src\resources.rc" /></ItemGroup>
<ItemGroup><Manifest Include="src\app.manifest" /></ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion CryptoProCleanupTests.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<Link><SubSystem>Console</SubSystem><GenerateDebugInformation>true</GenerateDebugInformation><AdditionalDependencies>advapi32.lib;crypt32.lib;msi.lib;ole32.lib;oleaut32.lib;setupapi.lib;shell32.lib;shlwapi.lib;taskschd.lib;version.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies><AdditionalOptions>/SUBSYSTEM:CONSOLE,6.01 %(AdditionalOptions)</AdditionalOptions></Link>
</ItemDefinitionGroup>
<ItemGroup><ClInclude Include="src\cleanup.hpp" /></ItemGroup>
<ItemGroup><ClCompile Include="src\core.cpp" /><ClCompile Include="src\certificates.cpp" /><ClCompile Include="src\offline.cpp" /><ClCompile Include="tests\test_core.cpp" /></ItemGroup>
<ItemGroup><ClCompile Include="src\core.cpp" /><ClCompile Include="src\certificates.cpp" /><ClCompile Include="src\offline_registry.cpp" /><ClCompile Include="src\offline.cpp" /><ClCompile Include="tests\test_core.cpp" /></ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>
15 changes: 11 additions & 4 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![MIT License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
[![Windows 7–11](https://img.shields.io/badge/Windows-7%20SP1%E2%80%9311-0078D6.svg)](#system-requirements)

> **Status: 0.4.0 release candidate.** Safe scanning was validated on Windows 11 with CryptoPro CSP 5.0, and a user successfully completed full removal and residual cleanup on a live Windows 10 x64 system. The disconnected Windows 7 x86 fix still requires a repeat field test before general availability.
> **Status: 0.4.0 RC2.** A user successfully completed full removal on a live Windows 10 x64 system. RC1 did not fix the real disconnected Windows 7 x86 disk; RC2 replaces the unsuitable `RegLoadAppKey` path with a system-hive loader and separately supports file-backed certificate stores. The same disk still needs a repeat test.

An unofficial portable utility for backing up license identifiers and public certificates, controlled removal of installed CryptoPro products, and rescue from a disconnected Windows 7 SP1 through Windows 11 installation.

Expand All @@ -31,9 +31,10 @@ The utility deliberately preserves Windows certificate stores, hardware tokens,
- restart-safe continuation, masked JSON reporting, and a privacy-safe operation log;
- disconnected-Windows rescue for licenses and public certificates;
- separately confirmed, recovery-backed conservative offline cleanup.
- explicit native-view access for cross-bitness scanning of disconnected x86/x64 Windows hives;
- sequential `SOFTWARE`, user `NTUSER.DAT`, and `SYSTEM` loading compatible with the Windows 7 application-hive limit;
- fallback profile discovery from `Users`, plus public certificates from user and local-machine stores.
- temporary mounting of real system `SOFTWARE`, `SYSTEM`, and `NTUSER.DAT` hives through `RegLoadKey`, followed by mandatory `RegUnLoadKey` cleanup;
- fallback profile discovery from `Users`, plus registry-backed user and local-machine public-certificate stores;
- public-certificate discovery in `AppData\Roaming\Microsoft\SystemCertificates\My\Certificates` without accessing private keys;
- copyable stage-by-stage offline diagnostics and a safe `--offline-scan` command.

## System requirements

Expand Down Expand Up @@ -62,6 +63,12 @@ Safe scan-only CLI:
CryptoProCleanup.exe --scan --report C:\Temp\cryptopro-report.json --lang en
```

Safe disconnected-Windows diagnostics without removal:

```text
CryptoProCleanup.exe --offline-scan E:\Windows --report C:\Temp\offline-diagnostic.txt --lang en
```

Version 0.4.0 has no unattended destructive mode.

## Build and package
Expand Down
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![MIT License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
[![Windows 7–11](https://img.shields.io/badge/Windows-7%20SP1%E2%80%9311-0078D6.svg)](#системные-требования)

> **Статус: релиз-кандидат 0.4.0.** Безопасное сканирование проверено на Windows 11 с CryptoPro CSP 5.0; полное удаление и очистка успешно выполнены пользователем на живой Windows 10 x64. Исправление чтения подключённой Windows 7 x86 требует повторной полевой проверки перед стабильным выпуском.
> **Статус: релиз-кандидат 0.4.0 RC2.** Полное удаление успешно проверено пользователем на живой Windows 10 x64. RC1 не исправил чтение реального диска Windows 7 x86; в RC2 ошибочный `RegLoadAppKey` заменён системным загрузчиком hive, а файловое хранилище сертификатов поддерживается отдельно. Требуется повторная проверка на том же диске.

Неофициальная portable-утилита для резервного копирования лицензий и открытых сертификатов, контролируемого удаления установленных продуктов CryptoPro и спасения данных из отключённой Windows 7 SP1–Windows 11.

Expand Down Expand Up @@ -41,9 +41,10 @@
- управляемая перезагрузка и продолжение через защищённый RunOnce-сеанс;
- безопасный CLI-режим сканирования без удаления.
- отдельная вкладка «Неисправный диск» для чтения отключённой Windows, извлечения лицензий и открытых сертификатов и консервативной расширенной очистки.
- явное native/WOW64-чтение офлайн-реестра: x86-утилита корректно обращается к физическим веткам подключённой Windows x86/x64;
- последовательная загрузка `SOFTWARE`, пользовательских `NTUSER.DAT` и `SYSTEM`, совместимая с ограничением Windows 7;
- резервный поиск профилей в `Users` и чтение как пользовательского, так и машинного хранилища открытых сертификатов.
- временное подключение настоящих системных `SOFTWARE`, `SYSTEM` и `NTUSER.DAT` через `RegLoadKey` с обязательным `RegUnLoadKey`;
- резервный поиск профилей в `Users` и чтение пользовательского и машинного реестровых хранилищ сертификатов;
- чтение открытых сертификатов из файлового хранилища `AppData\Roaming\Microsoft\SystemCertificates\My\Certificates` без доступа к закрытым ключам;
- копируемая пошаговая диагностика офлайн-сканирования и безопасный параметр `--offline-scan`.

## Системные требования

Expand Down Expand Up @@ -81,6 +82,12 @@ CLI только для безопасного сканирования:
CryptoProCleanup.exe --scan --report C:\Temp\cryptopro-report.json --lang ru
```

Безопасная диагностика подключённой Windows без удаления:

```text
CryptoProCleanup.exe --offline-scan E:\Windows --report C:\Temp\offline-diagnostic.txt --lang ru
```

Тихого автоматического удаления в версии 0.4.0 нет.

## Сборка
Expand Down
20 changes: 20 additions & 0 deletions docs/RELEASE_NOTES_0.4.0-rc2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# КриптоПро Очистка 0.4.0 RC2

Исправлена фундаментальная причина нулевого результата на подключённой Windows 7 x86.

## Что изменено

- `RegLoadAppKey`, который не смог открыть настоящий системный `SOFTWARE`, заменён на временный системный mount через `RegLoadKey`;
- после каждого чтения выполняется контролируемый `RegUnLoadKey`, его результат отражается в диагностике;
- пользовательские `NTUSER.DAT` открываются тем же способом;
- поддержаны сериализованные открытые сертификаты в `AppData\Roaming\Microsoft\SystemCertificates\My\Certificates`;
- закрытые ключи, `Microsoft\Crypto`, контейнеры CryptoPro и аппаратные токены не читаются и не экспортируются;
- добавлена кнопка «Диагностика…» с копированием пошаговых результатов;
- при полностью пустом или нераспознанном сканировании диагностика открывается автоматически;
- добавлен безопасный CLI: `--offline-scan <path> --report <path>`.

## Проверка

На искусственном отключённом образе новый конвейер нашёл 2 продукта CryptoPro, 4 значения лицензии, 1 офлайн-профиль и 7 открытых сертификатов. Оба системных hive были успешно выгружены. Модульные тесты, безопасный интеграционный тест и статический анализ MSVC пройдены. Чувствительные тестовые копии hive и сертификатов после проверки удалены.

Нужен повторный тест на том же физическом диске Windows 7 x86. Офлайн-очистку до подтверждения корректного списка запускать не следует.
5 changes: 4 additions & 1 deletion docs/TEST_MATRIX.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ For each VM retain the initial JSON report, final JSON report, cleanup log, prod

- 2026-08-19: Windows 11 x64 build 26100, CryptoPro CSP 5.0.13000 plus CryptoPro EDS Browser plug-in 2.0.15400 — unit tests and non-destructive integration scan passed. The scan found the complete MSI `InstallProperties\ProductID` through the packed ProductCode-derived path and enumerated seven public certificates from the current user's logical Personal store without exposing values or names in test output. Temporary CER/P7B export was reopened through CryptoAPI and removed. No removal was performed.
- 2026-08-20: user field report — full installed-product removal and residual cleanup completed successfully on a live Windows 10 x64 system.
- 2026-08-20: RC2 running on Windows 10 x64 returned zero products and certificates for a connected, bootable Windows 7 x86 disk. Version 0.4.0 now uses explicit native registry views, sequential application-hive loading, MSI Installer UserData product recovery, filesystem profile fallback, and user/machine certificate stores. A repeat test on that disk is mandatory before this scenario can pass.
- 2026-08-20: version 0.3.0 RC2 running on Windows 10 x64 returned zero products and certificates for a connected, bootable Windows 7 x86 disk. Version 0.4.0 RC1 added registry-view, MSI Installer UserData, profile-fallback, and certificate-store changes, but a repeat test still returned zero results.
- 2026-08-20: version 0.4.0 unit tests, non-destructive integration scan, and MSVC C++ static analysis passed. The release executable was verified as x86 with OS/subsystem version 6.01, `requireAdministrator`, system-DPI awareness, Common Controls v6, and no dynamic Visual C++ runtime dependency.
- 2026-08-20: user repeat test of 0.4.0 RC1 still returned zero products and certificates on the connected Windows 7 x86 disk. Reproduction showed `RegLoadAppKey` returning `ERROR_BADDB` for a valid saved system `SOFTWARE` hive; `RegLoadKey` opened and unloaded the same hive successfully. RC2 replaces the loader and adds serialized certificate-file discovery.
- 2026-08-20: read-only synthetic disconnected-Windows fixture passed with 2 confirmed CryptoPro products, 4 license candidates, 1 inactive profile, and 7 public certificates from `AppData\Roaming\Microsoft\SystemCertificates\My\Certificates`; both `SOFTWARE` and `SYSTEM` temporary mounts unloaded successfully.
- 2026-08-20: RC2 implementation passed unit tests, the non-destructive live integration scan, and MSVC C++ static analysis with no warnings. No `CryptoProCleanup_Offline_*` registry mounts remained after testing; sensitive hive/certificate fixture copies were removed.
- The running Windows directory is rejected as an offline target. A destructive disconnected-Windows VM test is still pending.
- 2026-08-19: MSVC C++ static analysis passed with no warnings. Offline scanning also compares the actual `SOFTWARE` and `SYSTEM` hive file identities so a filesystem alias to the running Windows installation is rejected.
- Destructive scenarios and the remaining OS/CSP matrix, including CSP 4.x, are still mandatory before marking a build generally available.
Loading
Loading