Skip to content

Commit

Permalink
Check-in source.
Browse files Browse the repository at this point in the history
  • Loading branch information
0x09 committed Jan 8, 2016
1 parent 4a704cd commit 1e738bd
Show file tree
Hide file tree
Showing 2 changed files with 891 additions and 0 deletions.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Parser and documentation for "pspbrwse.jbf" thumbnail caches generated by the file browsing component of Jasc Paint Shop Pro and Animation Shop.
The formats have been fully reverse engineered by studying program output without the use of a decompiler.
The format is described in the source file, and mirrored in the binary.

Scripts exist like [this one](http://www.perlmonks.org/?node_id=225501) which can dump v2 files by scraping for JPEG headers, but as of 2011 I wasn't able to find any full reverse engineering of the format.
Code is a simple step-by-step parser which should be easy to reference for adding JBF support in file forensics programs or etc.

Works on all major platforms with a C99 compiler. There is no makefile, simply `make jbfinspect`.

# Thumbnail formats
V2 files (PSP 6+) simply contain embedded JFIF thumbs. Older formats use two different custom bitmap RLE schemes with a custom implicit palette. For these the tool will decode the RLCs and write a plain bitmap with the palette added.
The first format (PSP 3-4) consists of either a run-length prefix followed by a palette index to repeat, or a raw palette entry for values < 192.
The second (PSP 5) consists of a run-length prefix followed by color, or a length prefix signalling a series of raw palette entries will follow for values < 128.
The parsing logic is thus:

v1.0-1.1: byte > 0xC0 ? [runlength+0xC0],[color] : [color]
v1.3: byte > 0x80 ? [runlength+0x80],[color] : [length],[colors]...

# Use
The command line tool can list metadata from the file or dump its contents with a few options including the ability to highlight or dump only thumbnails which no longer exist in the JBF source folder, and the ability to dump thumbs into a path recreated from the original path listed inside the JBF.

# Examples
List jbf contents, highlighting orphaned thumbnails (ANSI colors)

jbfinspect -o pspbrwse.jbf

Dump missing thumbs from a jbf into "thumbs"

jbfinspect -qod thumbs pspbrwse.jbf

Dump every jbf in home into a reconstructed directory tree under "thumbs"

find ~/ -name "*.jbf" -exec jbfinspect -qrd thumbs {} \;
Loading

0 comments on commit 1e738bd

Please sign in to comment.