MatrixEditor / hiktools

Python & C++ library for working with hikvision firmware/ SADP packets/ SADP Tool functionalities
MIT License
13 stars 0 forks source link

getting error while trying to decrypt .dev file #1

Closed OrGozlan closed 1 year ago

OrGozlan commented 1 year ago

When I am trying to decrypt hikvision firmware (downloaded from the official hikvision website) it returns the error:

Traceback (most recent call last): File "C:\Users*\PycharmProjects\hiktools\main.py", line 6, in with fmod.DigiCap('digicap.dav') as dcap: File "C:\Users*\AppData\Local\Programs\Python\Python310\lib\site-packages\hiktools\fmod\decrypter.py", line 389, in enter self.fparse() File "C:\Users*\AppData\Local\Programs\Python\Python310\lib\site-packages\hiktools\fmod\decrypter.py", line 367, in fparse self._head = split_header(decoded_head) File "C:\Users*\AppData\Local\Programs\Python\Python310\lib\site-packages\hiktools\fmod\decrypter.py", line 242, in split_header magic = uint32(buf) File "C:\Users***\AppData\Local\Programs\Python\Python310\lib\site-packages\hiktools\fmod\decrypter.py", line 72, in uint32 result, = unpack(f"{encoding}I", value) struct.error: unpack requires a buffer of 4 bytes

MatrixEditor commented 1 year ago

Thanks for the issue request - I will try to take a look at it in the next days.

MatrixEditor commented 1 year ago

The issue should have been resolved by now. With the latest PyPI release, version 1.2.1, you should be able to successfully decrypt the firmware file. However, please be aware that there is a possibility that the contents of certain files may still remain encrypted even after utilizing the module.