Dahua Firmware Mod Kit + Modded Dahua Firmware

Discussion in 'Dahua' started by cor35vet, Sep 5, 2016.

Share This Page

  1. roryk

    roryk n3wb

    Joined:
    Nov 28, 2017
    Messages:
    2
    Likes Received:
    0
    Location:
    Bahamas
    Hi, which firmware supports HDW4431EM-AS - I dont understand the names EOS, Themis etc. Thanks.
     
  2. larvard

    larvard n3wb

    Joined:
    Jul 17, 2015
    Messages:
    5
    Likes Received:
    0
    hi . please help me .

    DH_NVR4XXX-4KS2_Chn_V3.215.0000000.3.R.171106.bin
    https://www.dahuatech.com/download/832.html

    root@kalilinux:~/Desktop/Dahua-Firmware-Mod-Kit-master# ./extract.py -c NVR4XXX-4KS2 smart.bin
    WARNING Found config: NVR4XXX-4KS2
    Traceback (most recent call last):
    File "./extract.py", line 238, in <module>
    extractor.Extract(args.source)
    File "./extract.py", line 61, in Extract
    self.ZipFile = zipfile.ZipFile(self.SourceFile)
    File "/usr/lib/python3.6/zipfile.py", line 1108, in __init__
    self._RealGetContents()
    File "/usr/lib/python3.6/zipfile.py", line 1175, in _RealGetContents
    raise BadZipFile("File is not a zip file")
    zipfile.BadZipFile: File is not a zip file

     
  3. larvard

    larvard n3wb

    Joined:
    Jul 17, 2015
    Messages:
    5
    Likes Received:
    0
    older firmware

    root@kalilinux:~/Desktop/Dahua-Firmware-Mod-Kit-master# python3.6 ./extract.py -c NVR4XXX-4KS2 DH_NVR4XXX-4KS2_Chn_V3.215.0000000.1.R.170902.bin
    WARNING Found config: NVR4XXX-4KS2
    INFO Extracting 8 files to: 'DH_NVR4XXX-4KS2_Chn_V3.215.0000000.1.R.170902.bin.extracted'
    INFO Processing 'Install.lua'.
    INFO Processing 'u-boot.bin.img'.
    INFO Processing 'uImage.img'.
    INFO Processing 'romfs-x.squashfs.img'.
    INFO Processing 'web-x.squashfs.img'.
    INFO Processing 'custom-x.squashfs.img'.
    INFO Processing 'logo-x.squashfs.img'.
    CRITICAL Missing dependency: 'cramfsck'
    ERROR 'CramFS' handler returned non-zero return value for file: 'logo-x.squashfs.img.raw'
    Traceback (most recent call last):
    File "./extract.py", line 238, in <module>
    extractor.Extract(args.source)
    File "./extract.py", line 113, in Extract
    raise Exception("Handler returned non-zero return value!")
    Exception: Handler returned non-zero return value!
     
  4. alastairstevenson

    alastairstevenson Known around here

    Joined:
    Oct 28, 2014
    Messages:
    7,255
    Likes Received:
    1,880
    Location:
    Scotland
    It looks like you are missing a Linux tool :
    Code:
    alastair@PC-I5 ~ $ cramfsck -h
    usage: cramfsck [-hv] [-x dir] file
     -h         print this help
     -x dir     extract into dir
     -v         be more verbose
     file       file to test
    alastair@PC-I5 ~ $
    
    sudo apt-get install cramfsprogs
     
  5. larvard

    larvard n3wb

    Joined:
    Jul 17, 2015
    Messages:
    5
    Likes Received:
    0
    not working

    root@kalilinux:~# sudo apt-get install cramfsprogs
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Unable to locate package cramfsprogs
    root@kalilinux:~#
     
  6. alastairstevenson

    alastairstevenson Known around here

    Joined:
    Oct 28, 2014
    Messages:
    7,255
    Likes Received:
    1,880
    Location:
    Scotland
    It looks like your Linux distro does not have the cramfsprogs package available.

    See if you can use any of the downloads here if the package isn't in your normal repositories : Cramfsprogs Download (DEB)
     
  7. larvard

    larvard n3wb

    Joined:
    Jul 17, 2015
    Messages:
    5
    Likes Received:
    0
    WARNING Autodetected config: NVR4XXX-4KS2
    INFO Extracting 8 files to: 'DH_NVR4XXX-4KS2_Chn_V3.215.0000000.1.R.170902.bin.extracted'
    INFO Processing 'Install.lua'.
    INFO Processing 'u-boot.bin.img'.
    INFO Processing 'uImage.img'.
    INFO Processing 'romfs-x.squashfs.img'.
    INFO Processing 'web-x.squashfs.img'.
    INFO Processing 'custom-x.squashfs.img'.
    INFO Processing 'logo-x.squashfs.img'.
    WARNING Unrecognized file: 'sign.img'.
     
  8. larvard

    larvard n3wb

    Joined:
    Jul 17, 2015
    Messages:
    5
    Likes Received:
    0
    sudo python3.6 ./extract.py -c NVR4XXX-4KS2 DH_NVR4XXX-4KS2_Chn_V3.215.0000000.3.R.171106.bin
    WARNING Found config: NVR4XXX-4KS2
    Traceback (most recent call last):
    File "./extract.py", line 238, in <module>
    extractor.Extract(args.source)
    File "./extract.py", line 61, in Extract
    self.ZipFile = zipfile.ZipFile(self.SourceFile)
    File "/usr/lib/python3.6/zipfile.py", line 1108, in __init__
    self._RealGetContents()
    File "/usr/lib/python3.6/zipfile.py", line 1175, in _RealGetContents
    raise BadZipFile("File is not a zip file")
    zipfile.BadZipFile: File is not a zip file
     
  9. alastairstevenson

    alastairstevenson Known around here

    Joined:
    Oct 28, 2014
    Messages:
    7,255
    Likes Received:
    1,880
    Location:
    Scotland
    To be expected when it's not listed in NVR4XXX-4KS2

    I think the idea is that you develop / extend and contribute the mod-kit config files as the firmware develops.
    As originally posted by @cor35vet :
    Code:
    from .config import *
    
    DAHUA_FILES = OrderedDict([
        ("Install.lua", {
            "required": True,
            "type": DAHUA_TYPE.Plain
        }),
        ("u-boot.bin.img", {
            "required": True,
            "type": DAHUA_TYPE.Plain,
            "size": 0x00300000
        }),
        ("uImage.img", {
            "required": True,
            "type": DAHUA_TYPE.Plain,
            "size": 0x00a00000
        }),
        ("romfs-x.squashfs.img", {
            "required": True,
            "type": DAHUA_TYPE.uImage | DAHUA_TYPE.SquashFS,
            "size": 0x03600000
        }),
        ("web-x.squashfs.img", {
            "required": True,
            "type": DAHUA_TYPE.uImage | DAHUA_TYPE.SquashFS,
            "size": 0x00a00000
        }),
        ("custom-x.squashfs.img", {
            "required": True,
            "type": DAHUA_TYPE.uImage | DAHUA_TYPE.SquashFS,
            "size": 0x00200000
        }),
        ("logo-x.squashfs.img", {
            "required": True,
            "type": DAHUA_TYPE.uImage | DAHUA_TYPE.CramFS,
            "size": 0x00300000
        })
    ])
     
  10. nhocti

    nhocti n3wb

    Joined:
    Mar 21, 2017
    Messages:
    19
    Likes Received:
    1
    Even when you are success in modifying the firmware, there is no way to install it on the device. Latest firmware checks its folder by the checksum, and overall, the sign.img. So if you want to modify any file, you have to make a checksum again for that folder, and sign the firmware. As @cor35vet, it's impossible task.

    However, if you have uart dongle, then it's a easy task to upgrade firmware :)

     
Tags: