Skip to content

Commit 4104497

Browse files
authored
Merge pull request #20502 from zeroSteiner/feat/refactor-pe-compiling
Update PE EXE Templates
2 parents 1fe1512 + 9979af9 commit 4104497

File tree

20 files changed

+96
-804
lines changed

20 files changed

+96
-804
lines changed

data/templates/src/pe/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# PE Source Code
22
This directory contains the source code for the PE executable templates.
33

4-
## Building DLLs
5-
Use the provided `build_dlls.bat` file, and run it from within the Visual Studio
4+
## Building
5+
Use the provided `build_all.bat` file, and run it from within the Visual Studio
66
developer console. The batch file requires that the `%VCINSTALLDIR%` environment
77
variable be defined (which it should be by default). The build script will
88
create both the x86 and x64 templates before moving them into the correct
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@echo off
2+
3+
echo Compiling DLLs
4+
5+
for /D %%d in (dll*) do (
6+
pushd "%%d"
7+
call build.bat
8+
popd
9+
)
10+
11+
echo Compiling EXEs
12+
13+
for /D %%e in (exe*) do (
14+
pushd "%%e"
15+
call build.bat
16+
popd
17+
)

data/templates/src/pe/build_dlls.bat

Lines changed: 0 additions & 7 deletions
This file was deleted.

data/templates/src/pe/dll_mixed_mode/build.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
if "%~1"=="" GOTO NO_ARGUMENTS
44
echo Compiling for: %1
55
call "%VCINSTALLDIR%Auxiliary\Build\vcvarsall.bat" %1
6+
rem mscoree.lib requires .NET SDK to be installed, add it as a Visual Studio component
67
cl /CLR /LD /GS- /I ..\dll /DBUILDMODE=2 template.cpp /Fe:template_%1_windows_mixed_mode.dll /link mscoree.lib kernel32.lib /entry:DllMain /subsystem:WINDOWS
78
cl /CLR /LD /GS- /I ..\dll /DBUILDMODE=2 /DSCSIZE=262144 template.cpp /Fe:template_%1_windows_mixed_mode.256kib.dll /link mscoree.lib kernel32.lib /entry:DllMain /subsystem:WINDOWS
89
exit /B
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@echo off
2+
3+
if "%~1"=="" GOTO NO_ARGUMENTS
4+
echo Compiling for: %1
5+
call "%VCINSTALLDIR%Auxiliary\Build\vcvarsall.bat" %1
6+
cl /GS- template.c /Fe:template_%1_windows.exe /link kernel32.lib /entry:main /subsystem:WINDOWS /NODEFAULTLIB
7+
exit /B
8+
9+
:NO_ARGUMENTS
10+
%COMSPEC% /c "%0" x86
11+
%COMSPEC% /c "%0" x64
12+
del *.obj *.res
13+
move *.exe ..\..\..

data/templates/src/pe/exe/service/Service.sln

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)