Cross-compiling for 32/64 bit systems
- sudo apt-get install gcc-multlib
- gcc ‑m32 datei.c
Tipp: Add ‑static for a static binary.
Note that you need to install packets for the target platform, e.g. apt install gcc-i686-linux-gnu.
Cross-compiling for Windows
Install the packages like apt install gcc-mingw-w64. Then use x86_64-w64-mingw32-gcc execute.c -o execute.exe.
Disable security features
You can use checksec.sh to see which security techniques are enabled in a executable.
| Protection | gcc parameter to disable |
|---|---|
| PIE | -no-pie |
| Stack canary | -fno-stack-protector |
Leave a Reply
You must be logged in to post a comment.