Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[!] Error: Unsupported KDZ file format. #24

Open
ishiestar opened this issue Sep 2, 2019 · 3 comments
Open

[!] Error: Unsupported KDZ file format. #24

ishiestar opened this issue Sep 2, 2019 · 3 comments

Comments

@ishiestar
Copy link

when I run the following

$ ./unkdz -f V20D_00_0128.kdz -l

I get the following error

[!] Error: Unsupported KDZ file format.
[ ] Received header "f3 79 97 e5 2a 20 ff 71".

Are LG optimus KDZs not supported? This KDZ is of an LG Optimus L7 II (P713).

@ehem
Copy link
Owner

ehem commented Oct 3, 2019

Most likely LGE changed their format again (this happens, they want to deliberately break everyone else's software). The fix isn't too complex, near the top of unkdz.py the following:

        kdz_header = {
                b"\x28\x05\x00\x00"b"\x34\x31\x25\x80": 0,
                b"\x18\x05\x00\x00"b"\x32\x79\x44\x50": 1,
                kdz.KDZFile._dz_header:                 2,
        }

Would be changed to:

        kdz_header = {
                b"\x28\x05\x00\x00"b"\x34\x31\x25\x80": 0,
                b"\x18\x05\x00\x00"b"\x32\x79\x44\x50": 1,
                b"\xf3\x79\x97\xe5"b"\x2a\x20\xff\x71": 2,
                kdz.KDZFile._dz_header:                 3,
        }

Please confirm you end up with something sensible when trying this, also note those are tabs not spaces!

@phodina
Copy link

phodina commented Mar 23, 2023

Hi @ehem ,
I've got LG K40 and downloaded the zip with stock Android ROM.

However, there's an issue extracting the file. I've modified the byte definitions for the header.

--- a/unkdz.py
+++ b/unkdz.py
@@ -41,9 +41,10 @@ class KDZFileTools(kdz.KDZFile):
        infile = None

        kdz_header = {
-               b"\x28\x05\x00\x00"b"\x34\x31\x25\x80": 0,
-               b"\x18\x05\x00\x00"b"\x32\x79\x44\x50": 1,
-               kdz.KDZFile._dz_header:                 2,
+               b"\x28\x05\x00\x00"b"\x24\x38\x22\x25": 0,
+               b"\x58\x34\x32\x30"b"\x31\x30\x69\x5f": 1,
+               b"\x30\x32\x2e\x64"b"\x7a\x00\x00\x00": 2,
+               kdz.KDZFile._dz_header:                 3,
        }

But then I get:

./undz.py -x -f LG_K40.kdz
[!] Bad DZ file header!

#26

Is there any documentation on the KDZ file format available?

@phodina
Copy link

phodina commented Jul 27, 2023

So I used the unkkdz to extract the DZ file. However, then I got error about the unsupported GPT header.

bin/unkdz -f ~/Downloads/X420HM20a_09_0303.kdz -x
[!] Warning: Data between headers and payload! (offsets 826 to 83768)
[+] Extracting all partitions from v2 file!

[+] Extracting X42021v_00_TCL_MX_OP_0303.dz to kdzextracted/X42021v_00_TCL_MX_OP_0303.dz
[+] Extracting LGUP_c.dll to kdzextracted/LGUP_c.dll
[+] Extracting LGUP_c.dylib to kdzextracted/LGUP_c.dylib
[+] Extracting extra data to kdzextracted/kdz_extras.bin
undz -f ~/Downloads/kdzextracted/X42021v_00_TCL_MX_OP_0303.dz -l
[ ] Warning: Found 1 out of order chunks (please report)
Traceback (most recent call last):
  File "/gnu/store/h0326sq0gsqz8fxhlq4cjnnaql25qgnq-kdztools-1.2/bin/.undz.py-real", line 632, in loadChunks
    g = gpt.GPT(self.chunks[0].extract())
  File "/gnu/store/h0326sq0gsqz8fxhlq4cjnnaql25qgnq-kdztools-1.2/lib/python3.10/site-packages/gpt.py", line 268, in __init__
    raise NoGPT("Error: GPT major version isn't 1")
gpt.NoGPT: Error: GPT major version isn't 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/gnu/store/h0326sq0gsqz8fxhlq4cjnnaql25qgnq-kdztools-1.2/bin/.undz.py-real", line 1079, in <module>
    dztools.main()
  File "/gnu/store/h0326sq0gsqz8fxhlq4cjnnaql25qgnq-kdztools-1.2/bin/.undz.py-real", line 1045, in main
    self.dz_file = UNDZFile(cmd.dzfile)
  File "/gnu/store/h0326sq0gsqz8fxhlq4cjnnaql25qgnq-kdztools-1.2/bin/.undz.py-real", line 911, in __init__
    self.loadChunks()
  File "/gnu/store/h0326sq0gsqz8fxhlq4cjnnaql25qgnq-kdztools-1.2/bin/.undz.py-real", line 673, in loadChunks
    print("[!] Unable to find GPT in DZ file: {:s}".format(err))
TypeError: unsupported format string passed to NoGPT.__format__

steadfasterX added a commit to steadfasterX/kdztools that referenced this issue Oct 24, 2023
example:
https://lg-firmwares.com/downloads-file/23194/Q630EAW10d_00_OPEN_EU_DS_OP_0626

error:

> gpt.NoGPT: Error: GPT major version isn't 1

that error has been reported for other devices as well, see ehem#24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants