Announcement

Collapse
No announcement yet.

Novatek command line tools

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Novatek command line tools

    Novatek command line tools by [email protected] (his site)

    ntkcalk · Novatek checksum and startval calculator download v0.8 release notes
    Description: Calculates the checksum and baseval for Novatek raw images as well as BCL compressed images

    bfc · Basic compression library modified for Novatek v.3.3
    Description: Decompresses and compresses Novatek firmware partitions

    ntkfwinfo · Novatek firmware binary information utility download v.0.1
    Description:Parses the firmware binary for compressed partitions and guesses the firmware type for further modifying
    Last edited by nutsey; 08-11-2018, 02:44 PM.
    Donate here if you want to support my efforts and this site.

    Email me if you have any offers, requests or ideas.

  • #2
    CMD Script that is using ntkcalc and bfc utilities by [email protected] to automate compression, decompression and CRC calculation of firmware files. Just drag and drop FW file onto this cmd and select a mode.

    https://yadi.sk/d/Uov8WibY3F663H

    Comment


    • #3
      BFC has received an update to v1.1 to comply with Novatek code alignment rules
      Download: http://dc.p-mc.eu/tools/novatek/cmd#bfc

      Alf please update your script with the new filename

      Comment


      • nutsey
        nutsey commented
        Editing a comment
        Thanx for the update!

    • #4
      BFC just received another update. Initially I planned to just add decompression from a specific address to support multi-image binaries but I found a critical access violation bug during testing..

      Changelog:
      -fixed access violation bug
      -removed unneeded compression algorithms
      -modified parameter syntax: bfc compression now no longer requires you to enter the algorithm (since it only supports lz77 now)
      -added "multi-image" support, well at least kind of: You can now provide the offset of the bcl compressed partition you want to unpack and bfc will start extracting at that address

      New syntax:
      Compression:
      bfc c compressme.bin compressed.bin

      Decompression:
      bfc d compressed.bin uncompressed.bin
      bfc d compressed.bin uncompressed0.bin 0xaabbccdd


      Source will soon be published to gitlab (git.p-mc.eu)


      EDIT:
      bfc mod 2.1 is released as well.. Download from my page (linked in op)
      This release supports PartComp extraction via 'x' command:
      bfc x partcomp.bin extracted.bin

      Sources are online as well
      Last edited by [email protected]; 05-26-2017, 03:40 AM.

      Comment


      • #5
        I've just added another utility: ntkfwinfo 0.1
        It will print out the offsets of all included bcl partitions inside the binary provided via arguments and guess the firmware type. It's a small helper application for less advanced users
        Usage: ntkfwinfo firmware.bin
        Download: http://dc.p-mc.eu/tools/novatek/cmd#ntkfwinfo

        Comment


        • #6
          I almost feel like spamming with my applications, but who cares :P

          NtkTool (BnGui) v0.4
          Click image for larger version

Name:	ntktool.png
Views:	1332
Size:	31.8 KB
ID:	11303


          Description: NtkTool is a wrapper application for bfc4ntk and ntkcalc. It's currently bundled with required windows and linux binaries

          What is bfc4ntk and ntkcalc?
          bfc and ntkcalc are tools to unpack/repack/validate modified Novatek NT966XX firmware binaries. This application is a gui for the previously mentioned. After unpacking you can hack in your own bootlogo/modify movie parameters like bitrate/fps/dimension using NtkMPE, modify the AE table, ...

          Information: This tool is bundled with required bfc4ntk and ntkcalc. It will unpack them during runtime to its current directory and will delete them on exit. If you dont want it to overwrite existing files, add a file called .dontoverwrite to the same directory as BnGui.jar and it will not touch existing files.

          Usage:
          Manual operation:

          Extract allows to:
          - extract a FullComp (d) binary at default offset 0 or provided offset to [email protected]<offset>.rbn
          - extract a PartComp (x) binary at adress 0x00B0000 to filename.rbn
          Compress allows to:
          - compress a binary file to a FullComp (c) archive "filename.bcl"
          - compress a binary file to a PartComp (p) archive "filename.bcl"
          The "Run" button will change its text once it's clicked to give you a rough idea whats happening behind the gui. (validating, packing, revalidating, ....)
          The Log text area will show you stdout and stderr outputs from the native windows applications

          Quick unpack:
          Load a compressed PartComp or FullComp binary and the tool will detect all BCL partitions and list them below. You can quick unpack the partitions using the Unpack button. The raw binaries will be stored in the same folder as the original binary using this naming convention: [email protected]<offset>.rbn

          Partition merge:
          Merges two compressed partition files into a single binary. Output directory: Same as partition 0, file name can be set below "Merge" button.

          Download: NtkTool v0.4
          Direct download
          Last edited by [email protected]; 08-08-2018, 02:29 PM.

          Comment


          • #7
            BnGui received an update to BETA 0.3
            Changelog BETA 0.3:
            -bundled with latest ntkcalc.exe and bfc.exe to make usage easier and to make sure the application is always using the versions which it has been developed for
            -auto removal of extracted native applications after execution
            -if you want to keep your existing files and stop the application from overwriting existing files, add a file called ".dontoverwrite" to the same directory and it will not overwrite existing files
            Download in post above this one

            -------------


            bfc received an update to 2.4:
            Changelog 2.4:
            added filesize update to raw size @0x68 after using x-command (partcomp decompression)
            Warning: This release still does not support dynamic extraction of PartComp binaries. This will take some more time!
            Download link: http://dc.p-mc.eu/ntk_tools/bfc-v24.exe
            Last edited by [email protected]; 06-07-2017, 08:54 PM.

            Comment


            • #8
              Hello [email protected]. Can I use this for packing SJ4000? I am able to unpack this with your tool, but don't understand how to pack.

              Comment


            • #9
              For me the BFC just crash, wont open Win home ed 10 64bit. Can anyone help me unpack http://www.gitup.com/support/firmwar...IT1FW_V1.4.zip, i just want to change bootlogo with Nlogo.

              Comment


              • Tobi@s
                [email protected] commented
                Editing a comment
                Maybe you used an old version of bfc. Please try bngui beta 0.3 application

            • #10
              [email protected] BnGui 0.3 i think it worked really well, im finished with my firmware now.
              I did this procedure step by step:
              1. Loaded the file firmware.bin in BnGui 0.3 and then Unpacked it.
              2. Loaded the unpacked file in Ntool and changed the boot logo file and saved it.
              3. I then choosed the saved file and Compressed it in BnGui and got an .bcl file. Is it enough now to change the .bcl ending to .bin ? Or do i have to made some other compressions?

              Comment


              • #11
                EDITED! 18 July 2017

                I could change bitrates of my SJ5000x elite thru [email protected] app !!
                Thank you!

                Keep in mind that the number you apply at NtkMPE 1.1.2 in the bitrate column is multiplied by 3 to know the real bitrate at HIGH on bitrate settings.
                I've looked for the maximum value and all works like a charm, only 1 thing:
                At those high bitrates some recordings are not playable by the cam player but are well recorded.

                Original bitrate for 1080 30p was 22,1Mbps now I have a 46,2 Mbps bitrate.
                My 720 120p is now 53,4Mbps (original was 30Mbps).
                Now 120fps is good enough to make slowmotions and now I have perfect blue skies without blocking artifacts at 1080p.

                My steps (remember the SJcam FW has 2 partitions)
                1.-Have original FW (SJCAM002.bin)
                2.-Open bnGui BETA 0.3. Load original firmware and unpack only first partition (here you'll see the actual bitrates and resolutions) Result = one rbn file
                3.-Open NtkMPE.jar, load rbn file, change desired values and apply modifications.
                4.-Back again to bnGui BETA 0.3, on compress line, open rbn file, in mode c, run, you'll get a bcl file (this is the 1st partition modified and compressed)
                5.-Now you have 1st partition modified and you have to add the rest.
                5.-Open on Hex Editor both files (SJCAM002.bin and [email protected]). Search the last offset of your *.bcl file, select from that offset until the end
                in the original *.bin file, copy and paste it at the end of *.bcl file. Save it as the name accepted by the cam FW and update cam.
                That's all!
                Last edited by Michi_65; 07-18-2017, 08:26 PM.

                Comment


                • #12
                  @[email protected]

                  Great work, thank you very much! I changed succesfully all bitrates on my SJ5000x elite, by the way, do you think is possible to find and change contrast and color
                  values? Modify ISO on video mode would be great too!

                  Comment


                  • Tobi@s
                    [email protected] commented
                    Editing a comment
                    Might be possible but requires more investigation. At the moment I don't have time for this unfortunately

                  • Michi_65
                    Michi_65 commented
                    Editing a comment
                    OK We all appreciate your achievements, thank you!

                • #13
                  Originally posted by Michi_65 View Post
                  My steps (remember the SJcam FW has 2 partitions)
                  Thanks Michi_65! Your post has been of great help because this is exactly what I needed. Unfortunately, I cannot pass point #4 because I get a "NATIVE ERROR - Checksum magic invalid (432e)" while trying to recompress my partition .

                  Comment


                  • #14
                    Perepandel, I don't know why you have such error. I run windows 7 and HexWorkshop with http://dc.p-mc.eu/tools/novatek/bngui and http://dc.p-mc.eu/tools/novatek

                    Comment


                    • #15
                      The invalid checksum error occurs if the WORD at 0x6c does not match 0xAA55 (little endian).
                      This is a safety feature since all the firmwares I modified always had these two bytes there and I'm not sure what these two bytes are used for. Maybe they are a start value or part of even more novatek security checks.
                      I could disable this check for you but I can't promise a working firmware file after that. Well it shouldnt even flash if these two bytes are used for verifying the binary so it shouldnt be that much of an issue (i.e. not resulting in a brick)

                      As I replied to your personal message, I need access to the firmware binary to have a better look at the situtation

                      Comment


                      • Perepandel
                        Perepandel commented
                        Editing a comment
                        My fault, [email protected]! I'm not used to Mega so I sent you the link without the key... You have the valid link in another PM.

                        Is the source code for any of your tools available? I remember reading here or there it was, but I haven't been able to find it... In case it is, maybe I would risk modifying it by myself to see if I could get a working firmware

                      • Tobi@s
                        [email protected] commented
                        Editing a comment
                        Source code of bfc is available, but thats not the latest version. Will update the binaries and repository soon.
                        Ntkcalc source code is not available yet. I'm not sure if I'm going to release it. I've already provided the algorithm (implemented in c) for calculating the proprietary checksum somewhere in the Novatek R&D thread. Please see my next reply for more information regarding your firmware issue
                    Working...
                    X