This is a Pentax Firmware Decryption/Decompression tool, which is based on MooseV2's code, svenpeter42's code, and the decompress's patch made by bootcoder.
Made for the PHDK project.
First you need to make sure you have installed Node.js, in case you haven't, here is how.
Installing pfwtool
is very simple, just:
npm i pfwtool -g
To use this tool is straight forward:
pfwtool -i <in> -o <out>
-
<in>
is the filename/path of the firmware from downloaded package, such asfwdc220b.bin
, which is encrypted/compressed. -
<out>
is the output file name of the decrypted/decompressed firmware.
To extract the resources file in K-S1/K-S2 firmware:
pfwtool -i ks1.bin -e resdir
For other arguments, please check the --help
arguments
$ pfwtool -h
Usage: pfwtool [options]
A command line tool to decrypt/decompress Pentax firmware
Options:
-h, --help output usage information
-V, --version output the version number
-i, --input <filename> Encrypted firmware filename (e.g. "fwdc226b.bin"). If no input filename is specified, the standard input will be used.
-o, --output <filename> Output decrypted filename.
-d, --debug [logfile] Enable debug, log to file if the log filename is given, otherwise it will log to the console.
-l, --list-resources List resource files in the firmware.
-e, --extract-resources <dir> Extract the resource to the given directory.