#extract #image #file #path #directory #entries #reader🦀

jffs2

Rust implementation of jffs2 reader🦀

3 unstable releases

0.2.1 Jan 22, 2023
0.2.0 Jan 22, 2023
0.1.0 Jan 22, 2023

#56 in #entries

MIT license

1.5MB
33K SLoC

C 13K SLoC // 0.2% comments Shell 8K SLoC // 0.2% comments M4 7.5K SLoC // 0.2% comments Batch 1K SLoC Assembly 1K SLoC // 0.3% comments GNU Style Assembly 724 SLoC // 0.3% comments Rust 573 SLoC // 0.1% comments Perl 269 SLoC // 0.2% comments Automake 126 SLoC // 0.2% comments

Contains (autotools obfuscated code, 490KB) lzo/configure, (ELF exe/lib, 1KB) lzo/asm/i386/obj/elf32/lzo1c_s1.o, (ELF exe/lib, 1KB) lzo/asm/i386/obj/elf32/lzo1f_f1.o, (ELF exe/lib, 1KB) lzo/asm/i386/obj/elf32/lzo1x_f1.o, (ELF exe/lib, 1KB) lzo/asm/i386/obj/elf32/lzo1x_s1.o, (ELF exe/lib, 1KB) lzo/asm/i386/obj/elf32/lzo1y_f1.o and 8 more.

jffs2-rs

  • Rust implementation of jffs2 reader🦀

TL;DR

  • Extract the jffs2 image to the specified directory
    let path = Path::new("path/to/image.jffs2");
    let output_path = Path::new("/tmp/some/where");
    extract_jffs2(path, output_path).expect("Failed to extract file");
  • List all entries only
    let path = Path::new("path/to/image.jffs2");
    let entries = list_jffs2(path).expect("Failed to list entries");
    println!("{:?}", entries);

Current Status

  • The following compression algorithms are supported:
    • ✔ JFFS2_COMPR_NONE
    • ✔ JFFS2_COMPR_ZERO
    • ✔ JFFS2_COMPR_RTIME
    • ✗ JFFS2_COMPR_RUBINMIPS (deprecated)
    • ✗ JFFS2_COMPR_COPY (never implemented!)
    • ✔ JFFS2_COMPR_DYNRUBIN
    • ✔ JFFS2_COMPR_ZLIB
    • ✔ JFFS2_COMPR_LZO
    • ✔ JFFS2_COMPR_LZMA

Dependencies

~3–9.5MB
~94K SLoC