From 1ebca9d008d54821f3340172ff58f20c5878508f Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Sat, 24 Sep 2022 21:03:20 +0800 Subject: [PATCH] 2.2.0 --- RegShot/build/CMakeLists.txt | 114 -- RegShot/build/build_wdk.bat | 166 -- .../cmake_how_to_create_project_files.txt | 66 - RegShot/build/make_zip.bat | 280 --- RegShot/build/makefile.mak | 160 -- RegShot/build/regshot_icl12.sln | 26 - RegShot/build/regshot_icl12.vcxproj | 224 --- RegShot/build/regshot_icl12.vcxproj.filters | 66 - RegShot/build/regshot_vs2008.sln | 26 - RegShot/build/regshot_vs2008.vcproj | 440 ----- RegShot/build/regshot_vs2010.sln | 26 - RegShot/build/regshot_vs2010.vcxproj | 203 -- RegShot/build/regshot_vs2010.vcxproj.filters | 69 - RegShot/src/182to183/align.c | 123 -- RegShot/src/182to183/global.h | 158 -- RegShot/src/182to183/loadsave.c | 359 ---- RegShot/src/182to183/main.c | 41 - RegShot/src/Makefile | 120 -- RegShot/src/fileshot.c | 586 ------ RegShot/src/global.h | 415 ---- RegShot/src/language.c | 323 --- RegShot/src/misc.c | 143 -- RegShot/src/output.c | 179 -- RegShot/src/regshot.c | 1725 ----------------- RegShot/src/regshot.rc | 177 -- RegShot/src/res/Regshot.exe.manifest | 40 - RegShot/src/res/regshot.ico | Bin 22486 -> 0 bytes RegShot/src/resource.h | 77 - RegShot/src/setup.c | 172 -- RegShot/src/ui.c | 371 ---- RegShot/src/version.h | 103 - RegShot/src/winmain.c | 459 ----- 32 files changed, 7437 deletions(-) delete mode 100644 RegShot/build/CMakeLists.txt delete mode 100644 RegShot/build/build_wdk.bat delete mode 100644 RegShot/build/cmake_how_to_create_project_files.txt delete mode 100644 RegShot/build/make_zip.bat delete mode 100644 RegShot/build/makefile.mak delete mode 100644 RegShot/build/regshot_icl12.sln delete mode 100644 RegShot/build/regshot_icl12.vcxproj delete mode 100644 RegShot/build/regshot_icl12.vcxproj.filters delete mode 100644 RegShot/build/regshot_vs2008.sln delete mode 100644 RegShot/build/regshot_vs2008.vcproj delete mode 100644 RegShot/build/regshot_vs2010.sln delete mode 100644 RegShot/build/regshot_vs2010.vcxproj delete mode 100644 RegShot/build/regshot_vs2010.vcxproj.filters delete mode 100644 RegShot/src/182to183/align.c delete mode 100644 RegShot/src/182to183/global.h delete mode 100644 RegShot/src/182to183/loadsave.c delete mode 100644 RegShot/src/182to183/main.c delete mode 100644 RegShot/src/Makefile delete mode 100644 RegShot/src/fileshot.c delete mode 100644 RegShot/src/global.h delete mode 100644 RegShot/src/language.c delete mode 100644 RegShot/src/misc.c delete mode 100644 RegShot/src/output.c delete mode 100644 RegShot/src/regshot.c delete mode 100644 RegShot/src/regshot.rc delete mode 100644 RegShot/src/res/Regshot.exe.manifest delete mode 100644 RegShot/src/res/regshot.ico delete mode 100644 RegShot/src/resource.h delete mode 100644 RegShot/src/setup.c delete mode 100644 RegShot/src/ui.c delete mode 100644 RegShot/src/version.h delete mode 100644 RegShot/src/winmain.c diff --git a/RegShot/build/CMakeLists.txt b/RegShot/build/CMakeLists.txt deleted file mode 100644 index f159545..0000000 --- a/RegShot/build/CMakeLists.txt +++ /dev/null @@ -1,114 +0,0 @@ -### -### CMake settings -### -# see http://www.cmake.org/Wiki/CMake_Policies -cmake_minimum_required(VERSION 2.8) - - -### -### Project settings -### -project(RegShot) - -set(EXE_SUFFIX "-alpha") - - -### -### Project options -### - -## Build options -# --> Microsoft Visual C++ -# see http://msdn.microsoft.com/en-us/library/aa278396(v=VS.60).aspx -# http://msdn.microsoft.com/en-us/library/2kzt1wy3(v=VS.71).aspx -option(MSVC_SHARED_RT "MSVC: Build with shared runtime libs (/MD)" OFF) -option(MSVC_STHREADED_RT "MSVC: Build with single-threaded static runtime libs (/ML until VS .NET 2003)" OFF) - - -### -### Sources, headers, directories and libs -### -file(GLOB sources "../src/[a-zA-Z]*.c") -file(GLOB private_headers "../src/[a-zA-Z]*.h") -file(GLOB resources "../src/[a-zA-Z]*.rc") -file(GLOB manifests "../src/res/[a-zA-Z]*.manifest") - - -### -### General compilation settings -### -if(WIN32) - if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX "C:/") - endif() -endif() - -# GCC specialities -if(CMAKE_COMPILER_IS_GNUC) - message(FATAL_ERROR "GNU compiler not supported. Patch submissions welcome.") -endif() - -# Microsoft VisualC++ specialities -if(MSVC) - ### General stuff - # a) Change MSVC runtime library settings (/MD[d], /MT[d], /ML[d] (single-threaded until VS 2003)) - # plus set lib suffix for later use and project label accordingly - # see http://msdn.microsoft.com/en-us/library/aa278396(v=VS.60).aspx - # http://msdn.microsoft.com/en-us/library/2kzt1wy3(v=VS.71).aspx - set(LIB_RT_SUFFIX "md") # CMake defaults to /MD for MSVC - set(LIB_RT_OPTION "/MD") - # - if(NOT MSVC_SHARED_RT) # User wants to have static runtime libraries (/MT, /ML) - if(MSVC_STHREADED_RT) # User wants to have old single-threaded static runtime libraries - set(LIB_RT_SUFFIX "ml") - set(LIB_RT_OPTION "/ML") - if(NOT ${MSVC_VERSION} LESS 1400) - message(FATAL_ERROR "Single-threaded static runtime libraries (/ML) only available until VS .NET 2003 (7.1).") - endif() - else() - set(LIB_RT_SUFFIX "mt") - set(LIB_RT_OPTION "/MT") - endif() - - # correct linker options - foreach(flag_var CMAKE_C_FLAGS CMAKE_CXX_FLAGS) - foreach(config_name "" DEBUG RELEASE MINSIZEREL RELWITHDEBINFO) - set(var_name "${flag_var}") - if(NOT "${config_name}" STREQUAL "") - set(var_name "${var_name}_${config_name}") - endif() - string(REPLACE "/MD" "${LIB_RT_OPTION}" ${var_name} "${${var_name}}") - endforeach() - endforeach() - endif() - # - set(LABEL_SUFFIX "${LABEL_SUFFIX} ${LIB_RT_SUFFIX}") - - ### Project stuff - if(NOT ${MSVC_VERSION} LESS 1400) - add_definitions(-D_CRT_SECURE_NO_WARNINGS) - endif() - - if(CMAKE_CL_64) - set(PLATFORM_SUFFIX "-x64") - else() - set(PLATFORM_SUFFIX "") - endif() -endif() - - -### -### Executable -### -add_executable(${PROJECT_NAME}${PLATFORM_SUFFIX}${EXE_SUFFIX} - WIN32 - ${sources} - ${private_headers} - ${resources} - ${manifests} -) - -set_target_properties(${PROJECT_NAME}${PLATFORM_SUFFIX}${EXE_SUFFIX} - PROPERTIES - PROJECT_LABEL "${PROJECT_NAME}${PLATFORM_SUFFIX}${EXE_SUFFIX}${LABEL_SUFFIX}" -) diff --git a/RegShot/build/build_wdk.bat b/RegShot/build/build_wdk.bat deleted file mode 100644 index 438f87c..0000000 --- a/RegShot/build/build_wdk.bat +++ /dev/null @@ -1,166 +0,0 @@ -@ECHO OFF -rem ****************************************************************************** -rem * Copyright 2010-2011 XhmikosR -rem * -rem * This file is part of Regshot. -rem * -rem * Regshot is free software; you can redistribute it and/or modify -rem * it under the terms of the GNU General Public License as published by -rem * the Free Software Foundation; either version 2 of the License, or -rem * (at your option) any later version. -rem * -rem * Regshot is distributed in the hope that it will be useful, -rem * but WITHOUT ANY WARRANTY; without even the implied warranty of -rem * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -rem * GNU General Public License for more details. -rem * -rem * You should have received a copy of the GNU General Public License -rem * along with Regshot; if not, write to the Free Software -rem * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -rem * -rem * -rem * build_wdk.bat -rem * Batch file "wrapper" for makefile.mak, used to build Regshot with WDK -rem ****************************************************************************** - - -SETLOCAL ENABLEEXTENSIONS -CD /D %~dp0 - -rem Set the WDK directory -IF NOT DEFINED WDKBASEDIR SET "WDKBASEDIR=C:\WinDDK\7600.16385.1" - -rem Check the building environment -IF NOT EXIST "%WDKBASEDIR%" CALL :SUBMSG "ERROR" "Specify your WDK directory!" - - -rem Check for the help switches -IF /I "%~1" == "help" GOTO SHOWHELP -IF /I "%~1" == "/help" GOTO SHOWHELP -IF /I "%~1" == "-help" GOTO SHOWHELP -IF /I "%~1" == "--help" GOTO SHOWHELP -IF /I "%~1" == "/?" GOTO SHOWHELP - - -rem Check for the first switch -IF "%~1" == "" ( - SET "BUILDTYPE=Build" -) ELSE ( - IF /I "%~1" == "Build" SET "BUILDTYPE=Build" & GOTO CHECKSECONDARG - IF /I "%~1" == "/Build" SET "BUILDTYPE=Build" & GOTO CHECKSECONDARG - IF /I "%~1" == "-Build" SET "BUILDTYPE=Build" & GOTO CHECKSECONDARG - IF /I "%~1" == "--Build" SET "BUILDTYPE=Build" & GOTO CHECKSECONDARG - IF /I "%~1" == "Clean" SET "BUILDTYPE=Clean" & GOTO CHECKSECONDARG - IF /I "%~1" == "/Clean" SET "BUILDTYPE=Clean" & GOTO CHECKSECONDARG - IF /I "%~1" == "-Clean" SET "BUILDTYPE=Clean" & GOTO CHECKSECONDARG - IF /I "%~1" == "--Clean" SET "BUILDTYPE=Clean" & GOTO CHECKSECONDARG - IF /I "%~1" == "Rebuild" SET "BUILDTYPE=Rebuild" & GOTO CHECKSECONDARG - IF /I "%~1" == "/Rebuild" SET "BUILDTYPE=Rebuild" & GOTO CHECKSECONDARG - IF /I "%~1" == "-Rebuild" SET "BUILDTYPE=Rebuild" & GOTO CHECKSECONDARG - IF /I "%~1" == "--Rebuild" SET "BUILDTYPE=Rebuild" & GOTO CHECKSECONDARG - - ECHO. - ECHO Unsupported commandline switch! - ECHO Run "%~nx0 help" for details about the commandline switches. - CALL :SUBMSG "ERROR" "Compilation failed!" -) - - -:CHECKSECONDARG -rem Check for the second switch -IF "%~2" == "" ( - SET "ARCH=all" -) ELSE ( - IF /I "%~2" == "x86" SET "ARCH=x86" & GOTO START - IF /I "%~2" == "/x86" SET "ARCH=x86" & GOTO START - IF /I "%~2" == "-x86" SET "ARCH=x86" & GOTO START - IF /I "%~2" == "--x86" SET "ARCH=x86" & GOTO START - IF /I "%~2" == "x64" SET "ARCH=x64" & GOTO START - IF /I "%~2" == "/x64" SET "ARCH=x64" & GOTO START - IF /I "%~2" == "-x64" SET "ARCH=x64" & GOTO START - IF /I "%~2" == "--x64" SET "ARCH=x64" & GOTO START - IF /I "%~2" == "all" SET "ARCH=all" & GOTO START - IF /I "%~2" == "/all" SET "ARCH=all" & GOTO START - IF /I "%~2" == "-all" SET "ARCH=all" & GOTO START - IF /I "%~2" == "--all" SET "ARCH=all" & GOTO START - - ECHO. - ECHO Unsupported commandline switch! - ECHO Run "%~nx0 help" for details about the commandline switches. - CALL :SUBMSG "ERROR" "Compilation failed!" -) - - -:START -IF "%ARCH%" == "x64" GOTO x64 -IF "%ARCH%" == "x86" GOTO x86 - - -:x86 -SET "INCLUDE=%WDKBASEDIR%\inc\api;%WDKBASEDIR%\inc\api\crt\stl60;%WDKBASEDIR%\inc\crt;%WDKBASEDIR%\inc\ddk" -SET "LIB=%WDKBASEDIR%\lib\crt\i386;%WDKBASEDIR%\lib\win7\i386" -SET "PATH=%WDKBASEDIR%\bin\x86;%WDKBASEDIR%\bin\x86\x86" - -TITLE Building Regshot x86 with WDK... -ECHO. & ECHO. - -CALL :SUBNMAKE - -IF "%ARCH%" == "x86" GOTO END - - -:x64 -SET "INCLUDE=%WDKBASEDIR%\inc\api;%WDKBASEDIR%\inc\api\crt\stl60;%WDKBASEDIR%\inc\crt;%WDKBASEDIR%\inc\ddk" -SET "LIB=%WDKBASEDIR%\lib\crt\amd64;%WDKBASEDIR%\lib\win7\amd64" -SET "PATH=%WDKBASEDIR%\bin\x86;%WDKBASEDIR%\bin\x86\amd64" - -TITLE Building Regshot x64 with WDK... -ECHO. & ECHO. - -CALL :SUBNMAKE "x64=1" - - -:END -TITLE Building Regshot with WDK - Finished! -ENDLOCAL -EXIT /B - - -:SUBNMAKE -nmake /NOLOGO /f "makefile.mak" %BUILDTYPE% %1 -IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!" -EXIT /B - - -:SHOWHELP -TITLE "%~nx0 %1" -ECHO. & ECHO. -ECHO Usage: %~nx0 [Clean^|Build^|Rebuild] [x86^|x64^|all] -ECHO. -ECHO Notes: You can also prefix the commands with "-", "--" or "/". -ECHO The arguments are not case sensitive. -ECHO. & ECHO. -ECHO Edit "%~nx0" and set your WDK directory. -ECHO You shouldn't need to make any changes other than that. -ECHO. & ECHO. -ECHO Executing "%~nx0" will use the defaults: "%~nx0 build all" -ECHO. -ECHO If you skip the second argument the default one will be used. Example: -ECHO "%~nx0 rebuild" is the same as "%~nx0 rebuild all" -ECHO. -ECHO WARNING: "%~nx0 x86" won't work. -ECHO. -ENDLOCAL -EXIT /B - - -:SUBMSG -ECHO. & ECHO ______________________________ -ECHO [%~1] %~2 -ECHO ______________________________ & ECHO. -IF /I "%~1" == "ERROR" ( - PAUSE - EXIT -) ELSE ( - EXIT /B -) diff --git a/RegShot/build/cmake_how_to_create_project_files.txt b/RegShot/build/cmake_how_to_create_project_files.txt deleted file mode 100644 index 2fcb3a0..0000000 --- a/RegShot/build/cmake_how_to_create_project_files.txt +++ /dev/null @@ -1,66 +0,0 @@ -CMake allows to create project and make files for many different compilers from -a single source. This text will tell you how to create project files for RegShot. -If your compiler is not explained here then check out CMake's good documentation -at http://www.cmake.org/cmake/help/documentation.html - -First get CMake from http://www.cmake.org/ (Resources -> Download). -On Windows either use the installer, or extract the zip to a folder which will -contain the CMake folder and then add CMake's bin folder to your path. - -It is recommended to build out-of-source and not inside the source directory. - -The following commands use shell variables to allow re-using them via a script. - - -Preparation for different compilers: -==================================== -* set TDIR=vc6 & set CMGEN="Visual Studio 6" - "%ProgramFiles%\Microsoft Visual Studio\VC98\Bin\vcvars32.bat" - -* set TDIR=vc2002 & set CMGEN="Visual Studio 7" - "%ProgramFiles%\Microsoft Visual Studio .NET\VC7\bin\vcvars32.bat" - -* set TDIR=vc2003 & set CMGEN="Visual Studio 7 .NET 2003" - "%ProgramFiles%\Microsoft Visual Studio .NET 2003\VC7\bin\vcvars32.bat" - -* set TDIR=vc2005 & set CMGEN="Visual Studio 8 2005" - "%ProgramFiles%\Microsoft Visual Studio 8\VC\vcvarsall.bat" - -* set TDIR=vc2005-x64 & set CMGEN="Visual Studio 8 2005 Win64" - "%ProgramFiles%\Microsoft Visual Studio 8\VC\vcvarsall.bat" - -* set TDIR=vc2008 & set CMGEN="Visual Studio 9 2008" - "%ProgramFiles%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" - -* set TDIR=vc2008-x64 & set CMGEN="Visual Studio 9 2008 Win64" - "%ProgramFiles%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" - -* set TDIR=vc2010 & set CMGEN="Visual Studio 10" - "%ProgramFiles%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" - -* set TDIR=vc2010-x64 & set CMGEN="Visual Studio 10 Win64" - "%ProgramFiles%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" - - -Creating project files: -======================= -* cd /d C:\Coding\Regshot\trunk -* set CMOPTS= - Here you can set options to modify the resulting project files. - All options are listed in CMakeLists.txt and are normally self-explaining. - * Some important ones are: - -DMSVC_SHARED_RT=ON - link with shared runtime libs on MSVC - * Example: - set CMOPTS=-DMSVC_SHARED_RT=ON - -* mkdir bin\%TDIR% -* cd bin\%TDIR% -* del /s /q * & rmdir /s /q . -* cmake %CMOPTS% -G %CMGEN% ..\..\build - - -Tested compilers: -================= -VS 6 (32-Bit, Maddes, just remove DS_SHELLFONT from src/regshot.rc) -VS 2002 (32-Bit, Maddes) -VS 2008 (32-Bit & 64-Bit, Maddes) diff --git a/RegShot/build/make_zip.bat b/RegShot/build/make_zip.bat deleted file mode 100644 index 8fd6eaa..0000000 --- a/RegShot/build/make_zip.bat +++ /dev/null @@ -1,280 +0,0 @@ -@ECHO OFF -rem ****************************************************************************** -rem * Copyright 2010-2011 XhmikosR -rem * -rem * This file is part of Regshot. -rem * -rem * Regshot is free software; you can redistribute it and/or modify -rem * it under the terms of the GNU General Public License as published by -rem * the Free Software Foundation; either version 2 of the License, or -rem * (at your option) any later version. -rem * -rem * Regshot is distributed in the hope that it will be useful, -rem * but WITHOUT ANY WARRANTY; without even the implied warranty of -rem * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -rem * GNU General Public License for more details. -rem * -rem * You should have received a copy of the GNU General Public License -rem * along with Regshot; if not, write to the Free Software -rem * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -rem * -rem * -rem * make_packages.bat -rem * Batch file for building Regshot with WDK and creating the zip packages -rem ****************************************************************************** - - -SETLOCAL -CD /D %~dp0 - - -rem Check for the help switches -IF /I "%~1" == "help" GOTO SHOWHELP -IF /I "%~1" == "/help" GOTO SHOWHELP -IF /I "%~1" == "-help" GOTO SHOWHELP -IF /I "%~1" == "--help" GOTO SHOWHELP -IF /I "%~1" == "/?" GOTO SHOWHELP - - -rem Check for the first switch -IF "%~1" == "" ( - SET INPUTDIRx86=bin\WDK\Release_Win32 - SET INPUTDIRx64=bin\WDK\Release_x64 - SET SUFFIX=_WDK -) ELSE ( - IF /I "%~1" == "WDK" ( - SET INPUTDIRx86=bin\WDK\Release_Win32 - SET INPUTDIRx64=bin\WDK\Release_x64 - SET SUFFIX=_WDK - GOTO START - ) - IF /I "%~1" == "/WDK" ( - SET INPUTDIRx86=bin\WDK\Release_Win32 - SET INPUTDIRx64=bin\WDK\Release_x64 - SET SUFFIX=_WDK - GOTO START - ) - IF /I "%~1" == "-WDK" ( - SET INPUTDIRx86=bin\WDK\Release_Win32 - SET INPUTDIRx64=bin\WDK\Release_x64 - SET SUFFIX=_WDK - GOTO START - ) - IF /I "%~1" == "--WDK" ( - SET INPUTDIRx86=bin\WDK\Release_Win32 - SET INPUTDIRx64=bin\WDK\Release_x64 - SET SUFFIX=_WDK - GOTO START - ) - IF /I "%~1" == "VS2010" ( - SET INPUTDIRx86=bin\VS2010\Release_Win32 - SET INPUTDIRx64=bin\VS2010\Release_x64 - SET SUFFIX=_VS2010 - GOTO START - ) - IF /I "%~1" == "/VS2010" ( - SET INPUTDIRx86=bin\VS2010\Release_Win32 - SET INPUTDIRx64=bin\VS2010\Release_x64 - SET SUFFIX=_VS2010 - GOTO START - ) - IF /I "%~1" == "-VS2010" ( - SET INPUTDIRx86=bin\VS2010\Release_Win32 - SET INPUTDIRx64=bin\VS2010\Release_x64 - SET SUFFIX=_VS2010 - GOTO START - ) - IF /I "%~1" == "--VS2010" ( - SET INPUTDIRx86=bin\VS2010\Release_Win32 - SET INPUTDIRx64=bin\VS2010\Release_x64 - SET SUFFIX=_VS2010 - GOTO START - ) - IF /I "%~1" == "VS2008" ( - SET INPUTDIRx86=bin\VS2008\Release_Win32 - SET INPUTDIRx64=bin\VS2008\Release_x64 - SET SUFFIX=_VS2008 - GOTO START - ) - IF /I "%~1" == "/VS2008" ( - SET INPUTDIRx86=bin\VS2008\Release_Win32 - SET INPUTDIRx64=bin\VS2008\Release_x64 - SET SUFFIX=_VS2008 - GOTO START - ) - IF /I "%~1" == "-VS2008" ( - SET INPUTDIRx86=bin\VS2008\Release_Win32 - SET INPUTDIRx64=bin\VS2008\Release_x64 - SET SUFFIX=_VS2008 - GOTO START - ) - IF /I "%~1" == "--VS2008" ( - SET INPUTDIRx86=bin\VS2008\Release_Win32 - SET INPUTDIRx64=bin\VS2008\Release_x64 - SET SUFFIX=_VS2008 - GOTO START - ) - IF /I "%~1" == "ICL12" ( - SET INPUTDIRx86=bin\ICL12\Release_Win32 - SET INPUTDIRx64=bin\ICL12\Release_x64 - SET SUFFIX=_ICL12 - GOTO START - ) - IF /I "%~1" == "/ICL12" ( - SET INPUTDIRx86=bin\ICL12\Release_Win32 - SET INPUTDIRx64=bin\ICL12\Release_x64 - SET SUFFIX=_ICL12 - GOTO START - ) - IF /I "%~1" == "-ICL12" ( - SET INPUTDIRx86=bin\ICL12\Release_Win32 - SET INPUTDIRx64=bin\ICL12\Release_x64 - SET SUFFIX=_ICL12 - GOTO START - ) - IF /I "%~1" == "--ICL12" ( - SET INPUTDIRx86=bin\ICL12\Release_Win32 - SET INPUTDIRx64=bin\ICL12\Release_x64 - SET SUFFIX=_ICL12 - GOTO START - ) - IF /I "%~1" == "GCC" ( - SET INPUTDIRx86=bin\GCC\Release_Win32 - SET INPUTDIRx64=bin\GCC\Release_x64 - SET SUFFIX=_GCC - GOTO START - ) - IF /I "%~1" == "/GCC" ( - SET INPUTDIRx86=bin\GCC\Release_Win32 - SET INPUTDIRx64=bin\GCC\Release_x64 - SET SUFFIX=_GCC - GOTO START - ) - IF /I "%~1" == "-GCC" ( - SET INPUTDIRx86=bin\GCC\Release_Win32 - SET INPUTDIRx64=bin\GCC\Release_x64 - SET SUFFIX=_GCC - GOTO START - ) - IF /I "%~1" == "--GCC" ( - SET INPUTDIRx86=bin\GCC\Release_Win32 - SET INPUTDIRx64=bin\GCC\Release_x64 - SET SUFFIX=_GCC - GOTO START - ) - - ECHO. - ECHO Unsupported commandline switch! - ECHO Run "%~nx0 help" for details about the commandline switches. - CALL :SUBMSG "ERROR" "Compilation failed!" -) - - -:START -SET "TEMP_NAME=temp_zip%SUFFIX%" - -IF NOT EXIST "..\%INPUTDIRx86%\Regshot.exe" CALL :SUBMSG "ERROR" "Compile Regshot Win32 first!" -IF NOT EXIST "..\%INPUTDIRx64%\Regshot.exe" CALL :SUBMSG "ERROR" "Compile Regshot x64 first!" - -CALL :SubGetVersion -CALL :SubZipFiles %INPUTDIRx86% Win32 -CALL :SubZipFiles %INPUTDIRx64% x64 - - -:END -TITLE Finished! -ECHO. -ENDLOCAL -PAUSE -EXIT /B - - -:SubZipFiles -TITLE Creating the %2 ZIP file... -CALL :SUBMSG "INFO" "Creating the %2 ZIP file..." - -IF EXIST "%TEMP_NAME%" RD /S /Q "%TEMP_NAME%" -IF NOT EXIST "%TEMP_NAME%" MD "%TEMP_NAME%" - -COPY /Y /V "..\gpl.txt" "%TEMP_NAME%\GPL.txt" -COPY /Y /V "..\files\history.txt" "%TEMP_NAME%\History.txt" -COPY /Y /V "..\files\language.ini" "%TEMP_NAME%\" -COPY /Y /V "..\files\readme.txt" "%TEMP_NAME%\Readme.txt" -COPY /Y /V "..\files\regshot.ini" "%TEMP_NAME%\" -COPY /Y /V "..\%1\Regshot.exe" "%TEMP_NAME%\" - -PUSHD "%TEMP_NAME%" -START "" /B /WAIT "..\..\files\7za.exe" a -tzip -mx=9 "Regshot_%REGSHOTVER%_%2%SUFFIX%.zip" >NUL -IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!" - -CALL :SUBMSG "INFO" "Regshot_%REGSHOTVER%_%2%SUFFIX%.zip created successfully!" - -MOVE /Y "Regshot_%REGSHOTVER%_%2%SUFFIX%.zip" "..\" >NUL -POPD -IF EXIST "%TEMP_NAME%" RD /S /Q "%TEMP_NAME%" -EXIT /B - - -:SubGetVersion -rem Get the version -FOR /F "tokens=3,4 delims= " %%K IN ( - 'FINDSTR /I /L /C:"define REGSHOT_VERSION_MAJOR" "..\src\version.h"') DO ( - SET "VerMajor=%%K"&Call :SubVerMajor %%VerMajor:*Z=%%) -FOR /F "tokens=3,4 delims= " %%L IN ( - 'FINDSTR /I /L /C:"define REGSHOT_VERSION_MINOR" "..\src\version.h"') DO ( - SET "VerMinor=%%L"&Call :SubVerMinor %%VerMinor:*Z=%%) -FOR /F "tokens=3,4 delims= " %%M IN ( - 'FINDSTR /I /L /C:"define REGSHOT_VERSION_PATCH" "..\src\version.h"') DO ( - SET "VerBuild=%%M"&Call :SubVerBuild %%VerBuild:*Z=%%) -FOR /F "tokens=3,4 delims= " %%N IN ( - 'FINDSTR /I /L /C:"define REGSHOT_VERSION_REV" "..\src\version.h"') DO ( - SET "VerRev=%%N"&Call :SubVerRev %%VerRev:*Z=%%) - -SET REGSHOTVER=%VerMajor%.%VerMinor%.%VerBuild% -EXIT /B - - -:SubVerMajor -SET VerMajor=%* -EXIT /B - - -:SubVerMinor -SET VerMinor=%* -EXIT /B - - -:SubVerBuild -SET VerBuild=%* -EXIT /B - - -:SubVerRev -SET VerRev=%* -EXIT /B - - -:SHOWHELP -TITLE "%~nx0 %1" -ECHO. & ECHO. -ECHO Usage: %~nx0 [GCC^|ICL12^|VS2008^|VS2010^|WDK] -ECHO. -ECHO Notes: You can also prefix the commands with "-", "--" or "/". -ECHO The arguments are not case sensitive. -ECHO. & ECHO. -ECHO Executing "%~nx0" will use the defaults: "%~nx0 WDK" -ECHO. -ENDLOCAL -EXIT /B - - -:SUBMSG -ECHO. & ECHO ______________________________ -ECHO [%~1] %~2 -ECHO ______________________________ & ECHO. -IF /I "%~1"=="ERROR" ( - PAUSE - EXIT -) ELSE ( - EXIT /B -) diff --git a/RegShot/build/makefile.mak b/RegShot/build/makefile.mak deleted file mode 100644 index 9f17816..0000000 --- a/RegShot/build/makefile.mak +++ /dev/null @@ -1,160 +0,0 @@ -#****************************************************************************** -#* Copyright 2010-2011 XhmikosR -#* -#* This file is part of Regshot. -#* -#* Regshot is free software; you can redistribute it and/or modify -#* it under the terms of the GNU General Public License as published by -#* the Free Software Foundation; either version 2 of the License, or -#* (at your option) any later version. -#* -#* Regshot is distributed in the hope that it will be useful, -#* but WITHOUT ANY WARRANTY; without even the implied warranty of -#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#* GNU General Public License for more details. -#* -#* You should have received a copy of the GNU General Public License -#* along with Regshot; if not, write to the Free Software -#* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -#* -#* -#* makefile.mak -#* makefile for building Regshot with WDK -#* -#* Use build_wdk.bat and set there your WDK directory. -#****************************************************************************** - - -# Remove the .SILENT directive in order to display all the commands -.SILENT: - - -CC = cl.exe -LD = link.exe -RC = rc.exe - -!IFDEF x64 -BINDIR = ..\bin\WDK\Release_x64 -!ELSE -BINDIR = ..\bin\WDK\Release_Win32 -!ENDIF -OBJDIR = $(BINDIR)\obj -EXE = $(BINDIR)\Regshot.exe -SRC = ..\src -RES = $(SRC)\res - - -DEFINES = /D "_WINDOWS" /D "NDEBUG" /D "_CRT_SECURE_NO_WARNINGS" /D "WDK_BUILD" -CFLAGS = /nologo /c /Fo"$(OBJDIR)/" /W3 /EHsc /MD /O2 /GL /MP $(DEFINES) -LDFLAGS = /NOLOGO /WX /INCREMENTAL:NO /RELEASE /OPT:REF /OPT:ICF /MERGE:.rdata=.text \ - /DYNAMICBASE /NXCOMPAT /LTCG /DEBUG -LIBS = advapi32.lib comdlg32.lib kernel32.lib shell32.lib user32.lib -RFLAGS = /l 0x0409 - - -!IFDEF x64 -CFLAGS = $(CFLAGS) /D "_WIN64" /D "_WIN32_WINNT=0x0502" -LIBS = $(LIBS) msvcrt_win2003.obj -LDFLAGS = $(LDFLAGS) /STACK:67108864 /SUBSYSTEM:WINDOWS,5.02 /MACHINE:X64 -RFLAGS = $(RFLAGS) /d "_WIN64" -!ELSE -CFLAGS = $(CFLAGS) /D "WIN32" /D "_WIN32_WINNT=0x0500" -LIBS = $(LIBS) msvcrt_win2000.obj -LDFLAGS = $(LDFLAGS) /STACK:33554432 /LARGEADDRESSAWARE /SUBSYSTEM:WINDOWS,5.0 /MACHINE:X86 -RFLAGS = $(RFLAGS) /d "WIN32" -!ENDIF - - -############### -## Targets ## -############### -BUILD: CHECKDIRS $(EXE) - -CHECKDIRS: - IF NOT EXIST "$(OBJDIR)" MD "$(OBJDIR)" - -CLEAN: - ECHO Cleaning... & ECHO. - IF EXIST "$(EXE)" DEL "$(EXE)" - IF EXIST "$(OBJDIR)\*.obj" DEL "$(OBJDIR)\*.obj" - IF EXIST "$(OBJDIR)\Regshot.res" DEL "$(OBJDIR)\Regshot.res" - IF EXIST "$(BINDIR)\Regshot.pdb" DEL "$(BINDIR)\Regshot.pdb" - -IF EXIST "$(OBJDIR)" RD /Q "$(OBJDIR)" - -IF EXIST "$(BINDIR)" RD /Q "$(BINDIR)" - -REBUILD: CLEAN BUILD - - -#################### -## Object files ## -#################### -OBJECTS= \ - $(OBJDIR)\fileshot.obj \ - $(OBJDIR)\language.obj \ - $(OBJDIR)\misc.obj \ - $(OBJDIR)\output.obj \ - $(OBJDIR)\regshot.obj \ - $(OBJDIR)\regshot.res \ - $(OBJDIR)\setup.obj \ - $(OBJDIR)\ui.obj \ - $(OBJDIR)\winmain.obj - - -################## -## Batch rule ## -################## -{$(SRC)}.c{$(OBJDIR)}.obj:: - $(CC) $(CFLAGS) /Tc $< - - -################ -## Commands ## -################ -$(EXE): $(OBJECTS) - $(RC) $(RFLAGS) /fo"$(OBJDIR)\regshot.res" "$(SRC)\regshot.rc" >NUL - $(LD) $(LDFLAGS) $(LIBS) $(OBJECTS) /OUT:"$(EXE)" - - -#################### -## Dependencies ## -#################### -$(OBJDIR)\fileshot.obj: \ - $(SRC)\fileshot.c \ - $(SRC)\global.h - -$(OBJDIR)\language.obj: \ - $(SRC)\language.c \ - $(SRC)\global.h - -$(OBJDIR)\misc.obj: \ - $(SRC)\misc.c \ - $(SRC)\global.h - -$(OBJDIR)\output.obj: \ - $(SRC)\output.c \ - $(SRC)\global.h - -$(OBJDIR)\regshot.obj: \ - $(SRC)\regshot.c \ - $(SRC)\global.h \ - $(SRC)\version.h - -$(OBJDIR)\regshot.res: \ - $(SRC)\regshot.rc \ - $(SRC)\resource.h \ - $(RES)\Regshot.exe.manifest \ - $(RES)\regshot.ico \ - $(SRC)\version.h - -$(OBJDIR)\setup.obj: \ - $(SRC)\setup.c \ - $(SRC)\global.h - -$(OBJDIR)\ui.obj: \ - $(SRC)\ui.c \ - $(SRC)\global.h - -$(OBJDIR)\winmain.obj: \ - $(SRC)\winmain.c \ - $(SRC)\global.h \ - $(SRC)\version.h diff --git a/RegShot/build/regshot_icl12.sln b/RegShot/build/regshot_icl12.sln deleted file mode 100644 index a8d4eb3..0000000 --- a/RegShot/build/regshot_icl12.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "regshot", "regshot_icl12.vcxproj", "{4C971282-E758-4BA4-B2EF-905613EAADD8}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4C971282-E758-4BA4-B2EF-905613EAADD8}.Debug|Win32.ActiveCfg = Debug|Win32 - {4C971282-E758-4BA4-B2EF-905613EAADD8}.Debug|Win32.Build.0 = Debug|Win32 - {4C971282-E758-4BA4-B2EF-905613EAADD8}.Debug|x64.ActiveCfg = Debug|x64 - {4C971282-E758-4BA4-B2EF-905613EAADD8}.Debug|x64.Build.0 = Debug|x64 - {4C971282-E758-4BA4-B2EF-905613EAADD8}.Release|Win32.ActiveCfg = Release|Win32 - {4C971282-E758-4BA4-B2EF-905613EAADD8}.Release|Win32.Build.0 = Release|Win32 - {4C971282-E758-4BA4-B2EF-905613EAADD8}.Release|x64.ActiveCfg = Release|x64 - {4C971282-E758-4BA4-B2EF-905613EAADD8}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/RegShot/build/regshot_icl12.vcxproj b/RegShot/build/regshot_icl12.vcxproj deleted file mode 100644 index a1921cf..0000000 --- a/RegShot/build/regshot_icl12.vcxproj +++ /dev/null @@ -1,224 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|x64"> - <Configuration>Debug</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|x64"> - <Configuration>Release</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - </ItemGroup> - <PropertyGroup Label="Globals"> - <ProjectGuid>{4C971282-E758-4BA4-B2EF-905613EAADD8}</ProjectGuid> - <Keyword>Win32Proj</Keyword> - <RootNamespace>regshot</RootNamespace> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>true</UseDebugLibraries> - <CharacterSet>MultiByte</CharacterSet> - <PlatformToolset>Intel C++ Compiler 12.1</PlatformToolset> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>true</UseDebugLibraries> - <CharacterSet>MultiByte</CharacterSet> - <PlatformToolset>Intel C++ Compiler 12.1</PlatformToolset> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>MultiByte</CharacterSet> - <PlatformToolset>Intel C++ Compiler 12.1</PlatformToolset> - <InterproceduralOptimization>true</InterproceduralOptimization> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>MultiByte</CharacterSet> - <PlatformToolset>Intel C++ Compiler 12.1</PlatformToolset> - <InterproceduralOptimization>true</InterproceduralOptimization> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <ImportGroup Label="ExtensionSettings"> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <LinkIncremental>true</LinkIncremental> - <OutDir>..\bin\ICL12\$(Configuration)_$(Platform)\</OutDir> - <IntDir>..\bin\ICL12\$(Configuration)_$(Platform)\obj\</IntDir> - <TargetName>Regshot</TargetName> - <GenerateManifest>false</GenerateManifest> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <LinkIncremental>true</LinkIncremental> - <OutDir>..\bin\ICL12\$(Configuration)_$(Platform)\</OutDir> - <IntDir>..\bin\ICL12\$(Configuration)_$(Platform)\obj\</IntDir> - <TargetName>Regshot</TargetName> - <GenerateManifest>false</GenerateManifest> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <LinkIncremental>false</LinkIncremental> - <OutDir>..\bin\ICL12\$(Configuration)_$(Platform)\</OutDir> - <IntDir>..\bin\ICL12\$(Configuration)_$(Platform)\obj\</IntDir> - <TargetName>Regshot</TargetName> - <GenerateManifest>false</GenerateManifest> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <LinkIncremental>false</LinkIncremental> - <OutDir>..\bin\ICL12\$(Configuration)_$(Platform)\</OutDir> - <IntDir>..\bin\ICL12\$(Configuration)_$(Platform)\obj\</IntDir> - <TargetName>Regshot</TargetName> - <GenerateManifest>false</GenerateManifest> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <WarningLevel>Level3</WarningLevel> - <Optimization>Disabled</Optimization> - <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS</PreprocessorDefinitions> - <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> - <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> - </ClCompile> - <Link> - <SubSystem>Windows</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <StackReserveSize>33554432</StackReserveSize> - </Link> - <ResourceCompile> - <PreprocessorDefinitions>WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <SuppressStartupBanner>true</SuppressStartupBanner> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ClCompile> - <WarningLevel>Level3</WarningLevel> - <Optimization>Disabled</Optimization> - <PreprocessorDefinitions>_WIN64;_DEBUG;_WINDOWS</PreprocessorDefinitions> - <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> - <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> - </ClCompile> - <Link> - <SubSystem>Windows</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <StackReserveSize>67108864</StackReserveSize> - </Link> - <ResourceCompile> - <PreprocessorDefinitions>_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <SuppressStartupBanner>true</SuppressStartupBanner> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <WarningLevel>Level3</WarningLevel> - <Optimization>MaxSpeedHighLevel</Optimization> - <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions> - <MultiProcessorCompilation>true</MultiProcessorCompilation> - <RuntimeLibrary>MultiThreaded</RuntimeLibrary> - <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> - <StringPooling>true</StringPooling> - <FunctionLevelLinking>true</FunctionLevelLinking> - <FloatingPointModel>Fast</FloatingPointModel> - <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> - <IntrinsicFunctions>true</IntrinsicFunctions> - <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> - </ClCompile> - <Link> - <SubSystem>Windows</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - <LargeAddressAware>true</LargeAddressAware> - <MergeSections>.rdata=.text</MergeSections> - <SetChecksum>true</SetChecksum> - <WPOAsmListLocation>$(IntDir)</WPOAsmListLocation> - <WPOObjectFile>$(IntDir)</WPOObjectFile> - <StackReserveSize>33554432</StackReserveSize> - </Link> - <ResourceCompile> - <PreprocessorDefinitions>WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <SuppressStartupBanner>true</SuppressStartupBanner> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <WarningLevel>Level3</WarningLevel> - <Optimization>MaxSpeedHighLevel</Optimization> - <PreprocessorDefinitions>_WIN64;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions> - <MultiProcessorCompilation>true</MultiProcessorCompilation> - <RuntimeLibrary>MultiThreaded</RuntimeLibrary> - <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> - <StringPooling>true</StringPooling> - <FunctionLevelLinking>true</FunctionLevelLinking> - <FloatingPointModel>Fast</FloatingPointModel> - <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> - <IntrinsicFunctions>true</IntrinsicFunctions> - <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> - </ClCompile> - <Link> - <SubSystem>Windows</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - <MergeSections>.rdata=.text</MergeSections> - <SetChecksum>true</SetChecksum> - <WPOAsmListLocation>$(IntDir)</WPOAsmListLocation> - <WPOObjectFile>$(IntDir)</WPOObjectFile> - <StackReserveSize>67108864</StackReserveSize> - </Link> - <ResourceCompile> - <PreprocessorDefinitions>_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <SuppressStartupBanner>true</SuppressStartupBanner> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemGroup> - <ClInclude Include="..\src\global.h" /> - <ClInclude Include="..\src\resource.h" /> - </ItemGroup> - <ItemGroup> - <None Include="..\src\res\regshot.ico" /> - </ItemGroup> - <ItemGroup> - <ResourceCompile Include="..\src\regshot.rc" /> - </ItemGroup> - <ItemGroup> - <ClCompile Include="..\src\fileshot.c" /> - <ClCompile Include="..\src\language.c" /> - <ClCompile Include="..\src\misc.c" /> - <ClCompile Include="..\src\output.c" /> - <ClCompile Include="..\src\regshot.c" /> - <ClCompile Include="..\src\setup.c" /> - <ClCompile Include="..\src\ui.c" /> - <ClCompile Include="..\src\winmain.c" /> - </ItemGroup> - <ItemGroup> - <Manifest Include="..\src\res\RegShot.exe.manifest" /> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> - <ImportGroup Label="ExtensionTargets"> - </ImportGroup> -</Project> \ No newline at end of file diff --git a/RegShot/build/regshot_icl12.vcxproj.filters b/RegShot/build/regshot_icl12.vcxproj.filters deleted file mode 100644 index 273ba69..0000000 --- a/RegShot/build/regshot_icl12.vcxproj.filters +++ /dev/null @@ -1,66 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup> - <Filter Include="Source Files"> - <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> - <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> - </Filter> - <Filter Include="Header Files"> - <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> - <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> - </Filter> - <Filter Include="Resource Files"> - <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> - <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> - </Filter> - </ItemGroup> - <ItemGroup> - <ClInclude Include="..\src\global.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\src\resource.h"> - <Filter>Header Files</Filter> - </ClInclude> - </ItemGroup> - <ItemGroup> - <None Include="..\src\res\regshot.ico"> - <Filter>Resource Files</Filter> - </None> - </ItemGroup> - <ItemGroup> - <ResourceCompile Include="..\src\regshot.rc"> - <Filter>Resource Files</Filter> - </ResourceCompile> - </ItemGroup> - <ItemGroup> - <ClCompile Include="..\src\fileshot.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\src\language.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\src\misc.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\src\output.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\src\regshot.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\src\setup.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\src\ui.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\src\winmain.c"> - <Filter>Source Files</Filter> - </ClCompile> - </ItemGroup> - <ItemGroup> - <Manifest Include="..\src\res\RegShot.exe.manifest"> - <Filter>Resource Files</Filter> - </Manifest> - </ItemGroup> -</Project> \ No newline at end of file diff --git a/RegShot/build/regshot_vs2008.sln b/RegShot/build/regshot_vs2008.sln deleted file mode 100644 index 3812fa3..0000000 --- a/RegShot/build/regshot_vs2008.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Regshot", "regshot_vs2008.vcproj", "{A7D5D156-E803-459D-B768-7EBBC5D09DC6}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A7D5D156-E803-459D-B768-7EBBC5D09DC6}.Debug|Win32.ActiveCfg = Debug|Win32 - {A7D5D156-E803-459D-B768-7EBBC5D09DC6}.Debug|Win32.Build.0 = Debug|Win32 - {A7D5D156-E803-459D-B768-7EBBC5D09DC6}.Debug|x64.ActiveCfg = Debug|x64 - {A7D5D156-E803-459D-B768-7EBBC5D09DC6}.Debug|x64.Build.0 = Debug|x64 - {A7D5D156-E803-459D-B768-7EBBC5D09DC6}.Release|Win32.ActiveCfg = Release|Win32 - {A7D5D156-E803-459D-B768-7EBBC5D09DC6}.Release|Win32.Build.0 = Release|Win32 - {A7D5D156-E803-459D-B768-7EBBC5D09DC6}.Release|x64.ActiveCfg = Release|x64 - {A7D5D156-E803-459D-B768-7EBBC5D09DC6}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/RegShot/build/regshot_vs2008.vcproj b/RegShot/build/regshot_vs2008.vcproj deleted file mode 100644 index 24f3be3..0000000 --- a/RegShot/build/regshot_vs2008.vcproj +++ /dev/null @@ -1,440 +0,0 @@ -<?xml version="1.0" encoding="windows-1253"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9,00" - Name="Regshot" - ProjectGUID="{A7D5D156-E803-459D-B768-7EBBC5D09DC6}" - RootNamespace="Regshot" - Keyword="Win32Proj" - TargetFrameworkVersion="196613" - > - <Platforms> - <Platform - Name="Win32" - /> - <Platform - Name="x64" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="..\bin\VS2008\$(ConfigurationName)_$(PlatformName)\" - IntermediateDirectory="..\bin\VS2008\$(ConfigurationName)_$(PlatformName)\obj\" - ConfigurationType="1" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - WarningLevel="3" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="WIN32" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - LinkIncremental="2" - GenerateManifest="false" - GenerateDebugInformation="true" - SubSystem="2" - StackCommitSize="33554432" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Debug|x64" - OutputDirectory="..\bin\VS2008\$(ConfigurationName)_$(PlatformName)\" - IntermediateDirectory="..\bin\VS2008\$(ConfigurationName)_$(PlatformName)\obj\" - ConfigurationType="1" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TargetEnvironment="3" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - WarningLevel="3" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_WIN64" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - LinkIncremental="2" - GenerateManifest="false" - GenerateDebugInformation="true" - SubSystem="2" - StackCommitSize="67108864" - TargetMachine="17" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="..\bin\VS2008\$(ConfigurationName)_$(PlatformName)\" - IntermediateDirectory="..\bin\VS2008\$(ConfigurationName)_$(PlatformName)\obj\" - ConfigurationType="1" - CharacterSet="2" - WholeProgramOptimization="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - AdditionalOptions="/MP" - Optimization="2" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS" - RuntimeLibrary="0" - WarningLevel="3" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="WIN32" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - LinkIncremental="1" - GenerateManifest="false" - GenerateDebugInformation="true" - SubSystem="2" - StackCommitSize="33554432" - OptimizeReferences="2" - EnableCOMDATFolding="2" - LargeAddressAware="2" - SetChecksum="true" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|x64" - OutputDirectory="..\bin\VS2008\$(ConfigurationName)_$(PlatformName)\" - IntermediateDirectory="..\bin\VS2008\$(ConfigurationName)_$(PlatformName)\obj\" - ConfigurationType="1" - CharacterSet="2" - WholeProgramOptimization="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TargetEnvironment="3" - /> - <Tool - Name="VCCLCompilerTool" - AdditionalOptions="/MP" - Optimization="2" - PreprocessorDefinitions="_WIN64;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS" - RuntimeLibrary="0" - WarningLevel="3" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_WIN64" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - LinkIncremental="1" - GenerateManifest="false" - GenerateDebugInformation="true" - SubSystem="2" - StackCommitSize="67108864" - OptimizeReferences="2" - EnableCOMDATFolding="2" - SetChecksum="true" - TargetMachine="17" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath="..\src\fileshot.c" - > - </File> - <File - RelativePath="..\src\language.c" - > - </File> - <File - RelativePath="..\src\misc.c" - > - </File> - <File - RelativePath="..\src\output.c" - > - </File> - <File - RelativePath="..\src\regshot.c" - > - </File> - <File - RelativePath="..\src\setup.c" - > - </File> - <File - RelativePath="..\src\ui.c" - > - </File> - <File - RelativePath="..\src\winmain.c" - > - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - <File - RelativePath="..\src\global.h" - > - </File> - <File - RelativePath="..\src\resource.h" - > - </File> - <File - RelativePath="..\src\version.h" - > - </File> - </Filter> - <Filter - Name="Resource Files" - Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" - UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" - > - <File - RelativePath="..\src\res\Regshot.exe.manifest" - > - <FileConfiguration - Name="Debug|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCustomBuildTool" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|x64" - ExcludedFromBuild="true" - > - <Tool - Name="VCCustomBuildTool" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCustomBuildTool" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|x64" - ExcludedFromBuild="true" - > - <Tool - Name="VCCustomBuildTool" - /> - </FileConfiguration> - </File> - <File - RelativePath="..\src\res\regshot.ico" - > - </File> - <File - RelativePath="..\src\regshot.rc" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/RegShot/build/regshot_vs2010.sln b/RegShot/build/regshot_vs2010.sln deleted file mode 100644 index b731cda..0000000 --- a/RegShot/build/regshot_vs2010.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Regshot", "regshot_vs2010.vcxproj", "{4C971282-E758-4BA4-B2EF-905613EAADD8}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4C971282-E758-4BA4-B2EF-905613EAADD8}.Debug|Win32.ActiveCfg = Debug|Win32 - {4C971282-E758-4BA4-B2EF-905613EAADD8}.Debug|Win32.Build.0 = Debug|Win32 - {4C971282-E758-4BA4-B2EF-905613EAADD8}.Debug|x64.ActiveCfg = Debug|x64 - {4C971282-E758-4BA4-B2EF-905613EAADD8}.Debug|x64.Build.0 = Debug|x64 - {4C971282-E758-4BA4-B2EF-905613EAADD8}.Release|Win32.ActiveCfg = Release|Win32 - {4C971282-E758-4BA4-B2EF-905613EAADD8}.Release|Win32.Build.0 = Release|Win32 - {4C971282-E758-4BA4-B2EF-905613EAADD8}.Release|x64.ActiveCfg = Release|x64 - {4C971282-E758-4BA4-B2EF-905613EAADD8}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/RegShot/build/regshot_vs2010.vcxproj b/RegShot/build/regshot_vs2010.vcxproj deleted file mode 100644 index 3a7bb40..0000000 --- a/RegShot/build/regshot_vs2010.vcxproj +++ /dev/null @@ -1,203 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|x64"> - <Configuration>Debug</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|x64"> - <Configuration>Release</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - </ItemGroup> - <PropertyGroup Label="Globals"> - <ProjectGuid>{4C971282-E758-4BA4-B2EF-905613EAADD8}</ProjectGuid> - <Keyword>Win32Proj</Keyword> - <RootNamespace>Regshot</RootNamespace> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>true</UseDebugLibraries> - <CharacterSet>MultiByte</CharacterSet> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>true</UseDebugLibraries> - <CharacterSet>MultiByte</CharacterSet> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>MultiByte</CharacterSet> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>MultiByte</CharacterSet> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <ImportGroup Label="ExtensionSettings"> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <LinkIncremental>true</LinkIncremental> - <OutDir>..\bin\VS2010\$(Configuration)_$(Platform)\</OutDir> - <IntDir>..\bin\VS2010\$(Configuration)_$(Platform)\obj\</IntDir> - <TargetName>Regshot</TargetName> - <GenerateManifest>false</GenerateManifest> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <LinkIncremental>true</LinkIncremental> - <OutDir>..\bin\VS2010\$(Configuration)_$(Platform)\</OutDir> - <IntDir>..\bin\VS2010\$(Configuration)_$(Platform)\obj\</IntDir> - <TargetName>Regshot</TargetName> - <GenerateManifest>false</GenerateManifest> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <LinkIncremental>false</LinkIncremental> - <OutDir>..\bin\VS2010\$(Configuration)_$(Platform)\</OutDir> - <IntDir>..\bin\VS2010\$(Configuration)_$(Platform)\obj\</IntDir> - <TargetName>Regshot</TargetName> - <GenerateManifest>false</GenerateManifest> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <LinkIncremental>false</LinkIncremental> - <OutDir>..\bin\VS2010\$(Configuration)_$(Platform)\</OutDir> - <IntDir>..\bin\VS2010\$(Configuration)_$(Platform)\obj\</IntDir> - <TargetName>Regshot</TargetName> - <GenerateManifest>false</GenerateManifest> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <WarningLevel>Level4</WarningLevel> - <Optimization>Disabled</Optimization> - <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions> - <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> - <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> - <MultiProcessorCompilation>true</MultiProcessorCompilation> - <MinimalRebuild>false</MinimalRebuild> - </ClCompile> - <Link> - <SubSystem>Windows</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <StackReserveSize>33554432</StackReserveSize> - </Link> - <ResourceCompile> - <PreprocessorDefinitions>WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ClCompile> - <WarningLevel>Level4</WarningLevel> - <Optimization>Disabled</Optimization> - <PreprocessorDefinitions>_WIN64;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions> - <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> - <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> - <MultiProcessorCompilation>true</MultiProcessorCompilation> - <MinimalRebuild>false</MinimalRebuild> - </ClCompile> - <Link> - <SubSystem>Windows</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <StackReserveSize>67108864</StackReserveSize> - </Link> - <ResourceCompile> - <PreprocessorDefinitions>_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <WarningLevel>Level3</WarningLevel> - <Optimization>MaxSpeed</Optimization> - <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions> - <MultiProcessorCompilation>true</MultiProcessorCompilation> - <RuntimeLibrary>MultiThreaded</RuntimeLibrary> - <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> - </ClCompile> - <Link> - <SubSystem>Windows</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - <LargeAddressAware>true</LargeAddressAware> - <MergeSections>.rdata=.text</MergeSections> - <SetChecksum>true</SetChecksum> - <StackReserveSize>33554432</StackReserveSize> - </Link> - <ResourceCompile> - <PreprocessorDefinitions>WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <WarningLevel>Level3</WarningLevel> - <Optimization>MaxSpeed</Optimization> - <PreprocessorDefinitions>_WIN64;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions> - <MultiProcessorCompilation>true</MultiProcessorCompilation> - <RuntimeLibrary>MultiThreaded</RuntimeLibrary> - <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> - </ClCompile> - <Link> - <SubSystem>Windows</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - <MergeSections>.rdata=.text</MergeSections> - <SetChecksum>true</SetChecksum> - <StackReserveSize>67108864</StackReserveSize> - </Link> - <ResourceCompile> - <PreprocessorDefinitions>_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemGroup> - <ClInclude Include="..\src\global.h" /> - <ClInclude Include="..\src\resource.h" /> - <ClInclude Include="..\src\version.h" /> - </ItemGroup> - <ItemGroup> - <None Include="..\src\res\regshot.ico" /> - </ItemGroup> - <ItemGroup> - <ResourceCompile Include="..\src\regshot.rc" /> - </ItemGroup> - <ItemGroup> - <ClCompile Include="..\src\fileshot.c" /> - <ClCompile Include="..\src\language.c" /> - <ClCompile Include="..\src\misc.c" /> - <ClCompile Include="..\src\output.c" /> - <ClCompile Include="..\src\regshot.c" /> - <ClCompile Include="..\src\setup.c" /> - <ClCompile Include="..\src\ui.c" /> - <ClCompile Include="..\src\winmain.c" /> - </ItemGroup> - <ItemGroup> - <Manifest Include="..\src\res\Regshot.exe.manifest" /> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> - <ImportGroup Label="ExtensionTargets"> - </ImportGroup> -</Project> \ No newline at end of file diff --git a/RegShot/build/regshot_vs2010.vcxproj.filters b/RegShot/build/regshot_vs2010.vcxproj.filters deleted file mode 100644 index c0bba02..0000000 --- a/RegShot/build/regshot_vs2010.vcxproj.filters +++ /dev/null @@ -1,69 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup> - <Filter Include="Source Files"> - <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> - <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> - </Filter> - <Filter Include="Header Files"> - <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> - <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> - </Filter> - <Filter Include="Resource Files"> - <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> - <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> - </Filter> - </ItemGroup> - <ItemGroup> - <ClInclude Include="..\src\global.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\src\resource.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\src\version.h"> - <Filter>Header Files</Filter> - </ClInclude> - </ItemGroup> - <ItemGroup> - <None Include="..\src\res\regshot.ico"> - <Filter>Resource Files</Filter> - </None> - </ItemGroup> - <ItemGroup> - <ResourceCompile Include="..\src\regshot.rc"> - <Filter>Resource Files</Filter> - </ResourceCompile> - </ItemGroup> - <ItemGroup> - <ClCompile Include="..\src\fileshot.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\src\language.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\src\misc.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\src\output.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\src\regshot.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\src\setup.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\src\ui.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\src\winmain.c"> - <Filter>Source Files</Filter> - </ClCompile> - </ItemGroup> - <ItemGroup> - <Manifest Include="..\src\res\Regshot.exe.manifest"> - <Filter>Resource Files</Filter> - </Manifest> - </ItemGroup> -</Project> \ No newline at end of file diff --git a/RegShot/src/182to183/align.c b/RegShot/src/182to183/align.c deleted file mode 100644 index 44e4fcd..0000000 --- a/RegShot/src/182to183/align.c +++ /dev/null @@ -1,123 +0,0 @@ -/* - Copyright 2011 Regshot Team - - Regshot is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Regshot is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Regshot; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "global.h" - -//-------------------------------------------------- -// Realign key & value content after loading from hive file -//-------------------------------------------------- -VOID ReAlignReg(LPKEYCONTENT lpKey, size_t nBase) -{ - LPVALUECONTENT lpv; - - if (lpKey->lpkeyname != NULL) { - lpKey->lpkeyname += nBase; - } - if (lpKey->lpfirstvalue != NULL) { - lpKey->lpfirstvalue = (LPVALUECONTENT)((LPBYTE)lpKey->lpfirstvalue + nBase); - } - if (lpKey->lpfirstsubkey != NULL) { - lpKey->lpfirstsubkey = (LPKEYCONTENT)((LPBYTE)lpKey->lpfirstsubkey + nBase); - } - if (lpKey->lpbrotherkey != NULL) { - lpKey->lpbrotherkey = (LPKEYCONTENT)((LPBYTE)lpKey->lpbrotherkey + nBase); - } - if (lpKey->lpfatherkey != NULL) { - lpKey->lpfatherkey = (LPKEYCONTENT)((LPBYTE)lpKey->lpfatherkey + nBase); - } - - - for (lpv = lpKey->lpfirstvalue; lpv != NULL; lpv = lpv->lpnextvalue) { - - if (lpv->lpvaluename != NULL) { - lpv->lpvaluename += nBase; - } - if (lpv->lpvaluedata != NULL) { - lpv->lpvaluedata += nBase; - } - if (lpv->lpnextvalue != NULL) { - lpv->lpnextvalue = (LPVALUECONTENT)((LPBYTE)lpv->lpnextvalue + nBase); - } - if (lpv->lpfatherkey != NULL) { - lpv->lpfatherkey = (LPKEYCONTENT)((LPBYTE)lpv->lpfatherkey + nBase); - } - - } - - if (lpKey->lpfirstsubkey != NULL) { - ReAlignReg(lpKey->lpfirstsubkey, nBase); - } - - if (lpKey->lpbrotherkey != NULL) { - ReAlignReg(lpKey->lpbrotherkey, nBase); - } -} - - -//-------------------------------------------------- -// Realign filecontent, called by ReAlignFile() -//-------------------------------------------------- -VOID ReAlignFileContent(LPFILECONTENT lpFC, size_t nBase) -{ - - if (lpFC->lpfilename != NULL) { - lpFC->lpfilename += nBase; - } - if (lpFC->lpfirstsubfile != NULL) { - lpFC->lpfirstsubfile = (LPFILECONTENT)((LPBYTE)lpFC->lpfirstsubfile + nBase); - } - if (lpFC->lpbrotherfile != NULL) { - lpFC->lpbrotherfile = (LPFILECONTENT)((LPBYTE)lpFC->lpbrotherfile + nBase); - } - if (lpFC->lpfatherfile != NULL) { - lpFC->lpfatherfile = (LPFILECONTENT)((LPBYTE)lpFC->lpfatherfile + nBase); - } - - - if (lpFC->lpfirstsubfile != NULL) { - ReAlignFileContent(lpFC->lpfirstsubfile, nBase); - } - - if (lpFC->lpbrotherfile != NULL) { - ReAlignFileContent(lpFC->lpbrotherfile, nBase); - } - -} - - -//-------------------------------------------------- -// Realign file, walk through chain -//-------------------------------------------------- -VOID ReAlignFile(LPHEADFILE lpHF, size_t nBase) -{ - LPHEADFILE lphf; - - for (lphf = lpHF; lphf != NULL; lphf = lphf->lpnextheadfile) { - - if (lphf->lpnextheadfile != NULL) { - lphf->lpnextheadfile = (LPHEADFILE)((LPBYTE)lphf->lpnextheadfile + nBase); - } - if (lphf->lpfilecontent != NULL) { - lphf->lpfilecontent = (LPFILECONTENT)((LPBYTE)lphf->lpfilecontent + nBase); - } - - if (lphf->lpfilecontent != NULL) { // I wouldn't find crash bug(loadhive->readfile) in 1.8.0 if I had added it in that version - ReAlignFileContent(lphf->lpfilecontent, nBase); - } - } -} diff --git a/RegShot/src/182to183/global.h b/RegShot/src/182to183/global.h deleted file mode 100644 index 80ec9d6..0000000 --- a/RegShot/src/182to183/global.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - Copyright 2011 Regshot Team - - Regshot is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Regshot is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Regshot; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include <windows.h> -#include <stdio.h> -#include <shlobj.h> - -#define REGSHOT_HIVE_SIGNATURE_182 "REGSHOTHIVE" -#define REGSHOT_HIVE_SIGNATURE "RSHIVE183" - -#define HIVEBEGINOFFSET 512 // Hive file out put header computerlen*2+sizeof(systemtime)+32 must <hivebeginoffset!!!!!!!!!!!!!! - -#ifdef USEHEAPALLOC_DANGER - -// MSDN doc say use HEAP_NO_SERIALIZE is not good for process heap :( so change fromm 1 to 0 20111216 ,slower than using 1 -#define MYALLOC(x) HeapAlloc(hHeap,0,x) -#define MYALLOC0(x) HeapAlloc(hHeap,8,x) // HEAP_NO_SERIALIZE|HEAP_ZERO_MEMORY ,1|8 -#define MYFREE(x) HeapFree(hHeap,0,x) - -#else - -#define MYALLOC(x) GlobalAlloc(GMEM_FIXED,x) -#define MYALLOC0(x) GlobalAlloc(GPTR,x) -#define MYFREE(x) GlobalFree(x) - -#endif - -// Struct for hive version <=1.8.2 -// Struct used for Windows Registry Key -struct _KEYCONTENT { - LPSTR lpkeyname; // Pointer to key's name - struct _VALUECONTENT FAR *lpfirstvalue; // Pointer to key's first value - struct _KEYCONTENT FAR *lpfirstsubkey; // Pointer to key's first subkey - struct _KEYCONTENT FAR *lpbrotherkey; // Pointer to key's brother - struct _KEYCONTENT FAR *lpfatherkey; // Pointer to key's father - BYTE bkeymatch; // Flag used at comparing, 1.8.2<= is byte - -}; -typedef struct _KEYCONTENT KEYCONTENT, FAR *LPKEYCONTENT; - - -// Struct used for Windows Registry Value -struct _VALUECONTENT { - DWORD typecode; // Type of value [DWORD,STRING...] - DWORD datasize; // Value data size in bytes - LPSTR lpvaluename; // Pointer to value name - LPBYTE lpvaluedata; // Pointer to value data - struct _VALUECONTENT FAR *lpnextvalue; // Pointer to value's brother - struct _KEYCONTENT FAR *lpfatherkey; // Pointer to value's father[Key] - BYTE bvaluematch; // Flag used at comparing, 1.8.2<= is byte -}; -typedef struct _VALUECONTENT VALUECONTENT, FAR *LPVALUECONTENT; - - -// Struct used for Windows File System -struct _FILECONTENT { - LPSTR lpfilename; // Pointer to filename - DWORD writetimelow; // File write time [LOW DWORD] - DWORD writetimehigh; // File write time [HIGH DWORD] - DWORD filesizelow; // File size [LOW DWORD] - DWORD filesizehigh; // File size [HIGH DWORD] - DWORD fileattr; // File attributes - DWORD cksum; // File checksum(plan to add in 1.8 not used now) - struct _FILECONTENT FAR *lpfirstsubfile; // Pointer to files[DIRS] first sub file - struct _FILECONTENT FAR *lpbrotherfile; // Pointer to files[DIRS] brother - struct _FILECONTENT FAR *lpfatherfile; // Pointer to files father - BYTE bfilematch; // Flag used at comparing, 1.8.2<= is byte -}; -typedef struct _FILECONTENT FILECONTENT, FAR *LPFILECONTENT; - - -// Adjusted for filecontent saving. 1.8 -struct _HEADFILE { - struct _HEADFILE FAR *lpnextheadfile; // Pointer to next headfile struc - LPFILECONTENT lpfilecontent; // Pointer to filecontent -}; -typedef struct _HEADFILE HEADFILE, FAR *LPHEADFILE; - -// Pointers to Registry Key -LPKEYCONTENT lpHeadLocalMachine; // Pointer to HKEY_LOCAL_MACHINE 1 -LPKEYCONTENT lpHeadUsers; // Pointer to HKEY_USERS 1 -LPHEADFILE lpHeadFile; // Pointer to headfile -LPBYTE lpTempHive; // Pointer for loading hive files -HANDLE hFileWholeReg; -DWORD NBW; - -//----------------- struct for saving designed by maddes ------------------------ - -struct _SAVEKEYCONTENT { - DWORD fpos_keyname; // Pointer to key's name - DWORD fpos_firstvalue; // Pointer to key's first value - DWORD fpos_firstsubkey; // Pointer to key's first subkey - DWORD fpos_brotherkey; // Pointer to key's brother - DWORD fpos_fatherkey; // Pointer to key's father - DWORD bkeymatch; // Flag used at comparing, 1.8.2 <= is byte - -}; -typedef struct _SAVEKEYCONTENT SAVEKEYCONTENT, FAR *LPSAVEKEYCONTENT; - - -// Struct used for Windows Registry Value -struct _SAVEVALUECONTENT { - DWORD typecode; // Type of value [DWORD,STRING...] - DWORD datasize; // Value data size in bytes - DWORD fpos_valuename; // Pointer to value name - DWORD fpos_valuedata; // Pointer to value data - DWORD fpos_nextvalue; // Pointer to value's brother - DWORD fpos_fatherkey; // Pointer to value's father[Key] - DWORD bvaluematch; // Flag used at comparing, 1.8.2 <= is byte -}; -typedef struct _SAVEVALUECONTENT SAVEVALUECONTENT, FAR *LPSAVEVALUECONTENT; - - -// Struct used for Windows File System -struct _SAVEFILECONTENT { - DWORD fpos_filename; // Pointer to filename - DWORD writetimelow; // File write time [LOW DWORD] - DWORD writetimehigh; // File write time [HIGH DWORD] - DWORD filesizelow; // File size [LOW DWORD] - DWORD filesizehigh; // File size [HIGH DWORD] - DWORD fileattr; // File attributes - DWORD cksum; // File checksum(plan to add in 1.8 not used now) - DWORD fpos_firstsubfile; // Pointer to files[DIRS] first sub file - DWORD fpos_brotherfile; // Pointer to files[DIRS] brother - DWORD fpos_fatherfile; // Pointer to files father - DWORD bfilematch; // Flag used at comparing, 1.8.2 <= is byte -}; -typedef struct _SAVEFILECONTENT SAVEFILECONTENT, FAR *LPSAVEFILECONTENT; - - -// Adjusted for filecontent saving. 1.8 -struct _SAVEHEADFILE { - DWORD fpos_nextheadfile; // Pointer to next headfile struc - DWORD fpos_filecontent; // Pointer to filecontent -}; -typedef struct _SAVEHEADFILE SAVEHEADFILE, FAR *LPSAVEHEADFILE; - - -VOID ReAlignReg(LPKEYCONTENT lpKey, size_t nBase); -VOID ReAlignFileContent(LPFILECONTENT lpFC, size_t nBase); -VOID ReAlignFile(LPHEADFILE lpHF, size_t nBase); -BOOL LoadHive(LPCSTR lpFileName, LPKEYCONTENT FAR *lplpKeyHLM, LPKEYCONTENT FAR *lplpKeyUSER, LPHEADFILE FAR *lplpHeadFile); -BOOL SaveHive(LPCSTR lpFileName, LPKEYCONTENT lpKeyHLM, LPKEYCONTENT lpKeyUSER, LPHEADFILE lpHF); diff --git a/RegShot/src/182to183/loadsave.c b/RegShot/src/182to183/loadsave.c deleted file mode 100644 index 0e02450..0000000 --- a/RegShot/src/182to183/loadsave.c +++ /dev/null @@ -1,359 +0,0 @@ -/* - Copyright 2011 Regshot Team - - Regshot is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Regshot is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Regshot; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "global.h" - -char str_RegshotHiveSignature182[] = REGSHOT_HIVE_SIGNATURE_182; -char str_RegshotHiveSignature183[] = REGSHOT_HIVE_SIGNATURE; -LPBYTE lpOldHiveHeader; - -SAVEKEYCONTENT skc; -SAVEVALUECONTENT svc; -SAVEFILECONTENT sfc; - - -//-------------------------------------------------- -// Registry save engine -//-------------------------------------------------- -VOID SaveRegKey(LPKEYCONTENT lpKeyContent, DWORD nFPCurrentFatherKey, DWORD nFPCaller) -{ - DWORD nFPTemp4Write; - DWORD nFPHeader; - DWORD nFPCurrent; - DWORD nLenPlus1; - INT nPad; - INT nPad1; - LPVALUECONTENT lpv; - - // Note use (DWORD) to disable warning of lost of data to convert size_t to dword, in current windows,it is safe that registry's xxxxname is stay in DWORD long - nLenPlus1 = (DWORD)strlen(lpKeyContent->lpkeyname) + 1; // Get len+1 - nPad = (nLenPlus1 % sizeof(DWORD) == 0) ? 0 : (sizeof(DWORD) - nLenPlus1 % sizeof(DWORD)); - nFPHeader = SetFilePointer(hFileWholeReg, 0, NULL, FILE_CURRENT); // Save head fp - - // using struct ,idea from maddes - skc.fpos_keyname = nFPHeader + sizeof(SAVEKEYCONTENT); - skc.fpos_firstvalue = (lpKeyContent->lpfirstvalue != NULL) ? (nFPHeader + sizeof(SAVEKEYCONTENT) + nLenPlus1 + nPad) : 0; - skc.fpos_firstsubkey = 0; // it is filled later. - skc.fpos_brotherkey = 0; // it is filled later - skc.fpos_fatherkey = nFPCurrentFatherKey; - skc.bkeymatch = 0; - WriteFile(hFileWholeReg, &skc, sizeof(skc), &NBW, NULL); - - WriteFile(hFileWholeReg, lpKeyContent->lpkeyname, nLenPlus1, &NBW, NULL); // Save the current keyname - - nFPTemp4Write = 0; - if (nPad > 0) { - WriteFile(hFileWholeReg, &nFPTemp4Write, nPad, &NBW, NULL); - } - - - // Save the sub-value of current KeyContent - for (lpv = lpKeyContent->lpfirstvalue; lpv != NULL; lpv = lpv->lpnextvalue) { - - nLenPlus1 = (DWORD)strlen(lpv->lpvaluename) + 1; - nPad = (nLenPlus1 % sizeof(DWORD) == 0) ? 0 : (sizeof(DWORD) - nLenPlus1 % sizeof(DWORD)); // determine if pad to 4bytes is needed - nPad1 = (lpv->datasize % sizeof(DWORD) == 0) ? 0 : (sizeof(DWORD) - lpv->datasize % sizeof(DWORD)); - - nFPCurrent = SetFilePointer(hFileWholeReg, 0, NULL, FILE_CURRENT); // Save fp - svc.typecode = lpv->typecode; - svc.datasize = lpv->datasize; - svc.fpos_valuename = nFPCurrent + sizeof(SAVEVALUECONTENT); // size must same for valuecontent and savevaluecontent - svc.fpos_valuedata = (lpv->datasize > 0) ? (nFPCurrent + sizeof(SAVEVALUECONTENT) + nLenPlus1 + nPad) : 0; // if no lpvaluedata, we write 0 - svc.fpos_nextvalue = (lpv->lpnextvalue != NULL) ? (nFPCurrent + sizeof(SAVEVALUECONTENT) + nLenPlus1 + nPad + lpv->datasize + nPad1) : 0; // if no nextvalue we write 0 - svc.fpos_fatherkey = nFPHeader; - svc.bvaluematch = 0; - WriteFile(hFileWholeReg, &svc, sizeof(svc), &NBW, NULL); - - - WriteFile(hFileWholeReg, lpv->lpvaluename, nLenPlus1, &NBW, NULL); // Save lpvaluename - - nFPTemp4Write = 0; - if (nPad > 0) { - WriteFile(hFileWholeReg, &nFPTemp4Write, nPad, &NBW, NULL); - } - - if (lpv->datasize > 0) { - WriteFile(hFileWholeReg, lpv->lpvaluedata, lpv->datasize, &NBW, NULL); // Save lpvaluedata - - if (nPad1 > 0) { - WriteFile(hFileWholeReg, &nFPTemp4Write, nPad1, &NBW, NULL); - } - } - - } - - if (lpKeyContent->lpfirstsubkey != NULL) { - // pass this keycontent's position as subkey's fatherkey's position and pass the "lpfirstsubkey field" - SaveRegKey(lpKeyContent->lpfirstsubkey, nFPHeader, nFPHeader + 2 * sizeof(DWORD)); - } - - if (lpKeyContent->lpbrotherkey != NULL) { - // pass this key's fatherkey's position as brother's father and pass "lpbrotherkey field" - SaveRegKey(lpKeyContent->lpbrotherkey, nFPCurrentFatherKey, nFPHeader + 3 * sizeof(DWORD)); - } - - if (nFPCaller > 0) { // save position of current key in current father key - nFPCurrent = SetFilePointer(hFileWholeReg, 0, NULL, FILE_CURRENT); - SetFilePointer(hFileWholeReg, nFPCaller, NULL, FILE_BEGIN); - WriteFile(hFileWholeReg, &nFPHeader, sizeof(nFPHeader), &NBW, NULL); - SetFilePointer(hFileWholeReg, nFPCurrent, NULL, FILE_BEGIN); - } - -} - -//-------------------------------------------------- -// File save engine (It is stupid again!) added in 1.8 -// 1.8.3 changed some struct -// modi 20111216 -//-------------------------------------------------- -VOID SaveFileContent(LPFILECONTENT lpFileContent, DWORD nFPCurrentFatherFile, DWORD nFPCaller) -{ - - DWORD nFPTemp4Write; - DWORD nFPHeader; - DWORD nFPCurrent; - DWORD nLenPlus1; - int nPad; - - nLenPlus1 = (DWORD)strlen(lpFileContent->lpfilename) + 1; // Get len+1 - nFPHeader = SetFilePointer(hFileWholeReg, 0, NULL, FILE_CURRENT); // Save head fp - // using struct, idea from maddes - sfc.fpos_filename = nFPHeader + sizeof(SAVEFILECONTENT); // 1.8.3 11*4 former is 10*4+1 - sfc.writetimelow = lpFileContent->writetimelow; - sfc.writetimehigh = lpFileContent->writetimehigh; - sfc.filesizelow = lpFileContent->filesizelow; - sfc.filesizehigh = lpFileContent->filesizehigh; - sfc.fileattr = lpFileContent->fileattr; - sfc.cksum = lpFileContent->cksum; - sfc.fpos_firstsubfile = 0; - sfc.fpos_brotherfile = 0; - sfc.fpos_fatherfile = nFPCurrentFatherFile; - sfc.bfilematch = 0; - WriteFile(hFileWholeReg, &sfc, sizeof(sfc), &NBW, NULL); - - WriteFile(hFileWholeReg, lpFileContent->lpfilename, nLenPlus1, &NBW, NULL); // Save the current filename - - nPad = (nLenPlus1 % sizeof(DWORD) == 0) ? 0 : (sizeof(DWORD) - nLenPlus1 % sizeof(DWORD)); - - nFPTemp4Write = 0; - if (nPad > 0) { - WriteFile(hFileWholeReg, &nFPTemp4Write, nPad, &NBW, NULL); // Save the current filename - } - - if (lpFileContent->lpfirstsubfile != NULL) { - // pass this filecontent's position as subfile's fatherfile's position and pass the "lpfirstsubfile field" - SaveFileContent(lpFileContent->lpfirstsubfile, nFPHeader, nFPHeader + 7 * sizeof(DWORD)); - } - - if (lpFileContent->lpbrotherfile != NULL) { - // pass this file's fatherfile's position as brother's father and pass "lpbrotherfile field" - SaveFileContent(lpFileContent->lpbrotherfile, nFPCurrentFatherFile, nFPHeader + 8 * sizeof(DWORD)); - } - - if (nFPCaller > 0) { // save position of current file in current father file - nFPCurrent = SetFilePointer(hFileWholeReg, 0, NULL, FILE_CURRENT); - SetFilePointer(hFileWholeReg, nFPCaller, NULL, FILE_BEGIN); - WriteFile(hFileWholeReg, &nFPHeader, sizeof(nFPHeader), &NBW, NULL); - SetFilePointer(hFileWholeReg, nFPCurrent, NULL, FILE_BEGIN); - } - -} - -//--------------------------------------------------------------------------------- -// Load registry from HIVE file (After this, we should realign the data in memory) -//--------------------------------------------------------------------------------- -BOOL LoadHive(LPCSTR lpFileName, LPKEYCONTENT FAR *lplpKeyHLM, LPKEYCONTENT FAR *lplpKeyUSER, - LPHEADFILE FAR *lplpHeadFile) -{ - DWORD nFileSize; - DWORD nOffSet = 0; - size_t nBase; - DWORD i, j; - DWORD nRemain; - DWORD nReadSize; - BOOL bRet = FALSE; - LPBYTE lpHive; - - hFileWholeReg = CreateFile(lpFileName, GENERIC_READ , FILE_SHARE_READ , NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if (hFileWholeReg != INVALID_HANDLE_VALUE) { - lpHive = MYALLOC0(16); - ReadFile(hFileWholeReg, lpHive, 16, &NBW, NULL); - - if (strcmp(str_RegshotHiveSignature182, (const char *)(lpHive)) != 0) { - printf("Error:Does not detect regshot_hive_signagure used by version <=1.8.2"); //changed in 1.8.3 - bRet = FALSE; - } else { - nFileSize = GetFileSize(hFileWholeReg, NULL); - MYFREE(lpHive); - - lpHive = MYALLOC(nFileSize); - nBase = (size_t) lpHive; - lpOldHiveHeader = lpHive; - - ReadFile(hFileWholeReg, &nOffSet, 4, &NBW, NULL); - *lplpKeyHLM = (LPKEYCONTENT)(nBase + nOffSet); - - ReadFile(hFileWholeReg, &nOffSet, 4, &NBW, NULL); - *lplpKeyUSER = (LPKEYCONTENT)(nBase + nOffSet); - - ReadFile(hFileWholeReg, &nOffSet, 4, &NBW, NULL); - if (nOffSet == 0) { - *lplpHeadFile = NULL; - } else { - *lplpHeadFile = (LPHEADFILE)(nBase + nOffSet); - } - - SetFilePointer(hFileWholeReg, 0, NULL, FILE_BEGIN); - -#define READ_BATCH_SIZE 8192 - - printf("Reading %s....", lpFileName); - for (i = 0, j = 0, nRemain = nFileSize;; i += READ_BATCH_SIZE, j++) { - if (nRemain >= READ_BATCH_SIZE) { - nReadSize = READ_BATCH_SIZE; - } else { - nReadSize = nRemain; - } - ReadFile(hFileWholeReg, (lpHive) + i, nReadSize, &NBW, NULL); // read the whole file now - if (NBW != nReadSize) { - printf("Reading ERROR!"); - break; - } - nRemain -= nReadSize; - if (nRemain == 0) { - break; - } - - } -#undef READ_BATCH_SIZE - - ReAlignReg(*lplpKeyHLM, nBase); - ReAlignReg(*lplpKeyUSER, nBase); - - if (*lplpHeadFile != NULL) { - ReAlignFile(*lplpHeadFile, nBase); - } - - bRet = TRUE; - - } - CloseHandle(hFileWholeReg); - } else { - printf("Error:Can not open file!\n"); - bRet = FALSE; - } - - return(bRet); - -} - - -//-------------------------------------------------- -// Routine to call registry save engine and file save engine -//-------------------------------------------------- -BOOL SaveHive(LPCSTR lpFileName, LPKEYCONTENT lpKeyHLM, LPKEYCONTENT lpKeyUSER, - LPHEADFILE lpHF) -{ - DWORD nFPcurrent; - DWORD nFPcurrent1; - DWORD nFPTemp4Write; - BOOL bRet; - LPHEADFILE lphf; - - bRet = FALSE; - - if (lpKeyHLM != NULL || lpKeyUSER != NULL) { - - hFileWholeReg = CreateFile(lpFileName, GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); - if (hFileWholeReg != INVALID_HANDLE_VALUE) { - - WriteFile(hFileWholeReg, str_RegshotHiveSignature183, sizeof(str_RegshotHiveSignature183) - 1, &NBW, NULL); - - // 0 signature( <= 12) last 4 bytes may be used in furture - // 16 startoflpkeyhlm (512) - // 20 startoflpkeyuser(???) - // 24 fileheadchain begin (new) ->(file -> nextfilehead(4) next4bytes is filecontent) added in 1.8 - // 28 future use! - // 32 computer name - // 96 username - // 160 systemtime - - // Save the position of H_L_M - nFPcurrent = HIVEBEGINOFFSET; // computerlen*2+sizeof(systemtime)+32 must <hivebeginoffset - SetFilePointer(hFileWholeReg, 16, NULL, FILE_BEGIN); - WriteFile(hFileWholeReg, &nFPcurrent, 4, &NBW, NULL); - SetFilePointer(hFileWholeReg, 28, NULL, FILE_BEGIN); - WriteFile(hFileWholeReg, lpOldHiveHeader + 28, HIVEBEGINOFFSET - 28, &NBW, NULL); - - SetFilePointer(hFileWholeReg, HIVEBEGINOFFSET, NULL, FILE_BEGIN); - - printf("\nWriting %s....", lpFileName); - if (lpKeyHLM != NULL) { - SaveRegKey(lpKeyHLM, 0, 0); - } - - // Save the position of hkeyUsr - nFPcurrent = SetFilePointer(hFileWholeReg, 0, NULL, FILE_CURRENT); - SetFilePointer(hFileWholeReg, 20, NULL, FILE_BEGIN); - WriteFile(hFileWholeReg, &nFPcurrent, 4, &NBW, NULL); - SetFilePointer(hFileWholeReg, nFPcurrent, NULL, FILE_BEGIN); - - if (lpKeyUSER != NULL) { - SaveRegKey(lpKeyUSER, 0, 0); - } - - if (lpHF != NULL) { - // Write start position of file chain - nFPcurrent = SetFilePointer(hFileWholeReg, 0, NULL, FILE_CURRENT); - SetFilePointer(hFileWholeReg, 24, NULL, FILE_BEGIN); - WriteFile(hFileWholeReg, &nFPcurrent, 4, &NBW, NULL); // write start pos at 24 - SetFilePointer(hFileWholeReg, nFPcurrent, NULL, FILE_BEGIN); - - for (lphf = lpHF; lphf != NULL;) { - nFPcurrent = SetFilePointer(hFileWholeReg, 0, NULL, FILE_CURRENT); // save place for next filehead in chain - SetFilePointer(hFileWholeReg, sizeof(LPSAVEHEADFILE), NULL, FILE_CURRENT); // move 4 or 8 bytes, leave space for lpnextfilecontent - nFPTemp4Write = nFPcurrent + sizeof(LPSAVEHEADFILE) + sizeof(LPSAVEFILECONTENT); - WriteFile(hFileWholeReg, &nFPTemp4Write, sizeof(nFPTemp4Write), &NBW, NULL); // write lpfilecontent ,bug in r107 - - SaveFileContent(lphf->lpfilecontent, 0, 0); - nFPcurrent1 = SetFilePointer(hFileWholeReg, 0, NULL, FILE_CURRENT); - nFPTemp4Write = nFPcurrent1; - SetFilePointer(hFileWholeReg, nFPcurrent, NULL, FILE_BEGIN); - lphf = lphf->lpnextheadfile; - if (lphf != NULL) { - WriteFile(hFileWholeReg, &nFPTemp4Write, sizeof(nFPTemp4Write), &NBW, NULL); - } else { - nFPTemp4Write = 0; - WriteFile(hFileWholeReg, &nFPTemp4Write, sizeof(nFPTemp4Write), &NBW, NULL); - break; - } - SetFilePointer(hFileWholeReg, nFPcurrent1, NULL, FILE_BEGIN); - } - } - - CloseHandle(hFileWholeReg); - printf("\nDone.\n"); - bRet = TRUE; - } else { - printf("Error:Can not create file!\n"); - bRet = FALSE; - } - - } - return bRet; -} diff --git a/RegShot/src/182to183/main.c b/RegShot/src/182to183/main.c deleted file mode 100644 index 17e4477..0000000 --- a/RegShot/src/182to183/main.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - Copyright 2011 Regshot Team - - Regshot is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Regshot is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Regshot; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "global.h" - -int main(int argc, char *argv[]) -{ -#ifdef _WIN64 - printf("Cannot be compiled as 64bit program.\n"); - return 1; -#else - printf("Regshot hive file transfer program version 1.8.3beta1V4\n\ -Transfer hive file used in <= 1.8.2 to new structure used in 1.8.3\n\ -Usage: 182to183 infile.hiv outfile.hiv\n\n"); - if (argc < 3) { - printf("[X] Need input and output filenames!\n"); - return 1; - } - if (LoadHive(argv[1], &lpHeadLocalMachine, &lpHeadUsers, &lpHeadFile) != TRUE) { - return 1; - } - SaveHive(argv[2], lpHeadLocalMachine, lpHeadUsers, lpHeadFile); - - return 0; -#endif -} diff --git a/RegShot/src/Makefile b/RegShot/src/Makefile deleted file mode 100644 index d6480f6..0000000 --- a/RegShot/src/Makefile +++ /dev/null @@ -1,120 +0,0 @@ -#****************************************************************************** -#* Copyright 2011 XhmikosR -#* -#* This file is part of Regshot. -#* -#* Regshot is free software; you can redistribute it and/or modify -#* it under the terms of the GNU General Public License as published by -#* the Free Software Foundation; either version 2 of the License, or -#* (at your option) any later version. -#* -#* Regshot is distributed in the hope that it will be useful, -#* but WITHOUT ANY WARRANTY; without even the implied warranty of -#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#* GNU General Public License for more details. -#* -#* You should have received a copy of the GNU General Public License -#* along with Regshot; if not, write to the Free Software -#* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -#* -#* -#* makefile -#* makefile for building Regshot with GCC -#* -#****************************************************************************** - - -CC=gcc.exe - -all:.all -distclean: clean - -#DEBUG=yes -#64BIT=yes - -ifeq ($(64BIT),yes) - MY_PREFIX=x86_64-w64-mingw32- - CFLAGS=-DWIN64 -D_WIN64 -D_WIN32_WINNT=0x0502 - OPTFLAGS=-O3 -m64 - STACK_SIZE=67108864 -else - CFLAGS=-DWIN32 -D_WIN32 -D_WIN32_WINNT=0x0500 - OPTFLAGS=-O3 -march=i686 -msse -mfpmath=sse - STACK_SIZE=33554432 -endif - -ifeq ($(DEBUG),yes) - CFLAGS+=-DDEBUG -D_DEBUG -g -else - CFLAGS+=-DNDEBUG -UDEBUG -endif - -SRCS_C=\ - fileshot.c \ - language.c \ - misc.c \ - output.c \ - regshot.c \ - setup.c \ - ui.c \ - winmain.c - -RESSRC=regshot.rc - -TARGET_DIR=../bin/GCC/ - -ifeq ($(DEBUG),yes) - MY_DIR_PREFIX=Debug -else - MY_DIR_PREFIX=Release -endif - -ifeq ($(64BIT),yes) - MY_ARCH=x64 -else - MY_ARCH=Win32 -endif - -OBJ_DIR=$(TARGET_DIR)$(MY_DIR_PREFIX)_$(MY_ARCH)/obj/ - -OUTFLAGS=-MMD -o\ - -TARGET_EXE=$(TARGET_DIR)$(MY_DIR_PREFIX)_$(MY_ARCH)/Regshot.exe - - -# Targets - -.all: outdirs $(TARGET_EXE) - -.PHONY: outdirs $(OBJ_DIR) -outdirs: $(OBJ_DIR) -$(OBJ_DIR): - $(shell test -d $(@) || mkdir -p $(@)) - - -.PHONY: clean -clean: - rm -f $(TARGET_EXE) - rm -r -f $(OBJ_DIR) - - -# Commands - -OBJS+=$(SRCS_C:%.c=$(OBJ_DIR)%.o) $(RESSRC:%.rc=$(OBJ_DIR)%.res.o) - -$(OBJ_DIR)%.o: %.c - @echo $< - @$(MY_PREFIX)$(CC) -c $(CFLAGS) $(OPTFLAGS) $(OUTFLAGS) $@ $< - -$(OBJ_DIR)%.res.o: %.rc - @echo $< - @$(MY_PREFIX)windres -o $@ $< - -$(TARGET_EXE): $(OBJS) - @echo $@ - @$(MY_PREFIX)$(CC) -mwindows -Wl,--stack=$(STACK_SIZE) -o $@ $(OBJS) -ifneq ($(DEBUG),yes) - @$(MY_PREFIX)strip $@ -endif - --include $(SRCS_C:%.c=$(OBJ_DIR)%.d) diff --git a/RegShot/src/fileshot.c b/RegShot/src/fileshot.c deleted file mode 100644 index b7d1d6c..0000000 --- a/RegShot/src/fileshot.c +++ /dev/null @@ -1,586 +0,0 @@ -/* - Copyright 1999-2003,2007,2011 TiANWEi - Copyright 2004 tulipfan - Copyright 2011 maddes - - This file is part of Regshot. - - Regshot is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Regshot is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Regshot; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "global.h" -// ISDIR, ISFILE added in 1.8.0 -#define ISDIR(x) ( (x&FILE_ATTRIBUTE_DIRECTORY) != 0 ) -#define ISFILE(x) ( (x&FILE_ATTRIBUTE_DIRECTORY) == 0 ) - -SAVEFILECONTENT sFC; - - -extern LPBYTE lan_dir; -extern LPBYTE lan_file; - - -//------------------------------------------------------------- -// Routine to get Whole File Name[root dir] from a FILECONTENT -//------------------------------------------------------------- -LPSTR GetWholeFileName(LPFILECONTENT lpFileContent) -{ - LPFILECONTENT lpf; - LPSTR lpName; - LPSTR lptail; - size_t nLen = 0; - - for (lpf = lpFileContent; lpf != NULL; lpf = lpf->lpfatherfile) { - nLen += strlen(lpf->lpfilename) + 1; - } - if (nLen == 0) { - nLen++; - } - lpName = MYALLOC(nLen); - - lptail = lpName + nLen - 1; - *lptail = 0x00; - - for (lpf = lpFileContent; lpf != NULL; lpf = lpf->lpfatherfile) { - nLen = strlen(lpf->lpfilename); - memcpy(lptail -= nLen, lpf->lpfilename, nLen); - if (lptail > lpName) { - *--lptail = '\\'; // 0x5c; - } - } - return lpName; -} - - -//------------------------------------------------------------- -// Routine to walk through all sub tree of current directory [File system] -//------------------------------------------------------------- -VOID GetAllSubFile( - BOOL needbrother, - DWORD typedir, - DWORD typefile, - LPDWORD lpcountdir, - LPDWORD lpcountfile, - LPFILECONTENT lpFileContent -) -{ - //LPSTR lpTemp; - - if (ISDIR(lpFileContent->fileattr)) { - //lpTemp = lpFileContent->lpfilename; - if (strcmp(lpFileContent->lpfilename, ".") != 0 && strcmp(lpFileContent->lpfilename, "..") != 0) { // tfx added in 1.7.3 fixed at 1.8.0 we should add here 1.8.0 - //if (*(unsigned short *)lpTemp != 0x002E && !(*(unsigned short *)lpTemp == 0x2E2E && *(lpTemp + 2) == 0x00)) { // 1.8.2 - LogToMem(typedir, lpcountdir, lpFileContent); - } - } else { - LogToMem(typefile, lpcountfile, lpFileContent); - } - - if (lpFileContent->lpfirstsubfile != NULL) { - GetAllSubFile(TRUE, typedir, typefile, lpcountdir, lpcountfile, lpFileContent->lpfirstsubfile); - } - if (needbrother == TRUE) { - if (lpFileContent->lpbrotherfile != NULL) { - GetAllSubFile(TRUE, typedir, typefile, lpcountdir, lpcountfile, lpFileContent->lpbrotherfile); - } - } - - -} - - -//------------------------------------------------------------ -// File Shot Engine -//------------------------------------------------------------ -VOID GetFilesSnap(LPFILECONTENT lpFatherFile) -{ - LPSTR lpFilename; - LPSTR lpTemp; - HANDLE filehandle; - WIN32_FIND_DATA finddata; - LPFILECONTENT lpFileContent; - LPFILECONTENT lpFileContentTemp; - - lpTemp = GetWholeFileName(lpFatherFile); - //Not used - //if (bWinNTDetected) - //{ - // lpFilename = MYALLOC(strlen(lpTemp) + 5 + 4); - // strcpy(lpFilename,"\\\\?\\"); - // strcat(lpFilename,lpTemp); - //} - //else - { - lpFilename = MYALLOC(strlen(lpTemp) + 5); - strcpy(lpFilename, lpTemp); - } - strcat(lpFilename, "\\*.*"); - - MYFREE(lpTemp); - //_asm int 3; - filehandle = FindFirstFile(lpFilename, &finddata); - MYFREE(lpFilename); - if (filehandle == INVALID_HANDLE_VALUE) { - return; - } - - //lpTemp = finddata.cFileName; // 1.8 - - lpFileContent = MYALLOC0(sizeof(FILECONTENT)); - lpFileContent->lpfilename = MYALLOC0(strlen(finddata.cFileName) + 1); // must add one! - strcpy(lpFileContent->lpfilename, finddata.cFileName); - lpFileContent->writetimelow = finddata.ftLastWriteTime.dwLowDateTime; - lpFileContent->writetimehigh = finddata.ftLastWriteTime.dwHighDateTime; - lpFileContent->filesizelow = finddata.nFileSizeLow; - lpFileContent->filesizehigh = finddata.nFileSizeHigh; - lpFileContent->fileattr = finddata.dwFileAttributes; - lpFileContent->lpfatherfile = lpFatherFile; - lpFatherFile->lpfirstsubfile = lpFileContent; - lpFileContentTemp = lpFileContent; - - if (ISDIR(lpFileContent->fileattr)) { - if (strcmp(lpFileContent->lpfilename, ".") != 0 && strcmp(lpFileContent->lpfilename, "..") != 0 - && !IsInSkipList(lpFileContent->lpfilename, lplpFileSkipStrings)) { // tfx - - nGettingDir++; - GetFilesSnap(lpFileContent); - } - } else { - nGettingFile++; - } - - - for (; FindNextFile(filehandle, &finddata) != FALSE;) { - lpFileContent = MYALLOC0(sizeof(FILECONTENT)); - lpFileContent->lpfilename = MYALLOC0(strlen(finddata.cFileName) + 1); - strcpy(lpFileContent->lpfilename, finddata.cFileName); - lpFileContent->writetimelow = finddata.ftLastWriteTime.dwLowDateTime; - lpFileContent->writetimehigh = finddata.ftLastWriteTime.dwHighDateTime; - lpFileContent->filesizelow = finddata.nFileSizeLow; - lpFileContent->filesizehigh = finddata.nFileSizeHigh; - lpFileContent->fileattr = finddata.dwFileAttributes; - lpFileContent->lpfatherfile = lpFatherFile; - lpFileContentTemp->lpbrotherfile = lpFileContent; - lpFileContentTemp = lpFileContent; - - if (ISDIR(lpFileContent->fileattr)) { - if (strcmp(lpFileContent->lpfilename, ".") != 0 && strcmp(lpFileContent->lpfilename, "..") != 0 - && !IsInSkipList(lpFileContent->lpfilename, lplpFileSkipStrings)) { // tfx - nGettingDir++; - GetFilesSnap(lpFileContent); - } - } else { - nGettingFile++; - } - - } - FindClose(filehandle); - - nGettingTime = GetTickCount(); - if ((nGettingTime - nBASETIME1) > REFRESHINTERVAL) { - UpdateCounters(lan_dir, lan_file, nGettingDir, nGettingFile); - } - - return ; -} - - -//------------------------------------------------------------- -// File comparison engine (lp1 and lp2 run parallel) -//------------------------------------------------------------- -VOID CompareFirstSubFile(LPFILECONTENT lpHead1, LPFILECONTENT lpHead2) -{ - LPFILECONTENT lp1; - LPFILECONTENT lp2; - - for (lp1 = lpHead1; lp1 != NULL; lp1 = lp1->lpbrotherfile) { - for (lp2 = lpHead2; lp2 != NULL; lp2 = lp2->lpbrotherfile) { - if ((lp2->bfilematch == NOTMATCH) && strcmp(lp1->lpfilename, lp2->lpfilename) == 0) { // 1.8.2 from lstrcmp to strcmp - // Two files have the same name, but we are not sure they are the same, so we compare them! - if (ISFILE(lp1->fileattr) && ISFILE(lp2->fileattr)) - //(lp1->fileattr&FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY && (lp2->fileattr&FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY) - { - // Lp1 is file, lp2 is file - if (lp1->writetimelow == lp2->writetimelow && lp1->writetimehigh == lp2->writetimehigh && - lp1->filesizelow == lp2->filesizelow && lp1->filesizehigh == lp2->filesizehigh && lp1->fileattr == lp2->fileattr) { - // We found a match file! - lp2->bfilematch = ISMATCH; - } else { - // We found a dismatch file, they will be logged - lp2->bfilematch = ISMODI; - LogToMem(FILEMODI, &nFILEMODI, lp1); - } - - } else { - // At least one file of the pair is directory, so we try to determine - if (ISDIR(lp1->fileattr) && ISDIR(lp2->fileattr)) - // (lp1->fileattr&FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY && (lp2->fileattr&FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY) - { - // The two 'FILE's are all dirs - if (lp1->fileattr == lp2->fileattr) { - // Same dir attributes, we compare their subfiles - lp2->bfilematch = ISMATCH; - CompareFirstSubFile(lp1->lpfirstsubfile, lp2->lpfirstsubfile); - } else { - // Dir attributes changed, they will be logged - lp2->bfilematch = ISMODI; - LogToMem(DIRMODI, &nDIRMODI, lp1); - } - //break; - } else { - // One of the 'FILE's is dir, but which one? - if (ISFILE(lp1->fileattr) && ISDIR(lp2->fileattr)) - //(lp1->fileattr&FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY && (lp2->fileattr&FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY) - { - // lp1 is file, lp2 is dir - lp1->bfilematch = ISDEL; - LogToMem(FILEDEL, &nFILEDEL, lp1); - GetAllSubFile(FALSE, DIRADD, FILEADD, &nDIRADD, &nFILEADD, lp2); - } else { - // lp1 is dir, lp2 is file - lp2->bfilematch = ISADD; - LogToMem(FILEADD, &nFILEADD, lp2); - GetAllSubFile(FALSE, DIRDEL, FILEDEL, &nDIRDEL, &nFILEDEL, lp1); - } - } - } - break; - } - } - - if (lp2 == NULL) { - // lp2 looped to the end, that is, we can not find a lp2 matches lp1, so lp1 is deleted! - if (ISDIR(lp1->fileattr)) { - GetAllSubFile(FALSE, DIRDEL, FILEDEL, &nDIRDEL, &nFILEDEL, lp1); // if lp1 is dir - } else { - LogToMem(FILEDEL, &nFILEDEL, lp1); // if lp1 is file - } - } - } - - // We loop to the end, then we do an extra loop of lp2 use flag we previous made - for (lp2 = lpHead2; lp2 != NULL; lp2 = lp2->lpbrotherfile) { - nComparing++; - if (lp2->bfilematch == NOTMATCH) { - // We did not find a lp1 matches a lp2, so lp2 is added! - if (ISDIR(lp2->fileattr)) { - GetAllSubFile(FALSE, DIRADD, FILEADD, &nDIRADD, &nFILEADD, lp2); - } else { - LogToMem(FILEADD, &nFILEADD, lp2); - } - } - } - - // Progress bar update - if (nGettingFile != 0) - if (nComparing % nGettingFile > nFileStep) { - nComparing = 0; - SendDlgItemMessage(hWnd, IDC_PBCOMPARE, PBM_STEPIT, (WPARAM)0, (LPARAM)0); - } - -} - - -//------------------------------------------------------------- -// Routines to free all file tree -//------------------------------------------------------------- -VOID FreeAllFileContent(LPFILECONTENT lpFile) -{ - if (lpFile != NULL) { - FreeAllFileContent(lpFile->lpfirstsubfile); - FreeAllFileContent(lpFile->lpbrotherfile); - MYFREE(lpFile->lpfilename); - MYFREE(lpFile); - } -} - - -//------------------------------------------------------------- -// Routines to free head files -//------------------------------------------------------------- -VOID FreeAllFileHead(LPHEADFILE lp) -{ - if (lp != NULL) { - FreeAllFileHead(lp->lpnextheadfile); - FreeAllFileContent(lp->lpfilecontent); - //FreeAllFileContent(lp->lpfilecontent2); - MYFREE(lp); - } - -} - - -//-------------------------------------------------- -// File save engine (It is stupid again!) added in 1.8 -//-------------------------------------------------- -VOID SaveFileContent(LPFILECONTENT lpFileContent, DWORD nFPCurrentFatherFile, DWORD nFPCaller) -{ - - DWORD nFPTemp4Write; - DWORD nFPHeader; - DWORD nFPCurrent; - DWORD nLenPlus1; - int nPad; - - nLenPlus1 = (DWORD)strlen(lpFileContent->lpfilename) + 1; // Get len+1,this (dword) is for the writefile below. - nFPHeader = SetFilePointer(hFileWholeReg, 0, NULL, FILE_CURRENT); // Save head fp - // using struct, idea from maddes - sFC.fpos_filename = nFPHeader + sizeof(SAVEFILECONTENT); - sFC.writetimelow = lpFileContent->writetimelow; - sFC.writetimehigh = lpFileContent->writetimehigh; - sFC.filesizelow = lpFileContent->filesizelow; - sFC.filesizehigh = lpFileContent->filesizehigh; - sFC.fileattr = lpFileContent->fileattr; - sFC.cksum = lpFileContent->cksum; - sFC.fpos_firstsubfile = 0; //lpFileContent->lpfirstsubfile; - sFC.fpos_brotherfile = 0; //lpFileContent->lpbrotherfile; - sFC.fpos_fatherfile = nFPCurrentFatherFile; - sFC.bfilematch = 0; - WriteFile(hFileWholeReg, &sFC, sizeof(sFC), &NBW, NULL); - -/* - nFPTemp4Write = nFPHeader + sizeof(FILECONTENT); // - WriteFile(hFileWholeReg, &nFPTemp4Write, sizeof(nFPTemp4Write), &NBW, NULL); // Save the location of lpfilename - - WriteFile(hFileWholeReg, (LPBYTE)lpFileContent + sizeof(LPSTR), 6*sizeof(DWORD), &NBW, NULL); // Write time, size etc. 6*4 - - //nFPTemp4Write = (lpFileContent->lpfirstsubfile!=NULL) ? (nFPHeader + 41 + nLenPlus1) : 0; // We write lpfilename plus a "\0" - //WriteFile(hFileWholeReg,&nFPTemp4Write,4,&NBW,NULL); // Save the location of lpfirstsubfile - WriteFile(hFileWholeReg, (LPBYTE)lpFileContent + sizeof(LPSTR)+6*sizeof(DWORD), sizeof(LPFILECONTENT)*2, &NBW, NULL); // Save lpfirstsubfile and lpbrotherfile - WriteFile(hFileWholeReg, &nFPCurrentFatherFile, sizeof(nFPCurrentFatherFile), &NBW, NULL); // Save nFPCurrentFatherKey passed by caller - - lpFileContent->bfilematch=0; - WriteFile(hFileWholeReg, &(lpFileContent->bfilematch), sizeof(lpFileContent->bfilematch), &NBW, NULL); // Clear and save bfilematch -*/ - WriteFile(hFileWholeReg, lpFileContent->lpfilename, nLenPlus1, &NBW, NULL); // Save the current filename - - nPad = (nLenPlus1 % sizeof(DWORD) == 0) ? 0 : (sizeof(DWORD) - nLenPlus1 % sizeof(DWORD)); - - nFPTemp4Write = 0; - if (nPad > 0) { - WriteFile(hFileWholeReg, &nFPTemp4Write, nPad, &NBW, NULL); // Save the current filename - } - - if (lpFileContent->lpfirstsubfile != NULL) { - // pass this filecontent's position as subfile's fatherfile's position and pass the "lpfirstsubfile field" - SaveFileContent(lpFileContent->lpfirstsubfile, nFPHeader, nFPHeader + 7 * sizeof(DWORD)); - } - - if (lpFileContent->lpbrotherfile != NULL) { - // pass this file's fatherfile's position as brother's father and pass "lpbrotherfile field" - SaveFileContent(lpFileContent->lpbrotherfile, nFPCurrentFatherFile, nFPHeader + 8 * sizeof(DWORD)); - } - - if (nFPCaller > 0) { // save position of current file in current father file - nFPCurrent = SetFilePointer(hFileWholeReg, 0, NULL, FILE_CURRENT); - SetFilePointer(hFileWholeReg, nFPCaller, NULL, FILE_BEGIN); - WriteFile(hFileWholeReg, &nFPHeader, sizeof(nFPHeader), &NBW, NULL); - SetFilePointer(hFileWholeReg, nFPCurrent, NULL, FILE_BEGIN); - } - - // Need adjust progress bar para!! - nSavingFile++; - - if (nGettingFile != 0) - if (nSavingFile % nGettingFile > nFileStep) { - nSavingFile = 0; - SendDlgItemMessage(hWnd, IDC_PBCOMPARE, PBM_STEPIT, (WPARAM)0, (LPARAM)0); - UpdateWindow(hWnd); - PeekMessage(&msg, hWnd, WM_ACTIVATE, WM_ACTIVATE, PM_REMOVE); - } - - -} - - -#ifdef _WIN64 -//------------------------------------------------------------- -//Rebuild file snap from file buffer -//------------------------------------------------------------- -VOID RebuildFromHive_file(LPSAVEFILECONTENT lpFile, LPFILECONTENT lpFatherFC, LPFILECONTENT lpFC, LPBYTE lpHiveFileBase) -{ - LPFILECONTENT lpsubfile; - - if (lpFile->fpos_filename != 0) { - lpFC->lpfilename = (LPSTR)(lpHiveFileBase + lpFile->fpos_filename); - } - lpFC->writetimelow = lpFile->writetimelow; - lpFC->writetimehigh = lpFile->writetimehigh; - lpFC->filesizelow = lpFile->filesizelow; - lpFC->filesizehigh = lpFile->filesizehigh; - lpFC->fileattr = lpFile->fileattr; - lpFC->cksum = lpFile->cksum; - lpFC->lpfatherfile = lpFatherFC; - if (ISDIR(lpFC->fileattr)) { - nGettingDir++; - } else { - nGettingFile++; - } - - if (lpFile->fpos_firstsubfile != 0) { - lpsubfile = MYALLOC0(sizeof(FILECONTENT)); - lpFC->lpfirstsubfile = lpsubfile; - RebuildFromHive_file((LPSAVEFILECONTENT)(lpHiveFileBase + lpFile->fpos_firstsubfile), lpFC, lpsubfile, lpHiveFileBase); - } - - if (lpFile->fpos_brotherfile != 0) { - lpsubfile = MYALLOC0(sizeof(FILECONTENT)); - lpFC->lpbrotherfile = lpsubfile; - RebuildFromHive_file((LPSAVEFILECONTENT)(lpHiveFileBase + lpFile->fpos_brotherfile), lpFatherFC, lpsubfile, lpHiveFileBase); - } - - - nGettingTime = GetTickCount(); - if ((nGettingTime - nBASETIME1) > REFRESHINTERVAL) { - UpdateCounters(lan_dir, lan_file, nGettingDir, nGettingFile); - } - -} -//------------------------------------------------------------- -//Rebuild filehead from file buffer -//------------------------------------------------------------- -VOID RebuildFromHive_filehead(LPSAVEHEADFILE lpSHF, LPHEADFILE lpHeadFile, LPBYTE lpHiveFileBase) -{ - LPSAVEHEADFILE lpshf; - LPHEADFILE lpHF; - LPHEADFILE lpHFLast; - - for (lpshf = lpSHF, lpHF = lpHeadFile; lpHiveFileBase != (LPBYTE)lpshf; lpshf = (LPSAVEHEADFILE)(lpHiveFileBase + lpshf->fpos_nextheadfile)) { - - if (lpshf->fpos_filecontent != 0) { - lpHF->lpfilecontent = MYALLOC0(sizeof(FILECONTENT)); - RebuildFromHive_file((LPSAVEFILECONTENT)(lpHiveFileBase + lpshf->fpos_filecontent), NULL, lpHF->lpfilecontent, lpHiveFileBase); - } - if (lpshf->fpos_nextheadfile != 0) { - lpHF->lpnextheadfile = MYALLOC0(sizeof(HEADFILE)); - lpHFLast = lpHF; - lpHF = lpHF->lpnextheadfile; - } - - } -} - -#else -//-------------------------------------------------- -// Realign filecontent, called by ReAlignFile() -//-------------------------------------------------- -VOID ReAlignFileContent(LPFILECONTENT lpFC, size_t nBase) -{ - - if (lpFC->lpfilename != NULL) { - lpFC->lpfilename += nBase; - } - if (lpFC->lpfirstsubfile != NULL) { - lpFC->lpfirstsubfile = (LPFILECONTENT)((LPBYTE)lpFC->lpfirstsubfile + nBase); - } - if (lpFC->lpbrotherfile != NULL) { - lpFC->lpbrotherfile = (LPFILECONTENT)((LPBYTE)lpFC->lpbrotherfile + nBase); - } - if (lpFC->lpfatherfile != NULL) { - lpFC->lpfatherfile = (LPFILECONTENT)((LPBYTE)lpFC->lpfatherfile + nBase); - } - - - nGettingFile++; // just for the progress bar - - if (lpFC->lpfirstsubfile != NULL) { - ReAlignFileContent(lpFC->lpfirstsubfile, nBase); - } - - if (lpFC->lpbrotherfile != NULL) { - ReAlignFileContent(lpFC->lpbrotherfile, nBase); - } - -} - - -//-------------------------------------------------- -// Realign file, walk through chain -//-------------------------------------------------- -VOID ReAlignFile(LPHEADFILE lpHF, size_t nBase) -{ - LPHEADFILE lphf; - - for (lphf = lpHF; lphf != NULL; lphf = lphf->lpnextheadfile) { - - - if (lphf->lpnextheadfile != NULL) { - lphf->lpnextheadfile = (LPHEADFILE)((LPBYTE)lphf->lpnextheadfile + nBase); - } - if (lphf->lpfilecontent != NULL) { - lphf->lpfilecontent = (LPFILECONTENT)((LPBYTE)lphf->lpfilecontent + nBase); - ReAlignFileContent(lphf->lpfilecontent, nBase); - } - } -} - -#endif - -//-------------------------------------------------- -// Walkthrough lpHF and find lpname matches -//-------------------------------------------------- -LPFILECONTENT SearchDirChain(LPSTR lpname, LPHEADFILE lpHF) -{ - LPHEADFILE lphf; - - if (lpname != NULL) - for (lphf = lpHF; lphf != NULL; lphf = lphf->lpnextheadfile) { - if (lphf->lpfilecontent != NULL && lphf->lpfilecontent->lpfilename != NULL) - if (_stricmp(lpname, lphf->lpfilecontent->lpfilename) == 0) { - return lphf->lpfilecontent; - } - } - return NULL; -} - - -//-------------------------------------------------- -// Walkthrough lpheadfile chain and collect it's first dirname to lpDir -//-------------------------------------------------- -VOID FindDirChain(LPHEADFILE lpHF, LPSTR lpDir, size_t nMaxLen) -{ - size_t nLen; - LPHEADFILE lphf; - *lpDir = 0x00; - nLen = 0; - - for (lphf = lpHF; lphf != NULL; lphf = lphf->lpnextheadfile) { - if (lphf->lpfilecontent != NULL && nLen < nMaxLen) { - nLen += strlen(lphf->lpfilecontent->lpfilename) + 1; - strcat(lpDir, lphf->lpfilecontent->lpfilename); - strcat(lpDir, ";"); - } - } -} - - -//-------------------------------------------------- -// if two dir chains are the same -//-------------------------------------------------- -BOOL DirChainMatch(LPHEADFILE lphf1, LPHEADFILE lphf2) -{ - char lpDir1[EXTDIRLEN + 4]; - char lpDir2[EXTDIRLEN + 4]; - ZeroMemory(lpDir1, sizeof(lpDir1)); - ZeroMemory(lpDir2, sizeof(lpDir2)); - FindDirChain(lphf1, lpDir1, EXTDIRLEN); - FindDirChain(lphf2, lpDir2, EXTDIRLEN); - - if (_stricmp(lpDir1, lpDir2) != 0) { - return FALSE; - } else { - return TRUE; - } -} diff --git a/RegShot/src/global.h b/RegShot/src/global.h deleted file mode 100644 index 041bec0..0000000 --- a/RegShot/src/global.h +++ /dev/null @@ -1,415 +0,0 @@ -/* - Copyright 1999-2003,2007,2011 TiANWEi - Copyright 2004 tulipfan - - This file is part of Regshot. - - Regshot is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Regshot is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Regshot; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef REGSHOT_GLOBAL_H -#define REGSHOT_GLOBAL_H - - -#ifdef __GNUC__ -#include <unistd.h> -#endif -#include <windows.h> -#include <stdio.h> -#include <shlobj.h> -#include "resource.h" - -#if defined(_MSC_VER) && (_MSC_VER < 1300) // before VS 2002 .NET (e.g. VS 6) -#define SetClassLongPtr SetClassLong -#ifndef GCLP_HICON -#define GCLP_HICON GCL_HICON -#endif -#if !defined(LONG_PTR) -typedef long LONG_PTR; -#endif -#endif // _MSC_VER - -// added in 1.8.2 to gain a slightly faster speed but it is danger! -#define USEHEAPALLOC_DANGER -//#define DEBUGLOG - -#ifdef USEHEAPALLOC_DANGER - -// MSDN doc say use HEAP_NO_SERIALIZE is not good for process heap :( so change fromm 1 to 0 20111216 ,slower than using 1 -#define MYALLOC(x) HeapAlloc(hHeap,0,x) -#define MYALLOC0(x) HeapAlloc(hHeap,8,x) // (HEAP_NO_SERIALIZE|) HEAP_ZERO_MEMORY ,1|8 -#define MYFREE(x) HeapFree(hHeap,0,x) - -#else - -#define MYALLOC(x) GlobalAlloc(GMEM_FIXED,x) -#define MYALLOC0(x) GlobalAlloc(GPTR,x) -#define MYFREE(x) GlobalFree(x) - -#endif - - -// Some definations -#define SIZEOF_REG_DWORD 4 // In current windows, reg_dword's size=4 -#define NOTMATCH 0 // Define modification type in comparison results -#define ISMATCH 1 -#define ISDEL 2 -#define ISADD 3 -#define ISMODI 4 - -#define KEYADD 1 -#define KEYDEL 2 -#define VALADD 3 -#define VALDEL 4 -#define VALMODI 5 -#define FILEADD 6 -#define FILEDEL 7 -#define FILEMODI 8 -#define DIRADD 9 -#define DIRDEL 10 -#define DIRMODI 11 - -#define ESTIMATE_VALUEDATA_LENGTH 1024*1024 //Define estimated value data in scan -#define REFRESHINTERVAL 110 // Define progress refresh rate -#define MAXPBPOSITION 100 // Define progress bar length -#define COMMENTLENGTH 50 // Define commentfield length on the MainForm -#define HTMLWRAPLENGTH 1000 // Define html out put wrap length -#define MAXAMOUNTOFFILE 10000 // Define out put file counts -#define EXTDIRLEN MAX_PATH * 4 // Define searching directory field length -#define COMPUTERNAMELEN 64 // Define COMPUTER name length,do not change -#define HIVEBEGINOFFSET 512 // Hive file out put header computerlen*2+sizeof(systemtime)+32 must <hivebeginoffset!!!!!!!!!!!!!! -#define REGSHOT_HIVE_SIGNATURE "RSHIVE183" - - -// Some definitions of MutiLanguage strings [Free space length] -#define SIZEOF_LANGUAGE_SECTIONNAMES_BUFFER 2048 -#define SIZEOF_SINGLE_LANGUAGENAME 64 -#define SIZEOF_LANGSTRINGS 16384 -#define SIZEOF_ABOUTBOX 4096 - - -// Struct used for Windows Registry Key -struct _KEYCONTENT { - LPSTR lpkeyname; // Pointer to key's name - struct _VALUECONTENT FAR *lpfirstvalue; // Pointer to key's first value - struct _KEYCONTENT FAR *lpfirstsubkey; // Pointer to key's first subkey - struct _KEYCONTENT FAR *lpbrotherkey; // Pointer to key's brother - struct _KEYCONTENT FAR *lpfatherkey; // Pointer to key's father - size_t bkeymatch; // Flag used at comparing, 1.8.2<= is byte - -}; -typedef struct _KEYCONTENT KEYCONTENT, FAR *LPKEYCONTENT; - - -// Struct used for Windows Registry Value -struct _VALUECONTENT { - DWORD typecode; // Type of value [DWORD,STRING...] - DWORD datasize; // Value data size in bytes - LPSTR lpvaluename; // Pointer to value name - LPBYTE lpvaluedata; // Pointer to value data - struct _VALUECONTENT FAR *lpnextvalue; // Pointer to value's brother - struct _KEYCONTENT FAR *lpfatherkey; // Pointer to value's father[Key] - size_t bvaluematch; // Flag used at comparing, 1.8.2<= is byte -}; -typedef struct _VALUECONTENT VALUECONTENT, FAR *LPVALUECONTENT; - - -// Struct used for Windows File System -struct _FILECONTENT { - LPSTR lpfilename; // Pointer to filename - DWORD writetimelow; // File write time [LOW DWORD] - DWORD writetimehigh; // File write time [HIGH DWORD] - DWORD filesizelow; // File size [LOW DWORD] - DWORD filesizehigh; // File size [HIGH DWORD] - DWORD fileattr; // File attributes - DWORD cksum; // File checksum(plan to add in 1.8 not used now) - struct _FILECONTENT FAR *lpfirstsubfile; // Pointer to files[DIRS] first sub file - struct _FILECONTENT FAR *lpbrotherfile; // Pointer to files[DIRS] brother - struct _FILECONTENT FAR *lpfatherfile; // Pointer to files father - size_t bfilematch; // Flag used at comparing, 1.8.2<= is byte -}; -typedef struct _FILECONTENT FILECONTENT, FAR *LPFILECONTENT; - - -// Adjusted for filecontent saving. 1.8 -struct _HEADFILE { - struct _HEADFILE FAR *lpnextheadfile; // Pointer to next headfile struc - LPFILECONTENT lpfilecontent; // Pointer to filecontent -}; -typedef struct _HEADFILE HEADFILE, FAR *LPHEADFILE; - - -// Struct used for comparing result output -struct _COMRESULT { - LPSTR lpresult; // Pointer to result string - struct _COMRESULT FAR *lpnextresult; // Pointer to next _COMRESULT -}; -typedef struct _COMRESULT COMRESULT, FAR *LPCOMRESULT; - -// Struct for hive file header -struct _HIVEHEADER { - unsigned char signature[16]; // 16bytes offset 0 - DWORD offsetkeyhklm; // 4 offset 16 ( 512) - DWORD offsetkeyuser; // 4 offset 20 - DWORD offsetheadfile; // 4 offset 24 - DWORD reserved1; // 4 offset 28 future use! - unsigned char computername[64]; // 64 offset 32 - unsigned char username[64]; // 64 offset 96 username - SYSTEMTIME systemtime; // 8 * 2 = 16 bytes offset 160 - unsigned char reserved2[336]; // HIVEBEGINOFFSET(512) - sum(176) = 336 -}; -typedef struct _HIVEHEADER HIVEHEADER , FAR *LPHIVEHEADER; - - -//----------------- struct for saving designed by maddes ------------------------ - -struct _SAVEKEYCONTENT { - DWORD fpos_keyname; // Pointer to key's name - DWORD fpos_firstvalue; // Pointer to key's first value - DWORD fpos_firstsubkey; // Pointer to key's first subkey - DWORD fpos_brotherkey; // Pointer to key's brother - DWORD fpos_fatherkey; // Pointer to key's father - DWORD bkeymatch; // Flag used at comparing, 1.8.2 <= is byte - -}; -typedef struct _SAVEKEYCONTENT SAVEKEYCONTENT, FAR *LPSAVEKEYCONTENT; - - -// Struct used for Windows Registry Value -struct _SAVEVALUECONTENT { - DWORD typecode; // Type of value [DWORD,STRING...] - DWORD datasize; // Value data size in bytes - DWORD fpos_valuename; // Pointer to value name - DWORD fpos_valuedata; // Pointer to value data - DWORD fpos_nextvalue; // Pointer to value's brother - DWORD fpos_fatherkey; // Pointer to value's father[Key] - DWORD bvaluematch; // Flag used at comparing, 1.8.2 <= is byte -}; -typedef struct _SAVEVALUECONTENT SAVEVALUECONTENT, FAR *LPSAVEVALUECONTENT; - - -// Struct used for Windows File System -struct _SAVEFILECONTENT { - DWORD fpos_filename; // Pointer to filename - DWORD writetimelow; // File write time [LOW DWORD] - DWORD writetimehigh; // File write time [HIGH DWORD] - DWORD filesizelow; // File size [LOW DWORD] - DWORD filesizehigh; // File size [HIGH DWORD] - DWORD fileattr; // File attributes - DWORD cksum; // File checksum(plan to add in 1.8 not used now) - DWORD fpos_firstsubfile; // Pointer to files[DIRS] first sub file - DWORD fpos_brotherfile; // Pointer to files[DIRS] brother - DWORD fpos_fatherfile; // Pointer to files father - DWORD bfilematch; // Flag used at comparing, 1.8.2 <= is byte -}; -typedef struct _SAVEFILECONTENT SAVEFILECONTENT, FAR *LPSAVEFILECONTENT; - - -// Adjusted for filecontent saving. 1.8 -struct _SAVEHEADFILE { - DWORD fpos_nextheadfile; // Pointer to next headfile struc - DWORD fpos_filecontent; // Pointer to filecontent -}; -typedef struct _SAVEHEADFILE SAVEHEADFILE, FAR *LPSAVEHEADFILE; - - -// Pointers to compare result [see above] -LPCOMRESULT lpKEYADD; -LPCOMRESULT lpKEYDEL; -LPCOMRESULT lpVALADD; -LPCOMRESULT lpVALDEL; -LPCOMRESULT lpVALMODI; -LPCOMRESULT lpFILEADD; -LPCOMRESULT lpFILEDEL; -LPCOMRESULT lpFILEMODI; -LPCOMRESULT lpDIRADD; -LPCOMRESULT lpDIRDEL; -LPCOMRESULT lpDIRMODI; - - -LPCOMRESULT lpKEYADDHEAD; -LPCOMRESULT lpKEYDELHEAD; -LPCOMRESULT lpVALADDHEAD; -LPCOMRESULT lpVALDELHEAD; -LPCOMRESULT lpVALMODIHEAD; -LPCOMRESULT lpFILEADDHEAD; -LPCOMRESULT lpFILEDELHEAD; -LPCOMRESULT lpFILEMODIHEAD; -LPCOMRESULT lpDIRADDHEAD; -LPCOMRESULT lpDIRDELHEAD; -LPCOMRESULT lpDIRMODIHEAD; - - -// Number of Modification detected -DWORD nKEYADD; -DWORD nKEYDEL; -DWORD nVALADD; -DWORD nVALDEL; -DWORD nVALMODI; -DWORD nFILEADD; -DWORD nFILEDEL; -DWORD nFILEMODI; -DWORD nDIRADD; -DWORD nDIRDEL; -DWORD nDIRMODI; - - -// Some DWORD used to show the progress bar and etc -DWORD nGettingValue; -DWORD nGettingKey; -DWORD nComparing; -DWORD nRegStep; -DWORD nFileStep; -DWORD nSavingKey; -DWORD nGettingTime; -DWORD nBASETIME; -DWORD nBASETIME1; -DWORD nGettingFile; -DWORD nGettingDir; -DWORD nSavingFile; -//DWORD nMask = 0xf7fd; // not used now, but should be added -//DWORD nRegMessageCount = 0; -DWORD NBW; // that is: NumberOfBytesWritten; - - -// Pointers to Registry Key -LPKEYCONTENT lpHeadLocalMachine1; // Pointer to HKEY_LOCAL_MACHINE 1 -LPKEYCONTENT lpHeadLocalMachine2; // Pointer to HKEY_LOCAL_MACHINE 2 -LPKEYCONTENT lpHeadUsers1; // Pointer to HKEY_USERS 1 -LPKEYCONTENT lpHeadUsers2; -LPHEADFILE lpHeadFile1; // Pointer to headfile -LPHEADFILE lpHeadFile2; -LPBYTE lpTempHive1; // Pointer for loading hive files -LPBYTE lpTempHive2; -LPSTR lpComputerName1; -LPSTR lpComputerName2; -LPSTR lpUserName1; -LPSTR lpUserName2; -SYSTEMTIME FAR *lpSystemtime1, * lpSystemtime2; - - -// Some pointers need to allocate enough space to working -LPSTR lpKeyName; //following used in scan engine -LPSTR lpValueName; -LPBYTE lpValueData; -LPBYTE lpValueDataS; - - -LPSTR lpMESSAGE; -LPSTR lpExtDir; -LPSTR lpOutputpath; -LPSTR lpLastSaveDir; -LPSTR lpLastOpenDir; -LPSTR lpCurrentLanguage; -LPSTR lpWindowsDirName; -LPSTR lpTempPath; -LPSTR lpStartDir; -LPSTR lpLanguageIni; //For language.ini -LPSTR lpLangStrings; -LPSTR lpCurrentTranslator; -LPSTR lpRegshotIni; - -LPBYTE lpRegSkipStrings; -LPBYTE lpFileSkipStrings; -LPBYTE *lplpRegSkipStrings; -LPBYTE *lplpFileSkipStrings; -LPVOID lplpLangStrings; -//LPSTR REGSHOTDATFILE = "rgst152.dat"; -//LPSTR lpProgramDir; // tfx define -//LPSTR lpSnapKey; -//LPSTR lpSnapReturn; - - - -// Former definations used at Dynamic Monitor Engine. Not Used NOW -//#define DIOCPARAMSSIZE 20 // 4+4+4+8 bytes DIOCParams size! -//#define MAXLISTBOXLEN 1024 -//#define RING3TDLEN 8 // ring3 td name length -//LPSTR str_errorini = "Error create Dialog!"; -//INT tabarray[] = {40,106,426,466}; // the tabstops is the len addup! -//BOOL bWinNTDetected; -//UINT WM_REGSHOT = 0; - -#ifdef DEBUGLOG -LPSTR lstrdb1; -#endif - -MSG msg; // Windows MSG struct -HWND hWnd; // The handle of REGSHOT -HMENU hMenu; // The handles of shortcut menus -HMENU hMenuClear; // The handles of shortcut menus -HANDLE hFile; // Handle of file regshot use -HANDLE hFileWholeReg; // Handle of file regshot use -HCURSOR hHourGlass; // Handle of cursor -HCURSOR hSaveCursor; // Handle of cursor -BOOL is1; // Flag to determine is the 1st shot -BOOL is1LoadFromHive; // Flag to determine are shots load from hive files -BOOL is2LoadFromHive; // Flag to determine are shots load from hive files -RECT rect; // Window RECT -FILETIME ftLastWrite; // Filetime struct -BROWSEINFO BrowseInfo1; // BrowseINFO struct -OPENFILENAME opfn; // Openfilename struct -BOOL bUseLongRegHead; // 1.8.1 for compatible to 1.61e5 and undoreg1.46 -HANDLE hHeap; // 1.8.2 - -VOID LogToMem(DWORD actiontype, LPDWORD lpcount, LPVOID lp); -BOOL LoadSettingsFromIni(HWND hDlg); -BOOL SaveSettingsToIni(HWND hDlg); -BOOL IsInSkipList(LPSTR lpStr, LPBYTE *lpSkipList); -VOID UpdateCounters(LPBYTE title1, LPBYTE title2, DWORD count1, DWORD count2); -LPBYTE AtPos(LPBYTE lpMaster, LPBYTE lp, size_t size, size_t sizep); -BOOL GetLanguageType(HWND hDlg); -VOID GetDefaultStrings(VOID); -VOID PointToNewStrings(VOID); -BOOL GetLanguageStrings(HWND hDlg); -VOID CreateShotPopupMenu(VOID); -VOID UI_BeforeShot(DWORD id); -VOID UI_AfterShot(VOID); -VOID UI_BeforeClear(VOID); -VOID UI_AfterClear(VOID); - -VOID Shot1(void); -VOID Shot2(void); -BOOL CompareShots(void); -VOID SaveHive(LPKEYCONTENT lpKeyHLM, LPKEYCONTENT lpKeyUSER, LPHEADFILE lpHF, LPSTR computer, LPSTR user, LPVOID time); -BOOL LoadHive(LPKEYCONTENT FAR *lplpKeyHLM, LPKEYCONTENT FAR *lplpKeyUSER, LPHEADFILE FAR *lpHF, LPBYTE FAR *lpHive); -VOID FreeAllCompareResults(void); -VOID FreeAllKeyContent1(void); -VOID FreeAllKeyContent2(void); -VOID FreeAllFileHead(LPHEADFILE lp); -VOID ClearKeyMatchTag(LPKEYCONTENT lpKey); -VOID GetRegistrySnap(HKEY hkey, LPKEYCONTENT lpFatherKeyContent); // HWND hDlg, first para deleted in 1.8, return from void * to void -VOID GetFilesSnap(LPFILECONTENT lpFatherFile); // HWND hDlg, first para deleted in 1.8 -LPSTR GetWholeFileName(LPFILECONTENT lpFileContent); -VOID InitProgressBar(VOID); -VOID CompareFirstSubFile(LPFILECONTENT lpHead1, LPFILECONTENT lpHead2); -BOOL ReplaceInValidFileName(LPSTR lpf); -VOID ErrMsg(LPCSTR note); -VOID WriteHead(u_char *lpstr, DWORD count, BOOL isHTML); -VOID WritePart(LPCOMRESULT lpcomhead, BOOL isHTML, BOOL usecolor); -VOID WriteTitle(LPSTR lph, LPSTR lpb, BOOL isHTML); -VOID SaveFileContent(LPFILECONTENT lpFileContent, DWORD nFPCurrentFatherFile, DWORD nFPCaller); -VOID ClearHeadFileMatchTag(LPHEADFILE lpHF); -VOID FindDirChain(LPHEADFILE lpHF, LPSTR lpDir, size_t nMaxLen); -BOOL DirChainMatch(LPHEADFILE lphf1, LPHEADFILE lphf2); -VOID WriteHtmlbegin(void); -VOID WriteHtmlover(void); -VOID WriteHtmlbr(void); -VOID ReAlignFile(LPHEADFILE lpHF, size_t nBase); -VOID GetAllSubFile(BOOL needbrother, DWORD typedir, DWORD typefile, LPDWORD lpcountdir, LPDWORD lpcountfile, LPFILECONTENT lpFileContent); -VOID RebuildFromHive_filehead(LPSAVEHEADFILE lpSHF, LPHEADFILE lpHeadFile, LPBYTE lpHiveFileBase); -LPFILECONTENT SearchDirChain(LPSTR lpname, LPHEADFILE lpHF); - -#endif // REGSHOT_GLOBAL_H diff --git a/RegShot/src/language.c b/RegShot/src/language.c deleted file mode 100644 index abd5a21..0000000 --- a/RegShot/src/language.c +++ /dev/null @@ -1,323 +0,0 @@ -/* - Copyright 1999-2003,2007 TiANWEi - - This file is part of Regshot. - - Regshot is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Regshot is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Regshot; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "global.h" - -LPSTR str_DefaultLanguage = "English"; -LPSTR str_ItemTranslator = "Translator"; -LPSTR str_SectionCurrent = "CURRENT"; -LPSTR str_Original = "[Original]"; - -// This is the Pointer to Language Strings -LPBYTE lan_key; -LPBYTE lan_value; -LPBYTE lan_dir; -LPBYTE lan_file; -LPBYTE lan_time; -LPBYTE lan_keyadd; -LPBYTE lan_keydel; -LPBYTE lan_valadd; -LPBYTE lan_valdel; -LPBYTE lan_valmodi; -LPBYTE lan_fileadd; -LPBYTE lan_filedel; -LPBYTE lan_filemodi; -LPBYTE lan_diradd; -LPBYTE lan_dirdel; -LPBYTE lan_dirmodi; -LPBYTE lan_total; -LPBYTE lan_comments; -LPBYTE lan_datetime; -LPBYTE lan_computer; -LPBYTE lan_username; -LPBYTE lan_about; -LPBYTE lan_error; -LPBYTE lan_errorexecviewer; -LPBYTE lan_errorcreatefile; -LPBYTE lan_erroropenfile; -LPBYTE lan_errormovefp; -LPBYTE lan_menushot; -LPBYTE lan_menushotsave; -LPBYTE lan_menuload; -LPBYTE lan_menuclearallshots; -LPBYTE lan_menuclearshot1; -LPBYTE lan_menuclearshot2; - -// This is the dimension for MultiLanguage Default Strings[English] -unsigned char lan_default[][22] = { - "Keys:", - "Values:", - "Dirs:", - "Files:", - "Time:", - "Keys added:", - "Keys deleted:", - "Values added:", - "Values deleted:", - "Values modified:", - "Files added:", - "Files deleted:", - "Files[attr]modified:", - "Folders added:", - "Folders deleted:", - "Folders[attr]changed:", - "Total changes:", - "Comments:", - "Datetime:", - "Computer:", - "Username:", - "About", - "Error", - "Error call ex-viewer", - "Error create file", - "Error open file", - "Error move fp", - "&1st shot", - "&2nd shot", - "C&ompare", - "&Clear", - "&Quit", - "&About", - "&Monitor", - "Compare logs save as:", - "Output path:", - "Add comment into log:", - "Plain &TXT", - "&HTML document", - "&Scan dir1[;dir2;...]", - "&Shot", - "Shot and Sa&ve...", - "Loa&d...", - "&Clear All", - "Clear &1st shot", - "Clear &2nd shot" -}; - - -//-------------------------------------------------- -// Get language types -//-------------------------------------------------- -BOOL GetLanguageType(HWND hDlg) -{ - LRESULT nReturn; - BOOL bRet; - LPSTR lp; - LPSTR lpSectionNames = MYALLOC0(SIZEOF_LANGUAGE_SECTIONNAMES_BUFFER); - //LPSTR lpCurrentLanguage = MYALLOC0(SIZEOF_SINGLE_LANGUAGENAME); - - - nReturn = GetPrivateProfileSectionNames(lpSectionNames, SIZEOF_LANGUAGE_SECTIONNAMES_BUFFER, lpLanguageIni); - if (nReturn > 1) { - bRet = TRUE; - for (lp = lpSectionNames; *lp != 0; lp = lp + strlen(lp) + 1) { - if (_stricmp(lp, str_SectionCurrent) != 0) { - SendDlgItemMessage(hDlg, IDC_COMBOLANGUAGE, CB_ADDSTRING, (WPARAM)0, (LPARAM)lp); - } - } - GetPrivateProfileString(str_SectionCurrent, str_SectionCurrent, - str_DefaultLanguage, lpCurrentLanguage, 16, lpLanguageIni); - - nReturn = SendDlgItemMessage(hDlg, IDC_COMBOLANGUAGE, CB_FINDSTRINGEXACT, (WPARAM)0, (LPARAM)lpCurrentLanguage); - if (nReturn != CB_ERR) { - bRet = TRUE; - SendDlgItemMessage(hDlg, IDC_COMBOLANGUAGE, CB_SETCURSEL, (WPARAM)nReturn, (LPARAM)0); - } else { - bRet = FALSE; - } - - } else { - bRet = FALSE; - } - - MYFREE(lpSectionNames); - //MYFREE(lpCurrentLanguage); - return bRet; - -} - - -//-------------------------------------------------- -// Routines that show multi language -//-------------------------------------------------- -VOID GetDefaultStrings(VOID) -{ - //_asm int 3 - lan_key = lan_default[0]; - lan_value = lan_default[1]; - lan_dir = lan_default[2]; - lan_file = lan_default[3]; - lan_time = lan_default[4]; - lan_keyadd = lan_default[5]; - lan_keydel = lan_default[6]; - lan_valadd = lan_default[7]; - lan_valdel = lan_default[8]; - lan_valmodi = lan_default[9]; - lan_fileadd = lan_default[10]; - lan_filedel = lan_default[11]; - lan_filemodi = lan_default[12]; - lan_diradd = lan_default[13]; - lan_dirdel = lan_default[14]; - lan_dirmodi = lan_default[15]; - lan_total = lan_default[16]; - lan_comments = lan_default[17]; - lan_datetime = lan_default[18]; - lan_computer = lan_default[19]; - lan_username = lan_default[20]; - lan_about = lan_default[21]; - lan_error = lan_default[22]; - lan_errorexecviewer = lan_default[23]; - lan_errorcreatefile = lan_default[24]; - lan_erroropenfile = lan_default[25]; - lan_errormovefp = lan_default[26]; - lan_menushot = lan_default[40]; - lan_menushotsave = lan_default[41]; - lan_menuload = lan_default[42]; - lan_menuclearallshots = lan_default[43]; - lan_menuclearshot1 = lan_default[44]; - lan_menuclearshot2 = lan_default[45]; - -} - - -//-------------------------------------------------- -// Routines that show multi language -//-------------------------------------------------- -VOID PointToNewStrings(VOID) -{ - //LPDWORD lp = ldwTempStrings; - LPBYTE *lp = (LPBYTE *)lplpLangStrings; - - lan_key = *lp; - lp++; - lan_value = *lp; - lp++; - lan_dir = *lp; - lp++; - lan_file = *lp; - lp++; - lan_time = *lp; - lp++; - lan_keyadd = *lp; - lp++; - lan_keydel = *lp; - lp++; - lan_valadd = *lp; - lp++; - lan_valdel = *lp; - lp++; - lan_valmodi = *lp; - lp++; - lan_fileadd = *lp; - lp++; - lan_filedel = *lp; - lp++; - lan_filemodi = *lp; - lp++; - lan_diradd = *lp; - lp++; - lan_dirdel = *lp; - lp++; - lan_dirmodi = *lp; - lp++; - lan_total = *lp; - lp++; - lan_comments = *lp; - lp++; - lan_datetime = *lp; - lp++; - lan_computer = *lp; - lp++; - lan_username = *lp; - lp++; - lan_about = *lp; - lp++; - lan_error = *lp; - lp++; - lan_errorexecviewer = *lp; - lp++; - lan_errorcreatefile = *lp; - lp++; - lan_erroropenfile = *lp; - lp++; - lan_errormovefp = *lp; - lp += 14; - lan_menushot = *lp; - lp++; - lan_menushotsave = *lp; - lp++; - lan_menuload = *lp; - lp++; - lan_menuclearallshots = *lp; - lp++; - lan_menuclearshot1 = *lp; - lp++; - lan_menuclearshot2 = *lp; -} - - -//-------------------------------------------------- -// Routines that show multi language -//-------------------------------------------------- -BOOL GetLanguageStrings(HWND hDlg) -{ - LRESULT nIndex; - DWORD i; - BOOL bRet; - LPBYTE lpReturn; - //LPDWORD lp; - LPBYTE *lp; - char lpIniKey[16]; // 1.8.2 LPSTR lpIniKey = MYALLOC0(8); - - nIndex = SendDlgItemMessage(hDlg, IDC_COMBOLANGUAGE, CB_GETCURSEL, (WPARAM)0, (LPARAM)0); - if (nIndex != CB_ERR) { - - SendDlgItemMessage(hDlg, IDC_COMBOLANGUAGE, CB_GETLBTEXT, (WPARAM)nIndex, (LPARAM)lpCurrentLanguage); - WritePrivateProfileString(str_SectionCurrent, str_SectionCurrent, lpCurrentLanguage, lpLanguageIni); - ZeroMemory(lpLangStrings, SIZEOF_LANGSTRINGS); - GetPrivateProfileSection(lpCurrentLanguage, lpLangStrings, SIZEOF_LANGSTRINGS, lpLanguageIni); - for (i = 1, lp = (LPBYTE *)lplpLangStrings; i < 47; i++) { - - sprintf(lpIniKey, "%d%s", i, "="); - // pointer returned was pointed to char just after "=" - if ((lpReturn = AtPos((LPBYTE)lpLangStrings, (LPBYTE)lpIniKey, SIZEOF_LANGSTRINGS, strlen(lpIniKey))) != NULL) { - //_asm int 3; - //*(lp + i - 1) = (DWORD)lpReturn; - *(lp + i - 1) = lpReturn; - } else { - *(lp + i - 1) = lan_default[i - 1]; - } - - if (i >= 28 && i < 41 && i != 34) { - SetDlgItemText(hDlg, ID_BASE + 3 + i - 28, (LPSTR)(*(lp + i - 1))); - } - - } - - lpReturn = AtPos((LPBYTE)lpLangStrings, (LPBYTE)str_ItemTranslator, SIZEOF_LANGSTRINGS, strlen(str_ItemTranslator)); - lpCurrentTranslator = (lpReturn != NULL) ? ((LPSTR)lpReturn + 1) : str_Original; - PointToNewStrings(); - bRet = TRUE; - } else { - bRet = FALSE; - } - //MYFREE(lpCurrentLanguage); - //MYFREE(lpIniKey); - return bRet; -} diff --git a/RegShot/src/misc.c b/RegShot/src/misc.c deleted file mode 100644 index e48696a..0000000 --- a/RegShot/src/misc.c +++ /dev/null @@ -1,143 +0,0 @@ -/* - Copyright 1999-2003,2007 TiANWEi - - This file is part of Regshot. - - Regshot is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Regshot is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Regshot; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "global.h" - -extern LPBYTE lan_error; - - -//------------------------------------------------------------- -// Show error message -//------------------------------------------------------------- -VOID ErrMsg(LPCSTR note) -{ - MessageBox(hWnd, note, (LPCSTR)lan_error, MB_ICONHAND); -} - - -//------------------------------------------------------------- -// Routine to debug -//------------------------------------------------------------- -#ifdef DEBUGLOG -extern char *str_CR; -extern u_char *lan_errorcreatefile; -extern u_char *lan_errormovefp; - -VOID DebugLog(LPSTR filename, LPSTR lpstr, HWND hDlg, BOOL bisCR) -{ - DWORD length; - DWORD nPos; - - hFile = CreateFile(filename, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - if (hFile == INVALID_HANDLE_VALUE) { - ErrMsg((LPCSTR)lan_errorcreatefile); - } else { - nPos = SetFilePointer(hFile, 0, NULL, FILE_END); - if (nPos == 0xFFFFFFFF) { - ErrMsg((LPCSTR)lan_errormovefp); - } else { - - length = strlen(lpstr); - WriteFile(hFile, lpstr, length, &NBW, NULL); - if (NBW != length) { - //ErrMsg(lan_errorwritefile); - } - if (bisCR == TRUE) { - WriteFile(hFile, str_CR, sizeof(str_CR) - 1, &NBW, NULL); - } - } - } - CloseHandle(hFile); -} -#endif - - -//------------------------------------------------------------ -// Routine to replace invalid chars in comment fields -//------------------------------------------------------------ -BOOL ReplaceInValidFileName(LPSTR lpf) -{ - char lpInvalid[] = "\\/:*?\"<>|"; // 1.8.2 - DWORD i, j; - size_t nLen; - BOOL bLegal = FALSE; - nLen = strlen(lpf); - - for (i = 0; i < nLen; i++) { - for (j = 0; j < sizeof(lpInvalid) - 1; j++) { // changed at 1.8.2 from 9 to sizeof()-1 - if (*(lpf + i) == *(lpInvalid + j)) { - *(lpf + i) = '-'; // 0x2D; check for invalid chars and replace it (return FALSE;) - } else if (*(lpf + i) != 0x20 && *(lpf + i) != 0x09) { // At least one non-space, non-tab char needed! - bLegal = TRUE; - } - - } - } - return bLegal; -} - - -//-------------------------------------------------- -// Find lp's position in lpMaster (like At(), but not limit to str) -// add sizep :the size of lp, not using strlen -//-------------------------------------------------- -LPBYTE AtPos(LPBYTE lpMaster, LPBYTE lp, size_t size, size_t sizep) -{ - DWORD i, j; - //size_t nsizelp; - //nsizelp = strlen(lp); - - if (size <= sizep || sizep < 1) { - return NULL; - } - - for (i = 0; i < size - sizep; i++) { - for (j = 0; j < sizep; j++) { - if (*(lp + j) != *(lpMaster + i + j)) { - break; - } - } - //_asm int 3; - if (j == sizep) { - return lpMaster + i + sizep; - } - } - return NULL; - -} - - -//------------------------------------------------------------- -// Once, I thought about using own memory allocation method -//------------------------------------------------------------- -/*LPVOID MyHeapAlloc(DWORD type, DWORD size) -{ - if ((bTurboMode == FALSE) && ((lpMyHeap + size) < (lpMyHeap + MYHEAPSIZE))) - { - lpMyHeap = lpMyHeap + size; - if (type == LPTR) - ZeroMemory(lpMyHeap,size); - } - else - { - lpMyHeap = GlobalAlloc(type,size); - } - return lpMyHeap; -}*/ diff --git a/RegShot/src/output.c b/RegShot/src/output.c deleted file mode 100644 index a72caaf..0000000 --- a/RegShot/src/output.c +++ /dev/null @@ -1,179 +0,0 @@ -/* - Copyright 1999-2003,2007,2011 TiANWEi - Copyright 2007 Belogorokhov Youri - - This file is part of Regshot. - - Regshot is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Regshot is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Regshot; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "global.h" - - -// Some strings used to write to HTML or TEXT file, need [] to use with sizeof() -char str_CR[] = "\r\n"; // {0x0d,0x0a,0x00}; -char txt_line[] = "\r\n----------------------------------\r\n"; -char htm_BR[] = "<BR>"; -char htm_HTMLbegin[] = "<HTML>\r\n"; -char htm_HTMLover[] = "</HTML>"; -char htm_HEADbegin[] = "<HEAD>\r\n"; -char htm_HEADover[] = "</HEAD>\r\n"; -char htm_Td1Begin[] = "<TR><TD BGCOLOR = 669999 ALIGN = LEFT><FONT COLOR = WHITE><B>"; -char htm_Td2Begin[] = "<TR><TD NOWRAP><FONT COLOR = BLACK>"; -char htm_Td1Over[] = "</B></FONT></TD></TR>\r\n"; -char htm_Td2Over[] = "</FONT></TD></TR>\r\n"; -// color idea got from HANDLE(Youri) at wgapatcher.ru :) 1.8 -char htm_style[] = "<STYLE TYPE = \"text/css\">td{font-family:\"Tahoma\";font-size:9pt}\ -tr{font-size:9pt}body{font-size:9pt}\ -.o{background:#E0F0E0}.n{background:#FFFFFF}</STYLE>\r\n"; // 1.8.2 from e0e0e0 to e0f0e0 by Charles -char htm_BodyBegin[] = "<BODY BGCOLOR = FFFFFF TEXT = 000000 LINK = C8C8C8>\r\n"; -char htm_BodyOver[] = "</BODY>\r\n"; -char htm_TableBegin[] = "<TABLE BORDER = 0 WIDTH = 480>\r\n"; -char htm_TableOver[] = "</TABLE>\r\n"; -char htm_s1[] = "<span class = o>"; -char htm_s2[] = "<span class = n>"; -char htm_s3[] = "</span>\r\n"; -//char htm_website[] = "<FONT COLOR = C8C8C8>Bug reports to:<A HREF = \"http://sourceforge.net/projects/regshot/\">http://sourceforge.net/projects/regshot/</FONT></A>"; - - -//------------------------------------------------------------ -// Several routines to write to output file -//------------------------------------------------------------ -VOID WriteHead(u_char *lpstr, DWORD count, BOOL isHTML) -{ - char lpcount[8]; - sprintf(lpcount, "%d", count); - - if (isHTML == TRUE) { - WriteFile(hFile, htm_BR, sizeof(htm_BR) - 1, &NBW, NULL); - WriteFile(hFile, htm_TableBegin, sizeof(htm_TableBegin) - 1, &NBW, NULL); - WriteFile(hFile, htm_Td1Begin, sizeof(htm_Td1Begin) - 1, &NBW, NULL); - } else { - WriteFile(hFile, txt_line, sizeof(txt_line) - 1, &NBW, NULL); - } - WriteFile(hFile, lpstr, (DWORD)strlen((LPSTR)lpstr), &NBW, NULL); - WriteFile(hFile, lpcount, (DWORD)strlen(lpcount), &NBW, NULL); - - if (isHTML == TRUE) { - WriteFile(hFile, htm_Td1Over, sizeof(htm_Td1Over) - 1, &NBW, NULL); - WriteFile(hFile, htm_TableOver, sizeof(htm_TableOver) - 1, &NBW, NULL); - } else { - WriteFile(hFile, txt_line, sizeof(txt_line) - 1, &NBW, NULL); - } -} - - -//------------------------------------------------------------ -VOID WritePart(LPCOMRESULT lpcomhead, BOOL isHTML, BOOL usecolor) -{ - DWORD i; - size_t n; - size_t nLen; - LPSTR lpstr; - LPCOMRESULT lp; - - if (isHTML) { - WriteFile(hFile, htm_TableBegin, sizeof(htm_TableBegin) - 1, &NBW, NULL); - WriteFile(hFile, htm_Td2Begin, sizeof(htm_Td2Begin) - 1, &NBW, NULL); - } - - for (i = 0, lp = lpcomhead; lp != NULL; i++, lp = lp->lpnextresult) { - nLen = strlen(lp->lpresult); - lpstr = lp->lpresult; - if (isHTML) { - // 1.8.0 - if (usecolor && i % 2 == 0) { - WriteFile(hFile, htm_s1, sizeof(htm_s1) - 1, &NBW, NULL); - } else { - WriteFile(hFile, htm_s2, sizeof(htm_s2) - 1, &NBW, NULL); - } - } - - for (n = 0; nLen > 0;) { - nLen < HTMLWRAPLENGTH ? (n = nLen) : (n = HTMLWRAPLENGTH); - - WriteFile(hFile, lpstr, (DWORD)n, &NBW, NULL); - lpstr = lpstr + n; - nLen = nLen - n; - //WriteFile(hFile,lp->lpresult,strlen(lp->lpresult),&NBW,NULL); - if (isHTML) { - WriteFile(hFile, htm_BR, sizeof(htm_BR) - 1, &NBW, NULL); - } - //else - // WriteFile(hFile,str_CR,sizeof(str_CR) - 1,&NBW,NULL); - // for some reason, txt doesn't wrap anymore since 1.50e, check below! - } - - if (isHTML) { - if (usecolor) { - WriteFile(hFile, htm_s3, sizeof(htm_s3) - 1, &NBW, NULL); - } - } else { - WriteFile(hFile, str_CR, sizeof(str_CR) - 1, &NBW, NULL); // this! - } - - - } - - if (isHTML) { - WriteFile(hFile, htm_Td2Over, sizeof(htm_Td2Over) - 1, &NBW, NULL); - WriteFile(hFile, htm_TableOver, sizeof(htm_TableOver) - 1, &NBW, NULL); - } - -} - - -//------------------------------------------------------------ -VOID WriteTitle(LPSTR lph, LPSTR lpb, BOOL isHTML) -{ - if (isHTML) { - WriteFile(hFile, htm_TableBegin, sizeof(htm_TableBegin) - 1, &NBW, NULL); - WriteFile(hFile, htm_Td1Begin, sizeof(htm_Td1Begin) - 1, &NBW, NULL); - } - WriteFile(hFile, lph, (DWORD)strlen(lph), &NBW, NULL); - WriteFile(hFile, lpb, (DWORD)strlen(lpb), &NBW, NULL); - - if (isHTML) { - WriteFile(hFile, htm_Td1Over, sizeof(htm_Td1Over) - 1, &NBW, NULL); - WriteFile(hFile, htm_TableOver, sizeof(htm_TableOver) - 1, &NBW, NULL); - } else { - WriteFile(hFile, str_CR, sizeof(str_CR) - 1, &NBW, NULL); - } -} - - -// 1.8.0 -VOID WriteHtmlbegin(void) -{ - WriteFile(hFile, htm_HTMLbegin, sizeof(htm_HTMLbegin) - 1, &NBW, NULL); - WriteFile(hFile, htm_HEADbegin, sizeof(htm_HEADbegin) - 1, &NBW, NULL); - WriteFile(hFile, htm_style, sizeof(htm_style) - 1, &NBW, NULL); - WriteFile(hFile, htm_HEADover, sizeof(htm_HEADover) - 1, &NBW, NULL); - WriteFile(hFile, htm_BodyBegin, sizeof(htm_BodyBegin) - 1, &NBW, NULL); -} - - -VOID WriteHtmlover(void) -{ - //WriteFile(hFile,htm_website,sizeof(htm_website) - 1,&NBW,NULL); // omit at 1.8 - WriteFile(hFile, htm_BodyOver, sizeof(htm_BodyOver) - 1, &NBW, NULL); - WriteFile(hFile, htm_HTMLover, sizeof(htm_HTMLover) - 1, &NBW, NULL); -} - - -VOID WriteHtmlbr(void) -{ - WriteFile(hFile, htm_BR, sizeof(htm_BR) - 1, &NBW, NULL); -} diff --git a/RegShot/src/regshot.c b/RegShot/src/regshot.c deleted file mode 100644 index d43754b..0000000 --- a/RegShot/src/regshot.c +++ /dev/null @@ -1,1725 +0,0 @@ -/* - Copyright 1999-2003,2007,2011 TiANWEi - Copyright 2004 tulipfan - Copyright 2011 maddes - - This file is part of Regshot. - - Regshot is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Regshot is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Regshot; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "global.h" -#include "version.h" - -char str_DefResPre[] = REGSHOT_RESULT_FILE; -char str_filter[] = {"Regshot hive files [*.hiv]\0*.hiv\0All files\0*.*\0\0"}; -char str_RegshotHiveSignature[] = REGSHOT_HIVE_SIGNATURE; // Need [] to use with sizeof() must <12 -char str_ValueDataIsNULL[] = ": (NULL!)"; -SAVEKEYCONTENT sKC; -SAVEVALUECONTENT sVC; - - -extern LPBYTE lan_errorcreatefile; -extern LPBYTE lan_comments; -extern LPBYTE lan_datetime; -extern LPBYTE lan_computer; -extern LPBYTE lan_username; -extern LPBYTE lan_keydel; -extern LPBYTE lan_keyadd; -extern LPBYTE lan_valdel; -extern LPBYTE lan_valadd; -extern LPBYTE lan_valmodi; -extern LPBYTE lan_filedel; -extern LPBYTE lan_fileadd; -extern LPBYTE lan_filemodi; -extern LPBYTE lan_diradd; -extern LPBYTE lan_dirdel; -extern LPBYTE lan_dirmodi; -extern LPBYTE lan_total; -extern LPBYTE lan_key; -extern LPBYTE lan_value; -extern LPBYTE lan_dir; -extern LPBYTE lan_file; -extern LPBYTE lan_errorexecviewer; -extern LPBYTE lan_erroropenfile; - -extern char *str_prgname; // be careful of extern ref! Must be the same when declaring them, otherwise pointer would mis-point! -extern char str_CR[]; - - -//------------------------------------------------------------- -// Routine to get whole key name from KEYCONTENT -//------------------------------------------------------------- -LPSTR GetWholeKeyName(LPKEYCONTENT lpKeyContent) -{ - LPKEYCONTENT lpf; - LPSTR lpName; - LPSTR lptail; - size_t nLen = 0; - - for (lpf = lpKeyContent; lpf != NULL; lpf = lpf->lpfatherkey) { - nLen += strlen(lpf->lpkeyname) + 1; - } - if (nLen == 0) { - nLen++; - } - lpName = MYALLOC(nLen); - - lptail = lpName + nLen - 1; - *lptail = 0x00; - - for (lpf = lpKeyContent; lpf != NULL; lpf = lpf->lpfatherkey) { - nLen = strlen(lpf->lpkeyname); - memcpy(lptail -= nLen, lpf->lpkeyname, nLen); - if (lptail > lpName) { - *--lptail = '\\'; // 0x5c = '\\' - } - } - return lpName; -} - - -//------------------------------------------------------------- -// Routine to get whole value name from VALUECONTENT -//------------------------------------------------------------- -LPSTR GetWholeValueName(LPVALUECONTENT lpValueContent) -{ - LPKEYCONTENT lpf; - size_t nWholeLen; - size_t nLen; - LPSTR lpName; - LPSTR lptail; - - nLen = strlen(lpValueContent->lpvaluename); - nWholeLen = nLen + 1; - for (lpf = lpValueContent->lpfatherkey; lpf != NULL; lpf = lpf->lpfatherkey) { - nWholeLen += strlen(lpf->lpkeyname) + 1; - } - - lpName = MYALLOC(nWholeLen); - lptail = lpName + nWholeLen - 1; - - strcpy(lptail -= nLen, lpValueContent->lpvaluename); - *--lptail = '\\'; // 0x5c = '\\' - - for (lpf = lpValueContent->lpfatherkey; lpf != NULL; lpf = lpf->lpfatherkey) { - nLen = strlen(lpf->lpkeyname); - memcpy(lptail -= nLen, lpf->lpkeyname, nLen); - if (lptail > lpName) { - *--lptail = '\\'; // 0x5c = '\\' - } - } - return lpName; -} - - -//------------------------------------------------------------- -// Routine Trans VALUECONTENT.data[which in binary] into strings -// Called by GetWholeValueData() -//------------------------------------------------------------- -LPSTR TransData(LPVALUECONTENT lpValueContent, DWORD type) -{ - LPSTR lpvaluedata = NULL; - DWORD c; - DWORD size = lpValueContent->datasize; - - switch (type) { - - case REG_SZ: - // case REG_EXPAND_SZ: Not used any more, they all included in [default], - // because some non-regular value would corrupt this. - lpvaluedata = MYALLOC0(size + 5); // 5 is enough - strcpy(lpvaluedata, ": \""); - //if (lpValueContent->lpvaluedata != NULL) { - strcat(lpvaluedata, (const char *)lpValueContent->lpvaluedata); - //} - strcat(lpvaluedata, "\""); - // wsprintf has a bug that can not print string too long one time!); - //wsprintf(lpvaluedata,"%s%s%s",": \"",lpValueContent->lpvaluedata,"\""); - break; - case REG_MULTI_SZ: - // Be sure to add below line outside of following "if", - // for that GlobalFree(lp) must had lp already located! - lpvaluedata = MYALLOC0(size + 5); // 5 is enough - for (c = 0; c < size; c++) { - if (*((LPBYTE)(lpValueContent->lpvaluedata + c)) == 0) { - if (*((LPBYTE)(lpValueContent->lpvaluedata + c + 1)) != 0) { - *((LPBYTE)(lpValueContent->lpvaluedata + c)) = 0x20; // ??????? - } else { - break; - } - } - } - //*((LPBYTE)(lpValueContent->lpvaluedata + size)) = 0x00; // for some illegal multisz - strcpy(lpvaluedata, ": '"); - strcat(lpvaluedata, (const char *)lpValueContent->lpvaluedata); - strcat(lpvaluedata, "'"); - //wsprintf(lpvaluedata,"%s%s%s",": \"",lpValueContent->lpvaluedata,"\""); - break; - case REG_DWORD: - // case REG_DWORD_BIG_ENDIAN: Not used any more, they all included in [default] - lpvaluedata = MYALLOC0(SIZEOF_REG_DWORD * 2 + 5); // 13 is enough - sprintf(lpvaluedata, "%s%08X", ": 0x", *(LPDWORD)(lpValueContent->lpvaluedata)); - break; - default : - lpvaluedata = MYALLOC0(3 * (size + 1)); // 3*(size + 1) is enough - *lpvaluedata = 0x3a; - // for the resttype lengthofvaluedata doesn't contains the 0! - for (c = 0; c < size; c++) { - sprintf(lpvaluedata + 3 * c + 1, " %02X", *(lpValueContent->lpvaluedata + c)); - } - } - return lpvaluedata; -} - - -//------------------------------------------------------------- -// Routine to get whole value data from VALUECONTENT -//------------------------------------------------------------- -LPSTR GetWholeValueData(LPVALUECONTENT lpValueContent) -{ - LPSTR lpvaluedata = NULL; - DWORD c; - DWORD size = lpValueContent->datasize; - - if (lpValueContent->lpvaluedata != NULL) { //fix a bug at 20111228 - - switch (lpValueContent->typecode) { - case REG_SZ: - case REG_EXPAND_SZ: - //if (lpValueContent->lpvaluedata != NULL) { - if (size == (DWORD)strlen((const char *)(lpValueContent->lpvaluedata)) + 1) { - lpvaluedata = TransData(lpValueContent, REG_SZ); - } else { - lpvaluedata = TransData(lpValueContent, REG_BINARY); - } - //} else { - // lpvaluedata = TransData(lpValueContent, REG_SZ); - //} - break; - case REG_MULTI_SZ: - if (*((LPBYTE)(lpValueContent->lpvaluedata)) != 0x00) { - for (c = 0;; c++) { - if (*((LPWORD)(lpValueContent->lpvaluedata + c)) == 0) { - break; - } - } - if (size == c + 2) { - lpvaluedata = TransData(lpValueContent, REG_MULTI_SZ); - } else { - lpvaluedata = TransData(lpValueContent, REG_BINARY); - } - } else { - lpvaluedata = TransData(lpValueContent, REG_BINARY); - } - break; - case REG_DWORD: - case REG_DWORD_BIG_ENDIAN: - if (size == SIZEOF_REG_DWORD) { - lpvaluedata = TransData(lpValueContent, REG_DWORD); - } else { - lpvaluedata = TransData(lpValueContent, REG_BINARY); - } - break; - default : - lpvaluedata = TransData(lpValueContent, REG_BINARY); - } - } else { - lpvaluedata = MYALLOC0(sizeof(str_ValueDataIsNULL)); - strcpy(lpvaluedata, str_ValueDataIsNULL); - } - return lpvaluedata; -} - - -//------------------------------------------------------------- -// Routine to create new comparison result, distribute to different lp???MODI -//------------------------------------------------------------- -VOID CreateNewResult(DWORD actiontype, LPDWORD lpcount, LPSTR lpresult) -{ - LPCOMRESULT lpnew; - lpnew = (LPCOMRESULT)MYALLOC0(sizeof(COMRESULT)); - lpnew->lpresult = lpresult; - - switch (actiontype) { - case KEYADD: - *lpcount == 0 ? (lpKEYADDHEAD = lpnew) : (lpKEYADD->lpnextresult = lpnew); - lpKEYADD = lpnew; - break; - case KEYDEL: - *lpcount == 0 ? (lpKEYDELHEAD = lpnew) : (lpKEYDEL->lpnextresult = lpnew); - lpKEYDEL = lpnew; - break; - case VALADD: - *lpcount == 0 ? (lpVALADDHEAD = lpnew) : (lpVALADD->lpnextresult = lpnew); - lpVALADD = lpnew; - break; - case VALDEL: - *lpcount == 0 ? (lpVALDELHEAD = lpnew) : (lpVALDEL->lpnextresult = lpnew); - lpVALDEL = lpnew; - break; - case VALMODI: - *lpcount == 0 ? (lpVALMODIHEAD = lpnew) : (lpVALMODI->lpnextresult = lpnew); - lpVALMODI = lpnew; - break; - case FILEADD: - *lpcount == 0 ? (lpFILEADDHEAD = lpnew) : (lpFILEADD->lpnextresult = lpnew); - lpFILEADD = lpnew; - break; - case FILEDEL: - *lpcount == 0 ? (lpFILEDELHEAD = lpnew) : (lpFILEDEL->lpnextresult = lpnew); - lpFILEDEL = lpnew; - break; - case FILEMODI: - *lpcount == 0 ? (lpFILEMODIHEAD = lpnew) : (lpFILEMODI->lpnextresult = lpnew); - lpFILEMODI = lpnew; - break; - case DIRADD: - *lpcount == 0 ? (lpDIRADDHEAD = lpnew) : (lpDIRADD->lpnextresult = lpnew); - lpDIRADD = lpnew; - break; - case DIRDEL: - *lpcount == 0 ? (lpDIRDELHEAD = lpnew) : (lpDIRDEL->lpnextresult = lpnew); - lpDIRDEL = lpnew; - break; - case DIRMODI: - *lpcount == 0 ? (lpDIRMODIHEAD = lpnew) : (lpDIRMODI->lpnextresult = lpnew); - lpDIRMODI = lpnew; - break; - - } - (*lpcount)++; -} - - -//------------------------------------------------------------- -// Write comparison results into memory and call CreateNewResult() -//------------------------------------------------------------- -VOID LogToMem(DWORD actiontype, LPDWORD lpcount, LPVOID lp) -{ - LPSTR lpname; - LPSTR lpdata; - LPSTR lpall; - - if (actiontype == KEYADD || actiontype == KEYDEL) { - lpname = GetWholeKeyName(lp); - CreateNewResult(actiontype, lpcount, lpname); - } else { - if (actiontype == VALADD || actiontype == VALDEL || actiontype == VALMODI) { - - lpname = GetWholeValueName(lp); - lpdata = GetWholeValueData(lp); - lpall = MYALLOC(strlen(lpname) + strlen(lpdata) + 2); - // do not use:wsprintf(lpall,"%s%s",lpname,lpdata); !!! strlen limit! - strcpy(lpall, lpname); - strcat(lpall, lpdata); - MYFREE(lpname); - MYFREE(lpdata); - CreateNewResult(actiontype, lpcount, lpall); - } else { - lpname = GetWholeFileName(lp); - CreateNewResult(actiontype, lpcount, lpname); - } - - } -} - - -//------------------------------------------------------------- -// Routine to walk through sub keytree of current Key -//------------------------------------------------------------- -VOID GetAllSubName( - BOOL needbrother, - DWORD typekey, - DWORD typevalue, - LPDWORD lpcountkey, - LPDWORD lpcountvalue, - LPKEYCONTENT lpKeyContent -) -{ - - LPVALUECONTENT lpv; - LogToMem(typekey, lpcountkey, lpKeyContent); - - if (lpKeyContent->lpfirstsubkey != NULL) { - GetAllSubName(TRUE, typekey, typevalue, lpcountkey, lpcountvalue, lpKeyContent->lpfirstsubkey); - } - - if (needbrother == TRUE) - if (lpKeyContent->lpbrotherkey != NULL) { - GetAllSubName(TRUE, typekey, typevalue, lpcountkey, lpcountvalue, lpKeyContent->lpbrotherkey); - } - - for (lpv = lpKeyContent->lpfirstvalue; lpv != NULL; lpv = lpv->lpnextvalue) { - LogToMem(typevalue, lpcountvalue, lpv); - } -} - - -//------------------------------------------------------------- -// Routine to walk through all values of current key -//------------------------------------------------------------- -VOID GetAllValue(DWORD typevalue, LPDWORD lpcountvalue, LPKEYCONTENT lpKeyContent) -{ - LPVALUECONTENT lpv; - for (lpv = lpKeyContent->lpfirstvalue; lpv != NULL; lpv = lpv->lpnextvalue) { - LogToMem(typevalue, lpcountvalue, lpv); - } -} - - -//------------------------------------------------------------- -// Routine to free all comparison results (release memory) -//------------------------------------------------------------- -VOID FreeAllCom(LPCOMRESULT lpComResult) -{ - LPCOMRESULT lp; - LPCOMRESULT lpold; - - for (lp = lpComResult; lp != NULL;) { - if (lp->lpresult != NULL) { - MYFREE(lp->lpresult); - } - lpold = lp; - lp = lp->lpnextresult; - MYFREE(lpold); - } - -} - - -//------------------------------------------------------------- -// Routine to free all keys and values -//------------------------------------------------------------- -VOID FreeAllKey(LPKEYCONTENT lpKey) -{ - LPVALUECONTENT lpv; - LPVALUECONTENT lpvold; - - if (lpKey != NULL) { - FreeAllKey(lpKey->lpfirstsubkey); - FreeAllKey(lpKey->lpbrotherkey); - for (lpv = lpKey->lpfirstvalue; lpv != NULL;) { - MYFREE(lpv->lpvaluename); - if (lpv->lpvaluedata != NULL) { - MYFREE(lpv->lpvaluedata); - } - lpvold = lpv; - lpv = lpv->lpnextvalue; - MYFREE(lpvold); - } - MYFREE(lpKey->lpkeyname); - MYFREE(lpKey); - } - -} - -#ifdef _WIN64 -//------------------------------------------------------------- -//only for rebuild from hive,the name things remain in lptemphive -//------------------------------------------------------------- -VOID FreeAllKeyExceptNameValue(LPKEYCONTENT lpKey) -{ - LPVALUECONTENT lpv; - LPVALUECONTENT lpvold; - - if (lpKey != NULL) { - FreeAllKeyExceptNameValue(lpKey->lpfirstsubkey); - FreeAllKeyExceptNameValue(lpKey->lpbrotherkey); - for (lpv = lpKey->lpfirstvalue; lpv != NULL;) { - lpvold = lpv; - lpv = lpv->lpnextvalue; - MYFREE(lpvold); - } - MYFREE(lpKey); - } - -} - -#endif -//------------------------------------------------------------- -// Clear RegFlag previous made by comparison routine for the next comparison -//------------------------------------------------------------- -VOID ClearKeyMatchTag(LPKEYCONTENT lpKey) -{ - LPVALUECONTENT lpv; - - if (lpKey != NULL) { - lpKey->bkeymatch = 0; - for (lpv = lpKey->lpfirstvalue; lpv != NULL; lpv = lpv->lpnextvalue) { - lpv->bvaluematch = 0; - } - - //if (lpKey->lpfirstsubkey != NULL) // not used in 1.8 - { - ClearKeyMatchTag(lpKey->lpfirstsubkey); - } - - //if (lpKey->lpbrotherkey != NULL) // not used in 1.8 - { - ClearKeyMatchTag(lpKey->lpbrotherkey); - } - } -} - - -//------------------------------------------------------------- -// Clear Filematch Flag (core) -//------------------------------------------------------------- -VOID ClearFileContentMatchTag(LPFILECONTENT lpFC) -{ - if (lpFC != NULL) { - lpFC->bfilematch = 0; - //if (lpFC->lpfirstsubfile != NULL) - ClearFileContentMatchTag(lpFC->lpfirstsubfile); - //if (lpFC->lpbrotherfile != NULL) - ClearFileContentMatchTag(lpFC->lpbrotherfile); - } -} - - -//------------------------------------------------------------- -// Clear Filematch Flag previous made by comparison routine for the next comparison -//------------------------------------------------------------- -VOID ClearHeadFileMatchTag(LPHEADFILE lpHF) -{ - LPHEADFILE lphf; - - for (lphf = lpHF; lphf != NULL; lphf = lphf->lpnextheadfile) { - ClearFileContentMatchTag(lphf->lpfilecontent); - } -} - - -////////////////////////////////////// -VOID FreeAllKeyContent1(void) -{ - if (is1LoadFromHive) { -#ifdef _WIN64 - FreeAllKeyExceptNameValue(lpHeadLocalMachine1); - FreeAllKeyExceptNameValue(lpHeadUsers1); -#endif - MYFREE(lpTempHive1); // Note, together we free the filecontent! - lpTempHive1 = NULL; - lpHeadFile1 = NULL; // We add here - } else { - FreeAllKey(lpHeadLocalMachine1); - FreeAllKey(lpHeadUsers1); - } - lpHeadLocalMachine1 = NULL; - lpHeadUsers1 = NULL; - *lpComputerName1 = 0; - *lpUserName1 = 0; - -} - - -VOID FreeAllKeyContent2(void) -{ - if (is2LoadFromHive) { -#ifdef _WIN64 - FreeAllKeyExceptNameValue(lpHeadLocalMachine2); - FreeAllKeyExceptNameValue(lpHeadUsers2); -#endif - MYFREE(lpTempHive2); // Note, together we free the filecontent! - lpTempHive2 = NULL; - lpHeadFile2 = NULL; // We add here! - } else { - FreeAllKey(lpHeadLocalMachine2); - FreeAllKey(lpHeadUsers2); - } - lpHeadLocalMachine2 = NULL; - lpHeadUsers2 = NULL; - *lpComputerName2 = 0; - *lpUserName2 = 0; - -} - - -VOID FreeAllCompareResults(void) -{ - FreeAllCom(lpKEYADDHEAD); - FreeAllCom(lpKEYDELHEAD); - FreeAllCom(lpVALADDHEAD); - FreeAllCom(lpVALDELHEAD); - FreeAllCom(lpVALMODIHEAD); - FreeAllCom(lpFILEADDHEAD); - FreeAllCom(lpFILEDELHEAD); - FreeAllCom(lpFILEMODIHEAD); - FreeAllCom(lpDIRADDHEAD); - FreeAllCom(lpDIRDELHEAD); - FreeAllCom(lpDIRMODIHEAD); - - - nKEYADD = 0; - nKEYDEL = 0; - nVALADD = 0; - nVALDEL = 0; - nVALMODI = 0; - nFILEADD = 0; - nFILEDEL = 0; - nFILEMODI = 0; - nDIRADD = 0; - nDIRDEL = 0; - nDIRMODI = 0; - lpKEYADDHEAD = NULL; - lpKEYDELHEAD = NULL; - lpVALADDHEAD = NULL; - lpVALDELHEAD = NULL; - lpVALMODIHEAD = NULL; - lpFILEADDHEAD = NULL; - lpFILEDELHEAD = NULL; - lpFILEMODIHEAD = NULL; - lpDIRADDHEAD = NULL; - lpDIRDELHEAD = NULL; - lpDIRMODIHEAD = NULL; -} - - -//------------------------------------------------------------- -// Registry comparison engine -//------------------------------------------------------------- -VOID *CompareFirstSubKey(LPKEYCONTENT lpHead1, LPKEYCONTENT lpHead2) -{ - LPKEYCONTENT lp1; - LPKEYCONTENT lp2; - LPVALUECONTENT lpvalue1; - LPVALUECONTENT lpvalue2; - //DWORD i; - - for (lp1 = lpHead1; lp1 != NULL; lp1 = lp1->lpbrotherkey) { - for (lp2 = lpHead2; lp2 != NULL; lp2 = lp2->lpbrotherkey) { - if ((lp2->bkeymatch == NOTMATCH) && strcmp(lp1->lpkeyname, lp2->lpkeyname) == 0) { // 1.8.2 from lstrcmp to strcmp - // Same key found! We compare their values and their subkeys! - - lp2->bkeymatch = ISMATCH; - if (lp1->lpfirstvalue == NULL && lp2->lpfirstvalue != NULL) { - // Key1 has no values, so lpvalue2 is added! We find all values that belong to lp2! - GetAllValue(VALADD, &nVALADD, lp2); - } else { - if (lp1->lpfirstvalue != NULL && lp2->lpfirstvalue == NULL) { - // Key2 has no values, so lpvalue1 is deleted! We find all values that belong to lp1! - GetAllValue(VALDEL, &nVALDEL, lp1); - } else { - // Two keys all has values, so we loop them - - for (lpvalue1 = lp1->lpfirstvalue; lpvalue1 != NULL; lpvalue1 = lpvalue1->lpnextvalue) { - for (lpvalue2 = lp2->lpfirstvalue; lpvalue2 != NULL; lpvalue2 = lpvalue2->lpnextvalue) { - // Loop lp2 to find a value matchs lp1's - if ((lpvalue2->bvaluematch == NOTMATCH) && (lpvalue1->typecode == lpvalue2->typecode)) { - // Same valuedata type - if (strcmp(lpvalue1->lpvaluename, lpvalue2->lpvaluename) == 0) { // 1.8.2 from lstrcmp to strcmp - // Same valuename - if (lpvalue1->datasize == lpvalue2->datasize) { - // Same size of valuedata - /*for (i = 0; i < lpvalue1->datasize;i++) - { - if (*((lpvalue1->lpvaluedata) + i) != *((lpvalue2->lpvaluedata)+i)) - break; - } - if (i == lpvalue1->datasize)*/ - if (memcmp(lpvalue1->lpvaluedata, lpvalue2->lpvaluedata, lpvalue1->datasize) == 0) { // 1.8.2 - // Same valuedata, keys are the same! - - lpvalue2->bvaluematch = ISMATCH; - break; // Be sure not to do lp2 == NULL - } else { - // Valuedata not match due to data mismatch, we found a modified valuedata!***** - lpvalue2->bvaluematch = ISMODI; - LogToMem(VALMODI, &nVALMODI, lpvalue1); - LogToMem(VALMODI, &nVALMODI, lpvalue2); - nVALMODI--; - break; - } - } else { - // Valuedata does not match due to size, we found a modified valuedata!****** - lpvalue2->bvaluematch = ISMODI; - LogToMem(VALMODI, &nVALMODI, lpvalue1); - LogToMem(VALMODI, &nVALMODI, lpvalue2); - nVALMODI--; - break; - } - } - } - } - if (lpvalue2 == NULL) { - // We found a value in lp1 but not in lp2, we found a deleted value***** - LogToMem(VALDEL, &nVALDEL, lpvalue1); - } - } - // After we loop to end, we do extra loop use flag we previously made to get added values - for (lpvalue2 = lp2->lpfirstvalue; lpvalue2 != NULL; lpvalue2 = lpvalue2->lpnextvalue) { - if (lpvalue2->bvaluematch != ISMATCH && lpvalue2->bvaluematch != ISMODI) { - // We found a value in lp2's but not in lp1's ,we found a added value**** - LogToMem(VALADD, &nVALADD, lpvalue2); - - } - } - } - } - - ////////////////////////////////////////////////////////////// - // After we walk through the values above, we now try to loop the sub keys of current key - if (lp1->lpfirstsubkey == NULL && lp2->lpfirstsubkey != NULL) { - // lp2's firstsubkey added! - GetAllSubName(TRUE, KEYADD, VALADD, &nKEYADD, &nVALADD, lp2->lpfirstsubkey); - } - if (lp1->lpfirstsubkey != NULL && lp2->lpfirstsubkey == NULL) { - // lp1's firstsubkey deleted! - GetAllSubName(TRUE, KEYDEL, VALDEL, &nKEYDEL, &nVALDEL, lp1->lpfirstsubkey); - } - if (lp1->lpfirstsubkey != NULL && lp2->lpfirstsubkey != NULL) { - CompareFirstSubKey(lp1->lpfirstsubkey, lp2->lpfirstsubkey); - } - break; - } - } - if (lp2 == NULL) { - // We did not find a lp2 matches a lp1, so lp1 is deleted! - GetAllSubName(FALSE, KEYDEL, VALDEL, &nKEYDEL, &nVALDEL, lp1); - } - - } - - // After we loop to end, we do extra loop use flag we previously made to get added keys - for (lp2 = lpHead2; lp2 != NULL; lp2 = lp2->lpbrotherkey) { // ->lpbrotherkey - nComparing++; - if (lp2->bkeymatch == NOTMATCH) { - // We did not find a lp1 matches a lp2,so lp2 is added! - GetAllSubName(FALSE, KEYADD, VALADD, &nKEYADD, &nVALADD, lp2); - } - } - - // Progress bar update - if (nGettingKey != 0) - if (nComparing % nGettingKey > nRegStep) { - nComparing = 0; - SendDlgItemMessage(hWnd, IDC_PBCOMPARE, PBM_STEPIT, (WPARAM)0, (LPARAM)0); - } - - return NULL; -} - - -//------------------------------------------------------------ -// Routine to call registry/file comparison engine -//------------------------------------------------------------ -BOOL CompareShots(void) -{ - BOOL isHTML; - BOOL bshot2isnewer; - //BOOL bSaveWithCommentName; - LPSTR lpstrcomp; - LPSTR lpExt; - LPSTR lpDestFileName; - DWORD buffersize = 2048; - DWORD nTotal; - size_t nLengthofStr; - LPHEADFILE lphf1; - LPHEADFILE lphf2; - LPFILECONTENT lpfc1; - LPFILECONTENT lpfc2; - FILETIME ftime1; - FILETIME ftime2; - - - if (!DirChainMatch(lpHeadFile1, lpHeadFile2)) { - MessageBox(hWnd, "Found two shots with different DIR chain! (or with different order)\r\nYou can continue, but file comparison result would be abnormal!", "Warning", MB_ICONWARNING); - } - - InitProgressBar(); - - SystemTimeToFileTime(lpSystemtime1, &ftime1); - SystemTimeToFileTime(lpSystemtime2, &ftime2); - - bshot2isnewer = (CompareFileTime(&ftime1, &ftime2) <= 0) ? TRUE : FALSE; - if (bshot2isnewer) { - CompareFirstSubKey(lpHeadLocalMachine1, lpHeadLocalMachine2); - CompareFirstSubKey(lpHeadUsers1, lpHeadUsers2); - } else { - CompareFirstSubKey(lpHeadLocalMachine2, lpHeadLocalMachine1); - CompareFirstSubKey(lpHeadUsers2, lpHeadUsers1); - } - - SendDlgItemMessage(hWnd, IDC_PBCOMPARE, PBM_SETPOS, (WPARAM)0, (LPARAM)0); - - // Dir comparison v1.8.1 - // determine newer - if (bshot2isnewer) { - lphf1 = lpHeadFile1; - lphf2 = lpHeadFile2; - } else { - lphf1 = lpHeadFile2; - lphf2 = lpHeadFile1; - } - // first loop - for (; lphf1 != NULL; lphf1 = lphf1->lpnextheadfile) { - if (lphf1->lpfilecontent != NULL) { - lpfc1 = lphf1->lpfilecontent; - } else { - lpfc1 = NULL; - } - - if (lpfc1 != NULL) { - if ((lpfc2 = SearchDirChain(lpfc1->lpfilename, lphf2)) != NULL) { // note lphf2 should not changed here! - CompareFirstSubFile(lpfc1, lpfc2); // if found, we do compare - } else { // cannot find matched lpfc1 in lphf2 chain. - GetAllSubFile(FALSE, DIRDEL, FILEDEL, &nDIRDEL, &nFILEDEL, lpfc1); - } - } - } - // reset pointers - if (bshot2isnewer) { - lphf1 = lpHeadFile1; - lphf2 = lpHeadFile2; - } else { - lphf1 = lpHeadFile2; - lphf2 = lpHeadFile1; - } - // second loop - for (; lphf2 != NULL; lphf2 = lphf2->lpnextheadfile) { - if (lphf2->lpfilecontent != NULL) { - lpfc2 = lphf2->lpfilecontent; - } else { - lpfc2 = NULL; - } - if (lpfc2 != NULL) { - if ((lpfc1 = SearchDirChain(lpfc2->lpfilename, lphf1)) == NULL) { // in the second loop we only find those do not match - GetAllSubFile(FALSE, DIRADD, FILEADD, &nDIRADD, &nFILEADD, lpfc2); - } - } - } - /* silly one used in 1.8.0 - for (lphf1 = lpHeadFile1,lphf2 = lpHeadFile2;;) - { - // Normally, two lphf should run parallel, otherwise something abnormal should happen :( - if (lphf1 != NULL && lphf1->lpfilecontent != NULL) - lpfc1 = lphf1->lpfilecontent; - else - lpfc1 = NULL; - if (lphf2 != NULL && lphf2->lpfilecontent != NULL) - lpfc2 = lphf2->lpfilecontent; - else - lpfc2 = NULL; - if (lpfc1 == NULL && lpfc2 == NULL) - break; - if (bshot2isnewer) - CompareFirstSubFile(lpfc1,lpfc2); - else - CompareFirstSubFile(lpfc2,lpfc1); - - if (lphf1 != NULL) - lphf1 = lphf1->lpnextheadfile; - if (lphf2 != NULL) - lphf2 = lphf2->lpnextheadfile; - - } - */ - SendDlgItemMessage(hWnd, IDC_PBCOMPARE, PBM_SETPOS, (WPARAM)MAXPBPOSITION, (LPARAM)0); - - if (SendMessage(GetDlgItem(hWnd, IDC_RADIO1), BM_GETCHECK, (WPARAM)0, (LPARAM)0) == 1) { - isHTML = FALSE; - lpExt = ".txt"; - } else { - isHTML = TRUE; - lpExt = ".htm"; - } - - lpDestFileName = MYALLOC0(MAX_PATH * 4 + 4); - lpstrcomp = MYALLOC0(buffersize); // buffersize must> commentlength+10 .txt 0000 - GetDlgItemText(hWnd, IDC_EDITCOMMENT, lpstrcomp, COMMENTLENGTH); - GetDlgItemText(hWnd, IDC_EDITPATH, lpOutputpath, MAX_PATH); - - nLengthofStr = strlen(lpOutputpath); - - if (nLengthofStr > 0 && *(lpOutputpath + nLengthofStr - 1) != '\\') { - *(lpOutputpath + nLengthofStr) = '\\'; - *(lpOutputpath + nLengthofStr + 1) = 0x00; // bug found by "itschy" <itschy@lycos.de> 1.61d->1.61e - nLengthofStr++; - } - strcpy(lpDestFileName, lpOutputpath); - - //bSaveWithCommentName = TRUE; - if (ReplaceInValidFileName(lpstrcomp)) { - strcat(lpDestFileName, lpstrcomp); - } else { - strcat(lpDestFileName, str_DefResPre); - } - - nLengthofStr = strlen(lpDestFileName); - strcat(lpDestFileName, lpExt); - hFile = CreateFile(lpDestFileName, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); - if (hFile == INVALID_HANDLE_VALUE) { - DWORD filetail = 0; - - for (filetail = 0; filetail < MAXAMOUNTOFFILE; filetail++) { - sprintf(lpDestFileName + nLengthofStr, "_%04d", filetail); - //*(lpDestFileName+nLengthofStr + 5) = 0x00; - strcpy(lpDestFileName + nLengthofStr + 5, lpExt); - - hFile = CreateFile(lpDestFileName, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); - if (hFile == INVALID_HANDLE_VALUE) { - if (GetLastError() == ERROR_FILE_EXISTS) { // My God! I use stupid ERROR_ALREADY_EXISTS first!! - continue; - } else { - ErrMsg((LPCSTR)lan_errorcreatefile); - return FALSE; - } - } else { - break; - } - } - if (filetail >= MAXAMOUNTOFFILE) { - ErrMsg((LPCSTR)lan_errorcreatefile); - return FALSE; - } - - } - - if (isHTML == TRUE) { - WriteHtmlbegin(); - } - - WriteFile(hFile, str_prgname, (DWORD)strlen(str_prgname), &NBW, NULL); - WriteFile(hFile, str_CR, (DWORD)strlen(str_CR), &NBW, NULL); - - //_asm int 3; - GetDlgItemText(hWnd, IDC_EDITCOMMENT, lpstrcomp, COMMENTLENGTH); - WriteTitle((LPSTR)lan_comments, lpstrcomp, isHTML); - - - sprintf(lpstrcomp, "%d%s%d%s%d %02d%s%02d%s%02d %s %d%s%d%s%d %02d%s%02d%s%02d", - lpSystemtime1->wYear, "/", - lpSystemtime1->wMonth, "/", - lpSystemtime1->wDay, - lpSystemtime1->wHour, ":", - lpSystemtime1->wMinute, ":", - lpSystemtime1->wSecond, " , ", - lpSystemtime2->wYear, "/", - lpSystemtime2->wMonth, "/", - lpSystemtime2->wDay, - lpSystemtime2->wHour, ":", - lpSystemtime2->wMinute, ":", - lpSystemtime2->wSecond - - ); - - WriteTitle((LPSTR)lan_datetime, lpstrcomp, isHTML); - - - *lpstrcomp = 0x00; //ZeroMemory(lpstrcomp,buffersize); - //GetComputerName(lpstrcomp,&buffersize); - strcpy(lpstrcomp, lpComputerName1); - strcat(lpstrcomp, " , "); - strcat(lpstrcomp, lpComputerName2); - WriteTitle((LPSTR)lan_computer, lpstrcomp, isHTML); - - *lpstrcomp = 0x00; //ZeroMemory(lpstrcomp,buffersize); - //GetUserName(lpstrcomp,&buffersize); - strcpy(lpstrcomp, lpUserName1); - strcat(lpstrcomp, " , "); - strcat(lpstrcomp, lpUserName2); - - WriteTitle((LPSTR)lan_username, lpstrcomp, isHTML); - - MYFREE(lpstrcomp); - - // Write keydel part - if (nKEYDEL != 0) { - WriteHead(lan_keydel, nKEYDEL, isHTML); - WritePart(lpKEYDELHEAD, isHTML, FALSE); - } - // Write keyadd part - if (nKEYADD != 0) { - WriteHead(lan_keyadd, nKEYADD, isHTML); - WritePart(lpKEYADDHEAD, isHTML, FALSE); - } - // Write valdel part - if (nVALDEL != 0) { - WriteHead(lan_valdel, nVALDEL, isHTML); - WritePart(lpVALDELHEAD, isHTML, FALSE); - } - // Write valadd part - if (nVALADD != 0) { - WriteHead(lan_valadd, nVALADD, isHTML); - WritePart(lpVALADDHEAD, isHTML, FALSE); - } - // Write valmodi part - if (nVALMODI != 0) { - WriteHead(lan_valmodi, nVALMODI, isHTML); - WritePart(lpVALMODIHEAD, isHTML, TRUE); - } - // Write file add part - if (nFILEADD != 0) { - WriteHead(lan_fileadd, nFILEADD, isHTML); - WritePart(lpFILEADDHEAD, isHTML, FALSE); - } - // Write file del part - if (nFILEDEL != 0) { - WriteHead(lan_filedel, nFILEDEL, isHTML); - WritePart(lpFILEDELHEAD, isHTML, FALSE); - } - // Write file modi part - if (nFILEMODI != 0) { - WriteHead(lan_filemodi, nFILEMODI, isHTML); - WritePart(lpFILEMODIHEAD, isHTML, FALSE); - } - // Write directory add part - if (nDIRADD != 0) { - WriteHead(lan_diradd, nDIRADD, isHTML); - WritePart(lpDIRADDHEAD, isHTML, FALSE); - } - // Write directory del part - if (nDIRDEL != 0) { - WriteHead(lan_dirdel, nDIRDEL, isHTML); - WritePart(lpDIRDELHEAD, isHTML, FALSE); - } - // Write directory modi part - if (nDIRMODI != 0) { - WriteHead(lan_dirmodi, nDIRMODI, isHTML); - WritePart(lpDIRMODIHEAD, isHTML, FALSE); - } - - nTotal = nKEYADD + nKEYDEL + nVALADD + nVALDEL + nVALMODI + nFILEADD + nFILEDEL + nFILEMODI + nDIRADD + nDIRDEL + nDIRMODI; - if (isHTML == TRUE) { - WriteHtmlbr(); - } - WriteHead(lan_total, nTotal, isHTML); - if (isHTML == TRUE) { - WriteHtmlover(); - } - - - CloseHandle(hFile); - - if ((size_t)ShellExecute(hWnd, "open", lpDestFileName, NULL, NULL, SW_SHOW) <= 32) { - ErrMsg((LPCSTR)lan_errorexecviewer); - } - MYFREE(lpDestFileName); - - - return TRUE; -} - - -//------------------------------------------------------------ -// Registry shot engine -//------------------------------------------------------------ -VOID GetRegistrySnap(HKEY hkey, LPKEYCONTENT lpFatherKeyContent) -{ - - HKEY Subhkey; - DWORD i; - DWORD NTr; - DWORD TypeCode; - DWORD LengthOfKeyName; - DWORD LengthOfValueName; - DWORD LengthOfValueData; - DWORD LengthOfLongestValueName; - DWORD LengthOfLongestValueData; - DWORD LengthOfLongestSubkeyName; - //LPSTR lpValueName; - //LPBYTE lpValueData; - LPKEYCONTENT lpKeyContent; - LPVALUECONTENT lpValueContent; - LPKEYCONTENT lpKeyContentLast; - LPVALUECONTENT lpValueContentLast; - - lpKeyContentLast = NULL; - lpValueContentLast = NULL; - - // To detemine MAX length - if (RegQueryInfoKey( - hkey, - NULL, // lpClassName_nouse, - NULL, // &nClassName_nouse_length, - NULL, - NULL, // &NumberOfSubkeys, - &LengthOfLongestSubkeyName, // chars - NULL, // &nClassName_nouse_longestlength, - NULL, // &NumberOfValue, - &LengthOfLongestValueName, // chars - &LengthOfLongestValueData, // bytes - NULL, // &nSecurity_length_nouse, - NULL // &ftLastWrite - ) != ERROR_SUCCESS) { - return ; - } - //Comment out in beta1V5 20120102, v4 modified these to *4 +4 ,which is not right - //But not so sure to use global and pass chars, because once several years ago,in win2000,I encounter some problem. - //LengthOfLongestSubkeyName = LengthOfLongestSubkeyName * 2 + 3; // msdn says it is in unicode characters,right now maybe not large than that.old version use *2+3 - //LengthOfLongestValueName = LengthOfLongestValueName * 2 + 3; - LengthOfLongestSubkeyName = LengthOfLongestSubkeyName + 1; - LengthOfLongestValueName = LengthOfLongestValueName + 1; - LengthOfLongestValueData = LengthOfLongestValueData + 1; //use +1 maybe too careful. but since the real memory allocate is based on return of another call,it is just be here. - if (LengthOfLongestValueData >= ESTIMATE_VALUEDATA_LENGTH) { - lpValueDataS= lpValueData; - lpValueData = MYALLOC(LengthOfLongestValueData); - } - //lpValueName = MYALLOC(LengthOfLongestValueName); - - - // Get Values - for (i = 0;; i++) { - - *(LPBYTE)lpValueName = (BYTE)0x00; // That's the bug in 2000! thanks zhangl@digiark.com! - *(LPBYTE)lpValueData = (BYTE)0x00; - //DebugBreak(); - LengthOfValueName = LengthOfLongestValueName; - LengthOfValueData = LengthOfLongestValueData; - NTr = RegEnumValue(hkey, i, lpValueName, &LengthOfValueName, NULL, &TypeCode, lpValueData, &LengthOfValueData); - if (NTr == ERROR_NO_MORE_ITEMS) { - break; - } else { - if (NTr != ERROR_SUCCESS) { - continue; - } - } - -#ifdef DEBUGLOG - DebugLog("debug_trytogetvalue.log", "trying:", hWnd, FALSE); - DebugLog("debug_trytogetvalue.log", lpValueName, hWnd, TRUE); -#endif - - lpValueContent = MYALLOC0(sizeof(VALUECONTENT)); - // I had done if (i == 0) in 1.50b- ! thanks fisttk@21cn.com and non-standard - //if (lpFatherKeyContent->lpfirstvalue == NULL) { - if (lpValueContentLast == NULL) { - lpFatherKeyContent->lpfirstvalue = lpValueContent; - } else { - lpValueContentLast->lpnextvalue = lpValueContent; - } - lpValueContentLast = lpValueContent; - lpValueContent->typecode = TypeCode; - lpValueContent->datasize = LengthOfValueData; - lpValueContent->lpfatherkey = lpFatherKeyContent; - lpValueContent->lpvaluename = MYALLOC(strlen(lpValueName) + 1); - strcpy(lpValueContent->lpvaluename, lpValueName); - - if (LengthOfValueData != 0) { - lpValueContent->lpvaluedata = MYALLOC(LengthOfValueData); - CopyMemory(lpValueContent->lpvaluedata, lpValueData, LengthOfValueData); - //*(lpValueContent->lpvaluedata + LengthOfValueData) = 0x00; - } - nGettingValue++; - -#ifdef DEBUGLOG - lstrdb1 = MYALLOC0(100); - sprintf(lstrdb1, "LGVN:%08d LGVD:%08d VN:%08d VD:%08d", LengthOfLongestValueName, LengthOfLongestValueData, LengthOfValueName, LengthOfValueData); - DebugLog("debug_valuenamedata.log", lstrdb1, hWnd, TRUE); - DebugLog("debug_valuenamedata.log", GetWholeValueName(lpValueContent), hWnd, FALSE); - DebugLog("debug_valuenamedata.log", GetWholeValueData(lpValueContent), hWnd, TRUE); - //DebugLog("debug_valuenamedata.log",":",hWnd,FALSE); - //DebugLog("debug_valuenamedata.log",lpValueData,hWnd,TRUE); - MYFREE(lstrdb1); - -#endif - } - - //MYFREE(lpValueName); - if (LengthOfLongestValueData >= ESTIMATE_VALUEDATA_LENGTH) { - MYFREE(lpValueData); - lpValueData= lpValueDataS; - } - - - for (i = 0;; i++) { - LengthOfKeyName = LengthOfLongestSubkeyName; - *(LPBYTE)lpKeyName = (BYTE)0x00; - NTr = RegEnumKeyEx(hkey, i, lpKeyName, &LengthOfKeyName, NULL, NULL, NULL, &ftLastWrite); - if (NTr == ERROR_NO_MORE_ITEMS) { - break; - } else { - if (NTr != ERROR_SUCCESS) { - continue; - } - } - lpKeyContent = MYALLOC0(sizeof(KEYCONTENT)); - //if (lpFatherKeyContent->lpfirstsubkey == NULL) { - if (lpKeyContentLast == NULL) { - lpFatherKeyContent->lpfirstsubkey = lpKeyContent; - } else { - lpKeyContentLast->lpbrotherkey = lpKeyContent; - } - lpKeyContentLast = lpKeyContent; - lpKeyContent->lpkeyname = MYALLOC(strlen(lpKeyName) + 1); - strcpy(lpKeyContent->lpkeyname, lpKeyName); - lpKeyContent->lpfatherkey = lpFatherKeyContent; - //DebugLog("debug_getkey.log",lpKeyName,hWnd,TRUE); - -#ifdef DEBUGLOG - lstrdb1 = MYALLOC0(100); - sprintf(lstrdb1, "LGKN:%08d KN:%08d", LengthOfLongestSubkeyName, LengthOfKeyName); - DebugLog("debug_key.log", lstrdb1, hWnd, TRUE); - DebugLog("debug_key.log", GetWholeKeyName(lpKeyContent), hWnd, TRUE); - MYFREE(lstrdb1); - -#endif - - nGettingKey++; - - if (RegOpenKeyEx(hkey, lpKeyName, 0, KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS, &Subhkey) != ERROR_SUCCESS) { - continue; - } - if (IsInSkipList(lpKeyName, lplpRegSkipStrings)) { - // tfx - RegCloseKey(Subhkey); // 1.8.2 seperate - continue; - } - - GetRegistrySnap(Subhkey, lpKeyContent); - RegCloseKey(Subhkey); - } - - nGettingTime = GetTickCount(); - if ((nGettingTime - nBASETIME1) > REFRESHINTERVAL) { - UpdateCounters(lan_key, lan_value, nGettingKey, nGettingValue); - } - - - return ; -} - - -//-------------------------------------------------- -// Registry save engine -//-------------------------------------------------- -VOID SaveRegKey(LPKEYCONTENT lpKeyContent, DWORD nFPCurrentFatherKey, DWORD nFPCaller) -{ - DWORD nFPTemp4Write; - DWORD nFPHeader; - DWORD nFPCurrent; - DWORD nLenPlus1; - INT nPad; - INT nPad1; - LPVALUECONTENT lpv; - - // Note use (DWORD) to disable warning of lost of data to convert size_t to dword, in current windows,it is safe that registry's xxxxname is stay in DWORD long - nLenPlus1 = (DWORD)strlen(lpKeyContent->lpkeyname) + 1; // Get len+1 - nPad = (nLenPlus1 % sizeof(DWORD) == 0) ? 0 : (sizeof(DWORD) - nLenPlus1 % sizeof(DWORD)); - nFPHeader = SetFilePointer(hFileWholeReg, 0, NULL, FILE_CURRENT); // Save head fp - - // using struct ,idea from maddes - sKC.fpos_keyname = nFPHeader + sizeof(SAVEKEYCONTENT); - sKC.fpos_firstvalue = (lpKeyContent->lpfirstvalue != NULL) ? (nFPHeader + sizeof(SAVEKEYCONTENT) + nLenPlus1 + nPad) : 0; - sKC.fpos_firstsubkey = 0; // it is filled later. - sKC.fpos_brotherkey = 0; // it is filled later - sKC.fpos_fatherkey = nFPCurrentFatherKey; - sKC.bkeymatch = 0; - WriteFile(hFileWholeReg, &sKC, sizeof(sKC), &NBW, NULL); - -/* - nFPTemp4Write = nFPHeader + sizeof(KEYCONTENT); - WriteFile(hFileWholeReg, &nFPTemp4Write, sizeof(nFPTemp4Write), &NBW, NULL); // Save the location of lpkeyname - - nPad = (nLenPlus1 % sizeof(int) == 0) ? 0 : ( sizeof(int) - nLenPlus1 % sizeof(int) ); - nFPTemp4Write = (lpKeyContent->lpfirstvalue != NULL) ? (nFPHeader + sizeof(KEYCONTENT) + nLenPlus1 + nPad) : 0; - WriteFile(hFileWholeReg, &nFPTemp4Write, sizeof(nFPTemp4Write), &NBW, NULL); // Save the location of lpfirstvalue - - WriteFile(hFileWholeReg, (LPBYTE)lpKeyContent + sizeof(LPSTR)+sizeof(LPVALUECONTENT), sizeof(LPKEYCONTENT)*2, &NBW, NULL); // Save lpfirstsubkey and lpbrotherkey - WriteFile(hFileWholeReg, &nFPCurrentFatherKey, sizeof(nFPCurrentFatherKey), &NBW, NULL); // Save nFPCurrentFatherKey passed by caller - - lpKeyContent->bkeymatch=0; - WriteFile(hFileWholeReg, &(lpKeyContent->bkeymatch), sizeof(lpKeyContent->bkeymatch), &NBW, NULL); // Clear and save bkeymatch -*/ - WriteFile(hFileWholeReg, lpKeyContent->lpkeyname, nLenPlus1, &NBW, NULL); // Save the current keyname - - nFPTemp4Write = 0; - if (nPad > 0) { - WriteFile(hFileWholeReg, &nFPTemp4Write, nPad, &NBW, NULL); - } - - - - // Save the sub-value of current KeyContent - for (lpv = lpKeyContent->lpfirstvalue; lpv != NULL; lpv = lpv->lpnextvalue) { - - nLenPlus1 = (DWORD)strlen(lpv->lpvaluename) + 1; - nPad = (nLenPlus1 % sizeof(DWORD) == 0) ? 0 : (sizeof(DWORD) - nLenPlus1 % sizeof(DWORD)); - nPad1 = (lpv->datasize % sizeof(DWORD) == 0) ? 0 : (sizeof(DWORD) - lpv->datasize % sizeof(DWORD)); - - nFPCurrent = SetFilePointer(hFileWholeReg, 0, NULL, FILE_CURRENT); // Save fp - sVC.typecode = lpv->typecode; - sVC.datasize = lpv->datasize; - sVC.fpos_valuename = nFPCurrent + sizeof(SAVEVALUECONTENT); - sVC.fpos_valuedata = (lpv->datasize > 0) ? (nFPCurrent + sizeof(SAVEVALUECONTENT) + nLenPlus1 + nPad) : 0; // if no lpvaluedata, we write 0 - sVC.fpos_nextvalue = (lpv->lpnextvalue != NULL) ? (nFPCurrent + sizeof(SAVEVALUECONTENT) + nLenPlus1 + nPad + lpv->datasize + nPad1) : 0; // if no nextvalue we write 0 - sVC.fpos_fatherkey = nFPHeader; - sVC.bvaluematch = 0; - WriteFile(hFileWholeReg, &sVC, sizeof(sVC), &NBW, NULL); - -/* - WriteFile(hFileWholeReg, (LPBYTE)lpv, sizeof(DWORD)*2, &NBW, NULL); - - nFPTemp4Write = nFPCurrent + sizeof(VALUECONTENT); - WriteFile(hFileWholeReg, &nFPTemp4Write, sizeof(nFPTemp4Write), &NBW, NULL); // Save location of lpvaluename - - nPad = (nLenPlus1 % sizeof(int) == 0) ? 0 : (sizeof(int) - nLenPlus1 % sizeof(int)); // determine if pad to 4bytes is needed - nFPTemp4Write = (lpv->datasize > 0) ? (nFPCurrent + sizeof(VALUECONTENT) + nLenPlus1 + nPad) : 0; // if no lpvaluedata, we write 0 - WriteFile(hFileWholeReg, &nFPTemp4Write, sizeof(nFPTemp4Write), &NBW, NULL); // Save location of lpvaluedata - - nPad1 = (lpv->datasize % sizeof(int) == 0) ? 0 : (sizeof(int) - lpv->datasize % sizeof(int)); - nFPTemp4Write = (lpv->lpnextvalue != NULL) ? (nFPCurrent + sizeof(VALUECONTENT) + nLenPlus1 + nPad + lpv->datasize + nPad1) : 0; // if no nextvalue we write 0 - WriteFile(hFileWholeReg, &nFPTemp4Write, sizeof(nFPTemp4Write), &NBW, NULL); // Save location of next subvalue - - nFPTemp4Write = nFPHeader; - WriteFile(hFileWholeReg, &nFPTemp4Write, sizeof(nFPTemp4Write), &NBW, NULL); // Save location of current key - - lpv->bvaluematch=0; - WriteFile(hFileWholeReg, &(lpv->bvaluematch), sizeof(lpv->bvaluematch), &NBW, NULL); // Clear and save bvaluematch -*/ - WriteFile(hFileWholeReg, lpv->lpvaluename, nLenPlus1, &NBW, NULL); // Save lpvaluename - - nFPTemp4Write = 0; - if (nPad > 0) { - WriteFile(hFileWholeReg, &nFPTemp4Write, nPad, &NBW, NULL); - } - - if (lpv->datasize > 0) { - WriteFile(hFileWholeReg, lpv->lpvaluedata, lpv->datasize, &NBW, NULL); // Save lpvaluedata - - if (nPad1 > 0) { - WriteFile(hFileWholeReg, &nFPTemp4Write, nPad1, &NBW, NULL); - } - } - - - } - - if (lpKeyContent->lpfirstsubkey != NULL) { - // pass this keycontent's position as subkey's fatherkey's position and pass the "lpfirstsubkey field" - SaveRegKey(lpKeyContent->lpfirstsubkey, nFPHeader, nFPHeader + 2 * sizeof(DWORD)); - } - - if (lpKeyContent->lpbrotherkey != NULL) { - // pass this key's fatherkey's position as brother's father and pass "lpbrotherkey field" - SaveRegKey(lpKeyContent->lpbrotherkey, nFPCurrentFatherKey, nFPHeader + 3 * sizeof(DWORD)); - } - - if (nFPCaller > 0) { // save position of current key in current father key - nFPCurrent = SetFilePointer(hFileWholeReg, 0, NULL, FILE_CURRENT); - SetFilePointer(hFileWholeReg, nFPCaller, NULL, FILE_BEGIN); - WriteFile(hFileWholeReg, &nFPHeader, sizeof(nFPHeader), &NBW, NULL); - SetFilePointer(hFileWholeReg, nFPCurrent, NULL, FILE_BEGIN); - } - - nSavingKey++; - if (nGettingKey != 0) - if (nSavingKey % nGettingKey > nRegStep) { - nSavingKey = 0; - SendDlgItemMessage(hWnd, IDC_PBCOMPARE, PBM_STEPIT, (WPARAM)0, (LPARAM)0); - UpdateWindow(hWnd); - PeekMessage(&msg, hWnd, WM_ACTIVATE, WM_ACTIVATE, PM_REMOVE); - } - -} - - -//-------------------------------------------------- -// Routine to call registry save engine and file save engine -//-------------------------------------------------- -VOID SaveHive(LPKEYCONTENT lpKeyHLM, LPKEYCONTENT lpKeyUSER, - LPHEADFILE lpHF, LPSTR computer, LPSTR user, LPVOID time) -{ - DWORD nFPcurrent; - DWORD nFPcurrent1; - LPHEADFILE lphf; - HIVEHEADER hiveheader; - SAVEHEADFILE sh; - - if (lpKeyHLM != NULL || lpKeyUSER != NULL) { - - opfn.lStructSize = sizeof(opfn); - opfn.hwndOwner = hWnd; - opfn.lpstrFilter = str_filter; - opfn.lpstrFile = MYALLOC0(MAX_PATH *2 + 2); - opfn.nMaxFile = MAX_PATH; - opfn.lpstrInitialDir = lpLastSaveDir; - opfn.lpstrDefExt = "hiv"; - opfn.Flags = OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY; - if (GetSaveFileName(&opfn)) { - hFileWholeReg = CreateFile(opfn.lpstrFile, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - if (hFileWholeReg != INVALID_HANDLE_VALUE) { - - UI_BeforeClear(); - InitProgressBar(); - - //WriteFile(hFileWholeReg, str_RegshotHiveSignature, sizeof(str_RegshotHiveSignature) - 1, &NBW, NULL); // save lpvaluedata - - // 0 signature( <= 12) last 4 bytes may be used in furture - // 16 startoflpkeyhlm (512) - // 20 startoflpkeyuser(???) - // 24 fileheadchain begin (new) ->(file -> nextfilehead(4) next4bytes is filecontent) added in 1.8 - // 28 future use! - // 32 computer name - // 96 username - // 160 systemtime - - ZeroMemory(&hiveheader, sizeof(hiveheader)); - // Save the position of H_L_M - hiveheader.offsetkeyhklm = HIVEBEGINOFFSET; - - SetFilePointer(hFileWholeReg, HIVEBEGINOFFSET, NULL, FILE_BEGIN); - if (lpKeyHLM != NULL) { //always - SaveRegKey(lpKeyHLM, 0, 0); - } - - // Save the position of hkeyUsr - nFPcurrent = SetFilePointer(hFileWholeReg, 0, NULL, FILE_CURRENT); - hiveheader.offsetkeyuser = nFPcurrent; - - if (lpKeyUSER != NULL) { //always - SaveRegKey(lpKeyUSER, 0, 0); - } - - if (lpHF != NULL) { - // Write start position of file chain - nFPcurrent = SetFilePointer(hFileWholeReg, 0, NULL, FILE_CURRENT); - hiveheader.offsetheadfile = nFPcurrent; - - - for (lphf = lpHF; lphf != NULL;) { - - nFPcurrent = SetFilePointer(hFileWholeReg, 0, NULL, FILE_CURRENT); // save place for next filehead in chain - sh.fpos_filecontent = nFPcurrent + sizeof(sh.fpos_nextheadfile) + sizeof(sh.fpos_filecontent); - - SetFilePointer(hFileWholeReg, sizeof(sh), NULL, FILE_CURRENT); - - SaveFileContent(lphf->lpfilecontent, 0, 0); - - nFPcurrent1 = SetFilePointer(hFileWholeReg, 0, NULL, FILE_CURRENT); - lphf = lphf->lpnextheadfile; - sh.fpos_nextheadfile = (lphf != NULL) ? nFPcurrent1 : 0; - SetFilePointer(hFileWholeReg, nFPcurrent , NULL, FILE_BEGIN); - WriteFile(hFileWholeReg, &sh, sizeof(sh), &NBW, NULL); - if (lphf == NULL) { - break; - } - - SetFilePointer(hFileWholeReg, nFPcurrent1, NULL, FILE_BEGIN); - } - } - - - - - CopyMemory(hiveheader.signature, str_RegshotHiveSignature, sizeof(str_RegshotHiveSignature) - 1); - CopyMemory(hiveheader.computername, computer, strlen(computer)); - CopyMemory(hiveheader.username, user, strlen(user)); - CopyMemory(&hiveheader.systemtime, time, sizeof(SYSTEMTIME)); - - SetFilePointer(hFileWholeReg, 0 , NULL, FILE_BEGIN); - - WriteFile(hFileWholeReg, &hiveheader, sizeof(hiveheader), &NBW, NULL); - - ShowWindow(GetDlgItem(hWnd, IDC_PBCOMPARE), SW_HIDE); - - SetCursor(hSaveCursor); - MessageBeep(0xffffffff); - CloseHandle(hFileWholeReg); - } else { - ErrMsg((LPCSTR)lan_errorcreatefile); - } - - } - *(opfn.lpstrFile + opfn.nFileOffset) = 0x00; - strcpy(lpLastSaveDir, opfn.lpstrFile); - MYFREE(opfn.lpstrFile); - } -} -#ifdef _WIN64 -//------------------------------------------------------------- -//Rebuild registry snap from file buffer -//------------------------------------------------------------- -VOID RebuildFromHive_reg(LPSAVEKEYCONTENT lpFile, LPKEYCONTENT lpFatherkey, LPKEYCONTENT lpKey, LPBYTE lpHiveFileBase) -{ - LPVALUECONTENT lpValue; - LPVALUECONTENT lpValueLast; - LPSAVEVALUECONTENT lpv; - LPKEYCONTENT lpsubkey; - - lpValueLast = NULL; - - if (lpFile->fpos_keyname != 0) { - lpKey->lpkeyname = (LPSTR)(lpHiveFileBase + lpFile->fpos_keyname); - } - lpKey->lpfatherkey = lpFatherkey; - - nGettingKey++; - - for (lpv = (LPSAVEVALUECONTENT)(lpHiveFileBase + lpFile->fpos_firstvalue); lpHiveFileBase != (LPBYTE)lpv ; lpv = (LPSAVEVALUECONTENT)(lpHiveFileBase + lpv->fpos_nextvalue)) { - lpValue = MYALLOC0(sizeof(VALUECONTENT)); - if (lpValueLast != NULL) { - lpValueLast->lpnextvalue = lpValue; - } else { - lpKey->lpfirstvalue = lpValue; - } - - lpValue->typecode = lpv->typecode; - lpValue->datasize = lpv->datasize; - if (lpv->fpos_valuename != 0) { - lpValue->lpvaluename = (LPSTR)(lpHiveFileBase + lpv->fpos_valuename); - } - if (lpv->fpos_valuedata != 0) { - lpValue->lpvaluedata = lpHiveFileBase + lpv->fpos_valuedata; - } - - lpValue->lpfatherkey = lpKey; - lpValueLast = lpValue; - - nGettingValue++; - } - - - if (lpFile->fpos_firstsubkey != 0) { - lpsubkey = MYALLOC0(sizeof(KEYCONTENT)); - lpKey->lpfirstsubkey = lpsubkey; - RebuildFromHive_reg((LPSAVEKEYCONTENT)(lpHiveFileBase + lpFile->fpos_firstsubkey), lpKey, lpsubkey, lpHiveFileBase); - } - - if (lpFile->fpos_brotherkey != 0) { - lpsubkey = MYALLOC0(sizeof(KEYCONTENT)); - lpKey->lpbrotherkey = lpsubkey; - RebuildFromHive_reg((LPSAVEKEYCONTENT)(lpHiveFileBase + lpFile->fpos_brotherkey), lpKey, lpsubkey, lpHiveFileBase); - } - nGettingTime = GetTickCount(); - if ((nGettingTime - nBASETIME1) > REFRESHINTERVAL) { - UpdateCounters(lan_key, lan_value, nGettingKey, nGettingValue); - } - -} - -#else - - -//-------------------------------------------------- -// Realign key & value content after loading from hive file -//-------------------------------------------------- -VOID ReAlignReg(LPKEYCONTENT lpKey, size_t nBase) -{ - LPVALUECONTENT lpv; - - if (lpKey->lpkeyname != NULL) { - lpKey->lpkeyname += nBase; - } - if (lpKey->lpfirstvalue != NULL) { - lpKey->lpfirstvalue = (LPVALUECONTENT)((LPBYTE)lpKey->lpfirstvalue + nBase); - } - if (lpKey->lpfirstsubkey != NULL) { - lpKey->lpfirstsubkey = (LPKEYCONTENT)((LPBYTE)lpKey->lpfirstsubkey + nBase); - } - if (lpKey->lpbrotherkey != NULL) { - lpKey->lpbrotherkey = (LPKEYCONTENT)((LPBYTE)lpKey->lpbrotherkey + nBase); - } - if (lpKey->lpfatherkey != NULL) { - lpKey->lpfatherkey = (LPKEYCONTENT)((LPBYTE)lpKey->lpfatherkey + nBase); - } - - nGettingKey++; - - for (lpv = lpKey->lpfirstvalue; lpv != NULL; lpv = lpv->lpnextvalue) { - - if (lpv->lpvaluename != NULL) { - lpv->lpvaluename += nBase; - } - if (lpv->lpvaluedata != NULL) { - lpv->lpvaluedata += nBase; - } - if (lpv->lpnextvalue != NULL) { - lpv->lpnextvalue = (LPVALUECONTENT)((LPBYTE)lpv->lpnextvalue + nBase); - } - if (lpv->lpfatherkey != NULL) { - lpv->lpfatherkey = (LPKEYCONTENT)((LPBYTE)lpv->lpfatherkey + nBase); - } - - } - - if (lpKey->lpfirstsubkey != NULL) { - ReAlignReg(lpKey->lpfirstsubkey, nBase); - } - - if (lpKey->lpbrotherkey != NULL) { - ReAlignReg(lpKey->lpbrotherkey, nBase); - } -} -#endif - - -//--------------------------------------------------------------------------------- -// Load registry from HIVE file (After this, we should realign the data in memory) -//--------------------------------------------------------------------------------- -BOOL LoadHive(LPKEYCONTENT FAR *lplpKeyHLM, LPKEYCONTENT FAR *lplpKeyUSER, - LPHEADFILE FAR *lplpHeadFile, LPBYTE FAR *lpHive) -{ - DWORD nFileSize; - size_t nBase; - DWORD i, j; - DWORD nRemain; - DWORD nReadSize; - HIVEHEADER hiveheader; - char sname[MAX_PATH*2 + 2]; - - ZeroMemory(sname, sizeof(sname)); - - opfn.lStructSize = sizeof(opfn); - opfn.hwndOwner = hWnd; - opfn.lpstrFilter = str_filter; - opfn.lpstrFile = sname; - opfn.nMaxFile = MAX_PATH; - opfn.lpstrInitialDir = lpLastOpenDir; - opfn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; - opfn.lpstrDefExt = "hiv"; - if (!GetOpenFileName(&opfn)) { - return FALSE; - } - hFileWholeReg = CreateFile(opfn.lpstrFile, GENERIC_READ , FILE_SHARE_READ , NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if (hFileWholeReg == INVALID_HANDLE_VALUE) { - ErrMsg((LPCSTR)lan_erroropenfile); - return FALSE; - } - nFileSize = GetFileSize(hFileWholeReg, NULL); - if (nFileSize < sizeof(HIVEHEADER)) { - CloseHandle(hFileWholeReg); - ErrMsg((LPCSTR)"wrong filesize"); - return FALSE; - } - - ZeroMemory(&hiveheader, sizeof(HIVEHEADER)); - ReadFile(hFileWholeReg, &hiveheader, sizeof(HIVEHEADER), &NBW, NULL); - - - if (strcmp(str_RegshotHiveSignature, (const char *)(hiveheader.signature)) != 0) { - CloseHandle(hFileWholeReg); - ErrMsg((LPCSTR)"It is not a compatible hive to current version or it is not a valid Regshot hive file!"); - return FALSE; - } - //May add some check here - - - nGettingKey = 0; - nGettingFile = 0; - if (is1) { - UI_BeforeShot(IDC_1STSHOT); - } else { - UI_BeforeShot(IDC_2NDSHOT); - } - - *lpHive = MYALLOC(nFileSize); - - SetFilePointer(hFileWholeReg, 0, NULL, FILE_BEGIN); - - InitProgressBar(); -#define READ_BATCH_SIZE 8192 - nFileStep = nFileSize / READ_BATCH_SIZE / MAXPBPOSITION; - - for (i = 0, j = 0, nRemain = nFileSize;; i += READ_BATCH_SIZE, j++) { - if (nRemain >= READ_BATCH_SIZE) { - nReadSize = READ_BATCH_SIZE; - } else { - nReadSize = nRemain; - } - // Crash bug made in 1.8.0 tianwei, fixed in 1.8.1 tianwei - ReadFile(hFileWholeReg, (*lpHive) + i, nReadSize, &NBW, NULL); // read the whole file now - if (NBW != nReadSize) { - CloseHandle(hFileWholeReg); - ErrMsg((LPCSTR)"Reading ERROR!"); - return FALSE; - } - nRemain -= nReadSize; - if (nRemain == 0) { - break; - } - if (j % (nFileSize / READ_BATCH_SIZE) > nFileStep) { - j = 0; - SendDlgItemMessage(hWnd, IDC_PBCOMPARE, PBM_STEPIT, (WPARAM)0, (LPARAM)0); - UpdateWindow(hWnd); - PeekMessage(&msg, hWnd, WM_ACTIVATE, WM_ACTIVATE, PM_REMOVE); - } - } -#undef READ_BATCH_SIZE - ShowWindow(GetDlgItem(hWnd, IDC_PBCOMPARE), SW_HIDE); - - nBase = (size_t) * lpHive; - *lplpKeyHLM = (LPKEYCONTENT)(nBase + hiveheader.offsetkeyhklm); - *lplpKeyUSER = (LPKEYCONTENT)(nBase + hiveheader.offsetkeyuser); - *lplpHeadFile = (hiveheader.offsetheadfile == 0) ? NULL : (LPHEADFILE)(nBase + hiveheader.offsetheadfile); - -#ifdef _WIN64 - nGettingKey = 2; - nGettingValue = 0; - nGettingTime = 0; - nGettingFile = 0; - nGettingDir = 0; - nBASETIME = GetTickCount(); - nBASETIME1 = nBASETIME; - if (is1) { - UI_BeforeShot(IDC_1STSHOT); - } else { - UI_BeforeShot(IDC_2NDSHOT); - } - - *lplpKeyHLM = MYALLOC0(sizeof(KEYCONTENT)); - *lplpKeyUSER = MYALLOC0(sizeof(KEYCONTENT)); - RebuildFromHive_reg((LPSAVEKEYCONTENT)(nBase + hiveheader.offsetkeyhklm), NULL, *lplpKeyHLM , *lpHive); - RebuildFromHive_reg((LPSAVEKEYCONTENT)(nBase + hiveheader.offsetkeyuser), NULL, *lplpKeyUSER , *lpHive); - nGettingTime = GetTickCount(); - UpdateCounters(lan_key, lan_value, nGettingKey, nGettingValue); - -#else - ReAlignReg(*lplpKeyHLM, nBase); - ReAlignReg(*lplpKeyUSER, nBase); -#endif - - - if (*lplpHeadFile != NULL) { - SendMessage(GetDlgItem(hWnd, IDC_CHECKDIR), BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0); - SendMessage(hWnd, WM_COMMAND, (WPARAM)IDC_CHECKDIR, (LPARAM)0); -#ifdef _WIN64 - *lplpHeadFile = MYALLOC0(sizeof(HEADFILE)); - RebuildFromHive_filehead((LPSAVEHEADFILE)(nBase + hiveheader.offsetheadfile), *lplpHeadFile, *lpHive); - nGettingTime = GetTickCount(); - UpdateCounters(lan_dir, lan_file, nGettingDir, nGettingFile); -#else - ReAlignFile(*lplpHeadFile, nBase); -#endif - FindDirChain(*lplpHeadFile, lpExtDir, EXTDIRLEN); // Get new chains, must do this after ReAlignFile! - SetDlgItemText(hWnd, IDC_EDITDIR, lpExtDir); - } else { - SetDlgItemText(hWnd, IDC_EDITDIR, ""); - } - - - if (is1) { - // Use copymemory in 1.8, old version direct point to, which is wrong - CopyMemory(lpComputerName1, hiveheader.computername, COMPUTERNAMELEN); - CopyMemory(lpUserName1, hiveheader.username, COMPUTERNAMELEN); - CopyMemory(lpSystemtime1, &hiveheader.systemtime, sizeof(SYSTEMTIME)); - } else { - CopyMemory(lpComputerName2, hiveheader.computername, COMPUTERNAMELEN); - CopyMemory(lpUserName2, hiveheader.username, COMPUTERNAMELEN); - CopyMemory(lpSystemtime2, &hiveheader.systemtime, sizeof(SYSTEMTIME)); - } - - UI_AfterShot(); - - CloseHandle(hFileWholeReg); - - *(opfn.lpstrFile + opfn.nFileOffset) = 0x00; - strcpy(lpLastOpenDir, opfn.lpstrFile); - - - return TRUE; - -} diff --git a/RegShot/src/regshot.rc b/RegShot/src/regshot.rc deleted file mode 100644 index 3fbad61..0000000 --- a/RegShot/src/regshot.rc +++ /dev/null @@ -1,177 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" -#include "version.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include <winresrc.h> - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (United States) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_DIALOG1 DIALOGEX 0, 0, 194, 166 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_APPWINDOW -CAPTION REGSHOT_TITLE -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - DEFPUSHBUTTON "&1st shot",IDC_1STSHOT,137,10,49,13 - PUSHBUTTON "&2nd shot",IDC_2NDSHOT,137,27,49,13,WS_DISABLED - PUSHBUTTON "C&ompare",IDC_COMPARE,137,45,49,13,WS_DISABLED - PUSHBUTTON "&Clear",IDC_CLEAR1,137,63,49,13,WS_DISABLED - PUSHBUTTON "&Quit",IDC_CANCEL1,137,81,49,13 - PUSHBUTTON "&About",IDC_ABOUT,137,99,49,13 - COMBOBOX IDC_COMBOLANGUAGE,137,134,50,55,CBS_DROPDOWNLIST | CBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - CONTROL "Plain &TXT",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON,11,19,46,10 - CONTROL "&HTML document",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,60,19,71,10 - CONTROL "&Scan dir1[;dir2;dir3;...;dir nn]:",IDC_CHECKDIR,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,11,45,120,10 - EDITTEXT IDC_EDITDIR,11,58,94,14,ES_AUTOHSCROLL - PUSHBUTTON "...",IDC_BROWSE1,108,58,18,13 - EDITTEXT IDC_EDITPATH,12,94,94,14,ES_AUTOHSCROLL - PUSHBUTTON "...",IDC_BROWSE2,108,95,18,13 - EDITTEXT IDC_EDITCOMMENT,11,128,114,14,ES_AUTOHSCROLL - LTEXT "",IDC_TEXTCOUNT1,8,153,54,8,NOT WS_VISIBLE - LTEXT "",IDC_TEXTCOUNT2,69,153,59,8,NOT WS_VISIBLE - LTEXT "",IDC_TEXTCOUNT3,134,153,55,8,NOT WS_VISIBLE - GROUPBOX "Compare logs save as:",IDC_STATICSAVEFORMAT,6,7,125,27 - GROUPBOX "",IDC_STATIC,6,37,125,40 - GROUPBOX "Output path:",IDC_STATICOUTPUTPATH,6,82,125,31 - GROUPBOX "Add comment into the log:",IDC_STATICADDCOMMENT,6,117,125,31 - CONTROL "Progress1",IDC_PBCOMPARE,"msctls_progress32",NOT WS_VISIBLE | WS_BORDER,7,153,180,9 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_DIALOG1, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 187 - VERTGUIDE, 11 - VERTGUIDE, 131 - VERTGUIDE, 137 - VERTGUIDE, 186 - TOPMARGIN, 7 - BOTTOMMARGIN, 163 - END -END -#endif // APSTUDIO_INVOKED - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_MAINICON ICON "res\\regshot.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// RT_MANIFEST -// - -1 RT_MANIFEST "res\\Regshot.exe.manifest" - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION REGSHOT_VERSION_NUM - PRODUCTVERSION REGSHOT_VERSION_NUM - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "CompanyName", "Regshot Team" - VALUE "FileDescription", REGSHOT_TITLE - VALUE "FileVersion", REGSHOT_VERSION - VALUE "InternalName", "Regshot" - VALUE "LegalCopyright", REGSHOT_VERSION_COPYRIGHT - VALUE "OriginalFilename", "Regshot.exe" - VALUE "ProductName", "Regshot" - VALUE "ProductVersion", REGSHOT_VERSION - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // English (United States) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/RegShot/src/res/Regshot.exe.manifest b/RegShot/src/res/Regshot.exe.manifest deleted file mode 100644 index b187013..0000000 --- a/RegShot/src/res/Regshot.exe.manifest +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> - <assemblyIdentity - name="Regshot" - processorArchitecture="*" - version="1.8.3.0" - type="win32" - /> - <description>Regshot</description> - <dependency> - <dependentAssembly> - <assemblyIdentity - type="win32" - name="Microsoft.Windows.Common-Controls" - version="6.0.0.0" - processorArchitecture="*" - publicKeyToken="6595b64144ccf1df" - language="*" - /> - </dependentAssembly> - </dependency> - <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> - <security> - <requestedPrivileges> - <requestedExecutionLevel level="asInvoker" uiAccess="false"/> - </requestedPrivileges> - </security> - </trustInfo> - <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> - <application> - <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/> - <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/> - </application> - </compatibility> - <asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"> - <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings"> - <dpiAware>true</dpiAware> - </asmv3:windowsSettings> - </asmv3:application> -</assembly> \ No newline at end of file diff --git a/RegShot/src/res/regshot.ico b/RegShot/src/res/regshot.ico deleted file mode 100644 index 270fc168a3e9307dcd2224fa0050d94f4c57c8aa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 22486 zcmeHv2Urx#(speC5fw!;C_!>i!XgHgWB^oDk`YXRIg5!P2oeOuh^QFBETSMe=bUri z-I-ks7*IK8cmG;Ede3*yx#xcOJJ<jD{^!5_P}?)pRnu?v^mKQ1)c`;NVK6WN%thd~ z7{Gb}P*(o+Tm(RDG{BfK-_AD*0i?>nul&kzTOB}g{C9plN4`?4@BGTJkq)rk5kL#? ziB-TFBtboYmQ)X#fQIK(Q1_k=8k=T;>b^N(;A0CW2UdaU<_$1ozZ;nDIsg~_EFi^a zF<d>g6O>L*0p(y5Pzjz2+JR=Ec60`4g_(ou*%_c1YYOAjXTpRVGeIrW92Cm%T9X+} zXqy4rVY9$6crGv^tzl}&0+@1iKImMS1BMr@fDvU2Q%^4d!<czs5bXd;sg|I56Zvl~ z0JW4^V34^GOl~iR>FG<rEMOzdIOYlVp)0^Hb`{LZaD_Qx8)0trCRlN51K3|)2TQJO zgxN>-fX(GyF!$PaSb5U}obI^8%6K<C-U6=i+rc({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*6z%DWXe%q@H&)o6`66<1 z%~PeNnGO`n%XOnhz4gSn=gmOvv=`EevJ-quF(OFy2po`0kU6MZHuP;lknFLcZzF;w z&~E3;i;1;(i;C7I(P*W0qr?i(#>v3-ZF;GY^6`hXotlk9G4#R8J;TE^SP-IwG4x6u z;HOvvhb630UKZmx1+o}>-N_t2oWK}ml1Zc1cZsW=?ojiY%N%xGt&4UOZLd_cd*Zd2 z^eY-2v{P#M&l{v>puDh-PWDX|m7)$o%<X8g7lhb|20{>9t6~_)oN~gE&A4aD6iL=1 z##R_}FjlsUnxIvS>va4lhO!g!@!<d5$c|<(8p_9y=d_I&{gE6!vY(U_FJo&>J59{E zyo@t1ZxJ!6Y8D~WGMOBTl@!EC3SuL#so~y*K)xi3!RW^I{hLO0#^)X-##>TBicMI~ zJ<suoUEb$f>_obhuOT*7Z6hYPIu^^<&CH@?Yd*xdI30ofv}w&@3l<Q$OO}$Qo?CKT zV!RJ?;tww2=J}a%OF}IAiZPbz&M7NSSnLwQrNQ&^^4`6>=X1B%;#w1JOaNTpQB6%b ziuU&X*5?mIUuigQLl7|*<jd<A|8RFU=SA#v68+Zf5+5yA^0o>1?bts~otGS4$y+O$ z`{OK`?=hx=m%5NESQGU`P3bQ4*K5Re&rqHJ=nl+l4$e>SyA}?nxYmA6oYlckcV>RN zZ`Q`WFu5AnE&_k~pUU^$a&~(4Xmu|7wFSP_hOdP?(Jwr!PT)I5pJ{H*5xqYhg9lR9 zTYSjho$$FLApd=3Sm}H8rG2bCTJo`AckZ*>c2`>?4MqMD_V3qmKA`YRb}RC$0<8Hp rp{w|nepC2)ZfMj0`;$N5KmGXw5?ud5!{RLm{*FE<#ar_E@s|Gw(n@qk diff --git a/RegShot/src/resource.h b/RegShot/src/resource.h deleted file mode 100644 index 9c478d6..0000000 --- a/RegShot/src/resource.h +++ /dev/null @@ -1,77 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by regshot.rc -// -#ifndef IDC_STATIC -#define IDC_STATIC -1 -#endif - -#define IDD_DIALOG1 100 -#define IDD_DIALOG2 101 -#define IDI_MAINICON 111 -#define ID_BASE 1000 - -#define IDC_1STSHOT 1003 -#define IDC_2NDSHOT 1004 -#define IDC_COMPARE 1005 -#define IDC_CLEAR1 1006 -#define IDC_CANCEL1 1007 -#define IDC_ABOUT 1008 -#define IDC_MONITOR 1009 -#define IDC_STATICSAVEFORMAT 1010 -#define IDC_STATICOUTPUTPATH 1011 -#define IDC_STATICADDCOMMENT 1012 -#define IDC_RADIO1 1013 -#define IDC_RADIO2 1014 -#define IDC_CHECKDIR 1015 - -#define IDC_STATICSERVICE 1016 -#define IDC_STATICRING3 1017 -#define IDC_SETMASK 1018 -#define IDC_CHECKONTOP 1019 -#define IDC_CHECKPAUSE 1020 -#define IDC_CLEAR2 1021 -#define IDC_SAVE 1022 -#define IDC_CANCEL2 1023 -#define IDC_PBCOMPARE 1024 -#define IDC_EDITCOMMENT 1025 -#define IDC_EDITPATH 1026 -#define IDC_EDITDIR 1027 -#define IDC_TEXTCOUNT1 1028 -#define IDC_TEXTCOUNT2 1029 -#define IDC_TEXTCOUNT3 1030 -#define IDC_BROWSE1 1031 -#define IDC_BROWSE2 1032 -#define IDC_COMBOLANGUAGE 1033 -#define IDC_RegOpenKey 1034 -#define IDC_RegCloseKey 1035 -#define IDC_RegCreateKey 1036 -#define IDC_RegDeleteKey 1037 -#define IDC_RegSetValue 1038 -#define IDC_RegSetValueEx 1039 -#define IDC_RegQueryValue 1040 -#define IDC_RegQueryValueEx 1041 -#define IDC_RegDeleteValue 1042 -#define IDC_RegEnumKey 1043 -#define IDC_RegEnumValue 1044 -#define IDC_RegFlushKey 1045 -#define IDC_EDITRING3 1046 -#define IDC_LIST1 1047 -#define IDM_SHOTONLY 1048 -#define IDM_SHOTSAVE 1049 -#define IDM_LOAD 1050 -#define IDM_BREAK 1051 -#define IDM_CLEARALLSHOTS 1052 -#define IDM_CLEARSHOT1 1053 -#define IDM_CLEARSHOT2 1054 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 120 -#define _APS_NEXT_COMMAND_VALUE 40007 -#define _APS_NEXT_CONTROL_VALUE 1055 -#define _APS_NEXT_SYMED_VALUE 102 -#endif -#endif diff --git a/RegShot/src/setup.c b/RegShot/src/setup.c deleted file mode 100644 index ecb1668..0000000 --- a/RegShot/src/setup.c +++ /dev/null @@ -1,172 +0,0 @@ -/* - Copyright 2004 tulipfan - - This file is part of Regshot. - - Regshot is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Regshot is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Regshot; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -/* This file orignal coded by tulipfan - * Change function/variable name to more proper ones and fix for x64 by tianwei -*/ - -#include "global.h" -// 1.8.2 move defination from global.h to this place -#define SIZEOF_INI_SKIPBLOCK 65535 -#define MAX_INI_SKIPITEMS 100 - -// setup based on regshot.ini by tulipfan (tfx) -LPSTR INI_SETUP = "Setup"; -LPSTR INI_FLAG = "Flag"; -LPSTR INI_EXTDIR = "ExtDir"; -LPSTR INI_OUTDIR = "OutDir"; -LPSTR INI_SKIPREGKEY = "SkipRegKey"; -LPSTR INI_SKIPDIR = "SkipDir"; -LPSTR INI_USELONGREGHEAD = "UseLongRegHead"; // 1.8.1 tianwei for compatible to undoreg 1.46 again - - -BOOL LoadSettingsFromIni(HWND hDlg) // tfx get ini info (translate from chinese comment) -{ - int i; - LPBYTE lpReturn; - BYTE nFlag; - - char lpIniKey[16]; - - lplpRegSkipStrings = MYALLOC0(sizeof(LPSTR) * MAX_INI_SKIPITEMS); - lpRegSkipStrings = MYALLOC0(SIZEOF_INI_SKIPBLOCK); - if (GetPrivateProfileSection(INI_SKIPREGKEY, (LPSTR)lpRegSkipStrings, SIZEOF_INI_SKIPBLOCK, lpRegshotIni) > 0) { - for (i = 0; i < MAX_INI_SKIPITEMS - 1; i++) { - sprintf(lpIniKey, "%d%s", i, "="); - if ((lpReturn = AtPos(lpRegSkipStrings, (LPBYTE)lpIniKey, SIZEOF_INI_SKIPBLOCK, strlen(lpIniKey))) != NULL) { - *(lplpRegSkipStrings + i) = lpReturn; - //dwSnapFiles++; - } else { - break; - } - } - } - - lplpFileSkipStrings = MYALLOC0(sizeof(LPSTR) * MAX_INI_SKIPITEMS); - lpFileSkipStrings = MYALLOC0(SIZEOF_INI_SKIPBLOCK); - if (GetPrivateProfileSection(INI_SKIPDIR, (LPSTR)lpFileSkipStrings, SIZEOF_INI_SKIPBLOCK, lpRegshotIni)) { - for (i = 0; i < MAX_INI_SKIPITEMS - 1; i++) { - sprintf(lpIniKey, "%d%s", i, "="); - if ((lpReturn = AtPos(lpFileSkipStrings, (LPBYTE)lpIniKey, SIZEOF_INI_SKIPBLOCK, strlen(lpIniKey))) != NULL) { - *(lplpFileSkipStrings + i) = lpReturn; - //dwSnapFiles++; - } else { - break; - } - } - } - - nFlag = (BYTE)GetPrivateProfileInt(INI_SETUP, INI_FLAG, 1, lpRegshotIni); // default from 0 to 1 in 1.8.2 (TEXT) - //if (nFlag != 0) - { - SendMessage(GetDlgItem(hDlg, IDC_RADIO1), BM_SETCHECK, (WPARAM)(nFlag & 0x01), (LPARAM)0); - SendMessage(GetDlgItem(hDlg, IDC_RADIO2), BM_SETCHECK, (WPARAM)((nFlag & 0x01) ^ 0x01), (LPARAM)0); - //SendMessage(GetDlgItem(hDlg,IDC_CHECKDIR),BM_SETCHECK,(WPARAM)((nFlag&0x04)>>1),(LPARAM)0); // 1.7 - SendMessage(GetDlgItem(hDlg, IDC_CHECKDIR), BM_SETCHECK, (WPARAM)((nFlag & 0x02) >> 1), (LPARAM)0); - } - /*else delete in 1.8.1 - { - SendMessage(GetDlgItem(hDlg,IDC_RADIO1),BM_SETCHECK,(WPARAM)0x01,(LPARAM)0); - SendMessage(GetDlgItem(hDlg,IDC_RADIO2),BM_SETCHECK,(WPARAM)0x00,(LPARAM)0); - SendMessage(GetDlgItem(hDlg,IDC_CHECKDIR),BM_SETCHECK,(WPARAM)0x00,(LPARAM)0); - } - */ - // added in 1.8.1 for compatible with undoreg1.46 - bUseLongRegHead = GetPrivateProfileInt(INI_SETUP, INI_USELONGREGHEAD, 0, lpRegshotIni) != 0 ? TRUE : FALSE; - - if (GetPrivateProfileString(INI_SETUP, INI_EXTDIR, NULL, lpExtDir, MAX_PATH, lpRegshotIni) != 0) { - SetDlgItemText(hDlg, IDC_EDITDIR, lpExtDir); - } else { - SetDlgItemText(hDlg, IDC_EDITDIR, lpWindowsDirName); - } - - if (GetPrivateProfileString(INI_SETUP, INI_OUTDIR, NULL, lpOutputpath, MAX_PATH, lpRegshotIni) != 0) { - SetDlgItemText(hDlg, IDC_EDITPATH, lpOutputpath); - } else { - SetDlgItemText(hDlg, IDC_EDITPATH, lpTempPath); - } - - SendMessage(hDlg, WM_COMMAND, (WPARAM)IDC_CHECKDIR, (LPARAM)0); - - return TRUE; -} - - -BOOL SaveSettingsToIni(HWND hDlg) // tfx save settings to ini (translate from chinese) -{ - BYTE nFlag; - LPSTR lpString; - HANDLE hTest; - - // 1.8.2, someone might not want to create a regshot.ini when there isn't one. :O - hTest = CreateFile(lpRegshotIni, GENERIC_READ | GENERIC_WRITE, - FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if (hTest == INVALID_HANDLE_VALUE) { - return FALSE; - } - CloseHandle(hTest); - - //nFlag = (BYTE)(SendMessage(GetDlgItem(hDlg,IDC_RADIO1),BM_GETCHECK,(WPARAM)0,(LPARAM)0) // 1.7 - // |SendMessage(GetDlgItem(hDlg,IDC_RADIO2),BM_GETCHECK,(WPARAM)0,(LPARAM)0)<<1 - // |SendMessage(GetDlgItem(hDlg,IDC_CHECKDIR),BM_GETCHECK,(WPARAM)0,(LPARAM)0)<<2); - nFlag = (BYTE)(SendMessage(GetDlgItem(hDlg, IDC_RADIO1), BM_GETCHECK, (WPARAM)0, (LPARAM)0) | - SendMessage(GetDlgItem(hDlg, IDC_CHECKDIR), BM_GETCHECK, (WPARAM)0, (LPARAM)0) << 1); - - lpString = MYALLOC0(EXTDIRLEN + 4); - //sprintf(lpString,"%s = %d",INI_FLAG,nFlag); // 1.7 solokey - //WritePrivateProfileSection(INI_SETUP,lpString,lpRegshotIni); // 1.7 solokey, can only have one key. - - // 1.8.1 - sprintf(lpString, "%d", nFlag); - WritePrivateProfileString(INI_SETUP, INI_FLAG, lpString, lpRegshotIni); - sprintf(lpString, "%d", bUseLongRegHead); - WritePrivateProfileString(INI_SETUP, INI_USELONGREGHEAD, lpString, lpRegshotIni); - - - if (GetDlgItemText(hDlg, IDC_EDITDIR, lpString, (EXTDIRLEN/2)) != 0) { - WritePrivateProfileString(INI_SETUP, INI_EXTDIR, lpString, lpRegshotIni); - } - - if (GetDlgItemText(hDlg, IDC_EDITPATH, lpString, MAX_PATH) != 0) { - WritePrivateProfileString(INI_SETUP, INI_OUTDIR, lpString, lpRegshotIni); - } - - MYFREE(lpString); - MYFREE(lpRegshotIni); - MYFREE(lpRegSkipStrings); - MYFREE(lpFileSkipStrings); - //MYFREE(lpSnapKey); - //MYFREE(lpSnapReturn); - - return TRUE; -} - - -BOOL IsInSkipList(LPSTR lpStr, LPBYTE *lpSkipList) // tfx skip the list (translate from chinese) -{ - int i; - // todo: it seems bypass null item. But the getsetting is get all. Is it safe without the null thing? tianwei - for (i = 0; (LPSTR)(*(lpSkipList + i)) != NULL && i <= MAX_INI_SKIPITEMS - 1; i++) { - if (_stricmp(lpStr, (LPSTR)(*(lpSkipList + i))) == 0) { - return TRUE; - } - } - return FALSE; -} diff --git a/RegShot/src/ui.c b/RegShot/src/ui.c deleted file mode 100644 index 8f549a1..0000000 --- a/RegShot/src/ui.c +++ /dev/null @@ -1,371 +0,0 @@ -/* - Copyright 1999-2003,2007 TiANWEi - Copyright 2004 tulipfan - - This file is part of Regshot. - - Regshot is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Regshot is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Regshot; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "global.h" - -extern LPBYTE lan_time; -extern LPBYTE lan_key; -extern LPBYTE lan_value; -extern LPBYTE lan_dir; -extern LPBYTE lan_file; -extern LPBYTE lan_menushot; -extern LPBYTE lan_menushotsave; -extern LPBYTE lan_menuload; - - -char USERSSTRING_LONG[] = "HKEY_USERS"; // 1.6 using long name, so in 1.8.1 add an option -char USERSSTRING[] = "HKU"; // in regshot.ini, "UseLongRegHead" to control this -char LOCALMACHINESTRING[] = "HKLM"; -char LOCALMACHINESTRING_LONG[] = "HKEY_LOCAL_MACHINE"; - - -void ShowHideCounters(int nCmdShow) // 1.8.2 -{ - ShowWindow(GetDlgItem(hWnd, IDC_TEXTCOUNT1), nCmdShow); - ShowWindow(GetDlgItem(hWnd, IDC_TEXTCOUNT2), nCmdShow); - ShowWindow(GetDlgItem(hWnd, IDC_TEXTCOUNT3), nCmdShow); -} - - -////////////////////////////////////////////////////////////////// -VOID InitProgressBar(VOID) -{ - // The following are not so good, but they work - nSavingKey = 0; - nComparing = 0; - nRegStep = nGettingKey / MAXPBPOSITION; - nFileStep = nGettingFile / MAXPBPOSITION; - ShowHideCounters(SW_HIDE); // 1.8.2 - SendDlgItemMessage(hWnd, IDC_PBCOMPARE, PBM_SETRANGE, (WPARAM)0, MAKELPARAM(0, MAXPBPOSITION)); - SendDlgItemMessage(hWnd, IDC_PBCOMPARE, PBM_SETPOS, (WPARAM)0, (LPARAM)0); - SendDlgItemMessage(hWnd, IDC_PBCOMPARE, PBM_SETSTEP, (WPARAM)1, (LPARAM)0); - ShowWindow(GetDlgItem(hWnd, IDC_PBCOMPARE), SW_SHOW); -} - - -void UpdateCounters(LPBYTE title1, LPBYTE title2, DWORD count1, DWORD count2) -{ - //nGettingTime = GetTickCount(); - nBASETIME1 = nGettingTime; - sprintf(lpMESSAGE, "%s%d%s%d%s", lan_time, (nGettingTime - nBASETIME) / 1000, "s", (nGettingTime - nBASETIME) % 1000, "ms"); - SendDlgItemMessage(hWnd, IDC_TEXTCOUNT3, WM_SETTEXT, (WPARAM)0, (LPARAM)lpMESSAGE); - sprintf(lpMESSAGE, "%s%d", title1, count1); - SendDlgItemMessage(hWnd, IDC_TEXTCOUNT1, WM_SETTEXT, (WPARAM)0, (LPARAM)lpMESSAGE); - sprintf(lpMESSAGE, "%s%d", title2, count2); - SendDlgItemMessage(hWnd, IDC_TEXTCOUNT2, WM_SETTEXT, (WPARAM)0, (LPARAM)lpMESSAGE); - - UpdateWindow(hWnd); - PeekMessage(&msg, hWnd, WM_ACTIVATE, WM_ACTIVATE, PM_REMOVE); - //SetForegroundWindow(hWnd); -} - - -//-------------------------------------------------- -// Prepare the GUI for the shot about to be taken -//-------------------------------------------------- -VOID UI_BeforeShot(DWORD id) -{ - hHourGlass = LoadCursor(NULL, IDC_WAIT); - hSaveCursor = SetCursor(hHourGlass); - EnableWindow(GetDlgItem(hWnd, id), FALSE); - // Added in 1.8.2 - strcpy(lpMESSAGE, " "); // clear the counters - SendDlgItemMessage(hWnd, IDC_TEXTCOUNT1, WM_SETTEXT, (WPARAM)0, (LPARAM)lpMESSAGE); - SendDlgItemMessage(hWnd, IDC_TEXTCOUNT2, WM_SETTEXT, (WPARAM)0, (LPARAM)lpMESSAGE); - SendDlgItemMessage(hWnd, IDC_TEXTCOUNT3, WM_SETTEXT, (WPARAM)0, (LPARAM)lpMESSAGE); - ShowHideCounters(SW_SHOW); -} - - -//-------------------------------------------------- -// Reset the GUI after the shot has been taken -//-------------------------------------------------- -VOID UI_AfterShot(VOID) -{ - DWORD iddef; - - if (lpHeadLocalMachine1 == NULL) { - iddef = IDC_1STSHOT; - } else if (lpHeadLocalMachine2 == NULL) { - iddef = IDC_2NDSHOT; - } else { - iddef = IDC_COMPARE; - } - EnableWindow(GetDlgItem(hWnd, IDC_CLEAR1), TRUE); - EnableWindow(GetDlgItem(hWnd, iddef), TRUE); - SendMessage(hWnd, DM_SETDEFID, (WPARAM)iddef, (LPARAM)0); - SetFocus(GetDlgItem(hWnd, iddef)); - SetCursor(hSaveCursor); - MessageBeep(0xffffffff); -} - - -//-------------------------------------------------- -// Prepare the GUI for Clearing -//-------------------------------------------------- -VOID UI_BeforeClear(VOID) -{ - //EnableWindow(GetDlgItem(hWnd,IDC_CLEAR1),FALSE); - hHourGlass = LoadCursor(NULL, IDC_WAIT); - hSaveCursor = SetCursor(hHourGlass); - ShowHideCounters(SW_HIDE); - UpdateWindow(hWnd); -} - - -//-------------------------------------------------- -// Reset the GUI after the clearing -//-------------------------------------------------- -VOID UI_AfterClear(VOID) -{ - DWORD iddef = 0; - //BOOL bChk; // used for file scan disable - - if (lpHeadLocalMachine1 == NULL) { - iddef = IDC_1STSHOT; - } else if (lpHeadLocalMachine2 == NULL) { - iddef = IDC_2NDSHOT; - } - EnableWindow(GetDlgItem(hWnd, iddef), TRUE); - EnableWindow(GetDlgItem(hWnd, IDC_COMPARE), FALSE); - - if (lpHeadLocalMachine1 == NULL && lpHeadLocalMachine2 == NULL) { - EnableWindow(GetDlgItem(hWnd, IDC_2NDSHOT), FALSE); - EnableWindow(GetDlgItem(hWnd, IDC_CLEAR1), FALSE); - //bChk = TRUE; - } - //else // I forgot to comment out this, fixed at 1.8.2 - //bChk = FALSE; - - //EnableWindow(GetDlgItem(hWnd,IDC_CHECKDIR),bChk); // Not used 1.8; we only enable chk when clear all - //SendMessage(hWnd,WM_COMMAND,(WPARAM)IDC_CHECKDIR,(LPARAM)0); - - SetFocus(GetDlgItem(hWnd, iddef)); - SendMessage(hWnd, DM_SETDEFID, (WPARAM)iddef, (LPARAM)0); - SetCursor(hSaveCursor); - MessageBeep(0xffffffff); -} - - -// ----------------------------- -VOID Shot1(VOID) -{ - lpHeadLocalMachine1 = (LPKEYCONTENT)MYALLOC0(sizeof(KEYCONTENT)); - lpHeadUsers1 = (LPKEYCONTENT)MYALLOC0(sizeof(KEYCONTENT)); - - if (bUseLongRegHead) { // 1.8.1 - lpHeadLocalMachine1->lpkeyname = MYALLOC(sizeof(LOCALMACHINESTRING_LONG)); - lpHeadUsers1->lpkeyname = MYALLOC(sizeof(USERSSTRING_LONG)); - strcpy(lpHeadLocalMachine1->lpkeyname, LOCALMACHINESTRING_LONG); - strcpy(lpHeadUsers1->lpkeyname, USERSSTRING_LONG); - } else { - lpHeadLocalMachine1->lpkeyname = MYALLOC(sizeof(LOCALMACHINESTRING)); - lpHeadUsers1->lpkeyname = MYALLOC(sizeof(USERSSTRING)); - strcpy(lpHeadLocalMachine1->lpkeyname, LOCALMACHINESTRING); - strcpy(lpHeadUsers1->lpkeyname, USERSSTRING); - } - - - nGettingKey = 2; - nGettingValue = 0; - nGettingTime = 0; - nGettingFile = 0; - nGettingDir = 0; - nBASETIME = GetTickCount(); - nBASETIME1 = nBASETIME; - UI_BeforeShot(IDC_1STSHOT); - - GetRegistrySnap(HKEY_LOCAL_MACHINE, lpHeadLocalMachine1); - GetRegistrySnap(HKEY_USERS, lpHeadUsers1); - nGettingTime = GetTickCount(); - UpdateCounters(lan_key, lan_value, nGettingKey, nGettingValue); - - if (SendMessage(GetDlgItem(hWnd, IDC_CHECKDIR), BM_GETCHECK, (WPARAM)0, (LPARAM)0) == 1) { - size_t nLengthofStr; - DWORD i; - LPSTR lpSubExtDir; - LPHEADFILE lphf; - LPHEADFILE lphftemp; - - GetDlgItemText(hWnd, IDC_EDITDIR, lpExtDir, EXTDIRLEN/2); - nLengthofStr = strlen(lpExtDir); - - lphf = lphftemp = lpHeadFile1; // changed in 1.8 - lpSubExtDir = lpExtDir; - - if (nLengthofStr > 0) - for (i = 0; i <= nLengthofStr; i++) { - // This is the stupid filename detection routine, [seperate with ";"] - if (*(lpExtDir + i) == 0x3b || *(lpExtDir + i) == 0x00) { - *(lpExtDir + i) = 0x00; - - if (*(lpExtDir + i - 1) == '\\' && i > 0) { - *(lpExtDir + i - 1) = 0x00; - } - - if (*lpSubExtDir != 0x00) { - size_t nSubExtDirLen; - - lphf = (LPHEADFILE)MYALLOC0(sizeof(HEADFILE)); - if (lpHeadFile1 == NULL) { - lpHeadFile1 = lphf; - } else { - lphftemp->lpnextheadfile = lphf; - } - - lphftemp = lphf; - lphf->lpfilecontent = (LPFILECONTENT)MYALLOC0(sizeof(FILECONTENT)); - //lphf->lpfilecontent2 = (LPFILECONTENT)MYALLOC0(sizeof(FILECONTENT)); - - nSubExtDirLen = strlen(lpSubExtDir) + 1; - lphf->lpfilecontent->lpfilename = MYALLOC(nSubExtDirLen); - //lphf->lpfilecontent2->lpfilename = MYALLOC(nSubExtDirLen); - - strcpy(lphf->lpfilecontent->lpfilename, lpSubExtDir); - //strcpy(lphf->lpfilecontent2->lpfilename,lpSubExtDir); - - lphf->lpfilecontent->fileattr = FILE_ATTRIBUTE_DIRECTORY; - //lphf->lpfilecontent2->fileattr = FILE_ATTRIBUTE_DIRECTORY; - - GetFilesSnap(lphf->lpfilecontent); - nGettingTime = GetTickCount(); - UpdateCounters(lan_dir, lan_file, nGettingDir, nGettingFile); - } - lpSubExtDir = lpExtDir + i + 1; - } - } - } - - NBW = COMPUTERNAMELEN; - GetSystemTime(lpSystemtime1); - GetComputerName(lpComputerName1, &NBW); - GetUserName(lpUserName1, &NBW); - - UI_AfterShot(); - -} - - -// ----------------------------- -VOID Shot2(VOID) -{ - lpHeadLocalMachine2 = (LPKEYCONTENT)MYALLOC0(sizeof(KEYCONTENT)); - lpHeadUsers2 = (LPKEYCONTENT)MYALLOC0(sizeof(KEYCONTENT)); - - if (bUseLongRegHead) { // 1.8.1 - lpHeadLocalMachine2->lpkeyname = MYALLOC(sizeof(LOCALMACHINESTRING_LONG)); - lpHeadUsers2->lpkeyname = MYALLOC(sizeof(USERSSTRING_LONG)); - strcpy(lpHeadLocalMachine2->lpkeyname, LOCALMACHINESTRING_LONG); - strcpy(lpHeadUsers2->lpkeyname, USERSSTRING_LONG); - } else { - lpHeadLocalMachine2->lpkeyname = MYALLOC(sizeof(LOCALMACHINESTRING)); - lpHeadUsers2->lpkeyname = MYALLOC(sizeof(USERSSTRING)); - strcpy(lpHeadLocalMachine2->lpkeyname, LOCALMACHINESTRING); - strcpy(lpHeadUsers2->lpkeyname, USERSSTRING); - } - - - nGettingKey = 2; - nGettingValue = 0; - nGettingTime = 0; - nGettingFile = 0; - nGettingDir = 0; - nBASETIME = GetTickCount(); - nBASETIME1 = nBASETIME; - UI_BeforeShot(IDC_2NDSHOT); - - GetRegistrySnap(HKEY_LOCAL_MACHINE, lpHeadLocalMachine2); - GetRegistrySnap(HKEY_USERS, lpHeadUsers2); - nGettingTime = GetTickCount(); - UpdateCounters(lan_key, lan_value, nGettingKey, nGettingValue); - - if (SendMessage(GetDlgItem(hWnd, IDC_CHECKDIR), BM_GETCHECK, (WPARAM)0, (LPARAM)0) == 1) { - size_t nLengthofStr; - DWORD i; - LPSTR lpSubExtDir; - LPHEADFILE lphf; - LPHEADFILE lphftemp; - - GetDlgItemText(hWnd, IDC_EDITDIR, lpExtDir, EXTDIRLEN/2); - nLengthofStr = strlen(lpExtDir); - - lphf = lphftemp = lpHeadFile1; // changed in 1.8 - lpSubExtDir = lpExtDir; - - if (nLengthofStr > 0) - for (i = 0; i <= nLengthofStr; i++) { - // This is the stupid filename detection routine, [seperate with ";"] - if (*(lpExtDir + i) == 0x3b || *(lpExtDir + i) == 0x00) { - *(lpExtDir + i) = 0x00; - - if (*(lpExtDir + i - 1) == '\\' && i > 0) { - *(lpExtDir + i - 1) = 0x00; - } - - if (*lpSubExtDir != 0x00) { - size_t nSubExtDirLen; - - lphf = (LPHEADFILE)MYALLOC0(sizeof(HEADFILE)); - if (lpHeadFile2 == NULL) { - lpHeadFile2 = lphf; - } else { - lphftemp->lpnextheadfile = lphf; - } - - lphftemp = lphf; - lphf->lpfilecontent = (LPFILECONTENT)MYALLOC0(sizeof(FILECONTENT)); - - nSubExtDirLen = strlen(lpSubExtDir) + 1; - lphf->lpfilecontent->lpfilename = MYALLOC(nSubExtDirLen); - - strcpy(lphf->lpfilecontent->lpfilename, lpSubExtDir); - - lphf->lpfilecontent->fileattr = FILE_ATTRIBUTE_DIRECTORY; - - GetFilesSnap(lphf->lpfilecontent); - nGettingTime = GetTickCount(); - UpdateCounters(lan_dir, lan_file, nGettingDir, nGettingFile); - } - lpSubExtDir = lpExtDir + i + 1; - } - } - } - - NBW = COMPUTERNAMELEN; - GetSystemTime(lpSystemtime2); - GetComputerName(lpComputerName2, &NBW); - GetUserName(lpUserName2, &NBW); - UI_AfterShot(); -} - - -//-------------------------------------------------- -// Show popup shortcut menu -//-------------------------------------------------- -VOID CreateShotPopupMenu(VOID) -{ - hMenu = CreatePopupMenu(); - AppendMenu(hMenu, MF_STRING, IDM_SHOTONLY, (LPCSTR)lan_menushot); - AppendMenu(hMenu, MF_STRING, IDM_SHOTSAVE, (LPCSTR)lan_menushotsave); - AppendMenu(hMenu, MF_SEPARATOR, IDM_BREAK, NULL); - AppendMenu(hMenu, MF_STRING, IDM_LOAD, (LPCSTR)lan_menuload); - SetMenuDefaultItem(hMenu, IDM_SHOTONLY, FALSE); -} diff --git a/RegShot/src/version.h b/RegShot/src/version.h deleted file mode 100644 index db26f64..0000000 --- a/RegShot/src/version.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - Copyright 2011 XhmikosR - - This file is part of Regshot. - - Regshot is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Regshot is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Regshot; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - - -#ifndef REGSHOT_VERSION_H -#define REGSHOT_VERSION_H - - -#define DO_STRINGIFY(x) #x -#define STRINGIFY(x) DO_STRINGIFY(x) - -#define REGSHOT_VERSION_MAJOR 1 -#define REGSHOT_VERSION_MINOR 8 -#define REGSHOT_VERSION_PATCH 3 -#define REGSHOT_VERSION_REV 0 - -#define REGSHOT_VERSION_COPYRIGHT "Copyright (C) 1999-2012, all contributors" -#define REGSHOT_VERSION_NUM REGSHOT_VERSION_MAJOR,REGSHOT_VERSION_MINOR,REGSHOT_VERSION_PATCH,REGSHOT_VERSION_REV -#define REGSHOT_VERSION STRINGIFY(REGSHOT_VERSION_MAJOR) ", " STRINGIFY(REGSHOT_VERSION_MINOR) ", " STRINGIFY(REGSHOT_VERSION_PATCH) ", " STRINGIFY(REGSHOT_VERSION_REV) -#define REGSHOT_VERSION_STRING STRINGIFY(REGSHOT_VERSION_MAJOR) "." STRINGIFY(REGSHOT_VERSION_MINOR) "." STRINGIFY(REGSHOT_VERSION_PATCH) "-beta1V5" - -#ifdef _WIN64 -#define REGSHOT_TITLE "Regshot x64" -#define REGSHOT_RESULT_FILE "~res-x64" -#define REGSHOT_VERSION_PLATFORM "x64" -#else -#define REGSHOT_TITLE "Regshot" -#define REGSHOT_RESULT_FILE "~res" -#define REGSHOT_VERSION_PLATFORM "win32" -#endif // _WIN64 - -#ifdef _DEBUG -#define REGSHOT_VERSION_BUILDTYPE "d" -#else -#define REGSHOT_VERSION_BUILDTYPE "r" -#endif - -#define DO_STRINGIFY(x) #x -#define STRINGIFY(x) DO_STRINGIFY(x) - -#if defined(__GNUC__) - #define REGSHOT_VERSION_COMPILER "GCC "STRINGIFY(__GNUC__)"."STRINGIFY(__GNUC_MINOR__)"."STRINGIFY(__GNUC_PATCHLEVEL__) -#elif defined(__INTEL_COMPILER) - #if __INTEL_COMPILER >= 1200 - #define REGSHOT_VERSION_COMPILER "Intel Compiler 12" - #else - #define REGSHOT_VERSION_COMPILER "Intel Compiler (version unknown)" - #endif -#elif defined(WDK_BUILD) - #if _MSC_VER == 1600 - #if (_MSC_FULL_VER >= 160040219) - #define REGSHOT_VERSION_COMPILER "WDK (MSVC 2010 SP1)" - #else - #define REGSHOT_VERSION_COMPILER "WDK (MSVC 2010)" - #endif - #elif _MSC_VER == 1500 - #if (_MSC_FULL_VER == 150030729) - #define REGSHOT_VERSION_COMPILER "WDK" - #else - #define REGSHOT_VERSION_COMPILER "WDK (version unknown)" - #endif - #endif -#elif defined(_MSC_VER) - #if _MSC_VER == 1600 - #if (_MSC_FULL_VER >= 160040219) - #define REGSHOT_VERSION_COMPILER "MSVC 2010 SP1" - #else - #define REGSHOT_VERSION_COMPILER "MSVC 2010" - #endif - #elif _MSC_VER == 1500 - #if (_MSC_FULL_VER >= 150030729) - #define REGSHOT_VERSION_COMPILER "MSVC 2008 SP1" - #else - #define REGSHOT_VERSION_COMPILER "MSVC 2008" - #endif - #else - #define REGSHOT_VERSION_COMPILER "MSVC (version unknown)" - #endif -#else - #define REGSHOT_VERSION_COMPILER "(Unknown compiler)" -#endif - -#define REGSHOT_VERSION_DESCRIPTION REGSHOT_VERSION_STRING ", " REGSHOT_VERSION_PLATFORM ", " REGSHOT_VERSION_BUILDTYPE ", " REGSHOT_VERSION_COMPILER - - -#endif // REGSHOT_VERSION_H diff --git a/RegShot/src/winmain.c b/RegShot/src/winmain.c deleted file mode 100644 index 8dc4b63..0000000 --- a/RegShot/src/winmain.c +++ /dev/null @@ -1,459 +0,0 @@ -/* - Copyright 1999-2003,2007 TiANWEi - Copyright 2004 tulipfan - Copyright 2007 Belogorokhov Youri - - - This file is part of Regshot. - - Regshot is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Regshot is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Regshot; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - - -#include "global.h" -#include "version.h" - -char *str_prgname = REGSHOT_TITLE " " REGSHOT_VERSION_STRING; // tfx add program titile -char *str_aboutme = "Regshot is a free and open source registry compare utility.\nversion: " REGSHOT_VERSION_DESCRIPTION "\n\nhttp://sourceforge.net/projects/regshot/\n\n" REGSHOT_VERSION_COPYRIGHT "\n\n"; - -LPSTR REGSHOTINI = "regshot.ini"; // tfx -LPSTR REGSHOTLANGUAGEFILE = "language.ini"; - -extern LPBYTE lan_menuclearallshots; // Be careful of extern ref! must be the same when declare them, -extern LPBYTE lan_menuclearshot1; // otherwise pointer would mis-point, and I can not use sizeof -extern LPBYTE lan_menuclearshot2; // to get real array size in extern ref -extern LPBYTE lan_about; -extern LPSTR str_DefaultLanguage; -extern LPSTR str_Original; - - -// this new function added by Youri in 1.8.2, for expanding path in browse dialog -int CALLBACK SelectBrowseFolder(HWND hWnd, UINT uMsg, LPARAM lParam, LPARAM lpData) -{ - UNREFERENCED_PARAMETER(lParam); - if (uMsg == BFFM_INITIALIZED) { - SendMessage(hWnd, BFFM_SETSELECTION, 1, lpData); - } - return 0; -} - - -//-------------------------------------------------- -// Main Dialog Proc -//-------------------------------------------------- -BOOL CALLBACK DialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) -{ - size_t nLengthofStr; - //BYTE nFlag; - - UNREFERENCED_PARAMETER(lParam); - - switch (message) { - case WM_INITDIALOG: - - SendDlgItemMessage(hDlg, IDC_EDITCOMMENT, EM_SETLIMITTEXT, (WPARAM)COMMENTLENGTH, (LPARAM)0); - SendDlgItemMessage(hDlg, IDC_EDITPATH, EM_SETLIMITTEXT, (WPARAM)MAX_PATH, (LPARAM)0); - SendDlgItemMessage(hDlg, IDC_EDITDIR, EM_SETLIMITTEXT, (WPARAM)(EXTDIRLEN/2), (LPARAM)0); - - //enlarge some buffer in 201201 - lpCurrentLanguage = MYALLOC0(SIZEOF_SINGLE_LANGUAGENAME); - lpExtDir = MYALLOC0(EXTDIRLEN + 4); //EXTDIRLEN is actually 4*max_path - lpLanguageIni = MYALLOC0(MAX_PATH*4 + 4); //for language.ini - lpRegshotIni = MYALLOC0(MAX_PATH*4 + 4); //for regshot.ini - lpKeyName = MYALLOC0(MAX_PATH*2 + 2); //For scan engine store keyname - lpValueName = MYALLOC0(1024*16*2); //For scan engine store valuename - lpValueData = MYALLOC0(ESTIMATE_VALUEDATA_LENGTH); //For scan engine store valuedata estimate - lpMESSAGE = MYALLOC0(256); //For status bar text message store - lpWindowsDirName = MYALLOC0(MAX_PATH*2 + 2); - lpTempPath = MYALLOC0(MAX_PATH*2 + 2); - lpStartDir = MYALLOC0(MAX_PATH*2 + 2); - lpOutputpath = MYALLOC0(MAX_PATH*2 + 2); //store last save/open hive file dir - lpComputerName1 = MYALLOC0(COMPUTERNAMELEN); - lpComputerName2 = MYALLOC0(COMPUTERNAMELEN); - lpUserName1 = MYALLOC0(COMPUTERNAMELEN); - lpUserName2 = MYALLOC0(COMPUTERNAMELEN); - lpSystemtime1 = MYALLOC0(sizeof(SYSTEMTIME)); - lpSystemtime2 = MYALLOC0(sizeof(SYSTEMTIME)); - lpLangStrings = MYALLOC0(SIZEOF_LANGSTRINGS); - lplpLangStrings = MYALLOC0(sizeof(LPSTR) * 60); // max is 60 strings - - lpCurrentTranslator = str_Original; - - GetWindowsDirectory(lpWindowsDirName, MAX_PATH); - nLengthofStr = strlen(lpWindowsDirName); - if (nLengthofStr > 0 && *(lpWindowsDirName + nLengthofStr - 1) == '\\') { - *(lpWindowsDirName + nLengthofStr - 1) = 0x00; - } - GetTempPath(MAX_PATH, lpTempPath); - - //_asm int 3; - GetCurrentDirectory(MAX_PATH + 1, lpStartDir); // fixed at 1.8.2 former version use getcommandline() - strcpy(lpLanguageIni, lpStartDir); - if (*(lpLanguageIni + strlen(lpLanguageIni) - 1) != '\\') { // 1.8.2 - strcat(lpLanguageIni, "\\"); - } - strcat(lpLanguageIni, REGSHOTLANGUAGEFILE); - - - if (GetLanguageType(hDlg)) { - GetLanguageStrings(hDlg); - } else { - GetDefaultStrings(); - } - - SendMessage(hDlg, WM_COMMAND, (WPARAM)IDC_CHECKDIR, (LPARAM)0); - - lpLastSaveDir = lpOutputpath; - lpLastOpenDir = lpOutputpath; - - strcpy(lpRegshotIni, lpStartDir); - if (*(lpRegshotIni + strlen(lpRegshotIni) - 1) != '\\') { - strcat(lpRegshotIni, "\\"); - } - strcat(lpRegshotIni, REGSHOTINI); - - LoadSettingsFromIni(hDlg); // tfx - - return TRUE; - - case WM_COMMAND: - switch (LOWORD(wParam)) { - case IDC_1STSHOT: - CreateShotPopupMenu(); - is1 = TRUE; - GetWindowRect(GetDlgItem(hDlg, IDC_1STSHOT), &rect); - TrackPopupMenu(hMenu, TPM_LEFTALIGN | TPM_LEFTBUTTON, rect.left + 10, rect.top + 10, 0, hDlg, NULL); - DestroyMenu(hMenu); - - return(TRUE); - - case IDC_2NDSHOT: - CreateShotPopupMenu(); - is1 = FALSE; - GetWindowRect(GetDlgItem(hDlg, IDC_2NDSHOT), &rect); - TrackPopupMenu(hMenu, TPM_LEFTALIGN | TPM_LEFTBUTTON, rect.left + 10, rect.top + 10, 0, hDlg, NULL); - DestroyMenu(hMenu); - return(TRUE); - - case IDM_SHOTONLY: - if (is1) { - is1LoadFromHive = FALSE; - Shot1(); - } else { - is2LoadFromHive = FALSE; - Shot2(); - } - - return(TRUE); - - case IDM_SHOTSAVE: - if (is1) { - is1LoadFromHive = FALSE; - Shot1(); - SaveHive(lpHeadLocalMachine1, lpHeadUsers1, lpHeadFile1, lpComputerName1, lpUserName1, lpSystemtime1); // I might use a struct in future! - } else { - is2LoadFromHive = FALSE; - Shot2(); - SaveHive(lpHeadLocalMachine2, lpHeadUsers2, lpHeadFile2, lpComputerName2, lpUserName2, lpSystemtime2); - } - - return(TRUE); - - case IDM_LOAD: - if (is1) { - is1LoadFromHive = LoadHive(&lpHeadLocalMachine1, &lpHeadUsers1, &lpHeadFile1, &lpTempHive1); - } else { - is2LoadFromHive = LoadHive(&lpHeadLocalMachine2, &lpHeadUsers2, &lpHeadFile2, &lpTempHive2); - } - - //if (is1LoadFromHive || is2LoadFromHive) - // SendMessage(GetDlgItem(hWnd,IDC_CHECKDIR),BM_SETCHECK,(WPARAM)0x00,(LPARAM)0); - - return(TRUE); - - /*case IDC_SAVEREG: - SaveRegistry(lpHeadLocalMachine1,lpHeadUsers1); - return(TRUE);*/ - - case IDC_COMPARE: - EnableWindow(GetDlgItem(hDlg, IDC_COMPARE), FALSE); - UI_BeforeClear(); - CompareShots(); - ShowWindow(GetDlgItem(hDlg, IDC_PBCOMPARE), SW_HIDE); - EnableWindow(GetDlgItem(hDlg, IDC_CLEAR1), TRUE); - SetFocus(GetDlgItem(hDlg, IDC_CLEAR1)); - SendMessage(hDlg, DM_SETDEFID, (WPARAM)IDC_CLEAR1, (LPARAM)0); - SetCursor(hSaveCursor); - MessageBeep(0xffffffff); - return(TRUE); - - case IDC_CLEAR1: - hMenuClear = CreatePopupMenu(); - AppendMenu(hMenuClear, MF_STRING, IDM_CLEARALLSHOTS, (LPCSTR)lan_menuclearallshots); - AppendMenu(hMenuClear, MF_MENUBARBREAK, IDM_BREAK, NULL); - AppendMenu(hMenuClear, MF_STRING, IDM_CLEARSHOT1, (LPCSTR)lan_menuclearshot1); - AppendMenu(hMenuClear, MF_STRING, IDM_CLEARSHOT2, (LPCSTR)lan_menuclearshot2); - //AppendMenu(hMenuClear,MF_STRING,IDM_CLEARRESULT,"Clear comparison result"); - SetMenuDefaultItem(hMenuClear, IDM_CLEARALLSHOTS, FALSE); - - //if (lpHeadFile != NULL) - //{ - // EnableMenuItem(hMenuClear,IDM_CLEARSHOT1,MF_BYCOMMAND|MF_GRAYED); - // EnableMenuItem(hMenuClear,IDM_CLEARSHOT2,MF_BYCOMMAND|MF_GRAYED); - //} - //else - { - if (lpHeadLocalMachine1 != NULL) { - EnableMenuItem(hMenuClear, IDM_CLEARSHOT1, MF_BYCOMMAND | MF_ENABLED); - } else { - EnableMenuItem(hMenuClear, IDM_CLEARSHOT1, MF_BYCOMMAND | MF_GRAYED); - } - - if (lpHeadLocalMachine2 != NULL) { - EnableMenuItem(hMenuClear, IDM_CLEARSHOT2, MF_BYCOMMAND | MF_ENABLED); - } else { - EnableMenuItem(hMenuClear, IDM_CLEARSHOT2, MF_BYCOMMAND | MF_GRAYED); - } - } - GetWindowRect(GetDlgItem(hDlg, IDC_CLEAR1), &rect); - TrackPopupMenu(hMenuClear, TPM_LEFTALIGN | TPM_LEFTBUTTON, rect.left + 10, rect.top + 10, 0, hDlg, NULL); - DestroyMenu(hMenuClear); - return(TRUE); - - case IDM_CLEARALLSHOTS: - UI_BeforeClear(); - FreeAllKeyContent1(); // Note!! If loadfromhive and contains a file, we should let lpHeadFile to NULL - FreeAllKeyContent2(); - FreeAllCompareResults(); - - FreeAllFileHead(lpHeadFile1); - FreeAllFileHead(lpHeadFile2); - - lpHeadFile1 = NULL; - lpHeadFile2 = NULL; - UI_AfterClear(); - EnableWindow(GetDlgItem(hWnd, IDC_CLEAR1), FALSE); - return(TRUE); - - case IDM_CLEARSHOT1: - UI_BeforeClear(); - FreeAllKeyContent1(); - FreeAllCompareResults(); - FreeAllFileHead(lpHeadFile1); - lpHeadFile1 = NULL; - ClearKeyMatchTag(lpHeadLocalMachine2); // we clear shot2's tag - ClearKeyMatchTag(lpHeadUsers2); - ClearHeadFileMatchTag(lpHeadFile2); - UI_AfterClear(); - return(TRUE); - - case IDM_CLEARSHOT2: - UI_BeforeClear(); - FreeAllKeyContent2(); - FreeAllCompareResults(); - FreeAllFileHead(lpHeadFile2); - lpHeadFile2 = NULL; - ClearKeyMatchTag(lpHeadLocalMachine1); // we clear shot1's tag - ClearKeyMatchTag(lpHeadUsers1); - ClearHeadFileMatchTag(lpHeadFile1); - UI_AfterClear(); - return(TRUE); - - /*case IDM_CLEARRESULT: - UI_BeforeClear(); - FreeAllCompareResults(); - ClearKeyMatchTag(lpHeadLocalMachine1); - ClearKeyMatchTag(lpHeadLocalMachine2); - ClearKeyMatchTag(lpHeadUsers1); - ClearKeyMatchTag(lpHeadUsers2); - ClearHeadFileMatchTag(lpHeadFile1); - ClearHeadFileMatchTag(lpHeadFile2); - UI_AfterClear(); - return(TRUE);*/ - - case IDC_CHECKDIR: - if (SendMessage(GetDlgItem(hDlg, IDC_CHECKDIR), BM_GETCHECK, (WPARAM)0, (LPARAM)0) == 1) { - EnableWindow(GetDlgItem(hDlg, IDC_EDITDIR), TRUE); - EnableWindow(GetDlgItem(hDlg, IDC_BROWSE1), TRUE); - } else { - EnableWindow(GetDlgItem(hDlg, IDC_EDITDIR), FALSE); - EnableWindow(GetDlgItem(hDlg, IDC_BROWSE1), FALSE); - } - return(TRUE); - - case IDC_CANCEL1: - case IDCANCEL: - - SaveSettingsToIni(hDlg); // tfx - PostQuitMessage(0); - return(TRUE); - - case IDC_BROWSE1: { - - LPITEMIDLIST lpidlist; - BrowseInfo1.hwndOwner = hDlg; - BrowseInfo1.pszDisplayName = MYALLOC0(MAX_PATH*2 + 2); - //BrowseInfo1.lpszTitle = "Select:"; - BrowseInfo1.ulFlags = 0; // 3 lines added in 1.8.2 - BrowseInfo1.lpfn = NULL; - BrowseInfo1.lParam = 0; - - lpidlist = SHBrowseForFolder(&BrowseInfo1); - - if (lpidlist != NULL) { - size_t nWholeLen; - - SHGetPathFromIDList(lpidlist, BrowseInfo1.pszDisplayName); - nLengthofStr = GetDlgItemText(hDlg, IDC_EDITDIR, lpExtDir, EXTDIRLEN/2); - nWholeLen = nLengthofStr + strlen(BrowseInfo1.pszDisplayName); - - if (nWholeLen < EXTDIRLEN + 1) { - strcat(lpExtDir, ";"); - strcat(lpExtDir, BrowseInfo1.pszDisplayName); - - } else { - strcpy(lpExtDir, BrowseInfo1.pszDisplayName); - } - - SetDlgItemText(hDlg, IDC_EDITDIR, lpExtDir); - MYFREE(lpidlist); - } - - MYFREE(BrowseInfo1.pszDisplayName); - } - return(TRUE); - - case IDC_BROWSE2: { - - LPITEMIDLIST lpidlist; - BrowseInfo1.hwndOwner = hDlg; - BrowseInfo1.pszDisplayName = MYALLOC0(MAX_PATH*2 + 2); - //BrowseInfo1.lpszTitle = "Select:"; - - //----------------- - // Added by Youri in 1.8.2 ,Thanks! - // if you add this code, the browse dialog will be expand path and have button "Create Folder" - BrowseInfo1.ulFlags |= 0x0040; // BIF_NEWDIALOGSTYLE; // button "Create Folder" and resizable - BrowseInfo1.lpfn = SelectBrowseFolder; // function for expand path - BrowseInfo1.lParam = (LPARAM)BrowseInfo1.pszDisplayName; - // Initilize selection path - GetDlgItemText(hDlg, IDC_EDITPATH, BrowseInfo1.pszDisplayName, MAX_PATH); - //----------------- - - lpidlist = SHBrowseForFolder(&BrowseInfo1); - if (lpidlist != NULL) { - SHGetPathFromIDList(lpidlist, BrowseInfo1.pszDisplayName); - SetDlgItemText(hDlg, IDC_EDITPATH, BrowseInfo1.pszDisplayName); - MYFREE(lpidlist); - } - - MYFREE(BrowseInfo1.pszDisplayName); - } - return(TRUE); - - case IDC_COMBOLANGUAGE: - GetLanguageStrings(hDlg); - return(TRUE); - - case IDC_ABOUT: { - LPSTR lpAboutBox; - //_asm int 3; - lpAboutBox = MYALLOC0(SIZEOF_ABOUTBOX); - // it is silly that when wsprintf encounters a NULL string, it will write the whole string to NULL! - sprintf(lpAboutBox, "%s%s%s%s%s%s", str_aboutme, "[", (strlen(lpCurrentLanguage) == 0) ? str_DefaultLanguage : lpCurrentLanguage, "]", " by: ", lpCurrentTranslator); - MessageBox(hDlg, lpAboutBox, (LPCSTR)lan_about, MB_OK); - MYFREE(lpAboutBox); - return(TRUE); - } - } - - } - return(FALSE); -} - - -/*BOOL SetPrivilege(HANDLE hToken, LPCSTR pString, BOOL bEnablePrivilege) -{ - TOKEN_PRIVILEGES tp; - LUID luid; - TOKEN_PRIVILEGES tpPrevious; - DWORD cbSize = sizeof(TOKEN_PRIVILEGES); - - if (!LookupPrivilegeValue(NULL,pString,&luid)) - return FALSE; - tp.PrivilegeCount = 1; - tp.Privileges[0].Luid = luid; - tp.Privileges[0].Attributes = 0; - if (!AdjustTokenPrivileges(hToken,FALSE,&tp,sizeof(TOKEN_PRIVILEGES),&tpPrevious,&cbSize)) - return FALSE; - tpPrevious.PrivilegeCount = 1; - tpPrevious.Privileges[0].Luid = luid; - if (bEnablePrivilege) - tpPrevious.Privileges[0].Attributes| = (SE_PRIVILEGE_ENABLED); - else - tpPrevious.Privileges[0].Attributes^ = ((tpPrevious.Privileges[0].Attributes)&(SE_PRIVILEGE_ENABLED)); - if (!AdjustTokenPrivileges(hToken,FALSE,&tpPrevious,cbSize,NULL,NULL)) - return FALSE; - return TRUE; -}*/ - - -int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, - LPSTR lpszCmdLine, int nCmdShow) -{ - - /* - BOOL bWinNTDetected; - HANDLE hToken = 0; - OSVERSIONINFO winver; - winver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&winver); - bWinNTDetected = (winver.dwPlatformId == VER_PLATFORM_WIN32_NT) ? TRUE : FALSE; - //hWndMonitor be created first for the multilanguage interface. - - //FARPROC lpfnDlgProc; - //lpfnDlgProc = MakeProcInstance((FARPROC)DialogProc,hInstance); // old style of create dialogproc - */ - UNREFERENCED_PARAMETER(lpszCmdLine); - UNREFERENCED_PARAMETER(hPrevInstance); - - hHeap = GetProcessHeap(); // 1.8.2 - hWnd = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, (DLGPROC)DialogProc); - - SetClassLongPtr(hWnd, GCLP_HICON, (LONG_PTR)LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MAINICON))); - - SetWindowText(hWnd, str_prgname); // tfx set program title to str_prgname��avoid edit resource file - ShowWindow(hWnd, nCmdShow); - UpdateWindow(hWnd); - //SetPriorityClass(hInstance,31); - /*if (bWinNTDetected) - { - if (OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY,&hToken) == TRUE) - { - if (SetPrivilege(hToken,"SeSystemProfilePrivilege",TRUE) == TRUE) - { - MessageBox(hWnd,"We are in system level,enjoy!","Info:",MB_OK); - } - CloseHandle(hToken); - } - }*/ - while (GetMessage(&msg, NULL, (WPARAM)NULL, (LPARAM)NULL)) { - if (!IsDialogMessage(hWnd, &msg)) { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - } - return(int)(msg.wParam); -}