The attached app unpacks and repacks Hikvision firmware for K41/K51 NVRs and R0/R1/R6/G0 cameras. I plan to add support for more hardware, but in many cases I need to buy cameras to extract keys from them. Your donations can help, contribute here if you feel like it:
The binary runs on x64 Linux. Enjoy.
Code:
hikpack v2.5 Hikvision firmware packer/unpacker by montecrypto
*** No expressed or implied warranties of any kind. Use at your own risk ***
Usage:
hikpack -t <fwtype> -i <src_dav_file> print dav file information
hikpack -t <fwtype> -x <src_dav_file> -o <dst_dir> extract dav file into directory
hikpack [opts] -t <fwtype> -p <dst_dav_file> -o <src_dir> pack dav file from source directory
hikpack -t <fwtype> -d <src_crypted_file> -o <dst_file> decrypt file
hikpack -t <fwtype> -g <src_crypted_cfg> -o <dst_file> decrypt configuration backup file
hikpack -t <fwtype> -G <src_file> -o <crypted_cfg_file> encrypt configuration backup file (CRC adjusted if needed)
hikpack -t <fwtype> -e <src_file> -o <dst_crypted_file> encrypt file
-t option sets firmware platform type. Currently supported: cameras: r0,r1,r6,g0 nvr: k41,k51
----- The following options are used by the pack (-p) command:
-L <1,2> set language id (1=EN, 2=CN)
-D <YYYYMMDD> set firmware date.
-V <ver> set firmware version. Use hex number, e.g.: 0x05040003 for v5.4.3
For whatever reason attachments no longer work, the file is here:
hikpack_2.5.zip — RGhost — файлообменник
Thanks for the info. I'm having a little trouble decrypting a configuration file I downloaded. Here is the commands that I have tried to decrypt the file.
./hikpack -t r1 -g configurationFile -o configuraton_decrypted
I also tried r6, G0, etc but nothing seems to work. Here is a copy of the device info if that helps.
<DeviceInfo xmlns="
http://www.hikvision.com/ver10/XMLSchema" version="1.0">
<deviceName>TEST1</deviceName>
<deviceID>88</deviceID>
<deviceDescription>IPCamera</deviceDescription>
<deviceLocation>hangzhou</deviceLocation>
<systemContact>Hikvision.China</systemContact>
<model>DS-2CD4125FWD-IZ</model>
<serialNumber>DS-2CD4125FWD-IZ20160426CCWR596304447</serialNumber>
<macAddress>bc:ad:28:35:5f:6b</macAddress>
<firmwareVersion>V5.3.5</firmwareVersion>
<firmwareReleasedDate>build 151218</firmwareReleasedDate>
<bootVersion>V1.3.4</bootVersion>
<bootReleasedDate>100316</bootReleasedDate>
<hardwareVersion>0x0</hardwareVersion>
</DeviceInfo>