summaryrefslogtreecommitdiff
path: root/md/writeup/making_c_executables_smaller.md
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2023-02-04 14:10:26 +0000
committerFreeArtMan <dos21h@gmail.com>2023-02-04 14:10:26 +0000
commit380f0fe40b1ab20790e75dac779e73667cc5ac72 (patch)
tree9fa3b9c93b58c966daa22f955282bc3c181d909a /md/writeup/making_c_executables_smaller.md
parentdf881efab146ca3ee61bf8936f948dd976fc4740 (diff)
downloadmd-content-380f0fe40b1ab20790e75dac779e73667cc5ac72.tar.gz
md-content-380f0fe40b1ab20790e75dac779e73667cc5ac72.zip
Update all content to new pygmentize
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;