path: root/utils/jz4760_tools/Makefile
diff options
authorAmaury Pouly <>2015-03-23 21:30:06 +0100
committerGerrit Rockbox <>2015-03-29 14:08:28 +0200
commitb130b507349952cbab2a371628891de78cc8dda2 (patch)
treec2cc360f4fc8b14f704e93f89783ad7c31c2e67a /utils/jz4760_tools/Makefile
parent32154bfc0be5fa57ddc5f70c51c4162f4dceb0e8 (diff)
Add jz4760 tool
This tool can pack/unpack a jz4760 archive (like the one used for the fiio x1/x3/x5), and can descramble/scramble (it's the same operation) a firmware file (the sys.bin file in the archive). I did my best to keep the compatibility with the leaked Fiio/Ingenic tool which has the same name. I wrote the tools from scratch, but here are some remarks: - the format used is a slightly modified IHFS used in the older JZ4640 series, I used the information on the wiki about the IHFS format - the CRC computation done was already reversed engineered by someone on the forums but I realised this later - There are a few unknown fields in the headers, see comments in the source code - The firmware scrambling was discovered by pure guess, I realised there were some repetitve sequences, some I guessed it was a rotative XOR and ran some analysis to find the most probable sequence Change-Id: Ib83735b3db8475be5de9c94231714e88668a0340
Diffstat (limited to 'utils/jz4760_tools/Makefile')
1 files changed, 21 insertions, 0 deletions
diff --git a/utils/jz4760_tools/Makefile b/utils/jz4760_tools/Makefile
new file mode 100644
index 0000000000..847539e38c
--- /dev/null
+++ b/utils/jz4760_tools/Makefile
@@ -0,0 +1,21 @@
+CFLAGS=-g -std=c99 -Wall $(DEFINES) -Ilib
+SRC=$(wildcard *.c)
+SRCXX=$(wildcard *.cpp)
+EXEC=$(SRC:.c=) $(SRCXX:.cpp=)
+all: $(EXEC)
+%: %.c
+ $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
+%: %.cpp
+ $(CXX) $(CXXFLAGS) -o $@ $< $(LDFLAGS)
+ rm -fr $(EXEC)