I have here an unknown binary file which contains a graphical user interface. The file has the ending .kzb and it comes from the Kanzi desinger. Unfortunately the Kanzi desinger can no longer edit the extracted binary file. Apparently you can only change something if you have the original project. The file contains pictures that I would like to change. I know that it has to work, because someone has already done it, but doesn't want to reveal the secret :) Here is the file I want to customize. https://drive.google.com/drive/folders/1Z-RCdVGJv_jkKHcL3o_saOZz8sluMMG1?usp=sharing In the file is a Chinese and an English flag (as .png) which I would like to change / swap.

  • If the task is find png files in your binary, with don't you make a script that do that? I dont think is hard to do it, find the png header in the file and then reconstruct the image and you will be able to modify it.
    – camp0
    Apr 12, 2019 at 19:39
  • 1
    @camp0 If I knew how to do this, I wouldn‘t be here :)
    – Alonia
    Apr 12, 2019 at 19:44
  • 1
    @Alonia For extracting assets/resources there are several tools to do just that, like Dragon Unpacker. Check out wiki.xentax.com/index.php/Extraction_tools
    – 0xec
    Apr 12, 2019 at 20:02
  • @0xec Dragon Unpacker works fine, how can I exchange the edited file?
    – Alonia
    Apr 12, 2019 at 21:23
  • 2
    @Alonia You can use a hex editor. Do a byte search for the start of the original PNG in the kzb file. Then you can overwrite the succeeding bytes with the modified PNG. However before that you need to ensure that both the original and modified PNG's are of the same size or you would overwrite other data.
    – 0xec
    Apr 12, 2019 at 21:39

1 Answer 1

  1. Search the unknown binary file for the PNG magic number 89 50 4E 47 .PNG

  2. Determine size of the embedded PNG

  3. Search unknown binary file for that size as a binary integer.

  4. Replace PNG and size as appropriate in unknown binary file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.