Commit b8e80af8 authored by blackle's avatar blackle
Browse files

use lzma for compression

parent e857c81e
......@@ -5,17 +5,17 @@ all: cenotaph cenotaph_backup
.PHONY: packer
make -C main main.gz
make -C main main.xz
make -C packer header
cenotaph : main packer Makefile
cat ./packer/header ./main/main.gz > cenotaph
cat ./packer/header ./main/main.xz > cenotaph
chmod +x cenotaph
wc -c cenotaph
cenotaph_backup : main packer Makefile
cat ./packer/ ./main/main.gz > cenotaph_backup
cat ./packer/ ./main/main.xz > cenotaph_backup
chmod +x cenotaph_backup
wc -c cenotaph_backup
No preview for this file type
......@@ -18,7 +18,7 @@ shader.frag.min : shader.frag Makefile
sed -i 's/m_reflectance/i/g' shader.frag.min
sed -i 's/m_transparency/c/g' shader.frag.min
sed -i 's/MAXDEPTH/18/g' shader.frag.min
sed -i 's/MAXDEPTH/1/g' shader.frag.min
sed -i 's/\bRay\b/Co/g' shader.frag.min
sed -i 's/\bMat\b/Cr/g' shader.frag.min
......@@ -27,7 +27,7 @@ shader.h : shader.frag.min Makefile
mono ~/Downloads/shader_minifier.exe --preserve-externals shader.frag.min -o shader.h
main : main.c shader.h Makefile
gcc -o main main.c -lX11 -lGL -lcairo -lXrandr -O1 -fno-tree-ch -std=gnu11 -nostartfiles -nostdlib
gcc -o main main.c -lX11 -lGL -lcairo -lXrandr -Wl,--hash-style=gnu -O1 -fno-tree-ch -std=gnu11 -nostartfiles -nostdlib
strip main
strip -R .note -R .comment -R .eh_frame -R .eh_frame_hdr -R main
#remove section header
......@@ -52,3 +52,9 @@ main : main.c shader.h Makefile
main.gz : main Makefile
-rm main.gz
zopflikrzymod --gzip --i5000 --all --t8 main
wc -c main.gz
main.xz : main Makefile
-rm main.gz
lzma --format=lzma -9 --extreme --lzma1=preset=9,lc=1,lp=0,pb=0 --keep --stdout main > main.xz
wc -c main.xz
sed '1d;2d' $0 | zcat > /tmp/exe; chmod +x /tmp/exe; exec /tmp/exe;
sed '1d;2d' $0 | xzcat > /tmp/exe; chmod +x /tmp/exe; exec /tmp/exe;
......@@ -178,7 +178,11 @@ _child:
mov al, sys_execve
mov edi, __gzip
; mov edi, __gzip
push 0
push __gzip
pop rdi
push rdi
; use our arguments
minimov rsi, rsp
; xor rdx, rdx ;empty environ
......@@ -191,7 +195,7 @@ _child:
;e_shoff and e_flags are 12 bytes and can be nonsense
db '/bin/zcat',0,
db '/usr/bin/xzcat',0,
;replacing the "fd/3" with "exe\0" on the fly saves... 4 bytes
;its actually good we did this because the __memfd load into register
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment