Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated build options #115

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
AltDrag application coded by [@stefanstundin](https://github.com/stefansundin/altdrag).

This repository contains updated build options to enable some of the `gcc/ld` hardening options.

```powershell
> Get-PESecurity -Dir .

FileName : X:\altdrag\bin\AltDrag.exe
ARCH : I386
DotNET : False
ASLR : True
DEP : True
Authenticode : False
StrongNaming : N/A
SafeSEH : False
ControlFlowGuard : False
HighentropyVA : False

FileName : X:\altdrag\bin\hooks.dll
ARCH : I386
DotNET : False
ASLR : True
DEP : True
Authenticode : False
StrongNaming : N/A
SafeSEH : False
ControlFlowGuard : False
HighentropyVA : False

FileName : X:\altdrag\bin\hooks_x64.dll
ARCH : AMD64
DotNET : False
ASLR : True
DEP : True
Authenticode : False
StrongNaming : N/A
SafeSEH : N/A
ControlFlowGuard : False
HighentropyVA : True

FileName : X:\altdrag\bin\HookWindows_x64.exe
ARCH : AMD64
DotNET : False
ASLR : True
DEP : True
Authenticode : False
StrongNaming : N/A
SafeSEH : N/A
ControlFlowGuard : False
HighentropyVA : True
```
8 changes: 4 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ x86_64-w64-mingw32-windres -o bin/hookwindows_x64.o include/hookwindows_x64.rc
x86_64-w64-mingw32-windres -o bin/hooks_x64.o include/hooks.rc

if [[ "$1" == "release" ]]; then
i686-w64-mingw32-gcc -o bin/AltDrag.exe altdrag.c bin/altdrag.o -mwindows -lshlwapi -lwininet -lcomctl32 -O2 -s
i686-w64-mingw32-gcc -o bin/hooks.dll hooks.c bin/hooks.o -mdll -lshlwapi -lcomctl32 -lpsapi -lole32 -O2 -s
i686-w64-mingw32-gcc -Wl,-dynamicbase,-nxcompat -Wp,-D_FORTIFY_SOURCE=2 -o bin/AltDrag.exe altdrag.c bin/altdrag.o -mwindows -lshlwapi -lwininet -lcomctl32 -O3 -s -fstack-protector-strong -fstack-clash-protection -mthreads -static
i686-w64-mingw32-gcc -Wl,-dynamicbase,-nxcompat -Wp,-D_FORTIFY_SOURCE=2 -o bin/hooks.dll hooks.c bin/hooks.o -mdll -lshlwapi -lcomctl32 -lpsapi -lole32 -O2 -s -fstack-protector-strong -fstack-clash-protection -mthreads -static

x86_64-w64-mingw32-gcc -o bin/HookWindows_x64.exe hookwindows_x64.c bin/hookwindows_x64.o -mwindows -lshlwapi -O2 -s
x86_64-w64-mingw32-gcc -o bin/hooks_x64.dll hooks.c bin/hooks_x64.o -mdll -lshlwapi -lcomctl32 -lpsapi -O2 -s
x86_64-w64-mingw32-gcc -Wl,-dynamicbase,-nxcompat,--high-entropy-va -o bin/HookWindows_x64.exe hookwindows_x64.c bin/hookwindows_x64.o -mwindows -lshlwapi -O2 -s -fstack-clash-protection -mthreads -static
x86_64-w64-mingw32-gcc -Wl,-dynamicbase,-nxcompat,--high-entropy-va -o bin/hooks_x64.dll hooks.c bin/hooks_x64.o -mdll -lshlwapi -lcomctl32 -lpsapi -O2 -s -fstack-clash-protection -mthread -static

makensis -V2 installer.nsi

Expand Down