diff --git a/tools/Makefile b/tools/Makefile
index 17887b2d48..6351e5bec4 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -18,16 +18,19 @@ CLEANALL := scramble descramble iriver sh2d bmp2rb rdf2binary convbdf \
all:
@echo "Run make in your build directory!"
-scramble: scramble.o iriver.o mi4.o gigabeat.o gigabeats.o telechips.o
+scramble: scramble.o iriver.o mi4.o gigabeat.o gigabeats.o telechips.o iaudio_bl_flash.o
descramble: descramble.o iriver.o gigabeat.o
-scramble.o: scramble.c iriver.h mi4.h gigabeat.h telechips.h
+scramble.o: scramble.c iriver.h mi4.h gigabeat.h telechips.h iaudio_bl_flash.h
descramble.o: descramble.c iriver.h gigabeat.h
iriver.o: iriver.c iriver.h
gigabeat.o: gigabeat.c gigabeat.h
gigabeats.o: gigabeats.c gigabeats.h
mi4.o: mi4.c mi4.h
telechips.o: telechips.c telechips.h
+iaudio_bl_flash.o: iaudio_bl_flash.c iaudio_bl_flash.h
+iaudio_bl_flash.c iaudio_bl_flash.h: iaudio_bl_flash.bmp bmp2rb
+ $(SILENT)./bmp2rb -f 7 -h . $< >iaudio_bl_flash.c
sh2d: sh2d.c
diff --git a/tools/iaudio_bl_flash.bmp b/tools/iaudio_bl_flash.bmp
new file mode 100644
index 0000000000..093fe1481d
Binary files /dev/null and b/tools/iaudio_bl_flash.bmp differ
diff --git a/tools/scramble.c b/tools/scramble.c
index 0a5230068c..b49bde10a2 100644
--- a/tools/scramble.c
+++ b/tools/scramble.c
@@ -26,6 +26,7 @@
#include "gigabeats.h"
#include "mi4.h"
#include "telechips.h"
+#include "iaudio_bl_flash.h"
int iaudio_encode(char *iname, char *oname, char *idstring);
int ipod_encode(char *iname, char *oname, int fw_ver, bool fake_rsrc);
@@ -77,6 +78,12 @@ void int2be(unsigned int val, unsigned char* addr)
addr[3] = val & 0xFF;
}
+void short2be(unsigned short val, unsigned char* addr)
+{
+ addr[0] = (val >> 8) & 0xff;
+ addr[1] = val & 0xFF;
+}
+
void usage(void)
{
printf("usage: scramble [options]