Makefile and README doc
authorTJ <hacker@iam.tj>
Fri, 8 Apr 2016 19:50:17 +0000 (20:50 +0100)
committerTJ <hacker@iam.tj>
Fri, 8 Apr 2016 19:50:17 +0000 (20:50 +0100)
Makefile [new file with mode: 0644]
README [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..4431e86
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,19 @@
+PROG = fwlzw
+OBJS = lzw_decode.o lzw_encode.o heap_reap.o firmware_lzw.o
+CFLAGS = -std=c11 -g
+
+export PROG
+
+$(PROG): $(OBJS)
+       $(CC) $(CFLAGS) -o $@ $(OBJS)
+
+%.c:
+       $(CC) $(CFLAGS) -c $@
+
+clean:
+       -rm -f $(PROG) $(OBJS)
+
+tests:
+       $(MAKE) -C testsuite
+
+.PHONY: clean
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..7240339
--- /dev/null
+++ b/README
@@ -0,0 +1,21 @@
+This fwlzw (de)compressor originally came from the FFMPEG project and was modified by Broadcom for
+(de)compressing device configuration files.
+
+In the Zyxel/MitraStar/Broadcom source-code packages provided by those companies there is a tool
+that runs on the host for compression only:
+
+hostTools/CompressConfig
+
+That tool includes the FFMPEG library code but does NOT provide its own source-code, as it should
+since the files are licensed on the terms of the GNU GPL.
+
+I've copied the files from the Zyxel source-code distribution as the basis of this host-based executable tool:
+
+ cp Zyxel/source/userspace/public/libs/cms_util/lzw*.c .
+ cp Zyxel/source/userspace/public/include/cms_lzw.h .
+
+With this tool it is possible to extract the payload from a firmware file. It is typically the second
+payload image in the file - the first being the CFE/Kernel/root file-system combination.
+
+My fwheader tool can report the location and size of the payloads in the firmware file. Those values can
+then be used to extract the payload to a file, which can be passed to this fwlzw tool.