Skip to content

Commit

Permalink
Worked on WPS name resolution tool
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Mar 13, 2024
1 parent b690145 commit 8e00fab
Show file tree
Hide file tree
Showing 10 changed files with 613 additions and 43 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ stamp-h[1-9]
/src/serpentcrypt
/src/unicodetouch
/src/wevtinfo
/src/wpsname
/src/winregsave
/src/winshellfolder
/src/winshelllink
Expand Down
41 changes: 0 additions & 41 deletions autogen.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ $Library = Get-Content -Path configure.ac | select -skip 3 -first 1 | % { $_ -Re
$Version = Get-Content -Path configure.ac | select -skip 4 -first 1 | % { $_ -Replace " \[","" } | % { $_ -Replace "\],","" }
$Prefix = ${Library}.Substring(3)

Get-Content -Path "include\${Library}.h.in" | Out-File -Encoding ascii "include\${Library}.h"
Get-Content -Path "include\${Library}\definitions.h.in" | % { $_ -Replace "@VERSION@","${Version}" } | Out-File -Encoding ascii "include\${Library}\definitions.h"
Get-Content -Path "include\${Library}\features.h.in" | % { $_ -Replace "@[A-Z0-9_]*@","0" } | Out-File -Encoding ascii "include\${Library}\features.h"
Get-Content -Path "include\${Library}\types.h.in" | % { $_ -Replace "@[A-Z0-9_]*@","0" } | Out-File -Encoding ascii "include\${Library}\types.h"
Get-Content -Path "common\types.h.in" | % { $_ -Replace "@PACKAGE@","${Library}" } | Out-File -Encoding ascii "common\types.h"
Get-Content -Path "${Library}\${Library}_definitions.h.in" | % { $_ -Replace "@VERSION@","${Version}" } | Out-File -Encoding ascii "${Library}\${Library}_definitions.h"
Get-Content -Path "${Library}\${Library}.rc.in" | % { $_ -Replace "@VERSION@","${Version}" } | Out-File -Encoding ascii "${Library}\${Library}.rc"

If (Test-Path "setup.cfg.in")
{
Expand All @@ -27,38 +21,3 @@ If (Test-Path "${Prefix}.net")
Get-Content -Path "${Prefix}.net\${Prefix}.net.rc.in" | % { $_ -Replace "@VERSION@","${Version}" } | Out-File -Encoding ascii "${Prefix}.net\${Prefix}.net.rc"
}

$NamePrefix = ""

ForEach (${Library} in Get-ChildItem -Directory -Path "lib*")
{
ForEach (${DirectoryElement} in Get-ChildItem -Path "${Library}\*.l")
{
$OutputFile = ${DirectoryElement} -Replace ".l$",".c"

$NamePrefix = Split-Path -path ${DirectoryElement} -leaf
$NamePrefix = ${NamePrefix} -Replace ".l$","_"

Write-Host "Running: ${WinFlex} -Cf ${DirectoryElement}"

# PowerShell will raise NativeCommandError if win_flex writes to stdout or stderr
# therefore 2>&1 is added and the output is stored in a variable.
$Output = Invoke-Expression -Command "& '${WinFlex}' -Cf ${DirectoryElement} 2>&1"
Write-Host ${Output}

# Moving manually since `win_flex -o filename' does not provide the expected behavior.
Move-Item "lex.yy.c" ${OutputFile} -force
}

ForEach (${DirectoryElement} in Get-ChildItem -Path "${Library}\*.y")
{
$OutputFile = ${DirectoryElement} -Replace ".y$",".c"

Write-Host "Running: ${WinBison} -d -v -l -p ${NamePrefix} -o ${OutputFile} ${DirectoryElement}"

# PowerShell will raise NativeCommandError if win_bison writes to stdout or stderr
# therefore 2>&1 is added and the output is stored in a variable.
$Output = Invoke-Expression -Command "& '${WinBison}' -d -v -l -p ${NamePrefix} -o ${OutputFile} ${DirectoryElement} 2>&1"
Write-Host ${Output}
}
}

1 change: 1 addition & 0 deletions msvscpp/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ MSVSCPP_FILES = \
winregsave/winregsave.vcproj \
winshellfolder/winshellfolder.vcproj \
winshelllink/winshelllink.vcproj \
wpsname/wpsname.vcproj \
xor32sum/xor32sum.vcproj \
xor64sum/xor64sum.vcproj \
zcompress/zcompress.vcproj \
Expand Down
14 changes: 14 additions & 0 deletions msvscpp/assorted.sln
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,16 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wevtinfo", "wevtinfo\wevtin
{DD4C0210-D36E-4E74-AA91-B39E54E81E22} = {DD4C0210-D36E-4E74-AA91-B39E54E81E22}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wpsname", "wpsname\wpsname.vcproj", "{703A8EDC-5601-4662-A226-1C4FFBFEB6C3}"
ProjectSection(ProjectDependencies) = postProject
{16510E82-C099-4A58-8ABE-E62D36E945E8} = {16510E82-C099-4A58-8ABE-E62D36E945E8}
{7CCEB0A1-5BFC-4006-A364-EDAFC545EBF3} = {7CCEB0A1-5BFC-4006-A364-EDAFC545EBF3}
{2B851ED2-22C8-4BB6-AE22-E49A75536FF5} = {2B851ED2-22C8-4BB6-AE22-E49A75536FF5}
{12DF7DB4-FC19-44F7-89B6-B7221EA77BE6} = {12DF7DB4-FC19-44F7-89B6-B7221EA77BE6}
{952218B5-15F2-4EEC-B67D-164407BAE738} = {952218B5-15F2-4EEC-B67D-164407BAE738}
{DD4C0210-D36E-4E74-AA91-B39E54E81E22} = {DD4C0210-D36E-4E74-AA91-B39E54E81E22}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winregsave", "winregsave\winregsave.vcproj", "{9A2ECE73-F064-437E-A379-D4DE6A040116}"
ProjectSection(ProjectDependencies) = postProject
{7CCEB0A1-5BFC-4006-A364-EDAFC545EBF3} = {7CCEB0A1-5BFC-4006-A364-EDAFC545EBF3}
Expand Down Expand Up @@ -574,6 +584,10 @@ Global
{4600994E-D3A1-43F0-BCEE-A4AA7C7781C8}.Release|Win32.Build.0 = Release|Win32
{4600994E-D3A1-43F0-BCEE-A4AA7C7781C8}.VSDebug|Win32.ActiveCfg = VSDebug|Win32
{4600994E-D3A1-43F0-BCEE-A4AA7C7781C8}.VSDebug|Win32.Build.0 = VSDebug|Win32
{703A8EDC-5601-4662-A226-1C4FFBFEB6C3}.Release|Win32.ActiveCfg = Release|Win32
{703A8EDC-5601-4662-A226-1C4FFBFEB6C3}.Release|Win32.Build.0 = Release|Win32
{703A8EDC-5601-4662-A226-1C4FFBFEB6C3}.VSDebug|Win32.ActiveCfg = VSDebug|Win32
{703A8EDC-5601-4662-A226-1C4FFBFEB6C3}.VSDebug|Win32.Build.0 = VSDebug|Win32
{9A2ECE73-F064-437E-A379-D4DE6A040116}.Release|Win32.ActiveCfg = Release|Win32
{9A2ECE73-F064-437E-A379-D4DE6A040116}.Release|Win32.Build.0 = Release|Win32
{9A2ECE73-F064-437E-A379-D4DE6A040116}.VSDebug|Win32.ActiveCfg = VSDebug|Win32
Expand Down
234 changes: 234 additions & 0 deletions msvscpp/wpsname/wpsname.vcproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="wpsname"
ProjectGUID="{703A8EDC-5601-4662-A226-1C4FFBFEB6C3}"
RootNamespace="wpsname"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\include;..\..\common;..\..\libcerror;..\..\libcthreads;..\..\libcdata;..\..\libclocale;..\..\libcnotify;..\..\libuna;..\..\libcfile;..\..\libfcrypto;..\..\libfguid;..\..\libfvalue;..\..\libfdatetime;..\..\libfmos;..\..\libfplist;..\..\libfwevt;..\..\libfwnt;..\..\..\zlib;..\..\..\bzip2;..\..\libhmac"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;HAVE_LOCAL_LIBCERROR;HAVE_LOCAL_LIBCTHREADS;HAVE_LOCAL_LIBCDATA;HAVE_LOCAL_LIBCLOCALE;HAVE_LOCAL_LIBCNOTIFY;HAVE_LOCAL_LIBUNA;HAVE_LOCAL_LIBCFILE;HAVE_LOCAL_LIBFCRYPTO;HAVE_LOCAL_LIBFGUID;HAVE_LOCAL_LIBFVALUE;HAVE_LOCAL_LIBFDATETIME;HAVE_LOCAL_LIBFMOS;HAVE_LOCAL_LIBFPLIST;HAVE_LOCAL_LIBFWEVT;HAVE_LOCAL_LIBFWNT;ZLIB_DLL;BZ_DLL;HAVE_LOCAL_LIBHMAC;ASSORTED_DLL_IMPORT"
RuntimeLibrary="2"
WarningLevel="4"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
AdditionalLibraryDirectories="&quot;$(OutDir)&quot;"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="2"
DataExecutionPrevention="2"
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="VSDebug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\include;..\..\common;..\..\libcerror;..\..\libcthreads;..\..\libcdata;..\..\libclocale;..\..\libcnotify;..\..\libuna;..\..\libcfile;..\..\libfcrypto;..\..\libfguid;..\..\libfvalue;..\..\libfdatetime;..\..\libfmos;..\..\libfplist;..\..\libfwevt;..\..\libfwnt;..\..\..\zlib;..\..\..\bzip2;..\..\libhmac"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;HAVE_LOCAL_LIBCERROR;HAVE_LOCAL_LIBCTHREADS;HAVE_LOCAL_LIBCDATA;HAVE_LOCAL_LIBCLOCALE;HAVE_LOCAL_LIBCNOTIFY;HAVE_LOCAL_LIBUNA;HAVE_LOCAL_LIBCFILE;HAVE_LOCAL_LIBFCRYPTO;HAVE_LOCAL_LIBFGUID;HAVE_LOCAL_LIBFVALUE;HAVE_LOCAL_LIBFDATETIME;HAVE_LOCAL_LIBFMOS;HAVE_LOCAL_LIBFPLIST;HAVE_LOCAL_LIBFWEVT;HAVE_LOCAL_LIBFWNT;ZLIB_DLL;BZ_DLL;HAVE_LOCAL_LIBHMAC;ASSORTED_DLL_IMPORT"
BasicRuntimeChecks="3"
SmallerTypeCheck="true"
RuntimeLibrary="3"
WarningLevel="4"
DebugInformationFormat="3"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
AdditionalLibraryDirectories="&quot;$(OutDir)&quot;"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="1"
TargetMachine="1"
/>
<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\assorted_getopt.c"
>
</File>
<File
RelativePath="..\..\src\assorted_output.c"
>
</File>
<File
RelativePath="..\..\src\wpsname.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\src\assorted_getopt.h"
>
</File>
<File
RelativePath="..\..\src\assorted_i18n.h"
>
</File>
<File
RelativePath="..\..\src\assorted_libcerror.h"
>
</File>
<File
RelativePath="..\..\src\assorted_libcfile.h"
>
</File>
<File
RelativePath="..\..\src\assorted_libcnotify.h"
>
</File>
<File
RelativePath="..\..\src\assorted_libfguid.h"
>
</File>
<File
RelativePath="..\..\src\assorted_output.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}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
19 changes: 19 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ bin_PROGRAMS = \
serpentcrypt \
unicodetouch \
wevtinfo \
wpsname \
winregsave \
winshellfolder \
winshelllink \
Expand Down Expand Up @@ -478,6 +479,24 @@ wevtinfo_LDADD = \
@LIBCDATA_LIBADD@ \
@LIBCERROR_LIBADD@

wpsname_SOURCES = \
assorted_getopt.c assorted_getopt.h \
assorted_i18n.h \
assorted_libcerror.h \
assorted_libcfile.h \
assorted_libcnotify.h \
assorted_libfguid.h \
assorted_output.c assorted_output.h \
wpsname.c

wpsname_LDADD = \
@LIBFGUID_LIBADD@ \
@LIBCFILE_LIBADD@ \
@LIBUNA_LIBADD@ \
@LIBCNOTIFY_LIBADD@ \
@LIBCLOCALE_LIBADD@ \
@LIBCERROR_LIBADD@

winregsave_SOURCES = \
assorted_getopt.c assorted_getopt.h \
assorted_i18n.h \
Expand Down
Loading

0 comments on commit 8e00fab

Please sign in to comment.