├── lib └── empty.dir ├── .gitignore ├── examples ├── tgzip │ ├── .gitignore │ ├── makefile │ └── tgzip.c └── tgunzip │ ├── .gitignore │ ├── makefile.mgw │ ├── makefile.vc │ ├── makefile.dj2 │ ├── makefile.dmc │ ├── makefile │ ├── makefile.wat │ ├── makefile.b32 │ └── tgunzip.c ├── tests ├── corpus.md5sum ├── decomp-bad-inputs │ ├── 01 │ │ ├── id_000001_sig_11_src_000001_op_flip1_pos_3 │ │ ├── id_000000_sig_11_src_000001_op_flip1_pos_3 │ │ ├── id_000010_sig_07_src_000001_op_havoc_rep_2 │ │ ├── id_000012_sig_11_src_000001_op_havoc_rep_4 │ │ ├── id_000013_sig_11_src_000001_op_havoc_rep_4 │ │ ├── id_000014_sig_11_src_000001_op_havoc_rep_8 │ │ ├── id_000016_sig_07_src_000001_op_havoc_rep_2 │ │ ├── id_000017_sig_11_src_000001_op_havoc_rep_2 │ │ ├── id_000018_sig_11_src_000001_op_havoc_rep_8 │ │ ├── id_000019_sig_11_src_000001_op_havoc_rep_8 │ │ ├── id_000020_sig_11_src_000001_op_havoc_rep_8 │ │ ├── id_000021_sig_11_src_000001_op_havoc_rep_4 │ │ ├── id_000022_sig_11_src_000001_op_havoc_rep_4 │ │ ├── id_000023_sig_06_src_000001_op_havoc_rep_4 │ │ ├── id_000024_sig_11_src_000001_op_havoc_rep_8 │ │ ├── id_000027_sig_11_src_000005_op_havoc_rep_2 │ │ ├── id_000028_sig_11_src_000005_op_havoc_rep_4 │ │ ├── id_000029_sig_11_src_000005_op_havoc_rep_8 │ │ ├── id_000030_sig_11_src_000005_op_havoc_rep_8 │ │ ├── id_000031_sig_11_src_000005_op_havoc_rep_4 │ │ ├── id_000032_sig_11_src_000005_op_havoc_rep_8 │ │ ├── id_000034_sig_11_src_000005_op_havoc_rep_8 │ │ ├── id_000035_sig_11_src_000005_op_havoc_rep_8 │ │ ├── id_000002_sig_11_src_000001_op_flip2_pos_10 │ │ ├── id_000003_sig_11_src_000001_op_flip4_pos_10 │ │ ├── id_000004_sig_11_src_000001_op_flip4_pos_12 │ │ ├── id_000005_sig_11_src_000001_op_flip16_pos_10 │ │ ├── id_000008_sig_11_src_000001_op_havoc_rep_32 │ │ ├── id_000009_sig_11_src_000001_op_havoc_rep_16 │ │ ├── id_000011_sig_11_src_000001_op_havoc_rep_16 │ │ ├── id_000015_sig_11_src_000001_op_havoc_rep_32 │ │ ├── id_000025_sig_11_src_000005_op_flip1_pos_22 │ │ ├── id_000026_sig_11_src_000005_op_havoc_rep_16 │ │ ├── id_000033_sig_11_src_000005_op_havoc_rep_16 │ │ ├── min_id_000000_sig_11_src_000001_op_flip1_pos_3 │ │ ├── min_id_000002_sig_11_src_000001_op_flip2_pos_10 │ │ ├── min_id_000003_sig_11_src_000001_op_flip4_pos_10 │ │ ├── min_id_000004_sig_11_src_000001_op_flip4_pos_12 │ │ ├── min_id_000009_sig_11_src_000001_op_havoc_rep_16 │ │ ├── min_id_000010_sig_07_src_000001_op_havoc_rep_2 │ │ ├── min_id_000011_sig_11_src_000001_op_havoc_rep_16 │ │ ├── min_id_000012_sig_11_src_000001_op_havoc_rep_4 │ │ ├── min_id_000013_sig_11_src_000001_op_havoc_rep_4 │ │ ├── min_id_000014_sig_11_src_000001_op_havoc_rep_8 │ │ ├── min_id_000015_sig_11_src_000001_op_havoc_rep_32 │ │ ├── min_id_000016_sig_07_src_000001_op_havoc_rep_2 │ │ ├── min_id_000017_sig_11_src_000001_op_havoc_rep_2 │ │ ├── min_id_000018_sig_11_src_000001_op_havoc_rep_8 │ │ ├── min_id_000019_sig_11_src_000001_op_havoc_rep_8 │ │ ├── min_id_000020_sig_11_src_000001_op_havoc_rep_8 │ │ ├── min_id_000021_sig_11_src_000001_op_havoc_rep_4 │ │ ├── min_id_000022_sig_11_src_000001_op_havoc_rep_4 │ │ ├── min_id_000023_sig_06_src_000001_op_havoc_rep_4 │ │ ├── min_id_000024_sig_11_src_000001_op_havoc_rep_8 │ │ ├── min_id_000025_sig_11_src_000005_op_flip1_pos_22 │ │ ├── min_id_000026_sig_11_src_000005_op_havoc_rep_16 │ │ ├── min_id_000027_sig_11_src_000005_op_havoc_rep_2 │ │ ├── min_id_000028_sig_11_src_000005_op_havoc_rep_4 │ │ ├── min_id_000029_sig_11_src_000005_op_havoc_rep_8 │ │ ├── min_id_000030_sig_11_src_000005_op_havoc_rep_8 │ │ ├── min_id_000031_sig_11_src_000005_op_havoc_rep_4 │ │ ├── min_id_000032_sig_11_src_000005_op_havoc_rep_8 │ │ ├── min_id_000033_sig_11_src_000005_op_havoc_rep_16 │ │ ├── min_id_000034_sig_11_src_000005_op_havoc_rep_8 │ │ ├── min_id_000035_sig_11_src_000005_op_havoc_rep_8 │ │ ├── min_id_000005_sig_11_src_000001_op_flip16_pos_10 │ │ ├── id_000006_sig_11_src_000001_op_arith8_pos_12_val_-21 │ │ ├── id_000007_sig_11_src_000001_op_int16_pos_12_val_be__1000 │ │ ├── min_id_000006_sig_11_src_000001_op_arith8_pos_12_val_-21 │ │ └── min_id_000007_sig_11_src_000001_op_int16_pos_12_val_be__1000 │ ├── 00 │ │ ├── id_000015_sig_11_src_000000_op_havoc_rep_2 │ │ ├── id_000016_sig_11_src_000000_op_havoc_rep_4 │ │ ├── id_000017_sig_11_src_000000_op_havoc_rep_4 │ │ ├── id_000018_sig_11_src_000000_op_havoc_rep_2 │ │ ├── id_000019_sig_11_src_000000_op_havoc_rep_8 │ │ ├── id_000020_sig_11_src_000000_op_havoc_rep_8 │ │ ├── id_000021_sig_11_src_000000_op_havoc_rep_8 │ │ ├── id_000022_sig_11_src_000000_op_havoc_rep_4 │ │ ├── id_000023_sig_06_src_000000_op_havoc_rep_8 │ │ ├── id_000024_sig_06_src_000000_op_havoc_rep_8 │ │ ├── id_000025_sig_06_src_000033_op_havoc_rep_8 │ │ ├── id_000026_sig_11_src_000033_op_havoc_rep_2 │ │ ├── id_000027_sig_11_src_000040_op_havoc_rep_2 │ │ ├── id_000028_sig_11_src_000070_op_havoc_rep_2 │ │ ├── id_000029_sig_11_src_000070_op_havoc_rep_8 │ │ ├── id_000031_sig_11_src_000090_op_havoc_rep_4 │ │ ├── id_000000_sig_11_src_000000_op_flip1_pos_10 │ │ ├── id_000001_sig_11_src_000000_op_flip1_pos_10 │ │ ├── id_000002_sig_11_src_000000_op_flip1_pos_10 │ │ ├── id_000003_sig_11_src_000000_op_flip1_pos_12 │ │ ├── id_000004_sig_11_src_000000_op_flip1_pos_12 │ │ ├── id_000005_sig_11_src_000000_op_flip1_pos_12 │ │ ├── id_000006_sig_11_src_000000_op_flip1_pos_12 │ │ ├── id_000007_sig_11_src_000000_op_flip2_pos_11 │ │ ├── id_000008_sig_11_src_000000_op_flip2_pos_12 │ │ ├── id_000009_sig_11_src_000000_op_flip2_pos_12 │ │ ├── id_000010_sig_11_src_000000_op_flip4_pos_10 │ │ ├── id_000011_sig_11_src_000000_op_flip8_pos_10 │ │ ├── id_000014_sig_11_src_000000_op_havoc_rep_16 │ │ ├── id_000030_sig_11_src_000070_op_havoc_rep_16 │ │ ├── id_000032_sig_11_src_000096_op_flip1_pos_10 │ │ ├── id_000035_sig_11_src_000118_op_flip1_pos_58 │ │ ├── id_000036_sig_11_src_000187_op_flip1_pos_10 │ │ ├── id_000037_sig_11_src_000187_op_flip1_pos_12 │ │ ├── id_000038_sig_11_src_000187_op_flip1_pos_15 │ │ ├── id_000033_sig_11_src_000096_op_int16_pos_14_val__1 │ │ ├── id_000012_sig_11_src_000000_op_arith8_pos_11_val__6 │ │ ├── id_000013_sig_11_src_000000_op_arith8_pos_12_val_-9 │ │ └── id_000034_sig_11_src_000104_op_int32_pos_16_val_-32768 │ ├── 02 │ │ ├── id_000000_sig_11_src_000001_op_havoc_rep_4 │ │ ├── id_000001_sig_11_src_000001_op_havoc_rep_2 │ │ ├── id_000002_sig_11_src_000001_op_havoc_rep_2 │ │ └── id_000003_sig_11_src_000002_op_havoc_rep_4 │ ├── 03 │ │ ├── id_000000_sig_11_src_000001_op_havoc_rep_4 │ │ ├── id_000001_sig_11_src_000001_op_havoc_rep_2 │ │ ├── id_000002_sig_11_src_000001_op_havoc_rep_2 │ │ ├── id_000003_sig_11_src_000001_op_havoc_rep_2 │ │ ├── id_000004_sig_11_src_000002_op_havoc_rep_4 │ │ ├── id_000011_sig_11_src_000005_op_havoc_rep_4 │ │ ├── id_000013_sig_11_src_000005_op_havoc_rep_8 │ │ ├── id_000014_sig_11_src_000005_op_havoc_rep_2 │ │ ├── id_000015_sig_11_src_000005_op_havoc_rep_2 │ │ ├── id_000016_sig_11_src_000005_op_havoc_rep_2 │ │ ├── id_000017_sig_11_src_000005_op_havoc_rep_2 │ │ ├── id_000024_sig_11_src_000230_op_havoc_rep_2 │ │ ├── id_000025_sig_11_src_000230_op_havoc_rep_2 │ │ ├── id_000026_sig_11_src_000245_op_havoc_rep_2 │ │ ├── id_000029_sig_11_src_000247_op_havoc_rep_4 │ │ ├── id_000030_sig_11_src_000257_op_havoc_rep_2 │ │ ├── id_000031_sig_11_src_000257_op_havoc_rep_2 │ │ ├── id_000032_sig_11_src_000248_op_havoc_rep_2 │ │ ├── id_000033_sig_11_src_000291_op_havoc_rep_2 │ │ ├── id_000035_sig_11_src_000252_op_havoc_rep_2 │ │ ├── id_000041_sig_11_src_000016_op_havoc_rep_4 │ │ ├── id_000005_sig_11_src_000005_op_flip1_pos_20 │ │ ├── id_000006_sig_11_src_000005_op_flip1_pos_22 │ │ ├── id_000007_sig_11_src_000005_op_flip4_pos_24 │ │ ├── id_000012_sig_11_src_000005_op_havoc_rep_16 │ │ ├── id_000018_sig_11_src_000082_op_flip32_pos_19 │ │ ├── id_000020_sig_11_src_000155_op_flip2_pos_28 │ │ ├── id_000021_sig_11_src_000166_op_flip2_pos_10 │ │ ├── id_000027_sig_11_src_000254_op_flip1_pos_32 │ │ ├── id_000034_sig_11_src_000301_op_havoc_rep_64 │ │ ├── id_000038_sig_11_src_000320_op_flip1_pos_27 │ │ ├── id_000039_sig_11_src_000320_op_ext_AO_pos_43 │ │ ├── id_000040_sig_11_src_000326_op_havoc_rep_32 │ │ ├── id_000010_sig_11_src_000005_op_int8_pos_23_val_-1 │ │ ├── id_000037_sig_11_src_000319_000163_op_splice_rep_2 │ │ ├── id_000043_sig_11_src_000001_000321_op_splice_rep_4 │ │ ├── id_000008_sig_11_src_000005_op_arith8_pos_3_val__10 │ │ ├── id_000009_sig_11_src_000005_op_arith8_pos_3_val__18 │ │ ├── id_000022_sig_11_src_000156_op_int16_pos_26_val_-129 │ │ ├── id_000028_sig_11_src_000079_op_int32_pos_20_val_-128 │ │ ├── id_000042_sig_11_src_000205_000322_op_splice_rep_64 │ │ ├── id_000023_sig_11_src_000193_op_int16_pos_31_val_be__32 │ │ ├── id_000036_sig_11_src_000310_op_arith32_pos_20_val_be_-8 │ │ └── id_000019_sig_11_src_000082_op_int32_pos_19_val_be__65535 │ ├── 04 │ │ ├── id_000000_sig_11_src_000001_op_havoc_rep_2 │ │ ├── id_000001_sig_11_src_000001_op_havoc_rep_2 │ │ ├── id_000002_sig_11_src_000001_op_havoc_rep_2 │ │ ├── id_000003_sig_11_src_000001_op_havoc_rep_4 │ │ ├── id_000006_sig_11_src_000019_000004_op_splice_rep_2 │ │ ├── id_000007_sig_11_src_000047_000264_op_splice_rep_2 │ │ ├── id_000008_sig_11_src_000194_000266_op_splice_rep_2 │ │ ├── id_000009_sig_11_src_000134_000005_op_splice_rep_2 │ │ ├── id_000010_sig_11_src_000220_000226_op_splice_rep_8 │ │ ├── id_000004_sig_11_src_000034_op_int32_pos_44_val__1000 │ │ └── id_000005_sig_11_src_000063_op_int32_pos_17_val__1000 │ ├── 05 │ │ ├── id_000002_sig_06_src_000001_op_havoc_rep_4 │ │ ├── id_000003_sig_06_src_000001_op_havoc_rep_4 │ │ ├── id_000004_sig_06_src_000001_op_havoc_rep_4 │ │ ├── id_000008_sig_06_src_000003_op_havoc_rep_4 │ │ ├── id_000010_sig_06_src_000092_op_flip4_pos_3 │ │ ├── id_000011_sig_06_src_000155_op_havoc_rep_8 │ │ ├── id_000013_sig_06_src_000171_op_havoc_rep_2 │ │ ├── id_000014_sig_06_src_000170_op_havoc_rep_8 │ │ ├── id_000000_sig_06_src_000001_op_flip8_pos_12 │ │ ├── id_000001_sig_06_src_000001_op_havoc_rep_16 │ │ ├── id_000005_sig_06_src_000012_op_flip1_pos_13 │ │ ├── id_000006_sig_06_src_000012_op_havoc_rep_16 │ │ ├── id_000009_sig_06_src_000140_op_flip1_pos_15 │ │ ├── id_000012_sig_06_src_000163_000116_op_splice_rep_8 │ │ └── id_000007_sig_06_src_000108_op_arith16_pos_14_val_-2 │ ├── 06 │ │ ├── id_000002_sig_06_src_000001_op_havoc_rep_4 │ │ ├── id_000003_sig_06_src_000001_op_havoc_rep_8 │ │ ├── id_000004_sig_06_src_000001_op_havoc_rep_8 │ │ ├── id_000005_sig_06_src_000001_op_havoc_rep_4 │ │ ├── id_000001_sig_06_src_000001_op_havoc_rep_16 │ │ ├── id_000008_sig_06_src_000137_op_flip1_pos_58 │ │ └── id_000007_sig_06_src_000121_op_arith8_pos_12_val__26 │ ├── 07 │ │ ├── id_000000_sig_06_src_000001_op_havoc_rep_8 │ │ ├── id_000001_sig_06_src_000019_op_havoc_rep_4 │ │ └── id_000002_sig_06_src_000021_op_havoc_rep_8 │ ├── 08 │ │ └── id_000000_sig_06_src_000157_op_havoc_rep_4 │ └── 09 │ │ ├── id_000001_sig_11_src_000001_op_havoc_rep_2 │ │ ├── id_000009_sig_11_src_000133_op_havoc_rep_2 │ │ ├── id_000010_sig_11_src_000133_op_havoc_rep_4 │ │ ├── id_000011_sig_11_src_000151_op_havoc_rep_2 │ │ ├── id_000014_sig_11_src_000212_op_havoc_rep_2 │ │ ├── id_000019_sig_11_src_000098_op_havoc_rep_2 │ │ ├── id_000020_sig_11_src_000133_op_havoc_rep_2 │ │ ├── id_000025_sig_11_src_000235_op_havoc_rep_8 │ │ ├── id_000041_sig_11_src_000253_op_havoc_rep_8 │ │ ├── id_000002_sig_11_src_000023_op_flip2_pos_12 │ │ ├── id_000004_sig_11_src_000075_op_flip4_pos_61 │ │ ├── id_000007_sig_11_src_000075_op_havoc_rep_32 │ │ ├── id_000016_sig_11_src_000098_op_flip1_pos_13 │ │ ├── id_000017_sig_11_src_000098_op_flip2_pos_13 │ │ ├── id_000018_sig_11_src_000098_op_flip4_pos_12 │ │ ├── id_000022_sig_11_src_000218_op_flip2_pos_40 │ │ ├── id_000031_sig_11_src_000256_op_flip2_pos_480 │ │ ├── id_000032_sig_11_src_000256_op_flip4_pos_248 │ │ ├── id_000033_sig_11_src_000256_op_flip4_pos_364 │ │ ├── id_000037_sig_11_src_000260_op_flip2_pos_264 │ │ ├── id_000027_sig_11_src_000024_000141_op_splice_rep_4 │ │ ├── id_000036_sig_11_src_000256_000131_op_splice_rep_8 │ │ ├── id_000040_sig_11_src_000272_000023_op_splice_rep_4 │ │ ├── id_000003_sig_11_src_000023_op_arith8_pos_14_val_-28 │ │ ├── id_000005_sig_11_src_000075_op_arith8_pos_57_val_-5 │ │ ├── id_000008_sig_11_src_000133_op_arith8_pos_13_val_-34 │ │ ├── id_000012_sig_11_src_000212_op_arith8_pos_45_val__9 │ │ ├── id_000015_sig_11_src_000087_op_arith8_pos_20_val__11 │ │ ├── id_000023_sig_11_src_000218_op_int16_pos_111_val__0 │ │ ├── id_000026_sig_11_src_000143_op_arith8_pos_19_val__3 │ │ ├── id_000034_sig_06_src_000256_op_arith8_pos_499_val__8 │ │ ├── id_000039_sig_11_src_000260_op_int16_pos_397_val__0 │ │ ├── id_000000_sig_11_src_000001_op_int16_pos_11_val_be_-128 │ │ ├── id_000006_sig_11_src_000075_op_arith16_pos_62_val__28 │ │ ├── id_000013_sig_11_src_000212_op_int32_pos_15_val__32767 │ │ ├── id_000021_sig_11_src_000134_op_int16_pos_13_val_be_-128 │ │ ├── id_000038_sig_11_src_000260_op_arith16_pos_254_val_-29 │ │ └── id_000028_sig_11_src_000219_op_arith16_pos_62_val_be_-23 ├── corpus.tar.gz ├── clang-ubsan-build.sh ├── Makefile ├── run-decomp-bad-inputs.sh └── decomp-bad-inputs.ref ├── bin └── tgunzip.exe ├── Makefile ├── src ├── tinf.h ├── tinf_compat.h ├── makefile.vc ├── makefile.mgw ├── makefile.dj2 ├── makefile.dmc ├── makefile.b32 ├── makefile ├── makefile.wat ├── uzlib_conf.h ├── defl_static.h ├── tinfzlib.c ├── crc32.c ├── adler32.c ├── nasm │ ├── crc32.nas │ ├── tinfzlib.nas │ └── nasmlcm.inc ├── tinfgzip.c ├── genlz77.c ├── uzlib.h ├── defl_static.c └── tinflate.c ├── LICENSE ├── .github └── workflows │ └── stale.yml └── README.md /lib/empty.dir: -------------------------------------------------------------------------------- 1 | --- empty dir --- -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.map 3 | *.a 4 | -------------------------------------------------------------------------------- /examples/tgzip/.gitignore: -------------------------------------------------------------------------------- 1 | tgzip 2 | -------------------------------------------------------------------------------- /examples/tgunzip/.gitignore: -------------------------------------------------------------------------------- 1 | tgunzip 2 | -------------------------------------------------------------------------------- /tests/corpus.md5sum: -------------------------------------------------------------------------------- 1 | ec2a54ac0b37dd25f079db1f562471a2 corpus-out.tar 2 | -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000001_sig_11_src_000001_op_flip1_pos_3: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bin/tgunzip.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/bin/tgunzip.exe -------------------------------------------------------------------------------- /tests/corpus.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/corpus.tar.gz -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | all clean: 2 | $(MAKE) -C src $@ 3 | $(MAKE) -C examples/tgzip $@ 4 | $(MAKE) -C examples/tgunzip $@ 5 | -------------------------------------------------------------------------------- /src/tinf.h: -------------------------------------------------------------------------------- 1 | /* Compatibility header for the original tinf lib/older versions of uzlib. 2 | Note: may be removed in the future, please migrate to uzlib.h. */ 3 | #include "uzlib.h" 4 | -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000015_sig_11_src_000000_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000015_sig_11_src_000000_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000016_sig_11_src_000000_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000016_sig_11_src_000000_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000017_sig_11_src_000000_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000017_sig_11_src_000000_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000018_sig_11_src_000000_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000018_sig_11_src_000000_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000019_sig_11_src_000000_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000019_sig_11_src_000000_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000020_sig_11_src_000000_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000020_sig_11_src_000000_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000021_sig_11_src_000000_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000021_sig_11_src_000000_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000022_sig_11_src_000000_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000022_sig_11_src_000000_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000023_sig_06_src_000000_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000023_sig_06_src_000000_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000024_sig_06_src_000000_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000024_sig_06_src_000000_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000025_sig_06_src_000033_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000025_sig_06_src_000033_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000026_sig_11_src_000033_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000026_sig_11_src_000033_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000027_sig_11_src_000040_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000027_sig_11_src_000040_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000028_sig_11_src_000070_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000028_sig_11_src_000070_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000029_sig_11_src_000070_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000029_sig_11_src_000070_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000031_sig_11_src_000090_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000031_sig_11_src_000090_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000000_sig_11_src_000001_op_flip1_pos_3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000000_sig_11_src_000001_op_flip1_pos_3 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000010_sig_07_src_000001_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000010_sig_07_src_000001_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000012_sig_11_src_000001_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000012_sig_11_src_000001_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000013_sig_11_src_000001_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000013_sig_11_src_000001_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000014_sig_11_src_000001_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000014_sig_11_src_000001_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000016_sig_07_src_000001_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000016_sig_07_src_000001_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000017_sig_11_src_000001_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000017_sig_11_src_000001_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000018_sig_11_src_000001_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000018_sig_11_src_000001_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000019_sig_11_src_000001_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000019_sig_11_src_000001_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000020_sig_11_src_000001_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000020_sig_11_src_000001_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000021_sig_11_src_000001_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000021_sig_11_src_000001_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000022_sig_11_src_000001_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000022_sig_11_src_000001_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000023_sig_06_src_000001_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000023_sig_06_src_000001_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000024_sig_11_src_000001_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000024_sig_11_src_000001_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000027_sig_11_src_000005_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000027_sig_11_src_000005_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000028_sig_11_src_000005_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000028_sig_11_src_000005_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000029_sig_11_src_000005_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000029_sig_11_src_000005_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000030_sig_11_src_000005_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000030_sig_11_src_000005_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000031_sig_11_src_000005_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000031_sig_11_src_000005_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000032_sig_11_src_000005_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000032_sig_11_src_000005_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000034_sig_11_src_000005_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000034_sig_11_src_000005_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000035_sig_11_src_000005_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000035_sig_11_src_000005_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/02/id_000000_sig_11_src_000001_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/02/id_000000_sig_11_src_000001_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/02/id_000001_sig_11_src_000001_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/02/id_000001_sig_11_src_000001_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/02/id_000002_sig_11_src_000001_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/02/id_000002_sig_11_src_000001_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/02/id_000003_sig_11_src_000002_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/02/id_000003_sig_11_src_000002_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000000_sig_11_src_000001_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000000_sig_11_src_000001_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000001_sig_11_src_000001_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000001_sig_11_src_000001_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000002_sig_11_src_000001_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000002_sig_11_src_000001_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000003_sig_11_src_000001_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000003_sig_11_src_000001_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000004_sig_11_src_000002_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000004_sig_11_src_000002_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000011_sig_11_src_000005_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000011_sig_11_src_000005_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000013_sig_11_src_000005_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000013_sig_11_src_000005_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000014_sig_11_src_000005_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000014_sig_11_src_000005_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000015_sig_11_src_000005_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000015_sig_11_src_000005_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000016_sig_11_src_000005_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000016_sig_11_src_000005_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000017_sig_11_src_000005_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000017_sig_11_src_000005_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000024_sig_11_src_000230_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000024_sig_11_src_000230_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000025_sig_11_src_000230_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000025_sig_11_src_000230_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000026_sig_11_src_000245_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000026_sig_11_src_000245_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000029_sig_11_src_000247_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000029_sig_11_src_000247_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000030_sig_11_src_000257_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000030_sig_11_src_000257_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000031_sig_11_src_000257_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000031_sig_11_src_000257_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000032_sig_11_src_000248_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000032_sig_11_src_000248_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000033_sig_11_src_000291_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000033_sig_11_src_000291_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000035_sig_11_src_000252_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000035_sig_11_src_000252_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000041_sig_11_src_000016_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000041_sig_11_src_000016_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/04/id_000000_sig_11_src_000001_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/04/id_000000_sig_11_src_000001_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/04/id_000001_sig_11_src_000001_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/04/id_000001_sig_11_src_000001_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/04/id_000002_sig_11_src_000001_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/04/id_000002_sig_11_src_000001_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/04/id_000003_sig_11_src_000001_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/04/id_000003_sig_11_src_000001_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/05/id_000002_sig_06_src_000001_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/05/id_000002_sig_06_src_000001_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/05/id_000003_sig_06_src_000001_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/05/id_000003_sig_06_src_000001_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/05/id_000004_sig_06_src_000001_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/05/id_000004_sig_06_src_000001_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/05/id_000008_sig_06_src_000003_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/05/id_000008_sig_06_src_000003_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/05/id_000010_sig_06_src_000092_op_flip4_pos_3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/05/id_000010_sig_06_src_000092_op_flip4_pos_3 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/05/id_000011_sig_06_src_000155_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/05/id_000011_sig_06_src_000155_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/05/id_000013_sig_06_src_000171_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/05/id_000013_sig_06_src_000171_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/05/id_000014_sig_06_src_000170_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/05/id_000014_sig_06_src_000170_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/06/id_000002_sig_06_src_000001_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/06/id_000002_sig_06_src_000001_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/06/id_000003_sig_06_src_000001_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/06/id_000003_sig_06_src_000001_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/06/id_000004_sig_06_src_000001_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/06/id_000004_sig_06_src_000001_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/06/id_000005_sig_06_src_000001_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/06/id_000005_sig_06_src_000001_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/07/id_000000_sig_06_src_000001_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/07/id_000000_sig_06_src_000001_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/07/id_000001_sig_06_src_000019_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/07/id_000001_sig_06_src_000019_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/07/id_000002_sig_06_src_000021_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/07/id_000002_sig_06_src_000021_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/08/id_000000_sig_06_src_000157_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/08/id_000000_sig_06_src_000157_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000001_sig_11_src_000001_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000001_sig_11_src_000001_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000009_sig_11_src_000133_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000009_sig_11_src_000133_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000010_sig_11_src_000133_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000010_sig_11_src_000133_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000011_sig_11_src_000151_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000011_sig_11_src_000151_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000014_sig_11_src_000212_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000014_sig_11_src_000212_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000019_sig_11_src_000098_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000019_sig_11_src_000098_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000020_sig_11_src_000133_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000020_sig_11_src_000133_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000025_sig_11_src_000235_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000025_sig_11_src_000235_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000041_sig_11_src_000253_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000041_sig_11_src_000253_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000000_sig_11_src_000000_op_flip1_pos_10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000000_sig_11_src_000000_op_flip1_pos_10 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000001_sig_11_src_000000_op_flip1_pos_10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000001_sig_11_src_000000_op_flip1_pos_10 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000002_sig_11_src_000000_op_flip1_pos_10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000002_sig_11_src_000000_op_flip1_pos_10 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000003_sig_11_src_000000_op_flip1_pos_12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000003_sig_11_src_000000_op_flip1_pos_12 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000004_sig_11_src_000000_op_flip1_pos_12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000004_sig_11_src_000000_op_flip1_pos_12 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000005_sig_11_src_000000_op_flip1_pos_12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000005_sig_11_src_000000_op_flip1_pos_12 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000006_sig_11_src_000000_op_flip1_pos_12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000006_sig_11_src_000000_op_flip1_pos_12 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000007_sig_11_src_000000_op_flip2_pos_11: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000007_sig_11_src_000000_op_flip2_pos_11 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000008_sig_11_src_000000_op_flip2_pos_12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000008_sig_11_src_000000_op_flip2_pos_12 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000009_sig_11_src_000000_op_flip2_pos_12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000009_sig_11_src_000000_op_flip2_pos_12 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000010_sig_11_src_000000_op_flip4_pos_10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000010_sig_11_src_000000_op_flip4_pos_10 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000011_sig_11_src_000000_op_flip8_pos_10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000011_sig_11_src_000000_op_flip8_pos_10 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000014_sig_11_src_000000_op_havoc_rep_16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000014_sig_11_src_000000_op_havoc_rep_16 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000030_sig_11_src_000070_op_havoc_rep_16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000030_sig_11_src_000070_op_havoc_rep_16 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000032_sig_11_src_000096_op_flip1_pos_10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000032_sig_11_src_000096_op_flip1_pos_10 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000035_sig_11_src_000118_op_flip1_pos_58: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000035_sig_11_src_000118_op_flip1_pos_58 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000036_sig_11_src_000187_op_flip1_pos_10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000036_sig_11_src_000187_op_flip1_pos_10 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000037_sig_11_src_000187_op_flip1_pos_12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000037_sig_11_src_000187_op_flip1_pos_12 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000038_sig_11_src_000187_op_flip1_pos_15: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000038_sig_11_src_000187_op_flip1_pos_15 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000002_sig_11_src_000001_op_flip2_pos_10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000002_sig_11_src_000001_op_flip2_pos_10 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000003_sig_11_src_000001_op_flip4_pos_10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000003_sig_11_src_000001_op_flip4_pos_10 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000004_sig_11_src_000001_op_flip4_pos_12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000004_sig_11_src_000001_op_flip4_pos_12 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000005_sig_11_src_000001_op_flip16_pos_10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000005_sig_11_src_000001_op_flip16_pos_10 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000008_sig_11_src_000001_op_havoc_rep_32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000008_sig_11_src_000001_op_havoc_rep_32 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000009_sig_11_src_000001_op_havoc_rep_16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000009_sig_11_src_000001_op_havoc_rep_16 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000011_sig_11_src_000001_op_havoc_rep_16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000011_sig_11_src_000001_op_havoc_rep_16 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000015_sig_11_src_000001_op_havoc_rep_32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000015_sig_11_src_000001_op_havoc_rep_32 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000025_sig_11_src_000005_op_flip1_pos_22: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000025_sig_11_src_000005_op_flip1_pos_22 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000026_sig_11_src_000005_op_havoc_rep_16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000026_sig_11_src_000005_op_havoc_rep_16 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000033_sig_11_src_000005_op_havoc_rep_16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000033_sig_11_src_000005_op_havoc_rep_16 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000005_sig_11_src_000005_op_flip1_pos_20: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000005_sig_11_src_000005_op_flip1_pos_20 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000006_sig_11_src_000005_op_flip1_pos_22: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000006_sig_11_src_000005_op_flip1_pos_22 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000007_sig_11_src_000005_op_flip4_pos_24: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000007_sig_11_src_000005_op_flip4_pos_24 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000012_sig_11_src_000005_op_havoc_rep_16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000012_sig_11_src_000005_op_havoc_rep_16 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000018_sig_11_src_000082_op_flip32_pos_19: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000018_sig_11_src_000082_op_flip32_pos_19 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000020_sig_11_src_000155_op_flip2_pos_28: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000020_sig_11_src_000155_op_flip2_pos_28 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000021_sig_11_src_000166_op_flip2_pos_10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000021_sig_11_src_000166_op_flip2_pos_10 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000027_sig_11_src_000254_op_flip1_pos_32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000027_sig_11_src_000254_op_flip1_pos_32 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000034_sig_11_src_000301_op_havoc_rep_64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000034_sig_11_src_000301_op_havoc_rep_64 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000038_sig_11_src_000320_op_flip1_pos_27: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000038_sig_11_src_000320_op_flip1_pos_27 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000039_sig_11_src_000320_op_ext_AO_pos_43: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000039_sig_11_src_000320_op_ext_AO_pos_43 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000040_sig_11_src_000326_op_havoc_rep_32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000040_sig_11_src_000326_op_havoc_rep_32 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/05/id_000000_sig_06_src_000001_op_flip8_pos_12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/05/id_000000_sig_06_src_000001_op_flip8_pos_12 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/05/id_000001_sig_06_src_000001_op_havoc_rep_16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/05/id_000001_sig_06_src_000001_op_havoc_rep_16 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/05/id_000005_sig_06_src_000012_op_flip1_pos_13: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/05/id_000005_sig_06_src_000012_op_flip1_pos_13 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/05/id_000006_sig_06_src_000012_op_havoc_rep_16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/05/id_000006_sig_06_src_000012_op_havoc_rep_16 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/05/id_000009_sig_06_src_000140_op_flip1_pos_15: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/05/id_000009_sig_06_src_000140_op_flip1_pos_15 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/06/id_000001_sig_06_src_000001_op_havoc_rep_16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/06/id_000001_sig_06_src_000001_op_havoc_rep_16 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/06/id_000008_sig_06_src_000137_op_flip1_pos_58: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/06/id_000008_sig_06_src_000137_op_flip1_pos_58 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000002_sig_11_src_000023_op_flip2_pos_12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000002_sig_11_src_000023_op_flip2_pos_12 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000004_sig_11_src_000075_op_flip4_pos_61: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000004_sig_11_src_000075_op_flip4_pos_61 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000007_sig_11_src_000075_op_havoc_rep_32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000007_sig_11_src_000075_op_havoc_rep_32 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000016_sig_11_src_000098_op_flip1_pos_13: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000016_sig_11_src_000098_op_flip1_pos_13 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000017_sig_11_src_000098_op_flip2_pos_13: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000017_sig_11_src_000098_op_flip2_pos_13 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000018_sig_11_src_000098_op_flip4_pos_12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000018_sig_11_src_000098_op_flip4_pos_12 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000022_sig_11_src_000218_op_flip2_pos_40: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000022_sig_11_src_000218_op_flip2_pos_40 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000031_sig_11_src_000256_op_flip2_pos_480: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000031_sig_11_src_000256_op_flip2_pos_480 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000032_sig_11_src_000256_op_flip4_pos_248: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000032_sig_11_src_000256_op_flip4_pos_248 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000033_sig_11_src_000256_op_flip4_pos_364: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000033_sig_11_src_000256_op_flip4_pos_364 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000037_sig_11_src_000260_op_flip2_pos_264: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000037_sig_11_src_000260_op_flip2_pos_264 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000000_sig_11_src_000001_op_flip1_pos_3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000000_sig_11_src_000001_op_flip1_pos_3 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000002_sig_11_src_000001_op_flip2_pos_10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000002_sig_11_src_000001_op_flip2_pos_10 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000003_sig_11_src_000001_op_flip4_pos_10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000003_sig_11_src_000001_op_flip4_pos_10 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000004_sig_11_src_000001_op_flip4_pos_12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000004_sig_11_src_000001_op_flip4_pos_12 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000009_sig_11_src_000001_op_havoc_rep_16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000009_sig_11_src_000001_op_havoc_rep_16 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000010_sig_07_src_000001_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000010_sig_07_src_000001_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000011_sig_11_src_000001_op_havoc_rep_16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000011_sig_11_src_000001_op_havoc_rep_16 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000012_sig_11_src_000001_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000012_sig_11_src_000001_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000013_sig_11_src_000001_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000013_sig_11_src_000001_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000014_sig_11_src_000001_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000014_sig_11_src_000001_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000015_sig_11_src_000001_op_havoc_rep_32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000015_sig_11_src_000001_op_havoc_rep_32 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000016_sig_07_src_000001_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000016_sig_07_src_000001_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000017_sig_11_src_000001_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000017_sig_11_src_000001_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000018_sig_11_src_000001_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000018_sig_11_src_000001_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000019_sig_11_src_000001_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000019_sig_11_src_000001_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000020_sig_11_src_000001_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000020_sig_11_src_000001_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000021_sig_11_src_000001_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000021_sig_11_src_000001_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000022_sig_11_src_000001_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000022_sig_11_src_000001_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000023_sig_06_src_000001_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000023_sig_06_src_000001_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000024_sig_11_src_000001_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000024_sig_11_src_000001_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000025_sig_11_src_000005_op_flip1_pos_22: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000025_sig_11_src_000005_op_flip1_pos_22 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000026_sig_11_src_000005_op_havoc_rep_16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000026_sig_11_src_000005_op_havoc_rep_16 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000027_sig_11_src_000005_op_havoc_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000027_sig_11_src_000005_op_havoc_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000028_sig_11_src_000005_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000028_sig_11_src_000005_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000029_sig_11_src_000005_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000029_sig_11_src_000005_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000030_sig_11_src_000005_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000030_sig_11_src_000005_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000031_sig_11_src_000005_op_havoc_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000031_sig_11_src_000005_op_havoc_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000032_sig_11_src_000005_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000032_sig_11_src_000005_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000033_sig_11_src_000005_op_havoc_rep_16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000033_sig_11_src_000005_op_havoc_rep_16 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000034_sig_11_src_000005_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000034_sig_11_src_000005_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000035_sig_11_src_000005_op_havoc_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000035_sig_11_src_000005_op_havoc_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000033_sig_11_src_000096_op_int16_pos_14_val__1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000033_sig_11_src_000096_op_int16_pos_14_val__1 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000005_sig_11_src_000001_op_flip16_pos_10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000005_sig_11_src_000001_op_flip16_pos_10 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000010_sig_11_src_000005_op_int8_pos_23_val_-1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000010_sig_11_src_000005_op_int8_pos_23_val_-1 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000037_sig_11_src_000319_000163_op_splice_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000037_sig_11_src_000319_000163_op_splice_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000043_sig_11_src_000001_000321_op_splice_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000043_sig_11_src_000001_000321_op_splice_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/04/id_000006_sig_11_src_000019_000004_op_splice_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/04/id_000006_sig_11_src_000019_000004_op_splice_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/04/id_000007_sig_11_src_000047_000264_op_splice_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/04/id_000007_sig_11_src_000047_000264_op_splice_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/04/id_000008_sig_11_src_000194_000266_op_splice_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/04/id_000008_sig_11_src_000194_000266_op_splice_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/04/id_000009_sig_11_src_000134_000005_op_splice_rep_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/04/id_000009_sig_11_src_000134_000005_op_splice_rep_2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/04/id_000010_sig_11_src_000220_000226_op_splice_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/04/id_000010_sig_11_src_000220_000226_op_splice_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/05/id_000012_sig_06_src_000163_000116_op_splice_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/05/id_000012_sig_06_src_000163_000116_op_splice_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000027_sig_11_src_000024_000141_op_splice_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000027_sig_11_src_000024_000141_op_splice_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000036_sig_11_src_000256_000131_op_splice_rep_8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000036_sig_11_src_000256_000131_op_splice_rep_8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000040_sig_11_src_000272_000023_op_splice_rep_4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000040_sig_11_src_000272_000023_op_splice_rep_4 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000012_sig_11_src_000000_op_arith8_pos_11_val__6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000012_sig_11_src_000000_op_arith8_pos_11_val__6 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000013_sig_11_src_000000_op_arith8_pos_12_val_-9: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000013_sig_11_src_000000_op_arith8_pos_12_val_-9 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000006_sig_11_src_000001_op_arith8_pos_12_val_-21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000006_sig_11_src_000001_op_arith8_pos_12_val_-21 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000008_sig_11_src_000005_op_arith8_pos_3_val__10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000008_sig_11_src_000005_op_arith8_pos_3_val__10 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000009_sig_11_src_000005_op_arith8_pos_3_val__18: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000009_sig_11_src_000005_op_arith8_pos_3_val__18 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000022_sig_11_src_000156_op_int16_pos_26_val_-129: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000022_sig_11_src_000156_op_int16_pos_26_val_-129 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000028_sig_11_src_000079_op_int32_pos_20_val_-128: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000028_sig_11_src_000079_op_int32_pos_20_val_-128 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000042_sig_11_src_000205_000322_op_splice_rep_64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000042_sig_11_src_000205_000322_op_splice_rep_64 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/05/id_000007_sig_06_src_000108_op_arith16_pos_14_val_-2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/05/id_000007_sig_06_src_000108_op_arith16_pos_14_val_-2 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/06/id_000007_sig_06_src_000121_op_arith8_pos_12_val__26: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/06/id_000007_sig_06_src_000121_op_arith8_pos_12_val__26 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000003_sig_11_src_000023_op_arith8_pos_14_val_-28: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000003_sig_11_src_000023_op_arith8_pos_14_val_-28 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000005_sig_11_src_000075_op_arith8_pos_57_val_-5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000005_sig_11_src_000075_op_arith8_pos_57_val_-5 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000008_sig_11_src_000133_op_arith8_pos_13_val_-34: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000008_sig_11_src_000133_op_arith8_pos_13_val_-34 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000012_sig_11_src_000212_op_arith8_pos_45_val__9: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000012_sig_11_src_000212_op_arith8_pos_45_val__9 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000015_sig_11_src_000087_op_arith8_pos_20_val__11: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000015_sig_11_src_000087_op_arith8_pos_20_val__11 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000023_sig_11_src_000218_op_int16_pos_111_val__0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000023_sig_11_src_000218_op_int16_pos_111_val__0 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000026_sig_11_src_000143_op_arith8_pos_19_val__3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000026_sig_11_src_000143_op_arith8_pos_19_val__3 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000034_sig_06_src_000256_op_arith8_pos_499_val__8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000034_sig_06_src_000256_op_arith8_pos_499_val__8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000039_sig_11_src_000260_op_int16_pos_397_val__0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000039_sig_11_src_000260_op_int16_pos_397_val__0 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/00/id_000034_sig_11_src_000104_op_int32_pos_16_val_-32768: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/00/id_000034_sig_11_src_000104_op_int32_pos_16_val_-32768 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000023_sig_11_src_000193_op_int16_pos_31_val_be__32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000023_sig_11_src_000193_op_int16_pos_31_val_be__32 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000036_sig_11_src_000310_op_arith32_pos_20_val_be_-8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000036_sig_11_src_000310_op_arith32_pos_20_val_be_-8 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/04/id_000004_sig_11_src_000034_op_int32_pos_44_val__1000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/04/id_000004_sig_11_src_000034_op_int32_pos_44_val__1000 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/04/id_000005_sig_11_src_000063_op_int32_pos_17_val__1000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/04/id_000005_sig_11_src_000063_op_int32_pos_17_val__1000 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000000_sig_11_src_000001_op_int16_pos_11_val_be_-128: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000000_sig_11_src_000001_op_int16_pos_11_val_be_-128 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000006_sig_11_src_000075_op_arith16_pos_62_val__28: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000006_sig_11_src_000075_op_arith16_pos_62_val__28 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000013_sig_11_src_000212_op_int32_pos_15_val__32767: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000013_sig_11_src_000212_op_int32_pos_15_val__32767 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000021_sig_11_src_000134_op_int16_pos_13_val_be_-128: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000021_sig_11_src_000134_op_int16_pos_13_val_be_-128 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000038_sig_11_src_000260_op_arith16_pos_254_val_-29: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000038_sig_11_src_000260_op_arith16_pos_254_val_-29 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/id_000007_sig_11_src_000001_op_int16_pos_12_val_be__1000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/id_000007_sig_11_src_000001_op_int16_pos_12_val_be__1000 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000006_sig_11_src_000001_op_arith8_pos_12_val_-21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000006_sig_11_src_000001_op_arith8_pos_12_val_-21 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/03/id_000019_sig_11_src_000082_op_int32_pos_19_val_be__65535: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/03/id_000019_sig_11_src_000082_op_int32_pos_19_val_be__65535 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/09/id_000028_sig_11_src_000219_op_arith16_pos_62_val_be_-23: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/09/id_000028_sig_11_src_000219_op_arith16_pos_62_val_be_-23 -------------------------------------------------------------------------------- /tests/decomp-bad-inputs/01/min_id_000007_sig_11_src_000001_op_int16_pos_12_val_be__1000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pfalcon/uzlib/HEAD/tests/decomp-bad-inputs/01/min_id_000007_sig_11_src_000001_op_int16_pos_12_val_be__1000 -------------------------------------------------------------------------------- /tests/clang-ubsan-build.sh: -------------------------------------------------------------------------------- 1 | # Build with Clang UBSan to catch any runtime issues. 2 | # https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html 3 | 4 | make clean 5 | make CC="clang -fsanitize=undefined -fno-sanitize-recover=undefined" 6 | -------------------------------------------------------------------------------- /tests/Makefile: -------------------------------------------------------------------------------- 1 | # Very basic smoke test for decompressor 2 | test: 3 | $(MAKE) -C ../src 4 | $(MAKE) -C ../examples/tgunzip 5 | $(MAKE) -C ../examples/tgzip 6 | ../examples/tgunzip/tgunzip corpus.tar.gz corpus-out.tar 7 | md5sum -c corpus.md5sum 8 | 9 | clean: 10 | $(MAKE) -C ../src $@ 11 | $(MAKE) -C ../examples/tgzip $@ 12 | $(MAKE) -C ../examples/tgunzip $@ 13 | -------------------------------------------------------------------------------- /src/tinf_compat.h: -------------------------------------------------------------------------------- 1 | /* This header contains compatibility defines for the original tinf API 2 | and uzlib 2.x and below API. These defines are deprecated and going 3 | to be removed in the future, so applications should migrate to new 4 | uzlib API. */ 5 | #define TINF_DATA struct uzlib_uncomp 6 | 7 | #define destSize dest_size 8 | #define destStart dest_start 9 | #define readSource source_read_cb 10 | -------------------------------------------------------------------------------- /tests/run-decomp-bad-inputs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Make sure that globbing order below is independent on the current 4 | # user locale 5 | export LANG=C.UTF-8 6 | unset LC_COLLATE 7 | 8 | rm -f decomp-bad-inputs.log 9 | 10 | for f in decomp-bad-inputs/*/*; do 11 | echo "*" $f 12 | ../examples/tgunzip/tgunzip "$f" /dev/null 13 | echo $f $? >>decomp-bad-inputs.log 14 | done 15 | 16 | echo 17 | 18 | if diff -u decomp-bad-inputs.ref decomp-bad-inputs.log; then 19 | echo "Test passed" 20 | else 21 | echo "Test FAILED" 22 | fi 23 | -------------------------------------------------------------------------------- /examples/tgunzip/makefile.mgw: -------------------------------------------------------------------------------- 1 | ## 2 | ## tgunzip - gzip decompressor example 3 | ## 4 | ## MinGW / Cygwin makefile 5 | ## 6 | ## Copyright (c) 1998-2003 by Joergen Ibsen / Jibz 7 | ## All Rights Reserved 8 | ## 9 | 10 | target = tgunzip.exe 11 | objects = tgunzip.o 12 | libs = ../../lib/libtinf.a 13 | 14 | cflags = -s -Wall -Os -fomit-frame-pointer -I../../src 15 | ldflags = $(cflags) 16 | 17 | .PHONY: all clean 18 | 19 | all: $(target) 20 | 21 | $(target): $(objects) 22 | gcc $(ldflags) -o $@ $^ $(libs) 23 | 24 | %.o : %.c 25 | gcc $(cflags) -o $@ -c $< 26 | 27 | clean: 28 | $(RM) $(target) $(objects) 29 | -------------------------------------------------------------------------------- /examples/tgunzip/makefile.vc: -------------------------------------------------------------------------------- 1 | ## 2 | ## tgunzip - gzip decompressor example 3 | ## 4 | ## Visual C/C++ makefile (GNU Make) 5 | ## 6 | ## Copyright (c) 2003 by Joergen Ibsen / Jibz 7 | ## All Rights Reserved 8 | ## 9 | 10 | target = tgunzip.exe 11 | objects = tgunzip.obj 12 | libs = ../../lib/tinf.lib 13 | 14 | cflags = /nologo /W3 /O1 /G6 /W3 /Gy /GF /I..\..\src 15 | ldflags = /nologo /release /opt:ref /opt:icf 16 | 17 | .PHONY: all clean 18 | 19 | all: $(target) 20 | 21 | $(target): $(objects) 22 | link $(ldflags) /out:$@ $^ $(libs) 23 | 24 | %.obj : %.c 25 | cl $(cflags) -c $< 26 | 27 | clean: 28 | $(RM) $(target) $(objects) 29 | -------------------------------------------------------------------------------- /examples/tgunzip/makefile.dj2: -------------------------------------------------------------------------------- 1 | ## 2 | ## tgunzip - gzip decompressor example 3 | ## 4 | ## DJGPP makefile 5 | ## 6 | ## Copyright (c) 2003 by Joergen Ibsen / Jibz 7 | ## All Rights Reserved 8 | ## 9 | ## http://www.ibsensoftware.com/ 10 | ## 11 | 12 | target = tgunzip.exe 13 | objects = tgunzip.o 14 | libs = ../../lib/libtinf.a 15 | 16 | cflags = -s -Wall -Os -fomit-frame-pointer -I../../src 17 | ldflags = $(cflags) 18 | 19 | .PHONY: all clean 20 | 21 | all: $(target) 22 | 23 | $(target): $(objects) 24 | gcc $(ldflags) -o $@ $^ $(libs) 25 | 26 | %.o : %.c 27 | gcc $(cflags) -o $@ -c $< 28 | 29 | clean: 30 | $(RM) $(objects) $(target) 31 | -------------------------------------------------------------------------------- /src/makefile.vc: -------------------------------------------------------------------------------- 1 | ## 2 | ## tinflib - tiny inflate library (inflate, gzip, zlib) 3 | ## 4 | ## Visual C++ Makefile (GNU Make) 5 | ## 6 | ## Copyright (c) 2003 by Joergen Ibsen / Jibz 7 | ## All Rights Reserved 8 | ## 9 | 10 | target = ../lib/tinf.lib 11 | objects = tinflate.obj tinfgzip.obj tinfzlib.obj adler32.obj crc32.obj 12 | 13 | cflags = /nologo /W3 /O1 /G6 /W3 /Gy /GF 14 | 15 | .PHONY: all clean 16 | 17 | all: $(target) 18 | 19 | $(target): $(objects) 20 | $(RM) $@ 21 | lib /OUT:$@ $^ 22 | 23 | %.obj : %.c 24 | cl $(cflags) -c $< 25 | 26 | %.obj : %.nas 27 | nasm -o $@ -f win32 -O3 -Inasm/ $< 28 | 29 | clean: 30 | $(RM) $(target) $(objects) 31 | -------------------------------------------------------------------------------- /src/makefile.mgw: -------------------------------------------------------------------------------- 1 | ## 2 | ## tinflib - tiny inflate library (inflate, gzip, zlib) 3 | ## 4 | ## MinGW / Cygwin makefile 5 | ## 6 | ## Copyright (c) 2003 by Joergen Ibsen / Jibz 7 | ## All Rights Reserved 8 | ## 9 | 10 | target = ../lib/libtinf.a 11 | objects = tinflate.o tinfgzip.o tinfzlib.o adler32.o crc32.o 12 | 13 | cflags = -s -Wall -Os -fomit-frame-pointer 14 | 15 | .PHONY: all clean 16 | 17 | all: $(target) 18 | 19 | $(target): $(objects) 20 | $(RM) $@ 21 | ar -frsv $@ $^ 22 | ranlib $@ 23 | 24 | %.o : %.c 25 | gcc $(cflags) -o $@ -c $< 26 | 27 | %.o : %.nas 28 | nasm -o $@ -f win32 -O3 -Inasm/ $< 29 | 30 | clean: 31 | $(RM) $(target) $(objects) 32 | -------------------------------------------------------------------------------- /examples/tgunzip/makefile.dmc: -------------------------------------------------------------------------------- 1 | ## 2 | ## tgunzip - gzip decompressor example 3 | ## 4 | ## Digital Mars C/C++ makefile (GNU Make) 5 | ## 6 | ## Copyright (c) 2003 by Joergen Ibsen / Jibz 7 | ## All Rights Reserved 8 | ## 9 | ## http://www.ibsensoftware.com/ 10 | ## 11 | 12 | target = tgunzip.exe 13 | objects = tgunzip.obj 14 | libs = ..\..\lib\tinf.lib 15 | temps = tgunzip.map 16 | 17 | cflags = -s -mn -o+all -I..\..\src 18 | ldflags = $(cflags) 19 | 20 | .PHONY: all clean 21 | 22 | all: $(target) 23 | 24 | $(target): $(objects) 25 | dmc $(ldflags) -o$@ $^ $(libs) 26 | 27 | %.obj : %.c 28 | dmc $(cflags) -c $< 29 | 30 | clean: 31 | $(RM) $(objects) $(target) $(temps) 32 | -------------------------------------------------------------------------------- /examples/tgunzip/makefile: -------------------------------------------------------------------------------- 1 | ## 2 | ## tgunzip - gzip decompressor example 3 | ## 4 | ## GCC makefile (Linux, FreeBSD, BeOS and QNX) 5 | ## 6 | ## Copyright (c) 2003 by Joergen Ibsen / Jibz 7 | ## All Rights Reserved 8 | ## 9 | ## http://www.ibsensoftware.com/ 10 | ## 11 | 12 | target = tgunzip 13 | objects = tgunzip.o 14 | libs = ../../lib/libtinf.a 15 | 16 | COPT = -Os 17 | CFLAGS = -Wall -I../../src $(COPT) 18 | LDFLAGS = $(CFLAGS) -s -Wl,-Map,ld.map 19 | 20 | .PHONY: all clean 21 | 22 | all: $(target) 23 | 24 | $(target): $(objects) $(libs) 25 | $(CC) $(LDFLAGS) -o $@ $^ $(libs) 26 | 27 | %.o : %.c 28 | $(CC) $(CFLAGS) -c $< 29 | 30 | clean: 31 | $(RM) $(objects) $(target) 32 | -------------------------------------------------------------------------------- /examples/tgzip/makefile: -------------------------------------------------------------------------------- 1 | ## 2 | ## tgzip - gzip compressor example 3 | ## 4 | ## GCC makefile (Linux, FreeBSD, BeOS and QNX) 5 | ## 6 | ## Copyright (c) 2003 by Joergen Ibsen / Jibz 7 | ## Copyright (c) 2014 by Paul Sokolovsky 8 | ## 9 | ## http://www.ibsensoftware.com/ 10 | ## 11 | 12 | target = tgzip 13 | objects = tgzip.o 14 | libs = ../../lib/libtinf.a 15 | 16 | COPT = -Os 17 | CFLAGS = -Wall -I../../src $(COPT) 18 | LDFLAGS = $(CFLAGS) -s -Wl,-Map,ld.map 19 | 20 | .PHONY: all clean 21 | 22 | all: $(target) 23 | 24 | $(target): $(objects) $(libs) 25 | $(CC) $(LDFLAGS) -o $@ $^ $(libs) 26 | 27 | %.o : %.c 28 | $(CC) $(CFLAGS) -c $< 29 | 30 | clean: 31 | $(RM) $(objects) $(target) 32 | -------------------------------------------------------------------------------- /src/makefile.dj2: -------------------------------------------------------------------------------- 1 | ## 2 | ## tinflib - tiny inflate library (inflate, gzip, zlib) 3 | ## 4 | ## DJGPP makefile 5 | ## 6 | ## Copyright (c) 2003 by Joergen Ibsen / Jibz 7 | ## All Rights Reserved 8 | ## 9 | ## http://www.ibsensoftware.com/ 10 | ## 11 | 12 | target = ../lib/libtinf.a 13 | objects = tinflate.o tinfgzip.o tinfzlib.o adler32.o crc32.o 14 | 15 | cflags = -s -Wall -Os -fomit-frame-pointer 16 | 17 | .PHONY: all clean 18 | 19 | all: $(target) 20 | 21 | $(target): $(objects) 22 | $(RM) $@ 23 | ar -frsv $@ $^ 24 | ranlib $@ 25 | 26 | %.o : %.c 27 | gcc $(cflags) -o $@ -c $< 28 | 29 | %.o : %.nas 30 | nasm -o $@ -f coff -O3 -Inasm/ $< 31 | 32 | clean: 33 | $(RM) $(objects) $(target) 34 | -------------------------------------------------------------------------------- /src/makefile.dmc: -------------------------------------------------------------------------------- 1 | ## 2 | ## tinflib - tiny inflate library (inflate, gzip, zlib) 3 | ## 4 | ## Digital Mars C/C++ makefile (GNU Make) 5 | ## 6 | ## Copyright (c) 2003 by Joergen Ibsen / Jibz 7 | ## All Rights Reserved 8 | ## 9 | ## http://www.ibsensoftware.com/ 10 | ## 11 | 12 | target = ..\lib\tinf.lib 13 | objects = tinflate.obj tinfgzip.obj tinfzlib.obj adler32.obj crc32.obj 14 | 15 | cflags = -s -mn -o+all 16 | 17 | .PHONY: all clean 18 | 19 | all: $(target) 20 | 21 | $(target): $(objects) 22 | $(RM) $@ 23 | lib -c $@ $^ 24 | 25 | %.obj : %.c 26 | dmc $(cflags) -c $< 27 | 28 | %.obj : %.nas 29 | nasm -o $@ -f obj -D_OBJ_ -O3 $< 30 | 31 | clean: 32 | $(RM) $(objects) $(target) $(temps) 33 | -------------------------------------------------------------------------------- /examples/tgunzip/makefile.wat: -------------------------------------------------------------------------------- 1 | ## 2 | ## tgunzip - gzip decompressor example 3 | ## 4 | ## Watcom / OpenWatcom C/C++ makefile (GNU Make) 5 | ## 6 | ## Copyright (c) 2003 by Joergen Ibsen / Jibz 7 | ## All Rights Reserved 8 | ## 9 | ## http://www.ibsensoftware.com/ 10 | ## 11 | 12 | target = tgunzip.exe 13 | objects = tgunzip.obj 14 | libs = ../../lib/tinf.lib 15 | system = nt 16 | 17 | cflags = -bt=$(system) -d0 -ox -I..\..\src 18 | ldflags = system $(system) 19 | 20 | .PHONY: all clean 21 | 22 | all: $(target) 23 | 24 | $(target): $(objects) 25 | wlink $(ldflags) name $@ file {$^} library {$(libs)} 26 | 27 | %.obj : %.c 28 | wcc386 $(cflags) $< 29 | 30 | clean: 31 | $(RM) $(objects) $(target) 32 | -------------------------------------------------------------------------------- /examples/tgunzip/makefile.b32: -------------------------------------------------------------------------------- 1 | ## 2 | ## tgunzip - gzip decompressor example 3 | ## 4 | ## Borland C/C++ makefile (GNU Make) 5 | ## 6 | ## Copyright (c) 2003 by Joergen Ibsen / Jibz 7 | ## All Rights Reserved 8 | ## 9 | ## http://www.ibsensoftware.com/ 10 | ## 11 | 12 | target = tgunzip.exe 13 | objects = tgunzip.obj 14 | libs = ..\..\lib\tinf.lib 15 | temps = tgunzip.tds 16 | 17 | cflags = -a16 -K -O2 -OS -I..\..\src 18 | ldflags = -C -q -Gn -x -Gz -ap -Tpe 19 | 20 | .PHONY: all clean 21 | 22 | all: $(target) 23 | 24 | $(target): $(objects) 25 | ilink32 $(ldflags) c0x32 $(objects), $@ , , import32 cw32 $(libs) , , 26 | 27 | %.obj : %.c 28 | bcc32 $(cflags) -c $< 29 | 30 | clean: 31 | $(RM) $(objects) $(target) $(temps) 32 | -------------------------------------------------------------------------------- /src/makefile.b32: -------------------------------------------------------------------------------- 1 | ## 2 | ## tinflib - tiny inflate library (inflate, gzip, zlib) 3 | ## 4 | ## Borland C/C++ makefile (GNU Make) 5 | ## 6 | ## Copyright (c) 2003 by Joergen Ibsen / Jibz 7 | ## All Rights Reserved 8 | ## 9 | ## http://www.ibsensoftware.com/ 10 | ## 11 | 12 | target = ..\lib\tinf.lib 13 | objects = tinflate.obj tinfgzip.obj tinfzlib.obj adler32.obj crc32.obj 14 | 15 | cflags = -a16 -K -O2 -OS 16 | 17 | .PHONY: all clean 18 | 19 | all: $(target) 20 | 21 | $(target): $(objects) 22 | $(RM) $@ 23 | echo $(patsubst %,+%,$(objects)) >> lib.cmd 24 | tlib $@ /C @lib.cmd 25 | $(RM) lib.cmd 26 | 27 | %.obj : %.c 28 | bcc32 $(cflags) -c $< 29 | 30 | %.obj : %.nas 31 | nasm -o $@ -f obj -D_OBJ_ -O3 -Inasm/ $< 32 | 33 | clean: 34 | $(RM) $(objects) $(target) $(temps) 35 | -------------------------------------------------------------------------------- /src/makefile: -------------------------------------------------------------------------------- 1 | ## 2 | ## tinflib - tiny inflate library (inflate, gzip, zlib) 3 | ## 4 | ## GCC makefile (Linux, FreeBSD, BeOS and QNX) 5 | ## 6 | ## Copyright (c) 2003 by Joergen Ibsen / Jibz 7 | ## All Rights Reserved 8 | ## 9 | ## http://www.ibsensoftware.com/ 10 | ## 11 | 12 | target = ../lib/libtinf.a 13 | objects = tinflate.o tinfgzip.o tinfzlib.o adler32.o crc32.o \ 14 | defl_static.o genlz77.o 15 | 16 | COPT = -Os 17 | CFLAGS = -Wall $(COPT) 18 | LDFLAGS = $(CFLAGS) -s 19 | 20 | .PHONY: all clean 21 | 22 | all: $(target) 23 | 24 | $(target): $(objects) 25 | $(RM) $@ 26 | ar -frs $@ $^ 27 | ranlib $@ 28 | 29 | %.o : %.c 30 | $(CC) $(CFLAGS) -o $@ -c $< 31 | 32 | %.o : %.nas 33 | nasm -o $@ -f elf -D_ELF_ -O3 -Inasm/ $< 34 | 35 | clean: 36 | $(RM) $(objects) $(target) 37 | -------------------------------------------------------------------------------- /src/makefile.wat: -------------------------------------------------------------------------------- 1 | ## 2 | ## tinflib - tiny inflate library (inflate, gzip, zlib) 3 | ## 4 | ## Watcom / OpenWatcom C/C++ makefile (GNU Make) 5 | ## 6 | ## Copyright (c) 2003 by Joergen Ibsen / Jibz 7 | ## All Rights Reserved 8 | ## 9 | ## http://www.ibsensoftware.com/ 10 | ## 11 | 12 | target = ..\lib\tinf.lib 13 | objects = tinflate.obj tinfgzip.obj tinfzlib.obj adler32.obj crc32.obj 14 | system = nt 15 | 16 | cflags = -bt=$(system) -d0 -obmlrs -s -zl 17 | 18 | .PHONY: all clean 19 | 20 | all: $(target) 21 | 22 | $(target): $(objects) 23 | $(RM) $@ 24 | echo $(patsubst %,+%,$(objects)) >> lib.cmd 25 | wlib -c -n -q -s -fo -io $@ @lib.cmd 26 | $(RM) lib.cmd 27 | 28 | %.obj : %.c 29 | wcc386 $(cflags) $< 30 | 31 | %.obj : %.nas 32 | nasm -o $@ -f obj -D_OBJ_ -O3 -Inasm/ $< 33 | 34 | clean: 35 | $(RM) $(objects) $(target) 36 | -------------------------------------------------------------------------------- /src/uzlib_conf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * uzlib - tiny deflate/inflate library (deflate, gzip, zlib) 3 | * 4 | * Copyright (c) 2014-2018 by Paul Sokolovsky 5 | */ 6 | 7 | #ifndef UZLIB_CONF_H_INCLUDED 8 | #define UZLIB_CONF_H_INCLUDED 9 | 10 | #ifndef UZLIB_CONF_DEBUG_LOG 11 | /* Debug logging level 0, 1, 2, etc. */ 12 | #define UZLIB_CONF_DEBUG_LOG 0 13 | #endif 14 | 15 | #ifndef UZLIB_CONF_PARANOID_CHECKS 16 | /* Perform extra checks on the input stream, even if they aren't proven 17 | to be strictly required (== lack of them wasn't proven to lead to 18 | crashes). */ 19 | #define UZLIB_CONF_PARANOID_CHECKS 0 20 | #endif 21 | 22 | #ifndef UZLIB_CONF_USE_MEMCPY 23 | /* Use memcpy() for copying data out of LZ window or uncompressed blocks, 24 | instead of doing this byte by byte. For well-compressed data, this 25 | may noticeably increase decompression speed. But for less compressed, 26 | it can actually deteriorate it (due to the fact that many memcpy() 27 | implementations are optimized for large blocks of data, and have 28 | too much overhead for short strings of just a few bytes). */ 29 | #define UZLIB_CONF_USE_MEMCPY 0 30 | #endif 31 | 32 | #endif /* UZLIB_CONF_H_INCLUDED */ 33 | -------------------------------------------------------------------------------- /src/defl_static.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) uzlib authors 3 | * 4 | * This software is provided 'as-is', without any express 5 | * or implied warranty. In no event will the authors be 6 | * held liable for any damages arising from the use of 7 | * this software. 8 | * 9 | * Permission is granted to anyone to use this software 10 | * for any purpose, including commercial applications, 11 | * and to alter it and redistribute it freely, subject to 12 | * the following restrictions: 13 | * 14 | * 1. The origin of this software must not be 15 | * misrepresented; you must not claim that you 16 | * wrote the original software. If you use this 17 | * software in a product, an acknowledgment in 18 | * the product documentation would be appreciated 19 | * but is not required. 20 | * 21 | * 2. Altered source versions must be plainly marked 22 | * as such, and must not be misrepresented as 23 | * being the original software. 24 | * 25 | * 3. This notice may not be removed or altered from 26 | * any source distribution. 27 | */ 28 | 29 | /* This files contains type declaration and prototypes for defl_static.c. 30 | They may be altered/distinct from the originals used in PuTTY source 31 | code. */ 32 | 33 | void outbits(struct uzlib_comp *ctx, unsigned long bits, int nbits); 34 | void zlib_start_block(struct uzlib_comp *ctx); 35 | void zlib_finish_block(struct uzlib_comp *ctx); 36 | void zlib_literal(struct uzlib_comp *ctx, unsigned char c); 37 | void zlib_match(struct uzlib_comp *ctx, int distance, int len); 38 | -------------------------------------------------------------------------------- /src/tinfzlib.c: -------------------------------------------------------------------------------- 1 | /* 2 | * uzlib - tiny deflate/inflate library (deflate, gzip, zlib) 3 | * 4 | * Copyright (c) 2003 by Joergen Ibsen / Jibz 5 | * All Rights Reserved 6 | * 7 | * http://www.ibsensoftware.com/ 8 | * 9 | * Copyright (c) 2014-2018 by Paul Sokolovsky 10 | * 11 | * This software is provided 'as-is', without any express 12 | * or implied warranty. In no event will the authors be 13 | * held liable for any damages arising from the use of 14 | * this software. 15 | * 16 | * Permission is granted to anyone to use this software 17 | * for any purpose, including commercial applications, 18 | * and to alter it and redistribute it freely, subject to 19 | * the following restrictions: 20 | * 21 | * 1. The origin of this software must not be 22 | * misrepresented; you must not claim that you 23 | * wrote the original software. If you use this 24 | * software in a product, an acknowledgment in 25 | * the product documentation would be appreciated 26 | * but is not required. 27 | * 28 | * 2. Altered source versions must be plainly marked 29 | * as such, and must not be misrepresented as 30 | * being the original software. 31 | * 32 | * 3. This notice may not be removed or altered from 33 | * any source distribution. 34 | */ 35 | 36 | #include "tinf.h" 37 | 38 | int uzlib_zlib_parse_header(TINF_DATA *d) 39 | { 40 | unsigned char cmf, flg; 41 | 42 | /* -- get header bytes -- */ 43 | 44 | cmf = uzlib_get_byte(d); 45 | flg = uzlib_get_byte(d); 46 | 47 | /* -- check format -- */ 48 | 49 | /* check checksum */ 50 | if ((256*cmf + flg) % 31) return TINF_DATA_ERROR; 51 | 52 | /* check method is deflate */ 53 | if ((cmf & 0x0f) != 8) return TINF_DATA_ERROR; 54 | 55 | /* check window size is valid */ 56 | if ((cmf >> 4) > 7) return TINF_DATA_ERROR; 57 | 58 | /* check there is no preset dictionary */ 59 | if (flg & 0x20) return TINF_DATA_ERROR; 60 | 61 | /* initialize for adler32 checksum */ 62 | d->checksum_type = TINF_CHKSUM_ADLER; 63 | d->checksum = 1; 64 | 65 | return cmf >> 4; 66 | } 67 | -------------------------------------------------------------------------------- /src/crc32.c: -------------------------------------------------------------------------------- 1 | /* 2 | * CRC32 checksum 3 | * 4 | * Copyright (c) 1998-2003 by Joergen Ibsen / Jibz 5 | * All Rights Reserved 6 | * 7 | * http://www.ibsensoftware.com/ 8 | * 9 | * This software is provided 'as-is', without any express 10 | * or implied warranty. In no event will the authors be 11 | * held liable for any damages arising from the use of 12 | * this software. 13 | * 14 | * Permission is granted to anyone to use this software 15 | * for any purpose, including commercial applications, 16 | * and to alter it and redistribute it freely, subject to 17 | * the following restrictions: 18 | * 19 | * 1. The origin of this software must not be 20 | * misrepresented; you must not claim that you 21 | * wrote the original software. If you use this 22 | * software in a product, an acknowledgment in 23 | * the product documentation would be appreciated 24 | * but is not required. 25 | * 26 | * 2. Altered source versions must be plainly marked 27 | * as such, and must not be misrepresented as 28 | * being the original software. 29 | * 30 | * 3. This notice may not be removed or altered from 31 | * any source distribution. 32 | */ 33 | 34 | /* 35 | * CRC32 algorithm taken from the zlib source, which is 36 | * Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler 37 | */ 38 | 39 | #include "tinf.h" 40 | 41 | static const uint32_t tinf_crc32tab[16] = { 42 | 0x00000000, 0x1db71064, 0x3b6e20c8, 0x26d930ac, 0x76dc4190, 43 | 0x6b6b51f4, 0x4db26158, 0x5005713c, 0xedb88320, 0xf00f9344, 44 | 0xd6d6a3e8, 0xcb61b38c, 0x9b64c2b0, 0x86d3d2d4, 0xa00ae278, 45 | 0xbdbdf21c 46 | }; 47 | 48 | /* crc is previous value for incremental computation, 0xffffffff initially */ 49 | uint32_t uzlib_crc32(const void *data, unsigned int length, uint32_t crc) 50 | { 51 | const unsigned char *buf = (const unsigned char *)data; 52 | unsigned int i; 53 | 54 | for (i = 0; i < length; ++i) 55 | { 56 | crc ^= buf[i]; 57 | crc = tinf_crc32tab[crc & 0x0f] ^ (crc >> 4); 58 | crc = tinf_crc32tab[crc & 0x0f] ^ (crc >> 4); 59 | } 60 | 61 | // return value suitable for passing in next time, for final value invert it 62 | return crc/* ^ 0xffffffff*/; 63 | } 64 | -------------------------------------------------------------------------------- /src/adler32.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Adler-32 checksum 3 | * 4 | * Copyright (c) 2003 by Joergen Ibsen / Jibz 5 | * All Rights Reserved 6 | * 7 | * http://www.ibsensoftware.com/ 8 | * 9 | * This software is provided 'as-is', without any express 10 | * or implied warranty. In no event will the authors be 11 | * held liable for any damages arising from the use of 12 | * this software. 13 | * 14 | * Permission is granted to anyone to use this software 15 | * for any purpose, including commercial applications, 16 | * and to alter it and redistribute it freely, subject to 17 | * the following restrictions: 18 | * 19 | * 1. The origin of this software must not be 20 | * misrepresented; you must not claim that you 21 | * wrote the original software. If you use this 22 | * software in a product, an acknowledgment in 23 | * the product documentation would be appreciated 24 | * but is not required. 25 | * 26 | * 2. Altered source versions must be plainly marked 27 | * as such, and must not be misrepresented as 28 | * being the original software. 29 | * 30 | * 3. This notice may not be removed or altered from 31 | * any source distribution. 32 | */ 33 | 34 | /* 35 | * Adler-32 algorithm taken from the zlib source, which is 36 | * Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler 37 | */ 38 | 39 | #include "tinf.h" 40 | 41 | #define A32_BASE 65521 42 | #define A32_NMAX 5552 43 | 44 | uint32_t uzlib_adler32(const void *data, unsigned int length, uint32_t prev_sum /* 1 */) 45 | { 46 | const unsigned char *buf = (const unsigned char *)data; 47 | 48 | unsigned int s1 = prev_sum & 0xffff; 49 | unsigned int s2 = prev_sum >> 16; 50 | 51 | while (length > 0) 52 | { 53 | int k = length < A32_NMAX ? length : A32_NMAX; 54 | int i; 55 | 56 | for (i = k / 16; i; --i, buf += 16) 57 | { 58 | s1 += buf[0]; s2 += s1; s1 += buf[1]; s2 += s1; 59 | s1 += buf[2]; s2 += s1; s1 += buf[3]; s2 += s1; 60 | s1 += buf[4]; s2 += s1; s1 += buf[5]; s2 += s1; 61 | s1 += buf[6]; s2 += s1; s1 += buf[7]; s2 += s1; 62 | 63 | s1 += buf[8]; s2 += s1; s1 += buf[9]; s2 += s1; 64 | s1 += buf[10]; s2 += s1; s1 += buf[11]; s2 += s1; 65 | s1 += buf[12]; s2 += s1; s1 += buf[13]; s2 += s1; 66 | s1 += buf[14]; s2 += s1; s1 += buf[15]; s2 += s1; 67 | } 68 | 69 | for (i = k % 16; i; --i) { s1 += *buf++; s2 += s1; } 70 | 71 | s1 %= A32_BASE; 72 | s2 %= A32_BASE; 73 | 74 | length -= k; 75 | } 76 | 77 | return ((uint32_t)s2 << 16) | s1; 78 | } 79 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Introduction 2 | ------------ 3 | 4 | uzlib as a whole is licensed under the terms of Zlib license, listed in 5 | the next section. It consists of substantial works of individuals whose 6 | copyrights listed in the next session. Some portions of the uzlib codebase 7 | originally were licensed under different license(s), however compatible 8 | with the Zlib license. Such license(s) are listed at the end of this file. 9 | 10 | License 11 | ------- 12 | 13 | uzlib - Deflate/Zlib-compatible LZ77 compression/decompression library 14 | 15 | Copyright (c) 2003 Joergen Ibsen 16 | Copyright (c) 1997-2014 Simon Tatham 17 | Copyright (c) 2014-2020 Paul Sokolovsky 18 | 19 | This software is provided 'as-is', without any express or implied 20 | warranty. In no event will the authors be held liable for any damages 21 | arising from the use of this software. 22 | 23 | Permission is granted to anyone to use this software for any purpose, 24 | including commercial applications, and to alter it and redistribute it 25 | freely, subject to the following restrictions: 26 | 27 | 1. The origin of this software must not be misrepresented; you must 28 | not claim that you wrote the original software. If you use this 29 | software in a product, an acknowledgment in the product 30 | documentation would be appreciated but is not required. 31 | 32 | 2. Altered source versions must be plainly marked as such, and must 33 | not be misrepresented as being the original software. 34 | 35 | 3. This notice may not be removed or altered from any source 36 | distribution. 37 | 38 | ------- 39 | Original license for src/defl_static.c: 40 | 41 | PuTTY is copyright 1997-2014 Simon Tatham. 42 | 43 | Portions copyright Robert de Bath, Joris van Rantwijk, Delian 44 | Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas Barry, 45 | Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, Markus 46 | Kuhn, Colin Watson, and CORE SDI S.A. 47 | 48 | Permission is hereby granted, free of charge, to any person 49 | obtaining a copy of this software and associated documentation files 50 | (the "Software"), to deal in the Software without restriction, 51 | including without limitation the rights to use, copy, modify, merge, 52 | publish, distribute, sublicense, and/or sell copies of the Software, 53 | and to permit persons to whom the Software is furnished to do so, 54 | subject to the following conditions: 55 | 56 | The above copyright notice and this permission notice shall be 57 | included in all copies or substantial portions of the Software. 58 | 59 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 60 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 61 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 62 | NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE 63 | FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 64 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 65 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 66 | -------------------------------------------------------------------------------- /src/nasm/crc32.nas: -------------------------------------------------------------------------------- 1 | ;; 2 | ;; NASM assembler crc32 3 | ;; 4 | ;; Copyright (c) 1998-2003 by Joergen Ibsen / Jibz 5 | ;; All Rights Reserved 6 | ;; 7 | ;; http://www.ibsensoftware.com/ 8 | ;; 9 | ;; This software is provided 'as-is', without any express 10 | ;; or implied warranty. In no event will the authors be 11 | ;; held liable for any damages arising from the use of 12 | ;; this software. 13 | ;; 14 | ;; Permission is granted to anyone to use this software 15 | ;; for any purpose, including commercial applications, 16 | ;; and to alter it and redistribute it freely, subject to 17 | ;; the following restrictions: 18 | ;; 19 | ;; 1. The origin of this software must not be 20 | ;; misrepresented; you must not claim that you 21 | ;; wrote the original software. If you use this 22 | ;; software in a product, an acknowledgment in 23 | ;; the product documentation would be appreciated 24 | ;; but is not required. 25 | ;; 26 | ;; 2. Altered source versions must be plainly marked 27 | ;; as such, and must not be misrepresented as 28 | ;; being the original software. 29 | ;; 30 | ;; 3. This notice may not be removed or altered from 31 | ;; any source distribution. 32 | ;; 33 | 34 | ; CRC32 algorithm taken from the zlib source, which is 35 | ; Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler 36 | 37 | cpu 386 38 | 39 | bits 32 40 | 41 | %include "nasmlcm.inc" 42 | 43 | section lcmtext 44 | 45 | lcmglobal tinf_crc32,8 46 | 47 | lcmexport tinf_crc32,8 48 | 49 | ; ============================================================= 50 | 51 | lcmlabel tinf_crc32,8 52 | ; tinf_crc32(const void *data, 53 | ; unsigned int length); 54 | 55 | .len$ equ 2*4 + 4 + 4 56 | .dat$ equ 2*4 + 4 57 | 58 | push esi 59 | push edi 60 | 61 | mov esi, [esp + .dat$] ; esi -> buffer 62 | mov ecx, [esp + .len$] ; ecx = length 63 | 64 | sub eax, eax ; crc = 0 65 | 66 | test esi, esi 67 | jz short .c_exit 68 | 69 | test ecx, ecx 70 | jz short .c_exit 71 | 72 | dec eax ; crc = 0xffffffff 73 | 74 | %ifdef _OBJ_ 75 | mov edi, tinf_crc32tab wrt FLAT ; edi -> crctab 76 | %else 77 | mov edi, tinf_crc32tab ; edi -> crctab 78 | %endif 79 | 80 | .c_next_byte: 81 | xor al, [esi] 82 | inc esi 83 | 84 | mov edx, 0x0f 85 | and edx, eax 86 | 87 | shr eax, 4 88 | 89 | xor eax, [edi + edx*4] 90 | 91 | mov edx, 0x0f 92 | and edx, eax 93 | 94 | shr eax, 4 95 | 96 | xor eax, [edi + edx*4] 97 | 98 | dec ecx 99 | jnz short .c_next_byte 100 | 101 | not eax 102 | 103 | .c_exit: 104 | pop edi 105 | pop esi 106 | 107 | lcmret 8 108 | 109 | ; ============================================================= 110 | 111 | section lcmdata 112 | 113 | tinf_crc32tab dd 0x00000000, 0x1db71064, 0x3b6e20c8, 0x26d930ac, 0x76dc4190 114 | dd 0x6b6b51f4, 0x4db26158, 0x5005713c, 0xedb88320, 0xf00f9344 115 | dd 0xd6d6a3e8, 0xcb61b38c, 0x9b64c2b0, 0x86d3d2d4, 0xa00ae278 116 | dd 0xbdbdf21c 117 | 118 | ; ============================================================= 119 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | name: "Close stale tickets" 2 | on: 3 | schedule: 4 | - cron: "0 22 * * *" 5 | 6 | jobs: 7 | stale: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/stale@v3 11 | with: 12 | days-before-stale: 15 13 | days-before-close: 15 14 | exempt-issue-labels: triaged 15 | exempt-pr-labels: triaged,contrib 16 | stale-issue-message: | 17 | Thanks for your submission. However there was no (further) activity 18 | on it for some time. Below are possible reasons and/or means to 19 | proceed further: 20 | 21 | * Please make sure that your submission contains clear and complete 22 | description of the issue and information required to understand and 23 | reproduce it (exact version of all components involved, etc.). Please 24 | refer to numerous guides on submitting helpful bugreports, e.g. 25 | https://www.chiark.greenend.org.uk/~sgtatham/bugs.html 26 | 27 | * Please make sure that your feature request/suggestion/change aligns 28 | well with the project purpose, goals, and process. 29 | 30 | * If you face the issue you report while working on a community-oriented 31 | open-source project, feel free to provide additional context and 32 | information - that may help to prioritize the issue better. 33 | 34 | * As many open-source projects, this project is severely under-staffed 35 | and under-resourced. If you don't run a community-oriented open-source 36 | project, and would like to get additional support/maintenance, feel 37 | free to request a support contract. 38 | 39 | Thanks for your understanding! 40 | stale-pr-message: | 41 | Thanks for your submission. However there was no (further) activity 42 | on it for some time. Below are possible reasons and/or means to 43 | proceed further: 44 | 45 | * Please make sure that your submission contains clear and complete 46 | description of the issue and information required to understand and 47 | reproduce it (exact version of all components involved, etc.). Please 48 | refer to numerous guides on submitting helpful bugreports, e.g. 49 | https://www.chiark.greenend.org.uk/~sgtatham/bugs.html 50 | 51 | * Please make sure that your feature request/suggestion/change aligns 52 | well with the project purpose, goals, and process. 53 | 54 | * If you face the issue you report while working on a community-oriented 55 | open-source project, feel free to provide additional context and 56 | information - that may help to prioritize the issue better. 57 | 58 | * As many open-source projects, this project is severely under-staffed 59 | and under-resourced. If you don't run a community-oriented open-source 60 | project, and would like to get additional support/maintenance, feel 61 | free to request a support contract. 62 | 63 | Thanks for your understanding! 64 | close-issue-message: > 65 | Closing due to inactivity. 66 | close-pr-message: > 67 | Closing due to inactivity. 68 | -------------------------------------------------------------------------------- /src/tinfgzip.c: -------------------------------------------------------------------------------- 1 | /* 2 | * uzlib - tiny deflate/inflate library (deflate, gzip, zlib) 3 | * 4 | * Copyright (c) 2003 by Joergen Ibsen / Jibz 5 | * All Rights Reserved 6 | * 7 | * http://www.ibsensoftware.com/ 8 | * 9 | * Copyright (c) 2014-2018 by Paul Sokolovsky 10 | * 11 | * This software is provided 'as-is', without any express 12 | * or implied warranty. In no event will the authors be 13 | * held liable for any damages arising from the use of 14 | * this software. 15 | * 16 | * Permission is granted to anyone to use this software 17 | * for any purpose, including commercial applications, 18 | * and to alter it and redistribute it freely, subject to 19 | * the following restrictions: 20 | * 21 | * 1. The origin of this software must not be 22 | * misrepresented; you must not claim that you 23 | * wrote the original software. If you use this 24 | * software in a product, an acknowledgment in 25 | * the product documentation would be appreciated 26 | * but is not required. 27 | * 28 | * 2. Altered source versions must be plainly marked 29 | * as such, and must not be misrepresented as 30 | * being the original software. 31 | * 32 | * 3. This notice may not be removed or altered from 33 | * any source distribution. 34 | */ 35 | 36 | #include "tinf.h" 37 | 38 | #define FTEXT 1 39 | #define FHCRC 2 40 | #define FEXTRA 4 41 | #define FNAME 8 42 | #define FCOMMENT 16 43 | 44 | void tinf_skip_bytes(TINF_DATA *d, int num); 45 | uint16_t tinf_get_uint16(TINF_DATA *d); 46 | 47 | void tinf_skip_bytes(TINF_DATA *d, int num) 48 | { 49 | while (num--) uzlib_get_byte(d); 50 | } 51 | 52 | uint16_t tinf_get_uint16(TINF_DATA *d) 53 | { 54 | unsigned int v = uzlib_get_byte(d); 55 | v = (uzlib_get_byte(d) << 8) | v; 56 | return v; 57 | } 58 | 59 | int uzlib_gzip_parse_header(TINF_DATA *d) 60 | { 61 | unsigned char flg; 62 | 63 | /* -- check format -- */ 64 | 65 | /* check id bytes */ 66 | if (uzlib_get_byte(d) != 0x1f || uzlib_get_byte(d) != 0x8b) return TINF_DATA_ERROR; 67 | 68 | /* check method is deflate */ 69 | if (uzlib_get_byte(d) != 8) return TINF_DATA_ERROR; 70 | 71 | /* get flag byte */ 72 | flg = uzlib_get_byte(d); 73 | 74 | /* check that reserved bits are zero */ 75 | if (flg & 0xe0) return TINF_DATA_ERROR; 76 | 77 | /* -- find start of compressed data -- */ 78 | 79 | /* skip rest of base header of 10 bytes */ 80 | tinf_skip_bytes(d, 6); 81 | 82 | /* skip extra data if present */ 83 | if (flg & FEXTRA) 84 | { 85 | unsigned int xlen = tinf_get_uint16(d); 86 | tinf_skip_bytes(d, xlen); 87 | } 88 | 89 | /* skip file name if present */ 90 | if (flg & FNAME) { while (uzlib_get_byte(d)); } 91 | 92 | /* skip file comment if present */ 93 | if (flg & FCOMMENT) { while (uzlib_get_byte(d)); } 94 | 95 | /* check header crc if present */ 96 | if (flg & FHCRC) 97 | { 98 | /*unsigned int hcrc =*/ tinf_get_uint16(d); 99 | 100 | // TODO: Check! 101 | // if (hcrc != (tinf_crc32(src, start - src) & 0x0000ffff)) 102 | // return TINF_DATA_ERROR; 103 | } 104 | 105 | /* initialize for crc32 checksum */ 106 | d->checksum_type = TINF_CHKSUM_CRC; 107 | d->checksum = ~0; 108 | 109 | return TINF_OK; 110 | } 111 | -------------------------------------------------------------------------------- /examples/tgzip/tgzip.c: -------------------------------------------------------------------------------- 1 | /* 2 | * tgzip - gzip compressor example 3 | * 4 | * Copyright (c) 2003 by Joergen Ibsen / Jibz 5 | * Copyright (c) 2014-2018 by Paul Sokolovsky 6 | * 7 | * http://www.ibsensoftware.com/ 8 | * 9 | * This software is provided 'as-is', without any express 10 | * or implied warranty. In no event will the authors be 11 | * held liable for any damages arising from the use of 12 | * this software. 13 | * 14 | * Permission is granted to anyone to use this software 15 | * for any purpose, including commercial applications, 16 | * and to alter it and redistribute it freely, subject to 17 | * the following restrictions: 18 | * 19 | * 1. The origin of this software must not be 20 | * misrepresented; you must not claim that you 21 | * wrote the original software. If you use this 22 | * software in a product, an acknowledgment in 23 | * the product documentation would be appreciated 24 | * but is not required. 25 | * 26 | * 2. Altered source versions must be plainly marked 27 | * as such, and must not be misrepresented as 28 | * being the original software. 29 | * 30 | * 3. This notice may not be removed or altered from 31 | * any source distribution. 32 | */ 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | #include "uzlib.h" 39 | 40 | void exit_error(const char *what) 41 | { 42 | printf("ERROR: %s\n", what); 43 | exit(1); 44 | } 45 | 46 | int main(int argc, char *argv[]) 47 | { 48 | FILE *fin, *fout; 49 | unsigned int len; 50 | unsigned char *source; 51 | 52 | printf("tgzip - example from the uzlib library\n\n"); 53 | 54 | if (argc < 3) 55 | { 56 | printf( 57 | "Syntax: tgunzip \n\n" 58 | "Both input and output are kept in memory, so do not use this on huge files.\n"); 59 | 60 | return 1; 61 | } 62 | 63 | /* -- open files -- */ 64 | 65 | if ((fin = fopen(argv[1], "rb")) == NULL) exit_error("source file"); 66 | 67 | if ((fout = fopen(argv[2], "wb")) == NULL) exit_error("destination file"); 68 | 69 | /* -- read source -- */ 70 | 71 | fseek(fin, 0, SEEK_END); 72 | 73 | len = ftell(fin); 74 | 75 | fseek(fin, 0, SEEK_SET); 76 | 77 | source = (unsigned char *)malloc(len); 78 | 79 | if (source == NULL) exit_error("memory"); 80 | 81 | if (fread(source, 1, len, fin) != len) exit_error("read"); 82 | 83 | fclose(fin); 84 | 85 | /* -- compress data -- */ 86 | 87 | struct uzlib_comp comp = {0}; 88 | comp.dict_size = 32768; 89 | comp.hash_bits = 12; 90 | size_t hash_size = sizeof(uzlib_hash_entry_t) * (1 << comp.hash_bits); 91 | comp.hash_table = malloc(hash_size); 92 | memset(comp.hash_table, 0, hash_size); 93 | 94 | zlib_start_block(&comp); 95 | uzlib_compress(&comp, source, len); 96 | zlib_finish_block(&comp); 97 | 98 | printf("compressed to %u raw bytes\n", comp.outlen); 99 | 100 | /* -- write output -- */ 101 | 102 | putc(0x1f, fout); 103 | putc(0x8b, fout); 104 | putc(0x08, fout); 105 | putc(0x00, fout); // FLG 106 | int mtime = 0; 107 | fwrite(&mtime, sizeof(mtime), 1, fout); 108 | putc(0x04, fout); // XFL 109 | putc(0x03, fout); // OS 110 | 111 | fwrite(comp.outbuf, 1, comp.outlen, fout); 112 | 113 | unsigned crc = ~uzlib_crc32(source, len, ~0); 114 | fwrite(&crc, sizeof(crc), 1, fout); 115 | fwrite(&len, sizeof(len), 1, fout); 116 | 117 | fclose(fout); 118 | 119 | return 0; 120 | } 121 | -------------------------------------------------------------------------------- /src/genlz77.c: -------------------------------------------------------------------------------- 1 | /* 2 | * genlz77 - Generic LZ77 compressor 3 | * 4 | * Copyright (c) 2014 by Paul Sokolovsky 5 | * 6 | * This software is provided 'as-is', without any express 7 | * or implied warranty. In no event will the authors be 8 | * held liable for any damages arising from the use of 9 | * this software. 10 | * 11 | * Permission is granted to anyone to use this software 12 | * for any purpose, including commercial applications, 13 | * and to alter it and redistribute it freely, subject to 14 | * the following restrictions: 15 | * 16 | * 1. The origin of this software must not be 17 | * misrepresented; you must not claim that you 18 | * wrote the original software. If you use this 19 | * software in a product, an acknowledgment in 20 | * the product documentation would be appreciated 21 | * but is not required. 22 | * 23 | * 2. Altered source versions must be plainly marked 24 | * as such, and must not be misrepresented as 25 | * being the original software. 26 | * 27 | * 3. This notice may not be removed or altered from 28 | * any source distribution. 29 | */ 30 | #include 31 | #include 32 | #include 33 | #include "uzlib.h" 34 | 35 | #if 0 36 | #define HASH_BITS 12 37 | #else 38 | #define HASH_BITS data->hash_bits 39 | #endif 40 | 41 | #define HASH_SIZE (1<dict_size 52 | #endif 53 | 54 | /* Hash function can be defined as macro or as inline function */ 55 | 56 | /*#define HASH(p) (p[0] + p[1] + p[2])*/ 57 | 58 | /* This is hash function from liblzf */ 59 | static inline int HASH(struct uzlib_comp *data, const uint8_t *p) { 60 | int v = (p[0] << 16) | (p[1] << 8) | p[2]; 61 | int hash = ((v >> (3*8 - HASH_BITS)) - v) & (HASH_SIZE - 1); 62 | return hash; 63 | } 64 | 65 | #ifdef DUMP_LZTXT 66 | 67 | /* Counter for approximate compressed length in LZTXT mode. */ 68 | /* Literal is counted as 1, copy as 2 bytes. */ 69 | unsigned approx_compressed_len; 70 | 71 | void literal(void *data, uint8_t val) 72 | { 73 | printf("L%02x # %c\n", val, (val >= 0x20 && val <= 0x7e) ? val : '?'); 74 | approx_compressed_len++; 75 | } 76 | 77 | void copy(void *data, unsigned offset, unsigned len) 78 | { 79 | printf("C-%u,%u\n", offset, len); 80 | approx_compressed_len += 2; 81 | } 82 | 83 | #else 84 | 85 | static inline void literal(void *data, uint8_t val) 86 | { 87 | zlib_literal(data, val); 88 | } 89 | 90 | static inline void copy(void *data, unsigned offset, unsigned len) 91 | { 92 | zlib_match(data, offset, len); 93 | } 94 | 95 | #endif 96 | 97 | 98 | void uzlib_compress(struct uzlib_comp *data, const uint8_t *src, unsigned slen) 99 | { 100 | const uint8_t *top = src + slen - MIN_MATCH; 101 | while (src < top) { 102 | int h = HASH(data, src); 103 | const uint8_t **bucket = &data->hash_table[h & (HASH_SIZE - 1)]; 104 | const uint8_t *subs = *bucket; 105 | *bucket = src; 106 | if (subs && src > subs && (src - subs) <= MAX_OFFSET && !memcmp(src, subs, MIN_MATCH)) { 107 | src += MIN_MATCH; 108 | const uint8_t *m = subs + MIN_MATCH; 109 | int len = MIN_MATCH; 110 | while (*src == *m && len < MAX_MATCH && src < top) { 111 | src++; m++; len++; 112 | } 113 | copy(data, src - len - subs, len); 114 | } else { 115 | literal(data, *src++); 116 | } 117 | } 118 | // Process buffer tail, which is less than MIN_MATCH 119 | // (and so it doesn't make sense to look for matches there) 120 | top += MIN_MATCH; 121 | while (src < top) { 122 | literal(data, *src++); 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /src/nasm/tinfzlib.nas: -------------------------------------------------------------------------------- 1 | ;; 2 | ;; tinfzlib - tiny zlib uncompress 3 | ;; 4 | ;; Copyright (c) 2003 by Joergen Ibsen / Jibz 5 | ;; All Rights Reserved 6 | ;; 7 | ;; http://www.ibsensoftware.com/ 8 | ;; 9 | ;; This software is provided 'as-is', without any express 10 | ;; or implied warranty. In no event will the authors be 11 | ;; held liable for any damages arising from the use of 12 | ;; this software. 13 | ;; 14 | ;; Permission is granted to anyone to use this software 15 | ;; for any purpose, including commercial applications, 16 | ;; and to alter it and redistribute it freely, subject to 17 | ;; the following restrictions: 18 | ;; 19 | ;; 1. The origin of this software must not be 20 | ;; misrepresented; you must not claim that you 21 | ;; wrote the original software. If you use this 22 | ;; software in a product, an acknowledgment in 23 | ;; the product documentation would be appreciated 24 | ;; but is not required. 25 | ;; 26 | ;; 2. Altered source versions must be plainly marked 27 | ;; as such, and must not be misrepresented as 28 | ;; being the original software. 29 | ;; 30 | ;; 3. This notice may not be removed or altered from 31 | ;; any source distribution. 32 | ;; 33 | 34 | TINF_OK equ 0 35 | TINF_DATA_ERROR equ (-3) 36 | 37 | cpu 386 38 | 39 | bits 32 40 | 41 | %include "nasmlcm.inc" 42 | 43 | section lcmtext 44 | 45 | lcmglobal tinf_zlib_uncompress,16 46 | 47 | lcmexport tinf_zlib_uncompress,16 48 | 49 | lcmextern tinf_uncompress,16 50 | lcmextern tinf_adler32,8 51 | 52 | ; ============================================================= 53 | 54 | lcmlabel tinf_zlib_uncompress,16 55 | ; tinf_zlib_uncompress(void *dest, 56 | ; unsigned int *destLen, 57 | ; const void *source, 58 | ; unsigned int sourceLen) 59 | 60 | .slen$ equ 2*4 + 4 + 12 61 | .src$ equ 2*4 + 4 + 8 62 | .dlen$ equ 2*4 + 4 + 4 63 | .dst$ equ 2*4 + 4 64 | 65 | push esi 66 | push ebx 67 | 68 | mov esi, [esp + .src$] ; esi -> source 69 | 70 | ; -- get header bytes -- 71 | 72 | movzx eax, word [esi] ; al = cmf, ah = flg, 73 | 74 | ; -- check format -- 75 | 76 | ; check method is deflate 77 | ; if ((cmf & 0x0f) != 8) return TINF_DATA_ERROR; 78 | mov cl, 0x0f 79 | and cl, al 80 | cmp cl, 8 81 | jne short .return_error 82 | 83 | ; check window size is valid 84 | ; if ((cmf >> 4) > 7) return TINF_DATA_ERROR; 85 | mov ch, al 86 | shr ch, 4 87 | cmp ch, cl ; cl = 8 from above 88 | jae short .return_error 89 | 90 | ; check there is no preset dictionary 91 | ; if (flg & 0x20) return TINF_DATA_ERROR; 92 | test ah, 0x20 93 | jnz short .return_error 94 | 95 | ; check checksum 96 | ; if ((256*cmf + flg) % 31) return TINF_DATA_ERROR; 97 | xchg al, ah 98 | xor edx, edx 99 | lea ebx, [edx + 31] 100 | div ebx 101 | test edx, edx 102 | jnz short .return_error 103 | 104 | ; -- get adler32 checksum -- 105 | 106 | mov ecx, [esp + .slen$] ; ecx = sourceLen 107 | mov ebx, [esi + ecx - 4] 108 | 109 | %ifdef BSWAP_OK 110 | bswap ebx 111 | %else ; BSWAP_OK 112 | xchg bl, bh 113 | rol ebx, 16 114 | xchg bl, bh 115 | %endif ; BSWAP_OK 116 | 117 | ; -- inflate -- 118 | 119 | ; res = tinf_uncompress(dst, destLen, src + 2, sourceLen - 6); 120 | lea eax, [ecx - 6] 121 | push eax 122 | lea eax, [esi + 2] 123 | push eax 124 | push dword [esp + 8 + .dlen$] 125 | push dword [esp + 12 + .dst$] 126 | call tinf_uncompress 127 | add esp, byte 16 128 | 129 | ; if (res != TINF_OK) return TINF_DATA_ERROR; 130 | test eax, eax 131 | jnz short .return_error 132 | 133 | ; -- check adler32 checksum -- 134 | 135 | ; if (a32 != tinf_adler32(dst, *destLen)) return TINF_DATA_ERROR; 136 | mov eax, [esp + .dlen$]; 137 | push dword [eax] 138 | push dword [esp + 4 + .dst$] 139 | call tinf_adler32 140 | add esp, byte 8 141 | 142 | sub eax, ebx 143 | jz short .return_eax 144 | 145 | .return_error: 146 | mov eax, TINF_DATA_ERROR 147 | 148 | .return_eax: 149 | pop ebx 150 | pop esi 151 | 152 | lcmret 16 153 | 154 | ; ============================================================= 155 | 156 | %ifdef _OBJ_ 157 | section lcmdata 158 | %endif 159 | 160 | ; ============================================================= 161 | -------------------------------------------------------------------------------- /examples/tgunzip/tgunzip.c: -------------------------------------------------------------------------------- 1 | /* 2 | * tgunzip - gzip decompressor example 3 | * 4 | * Copyright (c) 2003 by Joergen Ibsen / Jibz 5 | * All Rights Reserved 6 | * 7 | * http://www.ibsensoftware.com/ 8 | * 9 | * Copyright (c) 2014-2016 by Paul Sokolovsky 10 | * 11 | * This software is provided 'as-is', without any express 12 | * or implied warranty. In no event will the authors be 13 | * held liable for any damages arising from the use of 14 | * this software. 15 | * 16 | * Permission is granted to anyone to use this software 17 | * for any purpose, including commercial applications, 18 | * and to alter it and redistribute it freely, subject to 19 | * the following restrictions: 20 | * 21 | * 1. The origin of this software must not be 22 | * misrepresented; you must not claim that you 23 | * wrote the original software. If you use this 24 | * software in a product, an acknowledgment in 25 | * the product documentation would be appreciated 26 | * but is not required. 27 | * 28 | * 2. Altered source versions must be plainly marked 29 | * as such, and must not be misrepresented as 30 | * being the original software. 31 | * 32 | * 3. This notice may not be removed or altered from 33 | * any source distribution. 34 | */ 35 | 36 | #include 37 | #include 38 | 39 | #include "uzlib.h" 40 | 41 | /* produce decompressed output in chunks of this size */ 42 | /* default is to decompress byte by byte; can be any other length */ 43 | #define OUT_CHUNK_SIZE 1 44 | 45 | void exit_error(const char *what) 46 | { 47 | printf("ERROR: %s\n", what); 48 | exit(1); 49 | } 50 | 51 | int main(int argc, char *argv[]) 52 | { 53 | FILE *fin, *fout; 54 | unsigned int len, dlen, outlen; 55 | const unsigned char *source; 56 | unsigned char *dest; 57 | int res; 58 | 59 | printf("tgunzip - example from the tiny inflate library (www.ibsensoftware.com)\n\n"); 60 | 61 | if (argc < 3) 62 | { 63 | printf( 64 | "Syntax: tgunzip \n\n" 65 | "Both input and output are kept in memory, so do not use this on huge files.\n"); 66 | 67 | return 1; 68 | } 69 | 70 | uzlib_init(); 71 | 72 | /* -- open files -- */ 73 | 74 | if ((fin = fopen(argv[1], "rb")) == NULL) exit_error("source file"); 75 | 76 | if ((fout = fopen(argv[2], "wb")) == NULL) exit_error("destination file"); 77 | 78 | /* -- read source -- */ 79 | 80 | fseek(fin, 0, SEEK_END); 81 | 82 | len = ftell(fin); 83 | 84 | fseek(fin, 0, SEEK_SET); 85 | 86 | source = (unsigned char *)malloc(len); 87 | 88 | if (source == NULL) exit_error("memory"); 89 | 90 | if (fread((unsigned char*)source, 1, len, fin) != len) exit_error("read"); 91 | 92 | fclose(fin); 93 | 94 | if (len < 4) exit_error("file too small"); 95 | 96 | /* -- get decompressed length -- */ 97 | 98 | dlen = source[len - 1]; 99 | dlen = 256*dlen + source[len - 2]; 100 | dlen = 256*dlen + source[len - 3]; 101 | dlen = 256*dlen + source[len - 4]; 102 | 103 | outlen = dlen; 104 | 105 | /* there can be mismatch between length in the trailer and actual 106 | data stream; to avoid buffer overruns on overlong streams, reserve 107 | one extra byte */ 108 | dlen++; 109 | 110 | dest = (unsigned char *)malloc(dlen); 111 | 112 | if (dest == NULL) exit_error("memory"); 113 | 114 | /* -- decompress data -- */ 115 | 116 | struct uzlib_uncomp d; 117 | // uzlib_uncompress_init(&d, malloc(32768), 32768); 118 | uzlib_uncompress_init(&d, NULL, 0); 119 | 120 | /* all 3 fields below must be initialized by user */ 121 | d.source = source; 122 | d.source_limit = source + len - 4; 123 | d.source_read_cb = NULL; 124 | 125 | res = uzlib_gzip_parse_header(&d); 126 | if (res != TINF_OK) { 127 | printf("Error parsing header: %d\n", res); 128 | exit(1); 129 | } 130 | 131 | d.dest_start = d.dest = dest; 132 | 133 | while (dlen) { 134 | unsigned int chunk_len = dlen < OUT_CHUNK_SIZE ? dlen : OUT_CHUNK_SIZE; 135 | d.dest_limit = d.dest + chunk_len; 136 | res = uzlib_uncompress_chksum(&d); 137 | dlen -= chunk_len; 138 | if (res != TINF_OK) { 139 | break; 140 | } 141 | } 142 | 143 | if (res != TINF_DONE) { 144 | printf("Error during decompression: %d\n", res); 145 | exit(-res); 146 | } 147 | 148 | printf("decompressed %lu bytes\n", d.dest - dest); 149 | 150 | #if 0 151 | if (d.dest - dest != gz.dlen) { 152 | printf("Invalid decompressed length: %lu vs %u\n", d.dest - dest, gz.dlen); 153 | } 154 | 155 | if (tinf_crc32(dest, gz.dlen) != gz.crc32) { 156 | printf("Invalid decompressed crc32\n"); 157 | } 158 | #endif 159 | 160 | /* -- write output -- */ 161 | 162 | fwrite(dest, 1, outlen, fout); 163 | 164 | fclose(fout); 165 | 166 | return 0; 167 | } 168 | -------------------------------------------------------------------------------- /src/uzlib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * uzlib - tiny deflate/inflate library (deflate, gzip, zlib) 3 | * 4 | * Copyright (c) 2003 by Joergen Ibsen / Jibz 5 | * All Rights Reserved 6 | * http://www.ibsensoftware.com/ 7 | * 8 | * Copyright (c) 2014-2018 by Paul Sokolovsky 9 | * 10 | * This software is provided 'as-is', without any express 11 | * or implied warranty. In no event will the authors be 12 | * held liable for any damages arising from the use of 13 | * this software. 14 | * 15 | * Permission is granted to anyone to use this software 16 | * for any purpose, including commercial applications, 17 | * and to alter it and redistribute it freely, subject to 18 | * the following restrictions: 19 | * 20 | * 1. The origin of this software must not be 21 | * misrepresented; you must not claim that you 22 | * wrote the original software. If you use this 23 | * software in a product, an acknowledgment in 24 | * the product documentation would be appreciated 25 | * but is not required. 26 | * 27 | * 2. Altered source versions must be plainly marked 28 | * as such, and must not be misrepresented as 29 | * being the original software. 30 | * 31 | * 3. This notice may not be removed or altered from 32 | * any source distribution. 33 | */ 34 | 35 | #ifndef UZLIB_H_INCLUDED 36 | #define UZLIB_H_INCLUDED 37 | 38 | #include 39 | #include 40 | #include 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | #include "uzlib_conf.h" 47 | #if UZLIB_CONF_DEBUG_LOG 48 | #include 49 | #endif 50 | 51 | /* calling convention */ 52 | #ifndef TINFCC 53 | #ifdef __WATCOMC__ 54 | #define TINFCC __cdecl 55 | #else 56 | #define TINFCC 57 | #endif 58 | #endif 59 | 60 | /* ok status, more data produced */ 61 | #define TINF_OK 0 62 | /* end of compressed stream reached */ 63 | #define TINF_DONE 1 64 | #define TINF_DATA_ERROR (-3) 65 | #define TINF_CHKSUM_ERROR (-4) 66 | #define TINF_DICT_ERROR (-5) 67 | 68 | /* checksum types */ 69 | #define TINF_CHKSUM_NONE 0 70 | #define TINF_CHKSUM_ADLER 1 71 | #define TINF_CHKSUM_CRC 2 72 | 73 | /* helper macros */ 74 | #define TINF_ARRAY_SIZE(arr) (sizeof(arr) / sizeof(*(arr))) 75 | 76 | /* data structures */ 77 | 78 | typedef struct { 79 | unsigned short table[16]; /* table of code length counts */ 80 | unsigned short trans[288]; /* code -> symbol translation table */ 81 | } TINF_TREE; 82 | 83 | struct uzlib_uncomp { 84 | /* Pointer to the next byte in the input buffer */ 85 | const unsigned char *source; 86 | /* Pointer to the next byte past the input buffer (source_limit = source + len) */ 87 | const unsigned char *source_limit; 88 | /* If source_limit == NULL, or source >= source_limit, this function 89 | will be used to read next byte from source stream. The function may 90 | also return -1 in case of EOF (or irrecoverable error). Note that 91 | besides returning the next byte, it may also update source and 92 | source_limit fields, thus allowing for buffered operation. */ 93 | int (*source_read_cb)(struct uzlib_uncomp *uncomp); 94 | 95 | unsigned int tag; 96 | unsigned int bitcount; 97 | 98 | /* Destination (output) buffer start */ 99 | unsigned char *dest_start; 100 | /* Current pointer in dest buffer */ 101 | unsigned char *dest; 102 | /* Pointer past the end of the dest buffer, similar to source_limit */ 103 | unsigned char *dest_limit; 104 | 105 | /* Accumulating checksum */ 106 | unsigned int checksum; 107 | char checksum_type; 108 | bool eof; 109 | 110 | int btype; 111 | int bfinal; 112 | unsigned int curlen; 113 | int lzOff; 114 | unsigned char *dict_ring; 115 | unsigned int dict_size; 116 | unsigned int dict_idx; 117 | 118 | TINF_TREE ltree; /* dynamic length/symbol tree */ 119 | TINF_TREE dtree; /* dynamic distance tree */ 120 | }; 121 | 122 | #include "tinf_compat.h" 123 | 124 | #define TINF_PUT(d, c) \ 125 | { \ 126 | *d->dest++ = c; \ 127 | if (d->dict_ring) { d->dict_ring[d->dict_idx++] = c; if (d->dict_idx == d->dict_size) d->dict_idx = 0; } \ 128 | } 129 | 130 | unsigned char TINFCC uzlib_get_byte(TINF_DATA *d); 131 | 132 | /* Decompression API */ 133 | 134 | void TINFCC uzlib_init(void); 135 | void TINFCC uzlib_uncompress_init(TINF_DATA *d, void *dict, unsigned int dictLen); 136 | int TINFCC uzlib_uncompress(TINF_DATA *d); 137 | int TINFCC uzlib_uncompress_chksum(TINF_DATA *d); 138 | 139 | int TINFCC uzlib_zlib_parse_header(TINF_DATA *d); 140 | int TINFCC uzlib_gzip_parse_header(TINF_DATA *d); 141 | 142 | /* Compression API */ 143 | 144 | typedef const uint8_t *uzlib_hash_entry_t; 145 | 146 | struct uzlib_comp { 147 | unsigned char *outbuf; 148 | int outlen, outsize; 149 | unsigned long outbits; 150 | int noutbits; 151 | int comp_disabled; 152 | 153 | uzlib_hash_entry_t *hash_table; 154 | unsigned int hash_bits; 155 | unsigned int dict_size; 156 | }; 157 | 158 | void TINFCC uzlib_compress(struct uzlib_comp *c, const uint8_t *src, unsigned slen); 159 | 160 | #include "defl_static.h" 161 | 162 | /* Checksum API */ 163 | 164 | /* prev_sum is previous value for incremental computation, 1 initially */ 165 | uint32_t TINFCC uzlib_adler32(const void *data, unsigned int length, uint32_t prev_sum); 166 | /* crc is previous value for incremental computation, 0xffffffff initially */ 167 | uint32_t TINFCC uzlib_crc32(const void *data, unsigned int length, uint32_t crc); 168 | 169 | #ifdef __cplusplus 170 | } /* extern "C" */ 171 | #endif 172 | 173 | #endif /* UZLIB_H_INCLUDED */ 174 | -------------------------------------------------------------------------------- /src/nasm/nasmlcm.inc: -------------------------------------------------------------------------------- 1 | ;; 2 | ;; NASM linker compatibility macros 2002.07.24 3 | ;; 4 | ;; Copyright (c) 2001-2003 by Joergen Ibsen / Jibz 5 | ;; All Rights Reserved 6 | ;; 7 | ;; http://www.ibsensoftware.com/ 8 | ;; 9 | 10 | ; define _ELF_ for ELF32 object files 11 | ; define _OBJ_ for OMF object files 12 | ; define _OBJ_ and _DLL_ for OMF object files for a dll (stdcall) 13 | ; define _MSLIBS_ for MS style Win32 import libs (lcmwinextern) 14 | ; default is DJGPP/WIN32 COFF object files 15 | 16 | ; remember to do lcm*extern before lcmimport 17 | 18 | ; ==================================================================== 19 | ; 20 | ; There are differences between how the object formats that NASM 21 | ; supports work, and what features they support. Similarly there 22 | ; are differences between how complete and standard compliant the 23 | ; support for these formats are in linkers. 24 | ; 25 | ; The NASM linker compatibility macros (nasmlcm) were put together 26 | ; to ease my work by allowing a single source file to be assembled 27 | ; for use with a number of compilers/linkers. 28 | ; 29 | ; Currently obj/omf, win32/coff, djgpp/coff and elf32 output formats 30 | ; are supported. The following macros are available: 31 | ; 32 | ; lcmtext - section name for the code section 33 | ; lcmdata - section name for the initialized data section 34 | ; lcmbss - section name for the uninitialized data section 35 | ; 36 | ; lcmglobal - declare a function (two arguments) or data (one 37 | ; argument) as global in the current format 38 | ; lcmcglobal - same as lcmglobal, but uses C name decoration 39 | ; 40 | ; lcmextern - declare a function (two arguments) or data (one 41 | ; argument) as extern in the current format 42 | ; lcmcextern - same as lcmextern, but uses C name decoration 43 | ; lcmdllextern - same as lcmextern, but uses dll name decoration 44 | ; lcmwinextern - same as lcmextern, but uses name decoration for 45 | ; calling Win32 Api functions (see _MSLIBS_) 46 | ; 47 | ; lcmimport - declares a function (two arguments) or data (one 48 | ; argument) as imported in the current format 49 | ; lcmexport - declares a function (two arguments) or data (one 50 | ; argument) as exported in the current format 51 | ; 52 | ; lcmlabel - start label for a function in the current format 53 | ; lcmclabel - start label for a function with C name decoration 54 | ; lcmadjust - adjust stack after a function call in the current 55 | ; format 56 | ; lcmret - return from a function in the current format 57 | ; lcmcret - return from a C function 58 | ; 59 | ; The following defines change the format and behaviour: 60 | ; 61 | ; _ELF_ - the lcm*global macro adds :function and :data type 62 | ; specifiers 63 | ; 64 | ; _OBJ_ - section names are similar to those produced by 65 | ; Borland tools to increase compatibility with 66 | ; various OMF compatible linkers 67 | ; 68 | ; _DLL_ - functions are exported and imported with added 69 | ; size specifiers (_SomeFunction@12), lcmret adjusts 70 | ; stack (stdcall) 71 | ; 72 | ; _MSLIBS_ - the lcmwinextern macro prepends an underscore and 73 | ; adds size specification for functions, allowing 74 | ; the object file to be linked with MS libraries. 75 | ; 76 | ; ==================================================================== 77 | 78 | %ifndef NASMLCM_INC_INCLUDED 79 | %define NASMLCM_INC_INCLUDED 80 | 81 | %ifdef _DLL_ 82 | %ifndef _OBJ_ 83 | %error "_DLL_ needs _OBJ_ defined!" 84 | %endif 85 | %endif 86 | 87 | ; --- define lcm- section names --- 88 | ; 89 | ; a number of linkers require omf objects where the section 90 | ; names are equal to those produces by tasm. 91 | 92 | %ifdef _OBJ_ 93 | 94 | %define lcmtext _TEXT class=CODE public use32 align=4 FLAT 95 | %define lcmdata _DATA class=DATA public use32 align=4 96 | %define lcmbss _BSS class=BSS public use32 align=4 FLAT 97 | 98 | group FLAT 99 | group DGROUP _DATA 100 | 101 | %else ; _OBJ_ 102 | 103 | %define lcmtext .text 104 | %define lcmdata .data 105 | %define lcmbss .bss 106 | 107 | %endif ; _OBJ_ 108 | 109 | ; --- define lcmglobal and lcm*extern macros --- 110 | ; 111 | ; special handling of functions and data for ELF32 112 | 113 | %ifdef _ELF_ 114 | 115 | %macro lcmglobal 2 116 | global %{1}:function 117 | %endmacro 118 | %macro lcmglobal 1 119 | global %{1}:data 120 | %endmacro 121 | 122 | %define lcmcglobal lcmglobal 123 | 124 | %macro lcmextern 1-2 125 | extern %1 126 | %endmacro 127 | 128 | %macro lcmcextern 0 129 | %error lcmcextern not supported in ELF format 130 | %endmacro 131 | 132 | %macro lcmdllextern 0 133 | %error lcmdllextern not supported in ELF format 134 | %endmacro 135 | 136 | %else ; _ELF_ 137 | 138 | %ifdef _DLL_ 139 | 140 | %macro lcmglobal 2 141 | global _%1 142 | global _%1@%2 143 | %endmacro 144 | %macro lcmglobal 1 145 | global _%1 146 | %define %1 _%1 147 | %endmacro 148 | 149 | %macro lcmcglobal 2 150 | global _%1 151 | %endmacro 152 | %macro lcmcglobal 1 153 | global _%1 154 | %define %1 _%1 155 | %endmacro 156 | 157 | %macro lcmextern 2 158 | extern _%1@%2 159 | %define %1 _%1@%2 160 | %endmacro 161 | %macro lcmextern 1 162 | extern _%1 163 | %define %1 _%1 164 | %endmacro 165 | 166 | %else 167 | 168 | %macro lcmglobal 2 169 | global _%1 170 | %endmacro 171 | %macro lcmglobal 1 172 | global _%1 173 | %define %1 _%1 174 | %endmacro 175 | 176 | %define lcmcglobal lcmglobal 177 | 178 | %macro lcmextern 1-2 179 | extern _%1 180 | %define %1 _%1 181 | %endmacro 182 | 183 | %endif 184 | 185 | %macro lcmcextern 1-2 186 | extern _%1 187 | %define %1 _%1 188 | %endmacro 189 | 190 | %macro lcmdllextern 2 191 | extern _%1@%2 192 | %define %1 _%1@%2 193 | %endmacro 194 | %macro lcmdllextern 1 195 | extern _%1 196 | %define %1 _%1 197 | %endmacro 198 | 199 | %macro lcmwinextern 2 200 | %ifdef _MSLIBS_ 201 | extern _%1@%2 202 | %define %1 _%1@%2 203 | %else 204 | extern %1 205 | %endif 206 | %endmacro 207 | 208 | %endif ; _ELF_ 209 | 210 | ; --- define lcmimport and lcmexport --- 211 | ; 212 | 213 | %ifdef _OBJ_ 214 | 215 | %macro lcmimport 2-3 216 | import %1 %2 %3 217 | %rotate 1 218 | %endmacro 219 | 220 | %ifdef _DLL_ 221 | 222 | %macro lcmexport 2 223 | export _%1 224 | export _%1@%2 225 | %endmacro 226 | %macro lcmexport 1 227 | export _%1 228 | %endmacro 229 | 230 | %else 231 | 232 | %macro lcmexport 1-2 233 | %endmacro 234 | 235 | %endif 236 | 237 | %else ; _OBJ_ 238 | 239 | %macro lcmimport 2-3 240 | %endmacro 241 | 242 | %macro lcmexport 1-2 243 | %endmacro 244 | 245 | %endif ; _OBJ_ 246 | 247 | ; --- define lcmlabel, lcmadjust and lcmret macros --- 248 | ; 249 | ; we need special labels and stdcall calling convention when 250 | ; assembling for a dll 251 | 252 | %ifdef _ELF_ 253 | 254 | %macro lcmlabel 2 255 | %1: 256 | %endmacro 257 | 258 | %define lcmclabel lcmlabel 259 | 260 | %macro lcmadjust 1 261 | %if %1 < 128 262 | add esp, byte %1 263 | %else 264 | add esp, %1 265 | %endif 266 | %endmacro 267 | 268 | %macro lcmret 1 269 | ret 270 | %endmacro 271 | 272 | %define lcmcret lcmret 273 | 274 | %else ; _ELF_ 275 | 276 | %ifdef _DLL_ 277 | %macro lcmlabel 2 278 | _%1: 279 | _%1@%2: 280 | %endmacro 281 | 282 | %macro lcmclabel 2 283 | _%1: 284 | %endmacro 285 | 286 | %macro lcmadjust 1 287 | %endmacro 288 | 289 | %macro lcmret 1 290 | %if %1 > 0 291 | ret %1 292 | %else 293 | ret 294 | %endif 295 | %endmacro 296 | 297 | %macro lcmcret 1 298 | ret 299 | %endmacro 300 | 301 | %else 302 | 303 | %macro lcmlabel 2 304 | _%1: 305 | %endmacro 306 | 307 | %define lcmclabel lcmlabel 308 | 309 | %macro lcmadjust 1 310 | %if %1 < 128 311 | add esp, byte %1 312 | %else 313 | add esp, %1 314 | %endif 315 | %endmacro 316 | 317 | %macro lcmret 1 318 | ret 319 | %endmacro 320 | 321 | %define lcmcret lcmret 322 | %endif 323 | 324 | %endif ; _ELF_ 325 | 326 | %endif ; NASMLCM_INC_INCLUDED 327 | -------------------------------------------------------------------------------- /src/defl_static.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Routines in this file are based on: 4 | Zlib (RFC1950 / RFC1951) compression for PuTTY. 5 | 6 | PuTTY is copyright 1997-2014 Simon Tatham. 7 | 8 | Portions copyright Robert de Bath, Joris van Rantwijk, Delian 9 | Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas Barry, 10 | Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, Markus 11 | Kuhn, Colin Watson, and CORE SDI S.A. 12 | 13 | Permission is hereby granted, free of charge, to any person 14 | obtaining a copy of this software and associated documentation files 15 | (the "Software"), to deal in the Software without restriction, 16 | including without limitation the rights to use, copy, modify, merge, 17 | publish, distribute, sublicense, and/or sell copies of the Software, 18 | and to permit persons to whom the Software is furnished to do so, 19 | subject to the following conditions: 20 | 21 | The above copyright notice and this permission notice shall be 22 | included in all copies or substantial portions of the Software. 23 | 24 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 25 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 26 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 27 | NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE 28 | FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 29 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 30 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 31 | */ 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include "uzlib.h" 38 | #include "defl_static.h" 39 | 40 | #define snew(type) ( (type *) malloc(sizeof(type)) ) 41 | #define snewn(n, type) ( (type *) malloc((n) * sizeof(type)) ) 42 | #define sresize(x, n, type) ( (type *) realloc((x), (n) * sizeof(type)) ) 43 | #define sfree(x) ( free((x)) ) 44 | 45 | #ifndef FALSE 46 | #define FALSE 0 47 | #define TRUE (!FALSE) 48 | #endif 49 | 50 | /* ---------------------------------------------------------------------- 51 | * Zlib compression. We always use the static Huffman tree option. 52 | * Mostly this is because it's hard to scan a block in advance to 53 | * work out better trees; dynamic trees are great when you're 54 | * compressing a large file under no significant time constraint, 55 | * but when you're compressing little bits in real time, things get 56 | * hairier. 57 | * 58 | * I suppose it's possible that I could compute Huffman trees based 59 | * on the frequencies in the _previous_ block, as a sort of 60 | * heuristic, but I'm not confident that the gain would balance out 61 | * having to transmit the trees. 62 | */ 63 | 64 | void outbits(struct uzlib_comp *out, unsigned long bits, int nbits) 65 | { 66 | assert(out->noutbits + nbits <= 32); 67 | out->outbits |= bits << out->noutbits; 68 | out->noutbits += nbits; 69 | while (out->noutbits >= 8) { 70 | if (out->outlen >= out->outsize) { 71 | out->outsize = out->outlen + 64; 72 | out->outbuf = sresize(out->outbuf, out->outsize, unsigned char); 73 | } 74 | out->outbuf[out->outlen++] = (unsigned char) (out->outbits & 0xFF); 75 | out->outbits >>= 8; 76 | out->noutbits -= 8; 77 | } 78 | } 79 | 80 | static const unsigned char mirrorbytes[256] = { 81 | 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 82 | 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, 83 | 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, 84 | 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, 85 | 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, 86 | 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, 87 | 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, 88 | 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, 89 | 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, 90 | 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, 91 | 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, 92 | 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, 93 | 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, 94 | 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, 95 | 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, 96 | 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, 97 | 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, 98 | 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, 99 | 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, 100 | 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, 101 | 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, 102 | 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, 103 | 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, 104 | 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, 105 | 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, 106 | 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, 107 | 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, 108 | 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, 109 | 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, 110 | 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, 111 | 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, 112 | 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff, 113 | }; 114 | 115 | typedef struct { 116 | uint8_t extrabits; 117 | uint8_t min, max; 118 | } len_coderecord; 119 | 120 | typedef struct { 121 | uint8_t code, extrabits; 122 | uint16_t min, max; 123 | } dist_coderecord; 124 | 125 | #define TO_LCODE(x, y) x - 3, y - 3 126 | #define FROM_LCODE(x) (x + 3) 127 | 128 | static const len_coderecord lencodes[] = { 129 | {0, TO_LCODE(3, 3)}, 130 | {0, TO_LCODE(4, 4)}, 131 | {0, TO_LCODE(5, 5)}, 132 | {0, TO_LCODE(6, 6)}, 133 | {0, TO_LCODE(7, 7)}, 134 | {0, TO_LCODE(8, 8)}, 135 | {0, TO_LCODE(9, 9)}, 136 | {0, TO_LCODE(10, 10)}, 137 | {1, TO_LCODE(11, 12)}, 138 | {1, TO_LCODE(13, 14)}, 139 | {1, TO_LCODE(15, 16)}, 140 | {1, TO_LCODE(17, 18)}, 141 | {2, TO_LCODE(19, 22)}, 142 | {2, TO_LCODE(23, 26)}, 143 | {2, TO_LCODE(27, 30)}, 144 | {2, TO_LCODE(31, 34)}, 145 | {3, TO_LCODE(35, 42)}, 146 | {3, TO_LCODE(43, 50)}, 147 | {3, TO_LCODE(51, 58)}, 148 | {3, TO_LCODE(59, 66)}, 149 | {4, TO_LCODE(67, 82)}, 150 | {4, TO_LCODE(83, 98)}, 151 | {4, TO_LCODE(99, 114)}, 152 | {4, TO_LCODE(115, 130)}, 153 | {5, TO_LCODE(131, 162)}, 154 | {5, TO_LCODE(163, 194)}, 155 | {5, TO_LCODE(195, 226)}, 156 | {5, TO_LCODE(227, 257)}, 157 | {0, TO_LCODE(258, 258)}, 158 | }; 159 | 160 | static const dist_coderecord distcodes[] = { 161 | {0, 0, 1, 1}, 162 | {1, 0, 2, 2}, 163 | {2, 0, 3, 3}, 164 | {3, 0, 4, 4}, 165 | {4, 1, 5, 6}, 166 | {5, 1, 7, 8}, 167 | {6, 2, 9, 12}, 168 | {7, 2, 13, 16}, 169 | {8, 3, 17, 24}, 170 | {9, 3, 25, 32}, 171 | {10, 4, 33, 48}, 172 | {11, 4, 49, 64}, 173 | {12, 5, 65, 96}, 174 | {13, 5, 97, 128}, 175 | {14, 6, 129, 192}, 176 | {15, 6, 193, 256}, 177 | {16, 7, 257, 384}, 178 | {17, 7, 385, 512}, 179 | {18, 8, 513, 768}, 180 | {19, 8, 769, 1024}, 181 | {20, 9, 1025, 1536}, 182 | {21, 9, 1537, 2048}, 183 | {22, 10, 2049, 3072}, 184 | {23, 10, 3073, 4096}, 185 | {24, 11, 4097, 6144}, 186 | {25, 11, 6145, 8192}, 187 | {26, 12, 8193, 12288}, 188 | {27, 12, 12289, 16384}, 189 | {28, 13, 16385, 24576}, 190 | {29, 13, 24577, 32768}, 191 | }; 192 | 193 | void zlib_literal(struct uzlib_comp *out, unsigned char c) 194 | { 195 | if (out->comp_disabled) { 196 | /* 197 | * We're in an uncompressed block, so just output the byte. 198 | */ 199 | outbits(out, c, 8); 200 | return; 201 | } 202 | 203 | if (c <= 143) { 204 | /* 0 through 143 are 8 bits long starting at 00110000. */ 205 | outbits(out, mirrorbytes[0x30 + c], 8); 206 | } else { 207 | /* 144 through 255 are 9 bits long starting at 110010000. */ 208 | outbits(out, 1 + 2 * mirrorbytes[0x90 - 144 + c], 9); 209 | } 210 | } 211 | 212 | void zlib_match(struct uzlib_comp *out, int distance, int len) 213 | { 214 | const dist_coderecord *d; 215 | const len_coderecord *l; 216 | int i, j, k; 217 | int lcode; 218 | 219 | assert(!out->comp_disabled); 220 | 221 | while (len > 0) { 222 | int thislen; 223 | 224 | /* 225 | * We can transmit matches of lengths 3 through 258 226 | * inclusive. So if len exceeds 258, we must transmit in 227 | * several steps, with 258 or less in each step. 228 | * 229 | * Specifically: if len >= 261, we can transmit 258 and be 230 | * sure of having at least 3 left for the next step. And if 231 | * len <= 258, we can just transmit len. But if len == 259 232 | * or 260, we must transmit len-3. 233 | */ 234 | thislen = (len > 260 ? 258 : len <= 258 ? len : len - 3); 235 | len -= thislen; 236 | 237 | /* 238 | * Binary-search to find which length code we're 239 | * transmitting. 240 | */ 241 | i = -1; 242 | j = sizeof(lencodes) / sizeof(*lencodes); 243 | while (1) { 244 | assert(j - i >= 2); 245 | k = (j + i) / 2; 246 | if (thislen < FROM_LCODE(lencodes[k].min)) 247 | j = k; 248 | else if (thislen > FROM_LCODE(lencodes[k].max)) 249 | i = k; 250 | else { 251 | l = &lencodes[k]; 252 | break; /* found it! */ 253 | } 254 | } 255 | 256 | lcode = l - lencodes + 257; 257 | 258 | /* 259 | * Transmit the length code. 256-279 are seven bits 260 | * starting at 0000000; 280-287 are eight bits starting at 261 | * 11000000. 262 | */ 263 | if (lcode <= 279) { 264 | outbits(out, mirrorbytes[(lcode - 256) * 2], 7); 265 | } else { 266 | outbits(out, mirrorbytes[0xc0 - 280 + lcode], 8); 267 | } 268 | 269 | /* 270 | * Transmit the extra bits. 271 | */ 272 | if (l->extrabits) 273 | outbits(out, thislen - FROM_LCODE(l->min), l->extrabits); 274 | 275 | /* 276 | * Binary-search to find which distance code we're 277 | * transmitting. 278 | */ 279 | i = -1; 280 | j = sizeof(distcodes) / sizeof(*distcodes); 281 | while (1) { 282 | assert(j - i >= 2); 283 | k = (j + i) / 2; 284 | if (distance < distcodes[k].min) 285 | j = k; 286 | else if (distance > distcodes[k].max) 287 | i = k; 288 | else { 289 | d = &distcodes[k]; 290 | break; /* found it! */ 291 | } 292 | } 293 | 294 | /* 295 | * Transmit the distance code. Five bits starting at 00000. 296 | */ 297 | outbits(out, mirrorbytes[d->code * 8], 5); 298 | 299 | /* 300 | * Transmit the extra bits. 301 | */ 302 | if (d->extrabits) 303 | outbits(out, distance - d->min, d->extrabits); 304 | } 305 | } 306 | 307 | void zlib_start_block(struct uzlib_comp *out) 308 | { 309 | // outbits(out, 0x9C78, 16); 310 | outbits(out, 1, 1); /* Final block */ 311 | outbits(out, 1, 2); /* Static huffman block */ 312 | } 313 | 314 | void zlib_finish_block(struct uzlib_comp *out) 315 | { 316 | outbits(out, 0, 7); /* close block */ 317 | outbits(out, 0, 7); /* Make sure all bits are flushed */ 318 | } 319 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | uzlib - Deflate/Zlib-compatible LZ77 compression/decompression library 2 | ====================================================================== 3 | 4 | uzlib is a library which can decompress any valid Deflate, Zlib, and Gzip 5 | (further called just "Deflate") bitstream, and compress data to Deflate- 6 | compatible bitstream, albeit with lower compression ratio than Zlib Deflate 7 | algorithm (very basic LZ77 compression algorithm is used instead, static 8 | Deflate Huffman tree encoding is used for bitstream). 9 | 10 | uzlib aims for minimal code size and runtime memory requirements, and thus 11 | suitable for (deeply) embedded systems. 12 | 13 | uzlib is based on: 14 | 15 | * tinf library by Joergen Ibsen (Deflate decompression) 16 | * Deflate Static Huffman tree routines by Simon Tatham 17 | * LZ77 compressor by Paul Sokolovsky 18 | 19 | Library integrated and maintained by Paul Sokolovsky. 20 | 21 | (c) 2014-2020 Paul Sokolovsky 22 | 23 | uzlib library is licensed under Zlib license. 24 | 25 | 26 | Decompressor features 27 | --------------------- 28 | 29 | Handling of input (compressed) stream: 30 | 31 | * Can reside (fully) in memory. 32 | * Can be received, byte by byte, from an application-defined callback 33 | function (which e.g. can read it from file or another I/O device). 34 | * Combination of the above: a chunk of input is buffered in memory, 35 | when buffer is exhausted, the application callback is called to refill 36 | it. 37 | 38 | Handling of output (decompressed) stream: 39 | 40 | * In-memory decompression, where output stream fully resides in memory. 41 | * Streaming decompression, which allows to process arbitrary-sized streams 42 | (longer than available memory), but requires in-memory buffer for Deflate 43 | dictionary window. 44 | * Application specifies number of output bytes it wants to decompress, 45 | which can be as high as UINT_MAX to decompress everything into memory 46 | at once, or as low as 1 to decompress byte by byte, or any other value 47 | to decompress a chunk of that size. 48 | 49 | Note that in regard to input stream handling, uzlib employs callback-based, 50 | "pull-style" design. The control flow looks as follows: 51 | 52 | 1. Application requests uzlib to decompress given number of bytes. 53 | 2. uzlib performs decompression. 54 | 3. If more input is needed to decompress given number of bytes, uzlib 55 | calls back into application to provide more input bytes. (An 56 | implication of this is that uzlib will always return given number of 57 | output bytes, unless end of stream (or error) happens). 58 | 59 | The original Zlib library instead features "push-style" design: 60 | 61 | 1. An application prepares arbitrary number of input bytes in a buffer, 62 | and free space in output buffer, and calls Zlib with these buffers. 63 | 2. Zlib tries to decode as much as possible input and produce as much 64 | as possible output. It returns back to the application if input 65 | buffer is exhausted, or output buffer is full, whatever happens 66 | first. 67 | 68 | Currently, uzlib doesn't support push-style operation a-la Zlib. 69 | 70 | Compressor features 71 | ------------------- 72 | 73 | Compressor uses very basic implementation of LZ77 algorithm using hash 74 | table to find repeating substrings. The size of the hash table (on which 75 | compression efficiency depends), pointer to the hashtable memory, and 76 | the size of LZ77 dictionary should be configured in `struct uzlib_comp`. 77 | 78 | Currently, compressor doesn't support streaming operation, both input and 79 | output must reside in memory. Neither it supports incremental operation, 80 | entire input buffer is compressed at once with a single call to uzlib. 81 | 82 | API and configuration 83 | --------------------- 84 | 85 | The API is defined in the file [uzlib.h](src/uzlib.h) and should be largely 86 | self-describing. There are also examples implementing gzip-compatible 87 | compression and decompression applications in [examples/](examples/) for 88 | further reference. (You may also refer to the original `tinf` README 89 | below for additional information, but it's mostly provided for 90 | historical reference, and `uzlib` largely evolved beyond it). 91 | 92 | There are some compile-time options for the library, defined in 93 | the file [uzlib_conf.h](src/uzlib_conf.h). They can be altered directly 94 | in the file, or passed as the compiler options (`-DXXX=YYY`) when 95 | building library. 96 | 97 | Binary sizes 98 | ------------ 99 | 100 | To give an impression of code/data sizes of uzlib, the following figures 101 | are provided. Numbers for *.o files are code sizes of individual 102 | components (tinflate.o is decompressor, genlz77.o and defl_static.o - 103 | compressor), and TINF_DATA is the size of the corresponding data 104 | structure. These numbers are provided for different architectures, 105 | with default uzlib configuration, and with compilers/their options 106 | as specified. 107 | 108 | ``` 109 | gcc -m32 -Os 110 | gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 111 | 2891 src/tinflate.o 112 | 381 src/genlz77.o 113 | 1685 src/defl_static.o 114 | 1284 TINF_DATA 115 | 116 | arm-none-eabi-gcc -mthumb -mcpu=cortex-m4 -Os 117 | arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 9-2019-q4-major) 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599] 118 | 1620 src/tinflate.o 119 | 180 src/genlz77.o 120 | 1131 src/defl_static.o 121 | 1284 TINF_DATA 122 | ``` 123 | 124 | --- 125 | 126 | Original tinf library README 127 | ============================ 128 | 129 | *For historical reference and to provide proper credit, the original `tinf` 130 | library README follows. NOTE: Many parts no longer apply to `uzlib`. In 131 | particular, API is different, features supported are largely extended, 132 | and during decompression, there are checks to avoid erroneous/undefined 133 | behavior on incorrect Deflate bitstreams.* 134 | 135 | tinf - tiny inflate library 136 | =========================== 137 | 138 | Version 1.00 139 | 140 | Copyright (c) 2003 Joergen Ibsen 141 | 142 | 143 | 144 | 145 | About 146 | ----- 147 | 148 | tinf is a small library implementing the decompression algorithm for the 149 | deflate compressed data format (called 'inflate'). Deflate compression is 150 | used in e.g. zlib, gzip, zip and png. 151 | 152 | I wrote it because I needed a small in-memory zlib decompressor for a self- 153 | extracting archive, and the zlib library added 15k to my program. The tinf 154 | code added only 2k. 155 | 156 | Naturally the size difference is insignificant in most cases. Also, the 157 | zlib library has many more features, is more secure, and mostly faster. 158 | But if you have a project that calls for a small and simple deflate 159 | decompressor, give it a try :-) 160 | 161 | While the implementation should be fairly compliant, it does assume it is 162 | given valid compressed data, and that there is sufficient space for the 163 | decompressed data. 164 | 165 | Simple wrappers for decompressing zlib streams and gzip'ed data in memory 166 | are supplied. 167 | 168 | tgunzip, an example command-line gzip decompressor in C, is included. 169 | 170 | The inflate algorithm and data format are from 'DEFLATE Compressed Data 171 | Format Specification version 1.3' ([RFC 1951][1]). 172 | 173 | The zlib data format is from 'ZLIB Compressed Data Format Specification 174 | version 3.3' ([RFC 1950][2]). 175 | 176 | The gzip data format is from 'GZIP file format specification version 4.3' 177 | ([RFC 1952][3]). 178 | 179 | Ideas for future versions: 180 | 181 | - the fixed Huffman trees could be built by `tinf_decode_trees()` 182 | using a small table 183 | - memory for the `TINF_DATA` object should be passed, to avoid using 184 | more than 1k of stack space 185 | - wrappers for unpacking zip archives and png images 186 | - implement more in x86 assembler 187 | - more sanity checks 188 | - in `tinf_uncompress`, the (entry value of) `destLen` and `sourceLen` 189 | are not used 190 | - blocking of some sort, so everything does not have to be in memory 191 | - optional table-based huffman decoder 192 | 193 | [1]: http://www.rfc-editor.org/rfc/rfc1951.txt 194 | [2]: http://www.rfc-editor.org/rfc/rfc1950.txt 195 | [3]: http://www.rfc-editor.org/rfc/rfc1952.txt 196 | 197 | 198 | Functionality 199 | ------------- 200 | 201 | void tinf_init(); 202 | 203 | Initialise the global uninitialised data used by the decompression code. 204 | This function must be called once before any calls to the decompression 205 | functions. 206 | 207 | int tinf_uncompress(void *dest, 208 | unsigned int *destLen, 209 | const void *source, 210 | unsigned int sourceLen); 211 | 212 | Decompress data in deflate compressed format from `source[]` to `dest[]`. 213 | `destLen` is set to the length of the decompressed data. Returns `TINF_OK` 214 | on success, and `TINF_DATA_ERROR` on error. 215 | 216 | int tinf_gzip_uncompress(void *dest, 217 | unsigned int *destLen, 218 | const void *source, 219 | unsigned int sourceLen); 220 | 221 | Decompress data in gzip compressed format from `source[]` to `dest[]`. 222 | `destLen` is set to the length of the decompressed data. Returns `TINF_OK` 223 | on success, and `TINF_DATA_ERROR` on error. 224 | 225 | int tinf_zlib_uncompress(void *dest, 226 | unsigned int *destLen, 227 | const void *source, 228 | unsigned int sourceLen); 229 | 230 | Decompress data in zlib compressed format from `source[]` to `dest[]`. 231 | `destLen` is set to the length of the decompressed data. Returns `TINF_OK` 232 | on success, and `TINF_DATA_ERROR` on error. 233 | 234 | unsigned int tinf_adler32(const void *data, 235 | unsigned int length); 236 | 237 | Computes the Adler-32 checksum of `length` bytes starting at `data`. Used by 238 | `tinf_zlib_uncompress()`. 239 | 240 | unsigned int tinf_crc32(const void *data, 241 | unsigned int length); 242 | 243 | Computes the CRC32 checksum of `length` bytes starting at `data`. Used by 244 | `tinf_gzip_uncompress()`. 245 | 246 | 247 | Source Code 248 | ----------- 249 | 250 | The source code is ANSI C, and assumes that int is 32-bit. It has been 251 | tested on the x86 platform under Windows and Linux. 252 | 253 | The decompression functions should be endian-neutral, and also reentrant 254 | and thread-safe (not tested). 255 | 256 | In src/nasm there are 32-bit x86 assembler (386+) versions of some of the 257 | files. 258 | 259 | Makefiles (GNU Make style) for a number of compilers are included. 260 | 261 | 262 | Frequently Asked Questions 263 | -------------------------- 264 | 265 | Q: Is it really free? Can I use it in my commercial ExpenZip software? 266 | 267 | A: It's open-source software, available under the zlib license (see 268 | later), which means you can use it for free -- even in commercial 269 | products. If you do, please be kind enough to add an acknowledgement. 270 | 271 | Q: Did you just strip stuff from the zlib source to make it smaller? 272 | 273 | A: No, tinf was written from scratch, using the RFC documentation of 274 | the formats it supports. 275 | 276 | Q: What do you mean by: 'the zlib library .. is more secure'? 277 | 278 | A: The zlib decompression code checks the compressed data for validity 279 | while decompressing, so even on corrupted data it will not crash. 280 | The tinf code assumes it is given valid compressed data. 281 | 282 | Q: I'm a Delphi programmer, can I use tinf? 283 | 284 | A: Sure, the object files produced by both Borland C and Watcom C should 285 | be linkable with Delphi. 286 | 287 | Q: Will tinf work on UltraSTRANGE machines running WhackOS? 288 | 289 | A: I have no idea .. please try it out and let me know! 290 | 291 | Q: Why are all the makefiles in GNU Make style? 292 | 293 | A: I'm used to GNU Make, and it has a number of features that are missing 294 | in some of the other Make utilities. 295 | 296 | Q: This is the first release, how can there be frequently asked questions? 297 | 298 | A: Ok, ok .. I made the questions up ;-) 299 | 300 | 301 | License 302 | ------- 303 | 304 | tinf - tiny inflate library 305 | 306 | Copyright (c) 2003 Joergen Ibsen 307 | 308 | This software is provided 'as-is', without any express or implied 309 | warranty. In no event will the authors be held liable for any damages 310 | arising from the use of this software. 311 | 312 | Permission is granted to anyone to use this software for any purpose, 313 | including commercial applications, and to alter it and redistribute it 314 | freely, subject to the following restrictions: 315 | 316 | 1. The origin of this software must not be misrepresented; you must 317 | not claim that you wrote the original software. If you use this 318 | software in a product, an acknowledgment in the product 319 | documentation would be appreciated but is not required. 320 | 321 | 2. Altered source versions must be plainly marked as such, and must 322 | not be misrepresented as being the original software. 323 | 324 | 3. This notice may not be removed or altered from any source 325 | distribution. 326 | -------------------------------------------------------------------------------- /tests/decomp-bad-inputs.ref: -------------------------------------------------------------------------------- 1 | decomp-bad-inputs/00/id_000000_sig_11_src_000000_op_flip1_pos_10 3 2 | decomp-bad-inputs/00/id_000001_sig_11_src_000000_op_flip1_pos_10 3 3 | decomp-bad-inputs/00/id_000002_sig_11_src_000000_op_flip1_pos_10 3 4 | decomp-bad-inputs/00/id_000003_sig_11_src_000000_op_flip1_pos_12 3 5 | decomp-bad-inputs/00/id_000004_sig_11_src_000000_op_flip1_pos_12 3 6 | decomp-bad-inputs/00/id_000005_sig_11_src_000000_op_flip1_pos_12 3 7 | decomp-bad-inputs/00/id_000006_sig_11_src_000000_op_flip1_pos_12 3 8 | decomp-bad-inputs/00/id_000007_sig_11_src_000000_op_flip2_pos_11 3 9 | decomp-bad-inputs/00/id_000008_sig_11_src_000000_op_flip2_pos_12 3 10 | decomp-bad-inputs/00/id_000009_sig_11_src_000000_op_flip2_pos_12 3 11 | decomp-bad-inputs/00/id_000010_sig_11_src_000000_op_flip4_pos_10 3 12 | decomp-bad-inputs/00/id_000011_sig_11_src_000000_op_flip8_pos_10 3 13 | decomp-bad-inputs/00/id_000012_sig_11_src_000000_op_arith8_pos_11_val__6 3 14 | decomp-bad-inputs/00/id_000013_sig_11_src_000000_op_arith8_pos_12_val_-9 3 15 | decomp-bad-inputs/00/id_000014_sig_11_src_000000_op_havoc_rep_16 3 16 | decomp-bad-inputs/00/id_000015_sig_11_src_000000_op_havoc_rep_2 3 17 | decomp-bad-inputs/00/id_000016_sig_11_src_000000_op_havoc_rep_4 3 18 | decomp-bad-inputs/00/id_000017_sig_11_src_000000_op_havoc_rep_4 3 19 | decomp-bad-inputs/00/id_000018_sig_11_src_000000_op_havoc_rep_2 3 20 | decomp-bad-inputs/00/id_000019_sig_11_src_000000_op_havoc_rep_8 3 21 | decomp-bad-inputs/00/id_000020_sig_11_src_000000_op_havoc_rep_8 3 22 | decomp-bad-inputs/00/id_000021_sig_11_src_000000_op_havoc_rep_8 3 23 | decomp-bad-inputs/00/id_000022_sig_11_src_000000_op_havoc_rep_4 3 24 | decomp-bad-inputs/00/id_000023_sig_06_src_000000_op_havoc_rep_8 3 25 | decomp-bad-inputs/00/id_000024_sig_06_src_000000_op_havoc_rep_8 3 26 | decomp-bad-inputs/00/id_000025_sig_06_src_000033_op_havoc_rep_8 3 27 | decomp-bad-inputs/00/id_000026_sig_11_src_000033_op_havoc_rep_2 3 28 | decomp-bad-inputs/00/id_000027_sig_11_src_000040_op_havoc_rep_2 3 29 | decomp-bad-inputs/00/id_000028_sig_11_src_000070_op_havoc_rep_2 3 30 | decomp-bad-inputs/00/id_000029_sig_11_src_000070_op_havoc_rep_8 3 31 | decomp-bad-inputs/00/id_000030_sig_11_src_000070_op_havoc_rep_16 3 32 | decomp-bad-inputs/00/id_000031_sig_11_src_000090_op_havoc_rep_4 3 33 | decomp-bad-inputs/00/id_000032_sig_11_src_000096_op_flip1_pos_10 3 34 | decomp-bad-inputs/00/id_000033_sig_11_src_000096_op_int16_pos_14_val__1 3 35 | decomp-bad-inputs/00/id_000034_sig_11_src_000104_op_int32_pos_16_val_-32768 3 36 | decomp-bad-inputs/00/id_000035_sig_11_src_000118_op_flip1_pos_58 3 37 | decomp-bad-inputs/00/id_000036_sig_11_src_000187_op_flip1_pos_10 3 38 | decomp-bad-inputs/00/id_000037_sig_11_src_000187_op_flip1_pos_12 3 39 | decomp-bad-inputs/00/id_000038_sig_11_src_000187_op_flip1_pos_15 3 40 | decomp-bad-inputs/01/id_000000_sig_11_src_000001_op_flip1_pos_3 3 41 | decomp-bad-inputs/01/id_000001_sig_11_src_000001_op_flip1_pos_3 1 42 | decomp-bad-inputs/01/id_000002_sig_11_src_000001_op_flip2_pos_10 3 43 | decomp-bad-inputs/01/id_000003_sig_11_src_000001_op_flip4_pos_10 3 44 | decomp-bad-inputs/01/id_000004_sig_11_src_000001_op_flip4_pos_12 3 45 | decomp-bad-inputs/01/id_000005_sig_11_src_000001_op_flip16_pos_10 3 46 | decomp-bad-inputs/01/id_000006_sig_11_src_000001_op_arith8_pos_12_val_-21 3 47 | decomp-bad-inputs/01/id_000007_sig_11_src_000001_op_int16_pos_12_val_be__1000 3 48 | decomp-bad-inputs/01/id_000008_sig_11_src_000001_op_havoc_rep_32 1 49 | decomp-bad-inputs/01/id_000009_sig_11_src_000001_op_havoc_rep_16 3 50 | decomp-bad-inputs/01/id_000010_sig_07_src_000001_op_havoc_rep_2 3 51 | decomp-bad-inputs/01/id_000011_sig_11_src_000001_op_havoc_rep_16 3 52 | decomp-bad-inputs/01/id_000012_sig_11_src_000001_op_havoc_rep_4 3 53 | decomp-bad-inputs/01/id_000013_sig_11_src_000001_op_havoc_rep_4 3 54 | decomp-bad-inputs/01/id_000014_sig_11_src_000001_op_havoc_rep_8 3 55 | decomp-bad-inputs/01/id_000015_sig_11_src_000001_op_havoc_rep_32 3 56 | decomp-bad-inputs/01/id_000016_sig_07_src_000001_op_havoc_rep_2 3 57 | decomp-bad-inputs/01/id_000017_sig_11_src_000001_op_havoc_rep_2 0 58 | decomp-bad-inputs/01/id_000018_sig_11_src_000001_op_havoc_rep_8 3 59 | decomp-bad-inputs/01/id_000019_sig_11_src_000001_op_havoc_rep_8 3 60 | decomp-bad-inputs/01/id_000020_sig_11_src_000001_op_havoc_rep_8 3 61 | decomp-bad-inputs/01/id_000021_sig_11_src_000001_op_havoc_rep_4 3 62 | decomp-bad-inputs/01/id_000022_sig_11_src_000001_op_havoc_rep_4 3 63 | decomp-bad-inputs/01/id_000023_sig_06_src_000001_op_havoc_rep_4 3 64 | decomp-bad-inputs/01/id_000024_sig_11_src_000001_op_havoc_rep_8 3 65 | decomp-bad-inputs/01/id_000025_sig_11_src_000005_op_flip1_pos_22 3 66 | decomp-bad-inputs/01/id_000026_sig_11_src_000005_op_havoc_rep_16 3 67 | decomp-bad-inputs/01/id_000027_sig_11_src_000005_op_havoc_rep_2 3 68 | decomp-bad-inputs/01/id_000028_sig_11_src_000005_op_havoc_rep_4 3 69 | decomp-bad-inputs/01/id_000029_sig_11_src_000005_op_havoc_rep_8 3 70 | decomp-bad-inputs/01/id_000030_sig_11_src_000005_op_havoc_rep_8 3 71 | decomp-bad-inputs/01/id_000031_sig_11_src_000005_op_havoc_rep_4 3 72 | decomp-bad-inputs/01/id_000032_sig_11_src_000005_op_havoc_rep_8 3 73 | decomp-bad-inputs/01/id_000033_sig_11_src_000005_op_havoc_rep_16 3 74 | decomp-bad-inputs/01/id_000034_sig_11_src_000005_op_havoc_rep_8 3 75 | decomp-bad-inputs/01/id_000035_sig_11_src_000005_op_havoc_rep_8 3 76 | decomp-bad-inputs/01/min_id_000000_sig_11_src_000001_op_flip1_pos_3 3 77 | decomp-bad-inputs/01/min_id_000002_sig_11_src_000001_op_flip2_pos_10 3 78 | decomp-bad-inputs/01/min_id_000003_sig_11_src_000001_op_flip4_pos_10 3 79 | decomp-bad-inputs/01/min_id_000004_sig_11_src_000001_op_flip4_pos_12 3 80 | decomp-bad-inputs/01/min_id_000005_sig_11_src_000001_op_flip16_pos_10 3 81 | decomp-bad-inputs/01/min_id_000006_sig_11_src_000001_op_arith8_pos_12_val_-21 3 82 | decomp-bad-inputs/01/min_id_000007_sig_11_src_000001_op_int16_pos_12_val_be__1000 3 83 | decomp-bad-inputs/01/min_id_000009_sig_11_src_000001_op_havoc_rep_16 3 84 | decomp-bad-inputs/01/min_id_000010_sig_07_src_000001_op_havoc_rep_2 3 85 | decomp-bad-inputs/01/min_id_000011_sig_11_src_000001_op_havoc_rep_16 3 86 | decomp-bad-inputs/01/min_id_000012_sig_11_src_000001_op_havoc_rep_4 3 87 | decomp-bad-inputs/01/min_id_000013_sig_11_src_000001_op_havoc_rep_4 3 88 | decomp-bad-inputs/01/min_id_000014_sig_11_src_000001_op_havoc_rep_8 3 89 | decomp-bad-inputs/01/min_id_000015_sig_11_src_000001_op_havoc_rep_32 3 90 | decomp-bad-inputs/01/min_id_000016_sig_07_src_000001_op_havoc_rep_2 3 91 | decomp-bad-inputs/01/min_id_000017_sig_11_src_000001_op_havoc_rep_2 3 92 | decomp-bad-inputs/01/min_id_000018_sig_11_src_000001_op_havoc_rep_8 3 93 | decomp-bad-inputs/01/min_id_000019_sig_11_src_000001_op_havoc_rep_8 3 94 | decomp-bad-inputs/01/min_id_000020_sig_11_src_000001_op_havoc_rep_8 3 95 | decomp-bad-inputs/01/min_id_000021_sig_11_src_000001_op_havoc_rep_4 3 96 | decomp-bad-inputs/01/min_id_000022_sig_11_src_000001_op_havoc_rep_4 3 97 | decomp-bad-inputs/01/min_id_000023_sig_06_src_000001_op_havoc_rep_4 3 98 | decomp-bad-inputs/01/min_id_000024_sig_11_src_000001_op_havoc_rep_8 3 99 | decomp-bad-inputs/01/min_id_000025_sig_11_src_000005_op_flip1_pos_22 3 100 | decomp-bad-inputs/01/min_id_000026_sig_11_src_000005_op_havoc_rep_16 3 101 | decomp-bad-inputs/01/min_id_000027_sig_11_src_000005_op_havoc_rep_2 3 102 | decomp-bad-inputs/01/min_id_000028_sig_11_src_000005_op_havoc_rep_4 1 103 | decomp-bad-inputs/01/min_id_000029_sig_11_src_000005_op_havoc_rep_8 3 104 | decomp-bad-inputs/01/min_id_000030_sig_11_src_000005_op_havoc_rep_8 3 105 | decomp-bad-inputs/01/min_id_000031_sig_11_src_000005_op_havoc_rep_4 3 106 | decomp-bad-inputs/01/min_id_000032_sig_11_src_000005_op_havoc_rep_8 3 107 | decomp-bad-inputs/01/min_id_000033_sig_11_src_000005_op_havoc_rep_16 3 108 | decomp-bad-inputs/01/min_id_000034_sig_11_src_000005_op_havoc_rep_8 3 109 | decomp-bad-inputs/01/min_id_000035_sig_11_src_000005_op_havoc_rep_8 3 110 | decomp-bad-inputs/02/id_000000_sig_11_src_000001_op_havoc_rep_4 4 111 | decomp-bad-inputs/02/id_000001_sig_11_src_000001_op_havoc_rep_2 4 112 | decomp-bad-inputs/02/id_000002_sig_11_src_000001_op_havoc_rep_2 4 113 | decomp-bad-inputs/02/id_000003_sig_11_src_000002_op_havoc_rep_4 3 114 | decomp-bad-inputs/03/id_000000_sig_11_src_000001_op_havoc_rep_4 3 115 | decomp-bad-inputs/03/id_000001_sig_11_src_000001_op_havoc_rep_2 4 116 | decomp-bad-inputs/03/id_000002_sig_11_src_000001_op_havoc_rep_2 3 117 | decomp-bad-inputs/03/id_000003_sig_11_src_000001_op_havoc_rep_2 4 118 | decomp-bad-inputs/03/id_000004_sig_11_src_000002_op_havoc_rep_4 0 119 | decomp-bad-inputs/03/id_000005_sig_11_src_000005_op_flip1_pos_20 3 120 | decomp-bad-inputs/03/id_000006_sig_11_src_000005_op_flip1_pos_22 3 121 | decomp-bad-inputs/03/id_000007_sig_11_src_000005_op_flip4_pos_24 3 122 | decomp-bad-inputs/03/id_000008_sig_11_src_000005_op_arith8_pos_3_val__10 3 123 | decomp-bad-inputs/03/id_000009_sig_11_src_000005_op_arith8_pos_3_val__18 3 124 | decomp-bad-inputs/03/id_000010_sig_11_src_000005_op_int8_pos_23_val_-1 3 125 | decomp-bad-inputs/03/id_000011_sig_11_src_000005_op_havoc_rep_4 3 126 | decomp-bad-inputs/03/id_000012_sig_11_src_000005_op_havoc_rep_16 3 127 | decomp-bad-inputs/03/id_000013_sig_11_src_000005_op_havoc_rep_8 3 128 | decomp-bad-inputs/03/id_000014_sig_11_src_000005_op_havoc_rep_2 3 129 | decomp-bad-inputs/03/id_000015_sig_11_src_000005_op_havoc_rep_2 3 130 | decomp-bad-inputs/03/id_000016_sig_11_src_000005_op_havoc_rep_2 3 131 | decomp-bad-inputs/03/id_000017_sig_11_src_000005_op_havoc_rep_2 3 132 | decomp-bad-inputs/03/id_000018_sig_11_src_000082_op_flip32_pos_19 3 133 | decomp-bad-inputs/03/id_000019_sig_11_src_000082_op_int32_pos_19_val_be__65535 3 134 | decomp-bad-inputs/03/id_000020_sig_11_src_000155_op_flip2_pos_28 3 135 | decomp-bad-inputs/03/id_000021_sig_11_src_000166_op_flip2_pos_10 3 136 | decomp-bad-inputs/03/id_000022_sig_11_src_000156_op_int16_pos_26_val_-129 3 137 | decomp-bad-inputs/03/id_000023_sig_11_src_000193_op_int16_pos_31_val_be__32 3 138 | decomp-bad-inputs/03/id_000024_sig_11_src_000230_op_havoc_rep_2 3 139 | decomp-bad-inputs/03/id_000025_sig_11_src_000230_op_havoc_rep_2 3 140 | decomp-bad-inputs/03/id_000026_sig_11_src_000245_op_havoc_rep_2 3 141 | decomp-bad-inputs/03/id_000027_sig_11_src_000254_op_flip1_pos_32 3 142 | decomp-bad-inputs/03/id_000028_sig_11_src_000079_op_int32_pos_20_val_-128 3 143 | decomp-bad-inputs/03/id_000029_sig_11_src_000247_op_havoc_rep_4 3 144 | decomp-bad-inputs/03/id_000030_sig_11_src_000257_op_havoc_rep_2 3 145 | decomp-bad-inputs/03/id_000031_sig_11_src_000257_op_havoc_rep_2 3 146 | decomp-bad-inputs/03/id_000032_sig_11_src_000248_op_havoc_rep_2 3 147 | decomp-bad-inputs/03/id_000033_sig_11_src_000291_op_havoc_rep_2 3 148 | decomp-bad-inputs/03/id_000034_sig_11_src_000301_op_havoc_rep_64 3 149 | decomp-bad-inputs/03/id_000035_sig_11_src_000252_op_havoc_rep_2 3 150 | decomp-bad-inputs/03/id_000036_sig_11_src_000310_op_arith32_pos_20_val_be_-8 3 151 | decomp-bad-inputs/03/id_000037_sig_11_src_000319_000163_op_splice_rep_2 3 152 | decomp-bad-inputs/03/id_000038_sig_11_src_000320_op_flip1_pos_27 3 153 | decomp-bad-inputs/03/id_000039_sig_11_src_000320_op_ext_AO_pos_43 3 154 | decomp-bad-inputs/03/id_000040_sig_11_src_000326_op_havoc_rep_32 3 155 | decomp-bad-inputs/03/id_000041_sig_11_src_000016_op_havoc_rep_4 0 156 | decomp-bad-inputs/03/id_000042_sig_11_src_000205_000322_op_splice_rep_64 3 157 | decomp-bad-inputs/03/id_000043_sig_11_src_000001_000321_op_splice_rep_4 3 158 | decomp-bad-inputs/04/id_000000_sig_11_src_000001_op_havoc_rep_2 4 159 | decomp-bad-inputs/04/id_000001_sig_11_src_000001_op_havoc_rep_2 4 160 | decomp-bad-inputs/04/id_000002_sig_11_src_000001_op_havoc_rep_2 4 161 | decomp-bad-inputs/04/id_000003_sig_11_src_000001_op_havoc_rep_4 0 162 | decomp-bad-inputs/04/id_000004_sig_11_src_000034_op_int32_pos_44_val__1000 0 163 | decomp-bad-inputs/04/id_000005_sig_11_src_000063_op_int32_pos_17_val__1000 0 164 | decomp-bad-inputs/04/id_000006_sig_11_src_000019_000004_op_splice_rep_2 4 165 | decomp-bad-inputs/04/id_000007_sig_11_src_000047_000264_op_splice_rep_2 0 166 | decomp-bad-inputs/04/id_000008_sig_11_src_000194_000266_op_splice_rep_2 0 167 | decomp-bad-inputs/04/id_000009_sig_11_src_000134_000005_op_splice_rep_2 4 168 | decomp-bad-inputs/04/id_000010_sig_11_src_000220_000226_op_splice_rep_8 4 169 | decomp-bad-inputs/05/id_000000_sig_06_src_000001_op_flip8_pos_12 3 170 | decomp-bad-inputs/05/id_000001_sig_06_src_000001_op_havoc_rep_16 3 171 | decomp-bad-inputs/05/id_000002_sig_06_src_000001_op_havoc_rep_4 3 172 | decomp-bad-inputs/05/id_000003_sig_06_src_000001_op_havoc_rep_4 3 173 | decomp-bad-inputs/05/id_000004_sig_06_src_000001_op_havoc_rep_4 3 174 | decomp-bad-inputs/05/id_000005_sig_06_src_000012_op_flip1_pos_13 3 175 | decomp-bad-inputs/05/id_000006_sig_06_src_000012_op_havoc_rep_16 3 176 | decomp-bad-inputs/05/id_000007_sig_06_src_000108_op_arith16_pos_14_val_-2 3 177 | decomp-bad-inputs/05/id_000008_sig_06_src_000003_op_havoc_rep_4 3 178 | decomp-bad-inputs/05/id_000009_sig_06_src_000140_op_flip1_pos_15 3 179 | decomp-bad-inputs/05/id_000010_sig_06_src_000092_op_flip4_pos_3 3 180 | decomp-bad-inputs/05/id_000011_sig_06_src_000155_op_havoc_rep_8 3 181 | decomp-bad-inputs/05/id_000012_sig_06_src_000163_000116_op_splice_rep_8 0 182 | decomp-bad-inputs/05/id_000013_sig_06_src_000171_op_havoc_rep_2 0 183 | decomp-bad-inputs/05/id_000014_sig_06_src_000170_op_havoc_rep_8 3 184 | decomp-bad-inputs/06/id_000001_sig_06_src_000001_op_havoc_rep_16 3 185 | decomp-bad-inputs/06/id_000002_sig_06_src_000001_op_havoc_rep_4 3 186 | decomp-bad-inputs/06/id_000003_sig_06_src_000001_op_havoc_rep_8 3 187 | decomp-bad-inputs/06/id_000004_sig_06_src_000001_op_havoc_rep_8 3 188 | decomp-bad-inputs/06/id_000005_sig_06_src_000001_op_havoc_rep_4 3 189 | decomp-bad-inputs/06/id_000007_sig_06_src_000121_op_arith8_pos_12_val__26 3 190 | decomp-bad-inputs/06/id_000008_sig_06_src_000137_op_flip1_pos_58 3 191 | decomp-bad-inputs/07/id_000000_sig_06_src_000001_op_havoc_rep_8 3 192 | decomp-bad-inputs/07/id_000001_sig_06_src_000019_op_havoc_rep_4 3 193 | decomp-bad-inputs/07/id_000002_sig_06_src_000021_op_havoc_rep_8 3 194 | decomp-bad-inputs/08/id_000000_sig_06_src_000157_op_havoc_rep_4 0 195 | decomp-bad-inputs/09/id_000000_sig_11_src_000001_op_int16_pos_11_val_be_-128 3 196 | decomp-bad-inputs/09/id_000001_sig_11_src_000001_op_havoc_rep_2 3 197 | decomp-bad-inputs/09/id_000002_sig_11_src_000023_op_flip2_pos_12 3 198 | decomp-bad-inputs/09/id_000003_sig_11_src_000023_op_arith8_pos_14_val_-28 3 199 | decomp-bad-inputs/09/id_000004_sig_11_src_000075_op_flip4_pos_61 3 200 | decomp-bad-inputs/09/id_000005_sig_11_src_000075_op_arith8_pos_57_val_-5 3 201 | decomp-bad-inputs/09/id_000006_sig_11_src_000075_op_arith16_pos_62_val__28 3 202 | decomp-bad-inputs/09/id_000007_sig_11_src_000075_op_havoc_rep_32 3 203 | decomp-bad-inputs/09/id_000008_sig_11_src_000133_op_arith8_pos_13_val_-34 3 204 | decomp-bad-inputs/09/id_000009_sig_11_src_000133_op_havoc_rep_2 3 205 | decomp-bad-inputs/09/id_000010_sig_11_src_000133_op_havoc_rep_4 3 206 | decomp-bad-inputs/09/id_000011_sig_11_src_000151_op_havoc_rep_2 3 207 | decomp-bad-inputs/09/id_000012_sig_11_src_000212_op_arith8_pos_45_val__9 3 208 | decomp-bad-inputs/09/id_000013_sig_11_src_000212_op_int32_pos_15_val__32767 3 209 | decomp-bad-inputs/09/id_000014_sig_11_src_000212_op_havoc_rep_2 3 210 | decomp-bad-inputs/09/id_000015_sig_11_src_000087_op_arith8_pos_20_val__11 3 211 | decomp-bad-inputs/09/id_000016_sig_11_src_000098_op_flip1_pos_13 3 212 | decomp-bad-inputs/09/id_000017_sig_11_src_000098_op_flip2_pos_13 3 213 | decomp-bad-inputs/09/id_000018_sig_11_src_000098_op_flip4_pos_12 3 214 | decomp-bad-inputs/09/id_000019_sig_11_src_000098_op_havoc_rep_2 3 215 | decomp-bad-inputs/09/id_000020_sig_11_src_000133_op_havoc_rep_2 3 216 | decomp-bad-inputs/09/id_000021_sig_11_src_000134_op_int16_pos_13_val_be_-128 3 217 | decomp-bad-inputs/09/id_000022_sig_11_src_000218_op_flip2_pos_40 3 218 | decomp-bad-inputs/09/id_000023_sig_11_src_000218_op_int16_pos_111_val__0 3 219 | decomp-bad-inputs/09/id_000025_sig_11_src_000235_op_havoc_rep_8 3 220 | decomp-bad-inputs/09/id_000026_sig_11_src_000143_op_arith8_pos_19_val__3 3 221 | decomp-bad-inputs/09/id_000027_sig_11_src_000024_000141_op_splice_rep_4 3 222 | decomp-bad-inputs/09/id_000028_sig_11_src_000219_op_arith16_pos_62_val_be_-23 3 223 | decomp-bad-inputs/09/id_000031_sig_11_src_000256_op_flip2_pos_480 3 224 | decomp-bad-inputs/09/id_000032_sig_11_src_000256_op_flip4_pos_248 3 225 | decomp-bad-inputs/09/id_000033_sig_11_src_000256_op_flip4_pos_364 3 226 | decomp-bad-inputs/09/id_000034_sig_06_src_000256_op_arith8_pos_499_val__8 3 227 | decomp-bad-inputs/09/id_000036_sig_11_src_000256_000131_op_splice_rep_8 3 228 | decomp-bad-inputs/09/id_000037_sig_11_src_000260_op_flip2_pos_264 3 229 | decomp-bad-inputs/09/id_000038_sig_11_src_000260_op_arith16_pos_254_val_-29 3 230 | decomp-bad-inputs/09/id_000039_sig_11_src_000260_op_int16_pos_397_val__0 3 231 | decomp-bad-inputs/09/id_000040_sig_11_src_000272_000023_op_splice_rep_4 3 232 | decomp-bad-inputs/09/id_000041_sig_11_src_000253_op_havoc_rep_8 3 233 | -------------------------------------------------------------------------------- /src/tinflate.c: -------------------------------------------------------------------------------- 1 | /* 2 | * uzlib - tiny deflate/inflate library (deflate, gzip, zlib) 3 | * 4 | * Copyright (c) 2003 by Joergen Ibsen / Jibz 5 | * All Rights Reserved 6 | * http://www.ibsensoftware.com/ 7 | * 8 | * Copyright (c) 2014-2018 by Paul Sokolovsky 9 | * 10 | * This software is provided 'as-is', without any express 11 | * or implied warranty. In no event will the authors be 12 | * held liable for any damages arising from the use of 13 | * this software. 14 | * 15 | * Permission is granted to anyone to use this software 16 | * for any purpose, including commercial applications, 17 | * and to alter it and redistribute it freely, subject to 18 | * the following restrictions: 19 | * 20 | * 1. The origin of this software must not be 21 | * misrepresented; you must not claim that you 22 | * wrote the original software. If you use this 23 | * software in a product, an acknowledgment in 24 | * the product documentation would be appreciated 25 | * but is not required. 26 | * 27 | * 2. Altered source versions must be plainly marked 28 | * as such, and must not be misrepresented as 29 | * being the original software. 30 | * 31 | * 3. This notice may not be removed or altered from 32 | * any source distribution. 33 | */ 34 | 35 | #include 36 | #include 37 | #include "tinf.h" 38 | 39 | #define UZLIB_DUMP_ARRAY(heading, arr, size) \ 40 | { \ 41 | printf("%s", heading); \ 42 | for (int i = 0; i < size; ++i) { \ 43 | printf(" %d", (arr)[i]); \ 44 | } \ 45 | printf("\n"); \ 46 | } 47 | 48 | uint32_t tinf_get_le_uint32(TINF_DATA *d); 49 | uint32_t tinf_get_be_uint32(TINF_DATA *d); 50 | 51 | /* --------------------------------------------------- * 52 | * -- uninitialized global data (static structures) -- * 53 | * --------------------------------------------------- */ 54 | 55 | #ifdef RUNTIME_BITS_TABLES 56 | 57 | /* extra bits and base tables for length codes */ 58 | unsigned char length_bits[30]; 59 | unsigned short length_base[30]; 60 | 61 | /* extra bits and base tables for distance codes */ 62 | unsigned char dist_bits[30]; 63 | unsigned short dist_base[30]; 64 | 65 | #else 66 | 67 | const unsigned char length_bits[30] = { 68 | 0, 0, 0, 0, 0, 0, 0, 0, 69 | 1, 1, 1, 1, 2, 2, 2, 2, 70 | 3, 3, 3, 3, 4, 4, 4, 4, 71 | 5, 5, 5, 5 72 | }; 73 | const unsigned short length_base[30] = { 74 | 3, 4, 5, 6, 7, 8, 9, 10, 75 | 11, 13, 15, 17, 19, 23, 27, 31, 76 | 35, 43, 51, 59, 67, 83, 99, 115, 77 | 131, 163, 195, 227, 258 78 | }; 79 | 80 | const unsigned char dist_bits[30] = { 81 | 0, 0, 0, 0, 1, 1, 2, 2, 82 | 3, 3, 4, 4, 5, 5, 6, 6, 83 | 7, 7, 8, 8, 9, 9, 10, 10, 84 | 11, 11, 12, 12, 13, 13 85 | }; 86 | const unsigned short dist_base[30] = { 87 | 1, 2, 3, 4, 5, 7, 9, 13, 88 | 17, 25, 33, 49, 65, 97, 129, 193, 89 | 257, 385, 513, 769, 1025, 1537, 2049, 3073, 90 | 4097, 6145, 8193, 12289, 16385, 24577 91 | }; 92 | 93 | #endif 94 | 95 | /* special ordering of code length codes */ 96 | const unsigned char clcidx[] = { 97 | 16, 17, 18, 0, 8, 7, 9, 6, 98 | 10, 5, 11, 4, 12, 3, 13, 2, 99 | 14, 1, 15 100 | }; 101 | 102 | /* ----------------------- * 103 | * -- utility functions -- * 104 | * ----------------------- */ 105 | 106 | #ifdef RUNTIME_BITS_TABLES 107 | /* build extra bits and base tables */ 108 | static void tinf_build_bits_base(unsigned char *bits, unsigned short *base, int delta, int first) 109 | { 110 | int i, sum; 111 | 112 | /* build bits table */ 113 | for (i = 0; i < delta; ++i) bits[i] = 0; 114 | for (i = 0; i < 30 - delta; ++i) bits[i + delta] = i / delta; 115 | 116 | /* build base table */ 117 | for (sum = first, i = 0; i < 30; ++i) 118 | { 119 | base[i] = sum; 120 | sum += 1 << bits[i]; 121 | } 122 | } 123 | #endif 124 | 125 | /* build the fixed huffman trees */ 126 | static void tinf_build_fixed_trees(TINF_TREE *lt, TINF_TREE *dt) 127 | { 128 | int i; 129 | 130 | /* build fixed length tree */ 131 | for (i = 0; i < 7; ++i) lt->table[i] = 0; 132 | 133 | lt->table[7] = 24; 134 | lt->table[8] = 152; 135 | lt->table[9] = 112; 136 | 137 | for (i = 0; i < 24; ++i) lt->trans[i] = 256 + i; 138 | for (i = 0; i < 144; ++i) lt->trans[24 + i] = i; 139 | for (i = 0; i < 8; ++i) lt->trans[24 + 144 + i] = 280 + i; 140 | for (i = 0; i < 112; ++i) lt->trans[24 + 144 + 8 + i] = 144 + i; 141 | 142 | /* build fixed distance tree */ 143 | for (i = 0; i < 5; ++i) dt->table[i] = 0; 144 | 145 | dt->table[5] = 32; 146 | 147 | for (i = 0; i < 32; ++i) dt->trans[i] = i; 148 | } 149 | 150 | /* given an array of code lengths, build a tree */ 151 | static void tinf_build_tree(TINF_TREE *t, const unsigned char *lengths, unsigned int num) 152 | { 153 | unsigned short offs[16]; 154 | unsigned int i, sum; 155 | 156 | /* clear code length count table */ 157 | for (i = 0; i < 16; ++i) t->table[i] = 0; 158 | 159 | /* scan symbol lengths, and sum code length counts */ 160 | for (i = 0; i < num; ++i) t->table[lengths[i]]++; 161 | 162 | #if UZLIB_CONF_DEBUG_LOG >= 2 163 | UZLIB_DUMP_ARRAY("codelen counts:", t->table, TINF_ARRAY_SIZE(t->table)); 164 | #endif 165 | 166 | /* In the lengths array, 0 means unused code. So, t->table[0] now contains 167 | number of unused codes. But table's purpose is to contain # of codes of 168 | particular length, and there're 0 codes of length 0. */ 169 | t->table[0] = 0; 170 | 171 | /* compute offset table for distribution sort */ 172 | for (sum = 0, i = 0; i < 16; ++i) 173 | { 174 | offs[i] = sum; 175 | sum += t->table[i]; 176 | } 177 | 178 | #if UZLIB_CONF_DEBUG_LOG >= 2 179 | UZLIB_DUMP_ARRAY("codelen offsets:", offs, TINF_ARRAY_SIZE(offs)); 180 | #endif 181 | 182 | /* create code->symbol translation table (symbols sorted by code) */ 183 | for (i = 0; i < num; ++i) 184 | { 185 | if (lengths[i]) t->trans[offs[lengths[i]]++] = i; 186 | } 187 | } 188 | 189 | /* ---------------------- * 190 | * -- decode functions -- * 191 | * ---------------------- */ 192 | 193 | unsigned char uzlib_get_byte(TINF_DATA *d) 194 | { 195 | /* If end of source buffer is not reached, return next byte from source 196 | buffer. */ 197 | if (d->source < d->source_limit) { 198 | return *d->source++; 199 | } 200 | 201 | /* Otherwise if there's callback and we haven't seen EOF yet, try to 202 | read next byte using it. (Note: the callback can also update ->source 203 | and ->source_limit). */ 204 | if (d->readSource && !d->eof) { 205 | int val = d->readSource(d); 206 | if (val >= 0) { 207 | return (unsigned char)val; 208 | } 209 | } 210 | 211 | /* Otherwise, we hit EOF (either from ->readSource() or from exhaustion 212 | of the buffer), and it will be "sticky", i.e. further calls to this 213 | function will end up here too. */ 214 | d->eof = true; 215 | 216 | return 0; 217 | } 218 | 219 | uint32_t tinf_get_le_uint32(TINF_DATA *d) 220 | { 221 | uint32_t val = 0; 222 | int i; 223 | for (i = 4; i--;) { 224 | val = val >> 8 | ((uint32_t)uzlib_get_byte(d)) << 24; 225 | } 226 | return val; 227 | } 228 | 229 | uint32_t tinf_get_be_uint32(TINF_DATA *d) 230 | { 231 | uint32_t val = 0; 232 | int i; 233 | for (i = 4; i--;) { 234 | val = val << 8 | uzlib_get_byte(d); 235 | } 236 | return val; 237 | } 238 | 239 | /* get one bit from source stream */ 240 | static int tinf_getbit(TINF_DATA *d) 241 | { 242 | unsigned int bit; 243 | 244 | /* check if tag is empty */ 245 | if (!d->bitcount--) 246 | { 247 | /* load next tag */ 248 | d->tag = uzlib_get_byte(d); 249 | d->bitcount = 7; 250 | } 251 | 252 | /* shift bit out of tag */ 253 | bit = d->tag & 0x01; 254 | d->tag >>= 1; 255 | 256 | return bit; 257 | } 258 | 259 | /* read a num bit value from a stream and add base */ 260 | static unsigned int tinf_read_bits(TINF_DATA *d, int num, int base) 261 | { 262 | unsigned int val = 0; 263 | 264 | /* read num bits */ 265 | if (num) 266 | { 267 | unsigned int limit = 1 << (num); 268 | unsigned int mask; 269 | 270 | for (mask = 1; mask < limit; mask *= 2) 271 | if (tinf_getbit(d)) val += mask; 272 | } 273 | 274 | return val + base; 275 | } 276 | 277 | /* given a data stream and a tree, decode a symbol */ 278 | static int tinf_decode_symbol(TINF_DATA *d, TINF_TREE *t) 279 | { 280 | int sum = 0, cur = 0, len = 0; 281 | 282 | /* get more bits while code value is above sum */ 283 | do { 284 | 285 | cur = 2*cur + tinf_getbit(d); 286 | 287 | if (++len == TINF_ARRAY_SIZE(t->table)) { 288 | return TINF_DATA_ERROR; 289 | } 290 | 291 | sum += t->table[len]; 292 | cur -= t->table[len]; 293 | 294 | } while (cur >= 0); 295 | 296 | sum += cur; 297 | #if UZLIB_CONF_PARANOID_CHECKS 298 | if (sum < 0 || sum >= TINF_ARRAY_SIZE(t->trans)) { 299 | return TINF_DATA_ERROR; 300 | } 301 | #endif 302 | 303 | return t->trans[sum]; 304 | } 305 | 306 | /* given a data stream, decode dynamic trees from it */ 307 | static int tinf_decode_trees(TINF_DATA *d, TINF_TREE *lt, TINF_TREE *dt) 308 | { 309 | /* code lengths for 288 literal/len symbols and 32 dist symbols */ 310 | unsigned char lengths[288+32]; 311 | unsigned int hlit, hdist, hclen, hlimit; 312 | unsigned int i, num, length; 313 | 314 | /* get 5 bits HLIT (257-286) */ 315 | hlit = tinf_read_bits(d, 5, 257); 316 | 317 | /* get 5 bits HDIST (1-32) */ 318 | hdist = tinf_read_bits(d, 5, 1); 319 | 320 | /* get 4 bits HCLEN (4-19) */ 321 | hclen = tinf_read_bits(d, 4, 4); 322 | 323 | for (i = 0; i < 19; ++i) lengths[i] = 0; 324 | 325 | /* read code lengths for code length alphabet */ 326 | for (i = 0; i < hclen; ++i) 327 | { 328 | /* get 3 bits code length (0-7) */ 329 | unsigned int clen = tinf_read_bits(d, 3, 0); 330 | 331 | lengths[clcidx[i]] = clen; 332 | } 333 | 334 | /* build code length tree, temporarily use length tree */ 335 | tinf_build_tree(lt, lengths, 19); 336 | 337 | /* decode code lengths for the dynamic trees */ 338 | hlimit = hlit + hdist; 339 | for (num = 0; num < hlimit; ) 340 | { 341 | int sym = tinf_decode_symbol(d, lt); 342 | unsigned char fill_value = 0; 343 | int lbits, lbase = 3; 344 | 345 | /* error decoding */ 346 | if (sym < 0) return sym; 347 | 348 | switch (sym) 349 | { 350 | case 16: 351 | /* copy previous code length 3-6 times (read 2 bits) */ 352 | if (num == 0) return TINF_DATA_ERROR; 353 | fill_value = lengths[num - 1]; 354 | lbits = 2; 355 | break; 356 | case 17: 357 | /* repeat code length 0 for 3-10 times (read 3 bits) */ 358 | lbits = 3; 359 | break; 360 | case 18: 361 | /* repeat code length 0 for 11-138 times (read 7 bits) */ 362 | lbits = 7; 363 | lbase = 11; 364 | break; 365 | default: 366 | /* values 0-15 represent the actual code lengths */ 367 | lengths[num++] = sym; 368 | /* continue the for loop */ 369 | continue; 370 | } 371 | 372 | /* special code length 16-18 are handled here */ 373 | length = tinf_read_bits(d, lbits, lbase); 374 | if (num + length > hlimit) return TINF_DATA_ERROR; 375 | for (; length; --length) 376 | { 377 | lengths[num++] = fill_value; 378 | } 379 | } 380 | 381 | #if UZLIB_CONF_DEBUG_LOG >= 2 382 | printf("lit code lengths (%d):", hlit); 383 | UZLIB_DUMP_ARRAY("", lengths, hlit); 384 | printf("dist code lengths (%d):", hdist); 385 | UZLIB_DUMP_ARRAY("", lengths + hlit, hdist); 386 | #endif 387 | 388 | #if UZLIB_CONF_PARANOID_CHECKS 389 | /* Check that there's "end of block" symbol */ 390 | if (lengths[256] == 0) { 391 | return TINF_DATA_ERROR; 392 | } 393 | #endif 394 | 395 | /* build dynamic trees */ 396 | tinf_build_tree(lt, lengths, hlit); 397 | tinf_build_tree(dt, lengths + hlit, hdist); 398 | 399 | return TINF_OK; 400 | } 401 | 402 | /* ----------------------------- * 403 | * -- block inflate functions -- * 404 | * ----------------------------- */ 405 | 406 | /* given a stream and two trees, inflate next chunk of output (a byte or more) */ 407 | static int tinf_inflate_block_data(TINF_DATA *d, TINF_TREE *lt, TINF_TREE *dt) 408 | { 409 | if (d->curlen == 0) { 410 | unsigned int offs; 411 | int dist; 412 | int sym = tinf_decode_symbol(d, lt); 413 | //printf("huff sym: %02x\n", sym); 414 | 415 | if (d->eof) { 416 | return TINF_DATA_ERROR; 417 | } 418 | 419 | /* literal byte */ 420 | if (sym < 256) { 421 | TINF_PUT(d, sym); 422 | return TINF_OK; 423 | } 424 | 425 | /* end of block */ 426 | if (sym == 256) { 427 | return TINF_DONE; 428 | } 429 | 430 | /* substring from sliding dictionary */ 431 | sym -= 257; 432 | if (sym >= 29) { 433 | return TINF_DATA_ERROR; 434 | } 435 | 436 | /* possibly get more bits from length code */ 437 | d->curlen = tinf_read_bits(d, length_bits[sym], length_base[sym]); 438 | 439 | dist = tinf_decode_symbol(d, dt); 440 | if (dist >= 30) { 441 | return TINF_DATA_ERROR; 442 | } 443 | 444 | /* possibly get more bits from distance code */ 445 | offs = tinf_read_bits(d, dist_bits[dist], dist_base[dist]); 446 | 447 | /* calculate and validate actual LZ offset to use */ 448 | if (d->dict_ring) { 449 | if (offs > d->dict_size) { 450 | return TINF_DICT_ERROR; 451 | } 452 | /* Note: unlike full-dest-in-memory case below, we don't 453 | try to catch offset which points to not yet filled 454 | part of the dictionary here. Doing so would require 455 | keeping another variable to track "filled in" size 456 | of the dictionary. Appearance of such an offset cannot 457 | lead to accessing memory outside of the dictionary 458 | buffer, and clients which don't want to leak unrelated 459 | information, should explicitly initialize dictionary 460 | buffer passed to uzlib. */ 461 | 462 | d->lzOff = d->dict_idx - offs; 463 | if (d->lzOff < 0) { 464 | d->lzOff += d->dict_size; 465 | } 466 | } else { 467 | /* catch trying to point before the start of dest buffer */ 468 | if (offs > d->dest - d->destStart) { 469 | return TINF_DATA_ERROR; 470 | } 471 | d->lzOff = -offs; 472 | } 473 | } 474 | 475 | /* copy next byte from dict substring */ 476 | if (d->dict_ring) { 477 | TINF_PUT(d, d->dict_ring[d->lzOff]); 478 | if ((unsigned)++d->lzOff == d->dict_size) { 479 | d->lzOff = 0; 480 | } 481 | } else { 482 | #if UZLIB_CONF_USE_MEMCPY 483 | /* copy as much as possible, in one memcpy() call */ 484 | unsigned int to_copy = d->curlen, dest_len = d->dest_limit - d->dest; 485 | if (to_copy > dest_len) { 486 | to_copy = dest_len; 487 | } 488 | memcpy(d->dest, d->dest + d->lzOff, to_copy); 489 | d->dest += to_copy; 490 | d->curlen -= to_copy; 491 | return TINF_OK; 492 | #else 493 | d->dest[0] = d->dest[d->lzOff]; 494 | d->dest++; 495 | #endif 496 | } 497 | d->curlen--; 498 | return TINF_OK; 499 | } 500 | 501 | /* inflate next byte from uncompressed block of data */ 502 | static int tinf_inflate_uncompressed_block(TINF_DATA *d) 503 | { 504 | if (d->curlen == 0) { 505 | unsigned int length, invlength; 506 | 507 | /* get length */ 508 | length = uzlib_get_byte(d); 509 | length += 256 * uzlib_get_byte(d); 510 | /* get one's complement of length */ 511 | invlength = uzlib_get_byte(d); 512 | invlength += 256 * uzlib_get_byte(d); 513 | /* check length */ 514 | if (length != (~invlength & 0x0000ffff)) return TINF_DATA_ERROR; 515 | 516 | /* increment length to properly return TINF_DONE below, without 517 | producing data at the same time */ 518 | d->curlen = length + 1; 519 | 520 | /* make sure we start next block on a byte boundary */ 521 | d->bitcount = 0; 522 | } 523 | 524 | if (--d->curlen == 0) { 525 | return TINF_DONE; 526 | } 527 | 528 | unsigned char c = uzlib_get_byte(d); 529 | TINF_PUT(d, c); 530 | return TINF_OK; 531 | } 532 | 533 | /* ---------------------- * 534 | * -- public functions -- * 535 | * ---------------------- */ 536 | 537 | /* initialize global (static) data */ 538 | void uzlib_init(void) 539 | { 540 | #ifdef RUNTIME_BITS_TABLES 541 | /* build extra bits and base tables */ 542 | tinf_build_bits_base(length_bits, length_base, 4, 3); 543 | tinf_build_bits_base(dist_bits, dist_base, 2, 1); 544 | 545 | /* fix a special case */ 546 | length_bits[28] = 0; 547 | length_base[28] = 258; 548 | #endif 549 | } 550 | 551 | /* initialize decompression structure */ 552 | void uzlib_uncompress_init(TINF_DATA *d, void *dict, unsigned int dictLen) 553 | { 554 | d->eof = 0; 555 | d->bitcount = 0; 556 | d->bfinal = 0; 557 | d->btype = -1; 558 | d->dict_size = dictLen; 559 | d->dict_ring = dict; 560 | d->dict_idx = 0; 561 | d->curlen = 0; 562 | } 563 | 564 | /* inflate next output bytes from compressed stream */ 565 | int uzlib_uncompress(TINF_DATA *d) 566 | { 567 | do { 568 | int res; 569 | 570 | /* start a new block */ 571 | if (d->btype == -1) { 572 | int old_btype; 573 | next_blk: 574 | old_btype = d->btype; 575 | /* read final block flag */ 576 | d->bfinal = tinf_getbit(d); 577 | /* read block type (2 bits) */ 578 | d->btype = tinf_read_bits(d, 2, 0); 579 | 580 | #if UZLIB_CONF_DEBUG_LOG >= 1 581 | printf("Started new block: type=%d final=%d\n", d->btype, d->bfinal); 582 | #endif 583 | 584 | if (d->btype == 1 && old_btype != 1) { 585 | /* build fixed huffman trees */ 586 | tinf_build_fixed_trees(&d->ltree, &d->dtree); 587 | } else if (d->btype == 2) { 588 | /* decode trees from stream */ 589 | res = tinf_decode_trees(d, &d->ltree, &d->dtree); 590 | if (res != TINF_OK) { 591 | return res; 592 | } 593 | } 594 | } 595 | 596 | /* process current block */ 597 | switch (d->btype) 598 | { 599 | case 0: 600 | /* decompress uncompressed block */ 601 | res = tinf_inflate_uncompressed_block(d); 602 | break; 603 | case 1: 604 | case 2: 605 | /* decompress block with fixed/dynamic huffman trees */ 606 | /* trees were decoded previously, so it's the same routine for both */ 607 | res = tinf_inflate_block_data(d, &d->ltree, &d->dtree); 608 | break; 609 | default: 610 | return TINF_DATA_ERROR; 611 | } 612 | 613 | if (res == TINF_DONE && !d->bfinal) { 614 | /* the block has ended (without producing more data), but we 615 | can't return without data, so start procesing next block */ 616 | goto next_blk; 617 | } 618 | 619 | if (res != TINF_OK) { 620 | return res; 621 | } 622 | 623 | } while (d->dest < d->dest_limit); 624 | 625 | return TINF_OK; 626 | } 627 | 628 | /* inflate next output bytes from compressed stream, updating 629 | checksum, and at the end of stream, verify it */ 630 | int uzlib_uncompress_chksum(TINF_DATA *d) 631 | { 632 | int res; 633 | unsigned char *data = d->dest; 634 | 635 | res = uzlib_uncompress(d); 636 | 637 | if (res < 0) return res; 638 | 639 | switch (d->checksum_type) { 640 | 641 | case TINF_CHKSUM_ADLER: 642 | d->checksum = uzlib_adler32(data, d->dest - data, d->checksum); 643 | break; 644 | 645 | case TINF_CHKSUM_CRC: 646 | d->checksum = uzlib_crc32(data, d->dest - data, d->checksum); 647 | break; 648 | } 649 | 650 | if (res == TINF_DONE) { 651 | unsigned int val; 652 | 653 | switch (d->checksum_type) { 654 | 655 | case TINF_CHKSUM_ADLER: 656 | val = tinf_get_be_uint32(d); 657 | if (d->checksum != val) { 658 | return TINF_CHKSUM_ERROR; 659 | } 660 | break; 661 | 662 | case TINF_CHKSUM_CRC: 663 | val = tinf_get_le_uint32(d); 664 | if (~d->checksum != val) { 665 | return TINF_CHKSUM_ERROR; 666 | } 667 | // Uncompressed size. TODO: Check 668 | val = tinf_get_le_uint32(d); 669 | break; 670 | } 671 | } 672 | 673 | return res; 674 | } 675 | --------------------------------------------------------------------------------