mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-01-12 17:48:27 +08:00
2.2.0
This commit is contained in:
parent
b6e0e203f8
commit
8a5efb6908
2
Makefile
2
Makefile
@ -12,6 +12,8 @@ build:
|
||||
zip -v -q -r package-script.zip package-script
|
||||
cp -rv VM deb/opt/apps/deepin-wine-runner
|
||||
cp -rv AllInstall.py deb/opt/apps/deepin-wine-runner
|
||||
cp -rv req deb/opt/apps/deepin-wine-runner
|
||||
cp -rv RegShot deb/opt/apps/deepin-wine-runner
|
||||
cp -rv BeCyIconGrabber.exe deb/opt/apps/deepin-wine-runner
|
||||
cp -rv deepin-wine-packager-with-script.py deb/opt/apps/deepin-wine-runner
|
||||
cp -rv deepin-wine-packager.py deb/opt/apps/deepin-wine-runner
|
||||
|
BIN
RegShot/182to183.exe
Normal file
BIN
RegShot/182to183.exe
Normal file
Binary file not shown.
114
RegShot/build/CMakeLists.txt
Normal file
114
RegShot/build/CMakeLists.txt
Normal file
@ -0,0 +1,114 @@
|
||||
###
|
||||
### 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}"
|
||||
)
|
166
RegShot/build/build_wdk.bat
Normal file
166
RegShot/build/build_wdk.bat
Normal file
@ -0,0 +1,166 @@
|
||||
@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
|
||||
)
|
66
RegShot/build/cmake_how_to_create_project_files.txt
Normal file
66
RegShot/build/cmake_how_to_create_project_files.txt
Normal file
@ -0,0 +1,66 @@
|
||||
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)
|
280
RegShot/build/make_zip.bat
Normal file
280
RegShot/build/make_zip.bat
Normal file
@ -0,0 +1,280 @@
|
||||
@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
|
||||
)
|
160
RegShot/build/makefile.mak
Normal file
160
RegShot/build/makefile.mak
Normal file
@ -0,0 +1,160 @@
|
||||
#******************************************************************************
|
||||
#* 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
|
26
RegShot/build/regshot_icl12.sln
Normal file
26
RegShot/build/regshot_icl12.sln
Normal file
@ -0,0 +1,26 @@
|
||||
|
||||
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
|
224
RegShot/build/regshot_icl12.vcxproj
Normal file
224
RegShot/build/regshot_icl12.vcxproj
Normal file
@ -0,0 +1,224 @@
|
||||
<?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>
|
66
RegShot/build/regshot_icl12.vcxproj.filters
Normal file
66
RegShot/build/regshot_icl12.vcxproj.filters
Normal file
@ -0,0 +1,66 @@
|
||||
<?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>
|
26
RegShot/build/regshot_vs2008.sln
Normal file
26
RegShot/build/regshot_vs2008.sln
Normal file
@ -0,0 +1,26 @@
|
||||
|
||||
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
|
440
RegShot/build/regshot_vs2008.vcproj
Normal file
440
RegShot/build/regshot_vs2008.vcproj
Normal file
@ -0,0 +1,440 @@
|
||||
<?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>
|
26
RegShot/build/regshot_vs2010.sln
Normal file
26
RegShot/build/regshot_vs2010.sln
Normal file
@ -0,0 +1,26 @@
|
||||
|
||||
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
|
203
RegShot/build/regshot_vs2010.vcxproj
Normal file
203
RegShot/build/regshot_vs2010.vcxproj
Normal file
@ -0,0 +1,203 @@
|
||||
<?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>
|
69
RegShot/build/regshot_vs2010.vcxproj.filters
Normal file
69
RegShot/build/regshot_vs2010.vcxproj.filters
Normal file
@ -0,0 +1,69 @@
|
||||
<?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>
|
339
RegShot/gpl.txt
Normal file
339
RegShot/gpl.txt
Normal file
@ -0,0 +1,339 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program 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.
|
||||
|
||||
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
1424
RegShot/language.ini
Normal file
1424
RegShot/language.ini
Normal file
File diff suppressed because it is too large
Load Diff
BIN
RegShot/regshot.exe
Normal file
BIN
RegShot/regshot.exe
Normal file
Binary file not shown.
15
RegShot/regshot.ini
Normal file
15
RegShot/regshot.ini
Normal file
@ -0,0 +1,15 @@
|
||||
[Setup]
|
||||
Flag=1
|
||||
ExtDir=
|
||||
OutDir=
|
||||
UseLongRegHead=0
|
||||
|
||||
[SkipRegKey]
|
||||
0=
|
||||
1=
|
||||
2=
|
||||
|
||||
[SkipDir]
|
||||
0=
|
||||
1=
|
||||
2=
|
BIN
RegShot/regshot_x64.exe
Normal file
BIN
RegShot/regshot_x64.exe
Normal file
Binary file not shown.
123
RegShot/src/182to183/align.c
Normal file
123
RegShot/src/182to183/align.c
Normal file
@ -0,0 +1,123 @@
|
||||
/*
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
158
RegShot/src/182to183/global.h
Normal file
158
RegShot/src/182to183/global.h
Normal file
@ -0,0 +1,158 @@
|
||||
/*
|
||||
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);
|
359
RegShot/src/182to183/loadsave.c
Normal file
359
RegShot/src/182to183/loadsave.c
Normal file
@ -0,0 +1,359 @@
|
||||
/*
|
||||
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;
|
||||
}
|
41
RegShot/src/182to183/main.c
Normal file
41
RegShot/src/182to183/main.c
Normal file
@ -0,0 +1,41 @@
|
||||
/*
|
||||
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
|
||||
}
|
120
RegShot/src/Makefile
Normal file
120
RegShot/src/Makefile
Normal file
@ -0,0 +1,120 @@
|
||||
#******************************************************************************
|
||||
#* 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)
|
586
RegShot/src/fileshot.c
Normal file
586
RegShot/src/fileshot.c
Normal file
@ -0,0 +1,586 @@
|
||||
/*
|
||||
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;
|
||||
}
|
||||
}
|
415
RegShot/src/global.h
Normal file
415
RegShot/src/global.h
Normal file
@ -0,0 +1,415 @@
|
||||
/*
|
||||
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
|
323
RegShot/src/language.c
Normal file
323
RegShot/src/language.c
Normal file
@ -0,0 +1,323 @@
|
||||
/*
|
||||
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;
|
||||
}
|
143
RegShot/src/misc.c
Normal file
143
RegShot/src/misc.c
Normal file
@ -0,0 +1,143 @@
|
||||
/*
|
||||
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;
|
||||
}*/
|
179
RegShot/src/output.c
Normal file
179
RegShot/src/output.c
Normal file
@ -0,0 +1,179 @@
|
||||
/*
|
||||
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);
|
||||
}
|
1725
RegShot/src/regshot.c
Normal file
1725
RegShot/src/regshot.c
Normal file
File diff suppressed because it is too large
Load Diff
177
RegShot/src/regshot.rc
Normal file
177
RegShot/src/regshot.rc
Normal file
@ -0,0 +1,177 @@
|
||||
// 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
|
||||
|
40
RegShot/src/res/Regshot.exe.manifest
Normal file
40
RegShot/src/res/Regshot.exe.manifest
Normal file
@ -0,0 +1,40 @@
|
||||
<?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>
|
BIN
RegShot/src/res/regshot.ico
Normal file
BIN
RegShot/src/res/regshot.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
77
RegShot/src/resource.h
Normal file
77
RegShot/src/resource.h
Normal file
@ -0,0 +1,77 @@
|
||||
//{{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
|
172
RegShot/src/setup.c
Normal file
172
RegShot/src/setup.c
Normal file
@ -0,0 +1,172 @@
|
||||
/*
|
||||
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;
|
||||
}
|
371
RegShot/src/ui.c
Normal file
371
RegShot/src/ui.c
Normal file
@ -0,0 +1,371 @@
|
||||
/*
|
||||
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);
|
||||
}
|
103
RegShot/src/version.h
Normal file
103
RegShot/src/version.h
Normal file
@ -0,0 +1,103 @@
|
||||
/*
|
||||
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
|
459
RegShot/src/winmain.c
Normal file
459
RegShot/src/winmain.c
Normal file
@ -0,0 +1,459 @@
|
||||
/*
|
||||
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);
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"Version": "2.2.0-Alpha4",
|
||||
"Version": "2.2.0",
|
||||
"Thank": [
|
||||
"感谢 @a2035274 @虚幻的早晨 https://bbs.deepin.org/post/238301",
|
||||
"感谢 @zhangs https://bbs.deepin.org/post/227948",
|
||||
|
@ -128,6 +128,7 @@ class QT:
|
||||
e1.setEditText(findExeHistory[-1])
|
||||
|
||||
def DisableButton(things):
|
||||
button_r_6.setDisabled(things)
|
||||
button1.setDisabled(things)
|
||||
button2.setDisabled(things)
|
||||
button3.setDisabled(things)
|
||||
@ -813,11 +814,11 @@ class UpdateWindow():
|
||||
ok.setDisabled(True)
|
||||
else:
|
||||
if "deepin/UOS 应用商店版本<带签名>" == programVersionType:
|
||||
url = "aHR0cHM6Ly8zMDQ2MjZwOTI3LmdvaG8uY28vc3BhcmstZGVlcGluLXdpbmUtcnVubmVyL3VwZGF0ZS11b3MuanNvbg=="
|
||||
url = "aHR0cDovLzEyMC4yNS4xNTMuMTQ0L3NwYXJrLWRlZXBpbi13aW5lLXJ1bm5lci91cGRhdGUtdW9zLmpzb24="
|
||||
elif "星火应用商店版本" == programVersionType:
|
||||
url = "aHR0cHM6Ly8zMDQ2MjZwOTI3LmdvaG8uY28vc3BhcmstZGVlcGluLXdpbmUtcnVubmVyL3VwZGF0ZS1zcGFyay5qc29u"
|
||||
url = "aHR0cDovLzEyMC4yNS4xNTMuMTQ0L3NwYXJrLWRlZXBpbi13aW5lLXJ1bm5lci91cGRhdGUtc3BhcmsuanNvbg=="
|
||||
else:
|
||||
url = "aHR0cHM6Ly8zMDQ2MjZwOTI3LmdvaG8uY28vc3BhcmstZGVlcGluLXdpbmUtcnVubmVyL3VwZGF0ZS5qc29u"
|
||||
url = "aHR0cDovLzEyMC4yNS4xNTMuMTQ0L3NwYXJrLWRlZXBpbi13aW5lLXJ1bm5lci91cGRhdGUuanNvbg=="
|
||||
try:
|
||||
UpdateWindow.data = json.loads(requests.get(base64.b64decode(url).decode("utf-8")).text)
|
||||
versionLabel = QtWidgets.QLabel(f"当前版本:{version}\n最新版本:{UpdateWindow.data['Version']}\n更新内容:")
|
||||
@ -1155,8 +1156,8 @@ class ProgramRunStatusShow():
|
||||
return
|
||||
try:
|
||||
sha = ProgramRunStatusUpload.GetSHA1(e2.currentText())
|
||||
lists = json.loads(requests.get(base64.b64decode("aHR0cHM6Ly8zMDQ2MjZwOTI3LmdvaG8uY28vc3BhcmstZGVlcGluLXdpbmUtcnVubmVyL2FwcC8=").decode("utf-8") + sha + base64.b64decode("L2FsbC5qc29u").decode("utf-8")).text)
|
||||
r = requests.get(base64.b64decode("aHR0cHM6Ly8zMDQ2MjZwOTI3LmdvaG8uY28vc3BhcmstZGVlcGluLXdpbmUtcnVubmVyL2FwcC8=").decode("utf-8") + sha + base64.b64decode("L3RpdGxlLnR4dA==").decode("utf-8"))
|
||||
lists = json.loads(requests.get(base64.b64decode("aHR0cDovLzEyMC4yNS4xNTMuMTQ0L3NwYXJrLWRlZXBpbi13aW5lLXJ1bm5lci9hcHAv").decode("utf-8") + sha + base64.b64decode("L2FsbC5qc29u").decode("utf-8")).text)
|
||||
r = requests.get(base64.b64decode("aHR0cDovLzEyMC4yNS4xNTMuMTQ0L3NwYXJrLWRlZXBpbi13aW5lLXJ1bm5lci9hcHAv").decode("utf-8") + sha + base64.b64decode("L3RpdGxlLnR4dA==").decode("utf-8"))
|
||||
r.encoding = "utf-8"
|
||||
title = r.text
|
||||
except:
|
||||
@ -1793,6 +1794,7 @@ updateThingsString = '''※1、Dll 提取工具支持 NT 6.X 及以上版本的
|
||||
13、不再强制依赖深度终端,只做推荐安装
|
||||
14、基于生态活动适配脚本的打包器在打包完成后会弹出对话框提示打包完成
|
||||
15、优化打包器的 spark wine helper 依赖设置方式
|
||||
16、新增 RegShot(注册表比对工具)
|
||||
<b>以下更新内容旧版本也适用(只限 2.1.0 及以上版本)</b>
|
||||
※1、在“安装更多Wine”的Wine安装工具中上新 Wine
|
||||
※2、云 Dll 工具上新 Dll
|
||||
@ -1832,7 +1834,7 @@ Qt 版本:{QtCore.qVersion()}
|
||||
title = "Wine 运行器 {}".format(version)
|
||||
updateThings = "{} 更新内容:\n{}\n更新时间:{}".format(version, updateThingsString, updateTime, time.strftime("%Y"))
|
||||
try:
|
||||
threading.Thread(target=requests.get, args=[parse.unquote(base64.b64decode("aHR0cHM6Ly8zMDQ2MjZwOTI3LmdvaG8uY28vc3BhcmstZGVlcGluLXdpbmUtcnVubmVyL29wZW4vSW5zdGFsbC5waHA=").decode("utf-8")) + "?Version=" + version]).start()
|
||||
threading.Thread(target=requests.get, args=[parse.unquote(base64.b64decode("aHR0cDovLzEyMC4yNS4xNTMuMTQ0L3NwYXJrLWRlZXBpbi13aW5lLXJ1bm5lci9vcGVuL0luc3RhbGwucGhw").decode("utf-8")) + "?Version=" + version]).start()
|
||||
except:
|
||||
pass
|
||||
iconListUnBuild = [
|
||||
@ -1962,8 +1964,8 @@ programManager.addWidget(wineConfig, 3, 0, 1, 1)
|
||||
fontAppStore = QtWidgets.QPushButton(QtCore.QCoreApplication.translate("U", "字体商店"))
|
||||
fontAppStore.clicked.connect(FontAppStore)
|
||||
programManager.addWidget(fontAppStore, 3, 2, 1, 1)
|
||||
button_r_6 = QtWidgets.QPushButton(QtCore.QCoreApplication.translate("U", "安装自定义字体"))
|
||||
button_r_6.clicked.connect(OpenWineFontPath)
|
||||
button_r_6 = QtWidgets.QPushButton(QtCore.QCoreApplication.translate("U", "RegShot"))
|
||||
button_r_6.clicked.connect(lambda: RunWineProgram(f"{programPath}/RegShot/regshot.exe"))
|
||||
programManager.addWidget(button_r_6, 3, 4, 1, 1)
|
||||
sparkWineSetting = QtWidgets.QPushButton(QtCore.QCoreApplication.translate("U", "星火wine配置"))
|
||||
sparkWineSetting.clicked.connect(lambda: threading.Thread(target=os.system, args=["/opt/durapps/spark-dwine-helper/spark-dwine-helper-settings/settings.sh"]).start())
|
||||
|
@ -1,3 +1,3 @@
|
||||
{
|
||||
"Version": "2.2.0-Alpha4"
|
||||
"Version": "2.2.0"
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
# 此库用于实现 52 版不连接程序服务器
|
||||
import req as requests
|
||||
import requests
|
||||
|
||||
unConnect = False
|
||||
with open("/var/lib/dpkg/status", "r") as i:
|
||||
|
Binary file not shown.
@ -14,7 +14,7 @@ import shutil
|
||||
import sys
|
||||
import json
|
||||
import traceback
|
||||
import req as requests
|
||||
import requests
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
# UI 布局(自动生成)
|
||||
|
Loading…
Reference in New Issue
Block a user