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

Getting error when extracting dz #16

Open
johnwayne087 opened this issue Jun 14, 2017 · 6 comments
Open

Getting error when extracting dz #16

johnwayne087 opened this issue Jun 14, 2017 · 6 comments

Comments

@johnwayne087
Copy link

I am trying to extract the dz and i am getting this error
C:\kdztools>undz.py -f kdzextracted/F600K30d_00.dz -l [!] Error: Value supposed to be zero in field "reserved5" is non-zero (0x5900)

This is the kdz F600K30d_00_0510.kdz
and its android 7.0

@ehem
Copy link
Owner

ehem commented Jul 14, 2017

I'd been trying to figure out what all the fields in the KDZ format were, as such the tool had been written to give errors for non-zero unknowns, rather than mere warnings.

For the short term if your need is to get an image of the data, you can suppress the error by modifying line 173 of the file libexec/dz.py and changing the value "True" to "False" (the True is a flag to generate an error if the value ends up being non-zero).

@agorski3
Copy link

ust for your information, I ran into this error as well. Since the guy before did not post a link to the actual image, the one I ran into it on is found there.

https://lg-firmwares.com/download-file/?fileId=10105

And is file VS98812B_02_0720_ARB00.kdz

Obviously, this is after extracting the dz from the kdz using your tool.

Hopefully this will help in solving the bug.

@enovella
Copy link

enovella commented Nov 2, 2018

I'd been trying to figure out what all the fields in the KDZ format were, as such the tool had been written to give errors for non-zero unknowns, rather than mere warnings.

For the short term if your need is to get an image of the data, you can suppress the error by modifying line 173 of the file libexec/dz.py and changing the value "True" to "False" (the True is a flag to generate an error if the value ends up being non-zero).

Hi, swapped the logic of this field to continue the execution and got an error like:

[11:56 edu@moon kdztools] >  python undz.py -f kdzextracted/V4010l_00.dz -x
[!] Error: extraneous data found IN pad

After patching some error by removing exit, I got more errors:

[11:56 edu@moon kdztools] >  python undz.py -f kdzextracted/V4010l_00.dz -x
[!] Error: extraneous data found IN pad
[!] Error: pad is not empty
[11:57 edu@moon kdztools] >  python undz.py -f kdzextracted/V4010l_00.dz -x
[!] Error: extraneous data found IN pad
[!] Error: pad is not empty
Traceback (most recent call last):
  File "undz.py", line 1035, in <module>
    dztools.main()
  File "undz.py", line 1001, in main
    self.dz_file = UNDZFile(cmd.dzfile)
  File "undz.py", line 873, in __init__
    self.loadChunks()
  File "undz.py", line 559, in loadChunks
    chunk = UNDZChunk(self, self.dzfile)
  File "undz.py", line 320, in __init__
    targetAddr = int(self.chunkName[len(self.sliceName)+1:-4])
ValueError: invalid literal for int() with base 10: 'other_LGU_KR_13158'

The firmware used is the latest LG V40 ThinQ Korean version:

 wget -c http://pkg02.lime.gdms.lge.com/dn/downloader.dev?fileKey=FW97NX72A2JCA1I61965CIN/V409N10l_00_LGU_KR_OP_1015.kdz

Going to investigate if I can extract at least some files from the img. Really need only 2 or 3 files from it. Any feedback is welcome @ehem

@enovella
Copy link

enovella commented Nov 2, 2018

After so many patches, I got some extracted files:

[+] Extracting devcfg_a_81926.bin to E.devcfg_a_81926.bin.chunk
[+] Extracting qupfw_a_81958.bin to E.qupfw_a_81958.bin.chunk
[+] Extracting laf_a_81990.bin to E.laf_a_81990.bin.chunk
[+] Extracting 0_vbmeta_LGU_KR.img to E.0_vbmeta_LGU_KR.img.chunk
[+] Extracting dtbo_a_94294.bin to E.dtbo_a_94294.bin.chunk
[+] Extracting storsec_a_96342.bin to E.storsec_a_96342.bin.chunk
[+] Extracting raw_resources_a_96374.bin to E.raw_resources_a_96374.bin.chunk
[+] Extracting sid_a_98422.bin to E.sid_a_98422.bin.chunk
...
[+] Extracting PrimaryGPT_0.bin to F.PrimaryGPT_0.bin.chunk
[+] Extracting BackupGPT_2043.bin to F.BackupGPT_2043.bin.chunk
[+] Extracting PrimaryGPT_0.bin to G.PrimaryGPT_0.bin.chunk
[+] Extracting BackupGPT_2043.bin to G.BackupGPT_2043.bin.chunk

Lets see how to proceed now. Will keep you posted

@enovella
Copy link

enovella commented Nov 2, 2018

Got it in #22 (comment)

@RebelLion420
Copy link

To add to this, I was struggling to extract stock for LG G6 and finally figured out how this guy "patched" the files to work for that specific error. In addition to @ehem 's fix here, you also need to comment out line 89 in undz.py to still print the error message but avoid the exit. I extracted system successfully with this method

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

5 participants