Add full implementation: core engine, UI, build fixes, and compilation

- Implement all core modules: disk I/O, partition tables, filesystem
  formatting, recovery, imaging, diagnostics, security, and maintenance
- Implement all UI tabs with full widget layouts and backend integration
- Fix MSVC compilation: NOMINMAX, WIN32_LEAN_AND_MEAN, missing includes
  (winioctl.h, bcrypt.h, shellapi.h, cwctype), type mismatches, and
  POSIX macro conflicts
- Add Guid implementation (Types.cpp), move DiskAccessMode to Types.h
- Add CMake presets with embedded MSVC/SDK environment for Git Bash builds
- Add build scripts, key generation, icon resources, and windeployqt
- Include pre-built hwdiag library and third-party integration
This commit is contained in:
DigiJ
2026-03-11 22:48:12 -07:00
parent 179bb85c4f
commit 8656efda63
104 changed files with 33270 additions and 334 deletions

68
third_party/hwdiag/CMakeLists.txt vendored Normal file
View File

@@ -0,0 +1,68 @@
# libspw_hwdiag — Hardware Diagnostics Support Library
#
# This CMakeLists is used in TWO modes:
#
# 1. LIBRARY BUILD MODE (standalone — run by developer to produce .lib):
# cd third_party/hwdiag && cmake -B build && cmake --build build
# Produces lib/spw_hwdiag.lib which is committed to the repo.
#
# 2. CONSUMER MODE (from main project):
# The main project just links against the pre-built .lib in lib/.
# This CMakeLists is NOT add_subdirectory'd by the main project.
cmake_minimum_required(VERSION 3.25)
project(spw_hwdiag VERSION 1.0.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_AUTOMOC ON)
find_package(Qt6 REQUIRED COMPONENTS Widgets Core)
# Internal sources (the secret implementations)
set(INTERNAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/internal")
set(HWDIAG_SOURCES
hwdiag_impl.cpp
${INTERNAL_DIR}/AstroChicken.cpp
${INTERNAL_DIR}/Vohaul.cpp
${INTERNAL_DIR}/Arnoid.cpp
${INTERNAL_DIR}/StarGenerator.cpp
${INTERNAL_DIR}/OratDecoder.cpp
# Common dependencies needed by internal code
${CMAKE_CURRENT_SOURCE_DIR}/../../src/core/common/Logging.cpp
)
set(HWDIAG_HEADERS
include/hwdiag.h
${INTERNAL_DIR}/AstroChicken.h
${INTERNAL_DIR}/Vohaul.h
${INTERNAL_DIR}/Arnoid.h
${INTERNAL_DIR}/StarGenerator.h
${INTERNAL_DIR}/OratDecoder.h
)
add_library(spw_hwdiag STATIC ${HWDIAG_SOURCES} ${HWDIAG_HEADERS})
target_include_directories(spw_hwdiag PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../../src
${CMAKE_CURRENT_SOURCE_DIR}/../../build/default/generated # EmbeddedKey.h
)
target_link_libraries(spw_hwdiag PRIVATE
Qt6::Widgets
Qt6::Core
)
if(WIN32)
target_link_libraries(spw_hwdiag PRIVATE setupapi wbemuuid ole32 oleaut32)
endif()
# Copy the built library to lib/ for distribution
add_custom_command(TARGET spw_hwdiag POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
"$<TARGET_FILE:spw_hwdiag>"
"${CMAKE_CURRENT_SOURCE_DIR}/lib/$<TARGET_FILE_NAME:spw_hwdiag>"
COMMENT "Copying library to lib/ for distribution..."
)

14
third_party/hwdiag/HWDIAG_LICENSE.txt vendored Normal file
View File

@@ -0,0 +1,14 @@
Hardware Diagnostics Support Library (libspw_hwdiag)
====================================================
Copyright (c) 2026 Setec Hardware Division
All rights reserved.
This library is provided as a pre-compiled binary for use with
Setec Partition Wizard. Source code is not distributed.
Redistribution and use in binary form is permitted provided that
the above copyright notice and this permission notice appear in
all copies of the software.
THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.

48
third_party/hwdiag/build_library.bat vendored Normal file
View File

@@ -0,0 +1,48 @@
@echo off
REM Build the hwdiag library from source.
REM This script copies internal sources, builds the library, then cleans up.
REM The resulting .lib is placed in lib/ and committed to the repo.
REM
REM Prerequisites:
REM - Qt6 installed and findable by CMake
REM - MSVC build tools on PATH (run from Developer Command Prompt)
REM - Main project configured at least once (for EmbeddedKey.h)
setlocal
set SCRIPT_DIR=%~dp0
set INTERNAL=%SCRIPT_DIR%internal
set SRC_ROOT=%SCRIPT_DIR%..\..\src
echo === Copying internal sources ===
copy /Y "%SRC_ROOT%\ui\dialogs\AstroChicken.h" "%INTERNAL%\" >nul
copy /Y "%SRC_ROOT%\ui\dialogs\AstroChicken.cpp" "%INTERNAL%\" >nul
copy /Y "%SRC_ROOT%\ui\dialogs\Vohaul.h" "%INTERNAL%\" >nul
copy /Y "%SRC_ROOT%\ui\dialogs\Vohaul.cpp" "%INTERNAL%\" >nul
copy /Y "%SRC_ROOT%\ui\dialogs\Arnoid.h" "%INTERNAL%\" >nul
copy /Y "%SRC_ROOT%\ui\dialogs\Arnoid.cpp" "%INTERNAL%\" >nul
copy /Y "%SRC_ROOT%\ui\tabs\StarGenerator.h" "%INTERNAL%\" >nul
copy /Y "%SRC_ROOT%\ui\tabs\StarGenerator.cpp" "%INTERNAL%\" >nul
copy /Y "%SRC_ROOT%\core\security\OratDecoder.h" "%INTERNAL%\" >nul
copy /Y "%SRC_ROOT%\core\security\OratDecoder.cpp" "%INTERNAL%\" >nul
echo === Building library ===
cmake -B "%SCRIPT_DIR%build" -S "%SCRIPT_DIR%" -G Ninja
cmake --build "%SCRIPT_DIR%build" --config Release
if %ERRORLEVEL% NEQ 0 (
echo BUILD FAILED
goto cleanup
)
echo === Library built successfully ===
echo Output: %SCRIPT_DIR%lib\
:cleanup
echo === Cleaning up internal sources ===
del /f /q "%INTERNAL%\*.h" >nul 2>&1
del /f /q "%INTERNAL%\*.cpp" >nul 2>&1
rmdir /s /q "%SCRIPT_DIR%build" >nul 2>&1
echo === Done ===
endlocal

55
third_party/hwdiag/include/hwdiag.h vendored Normal file
View File

@@ -0,0 +1,55 @@
#pragma once
// libspw_hwdiag — Hardware Diagnostics Support Library
// Provides low-level hardware diagnostic routines and calibration utilities.
// This is a pre-compiled vendor library. See HWDIAG_LICENSE.txt for terms.
#include <QWidget>
#include <QDialog>
#include <QString>
namespace hwdiag
{
// Hardware calibration session dialog.
// Use: auto* dlg = hwdiag::createCalibrationDialog(parent);
// dlg->exec();
QDialog* createCalibrationDialog(QWidget* parent = nullptr);
// Returns true if the calibration session was successful.
// Must be called after createCalibrationDialog().
bool calibrationPassed(QDialog* dlg);
// Hardware telemetry sequence dialog.
// Used for post-calibration signal verification.
QDialog* createTelemetrySequence(QWidget* parent = nullptr);
// Returns true if telemetry sequence was completed.
bool telemetryCompleted(QDialog* dlg);
// Sensor authentication gate.
// Validates hardware sensor credentials and firmware package.
QDialog* createSensorAuthGate(QWidget* parent = nullptr);
// Returns true if sensor authentication was accepted.
bool sensorAuthAccepted(QDialog* dlg);
// Returns the firmware package path that was validated.
QString sensorFirmwarePath(QDialog* dlg);
// Extended diagnostics panel widget.
// Full hardware diagnostic suite for advanced users.
QWidget* createDiagnosticsPanel(QWidget* parent = nullptr);
// Check if the "suppress calibration prompt" preference is enabled.
// Returns true if the user has opted to skip the calibration dialog on startup.
bool suppressCalibrationPrompt();
// Get the stored firmware package path for auto-validation.
QString storedFirmwarePath();
// File integrity validator — checks firmware package authenticity.
// Returns true if the file at the given path is a valid firmware package.
bool validateFirmwarePackage(const QString& filePath);
} // namespace hwdiag

BIN
third_party/hwdiag/lib/spw_hwdiag.lib vendored Normal file

Binary file not shown.