summaryrefslogtreecommitdiffstats
path: root/md/writeup/making_c_executables_smaller.md
diff options
context:
space:
mode:
Diffstat (limited to 'md/writeup/making_c_executables_smaller.md')
-rw-r--r--md/writeup/making_c_executables_smaller.md10
1 files changed, 5 insertions, 5 deletions
diff --git a/md/writeup/making_c_executables_smaller.md b/md/writeup/making_c_executables_smaller.md
index 1fb5341..6b50516 100644
--- a/md/writeup/making_c_executables_smaller.md
+++ b/md/writeup/making_c_executables_smaller.md
@@ -27,13 +27,13 @@ int main()
```
Compile:
-```
+```sh
gcc main.c -o main -lSDL
```
Size before: 5326 bytes
Execute command:
-```
+```sh
strip main
```
@@ -50,7 +50,7 @@ ELF kickers[2] webpage.
Execute command:
-```
+```bash
sstrip main
```
@@ -62,7 +62,7 @@ GC Masher[3] Allows to
brute force gcc options for smaller executable size.
I where using this options for gcsmaher
-```
+```text
-O -O0 -O1 -O2 -O3 -Os
-ffast-math
-fomit-frame-pointer
@@ -96,7 +96,7 @@ a=/tmp/I;tail -n+2 $0|zcat>$a;chmod +x $a;$a;rm $a;exit
Best options and smallest size now is 563 byte. Nope this is not smallest size try to rename executable name to one symbol and you will get 4 extra bytes.
-```
+```bash
gcc -Os -ffast-math -fomit-frame-pointer
-fauto-inc-dec -mpush-args -mno-red-zone -c small.c;
ld -dynamic-linker /lib/ld-linux.so.2 small.o /usr/lib/libSDL.so -o small;