Commit graph

11 commits

Author SHA1 Message Date
Peter Wu
94c0dc5ac2 parse-props.py: fix assert failure 2015-12-29 13:24:07 +01:00
Peter Wu
a1208e6723 Improve INFO GPRO field
Not just the first two bytes should match, it should be the expected
length. Found the hint in dmesg after failing to retrieve the properties
file. Setting all following bytes to 0xff does not seem to affect the
output, so let's keep it like this. The original software does send an
empty buffer though (with all zeroes).
2015-12-29 13:17:44 +01:00
Peter Wu
70ea7bf69b Move extract-partitions.py, add to README
Allows you to use it without having to set `PYTHONPATH=.` first.
2015-12-27 16:51:08 +01:00
Peter Wu
5e65f24aea extract-partitions.py: allow for disabling --max-size
Useful if you want to dump everything. For finer selection, use
partitions.py directly.
2015-12-27 16:37:56 +01:00
Peter Wu
c8e27d445d Allow partition lookup by label 2015-12-27 11:21:32 +01:00
Peter Wu
a27775129d extract-partitions.py: fix reading 512 bytes too short
/proc/partitions outputs blocks of 1 KiB, but the size can be aligned
at 512 bytes (as observed with the "grow" partition). Re-use the
partitions.py code for dumping partitions.

Previously every partition would be opened separately, now this
requests the partition offset and size for each partition, but the disk
is opened only once.

This takes about 32 seconds for 356 MiB.
2015-12-26 23:18:35 +01:00
Peter Wu
e0f269128f extract-partitions.py: fix unaligned files
Seeking on a file open for appending does not really work. Also fix
offset in debug message.
2015-12-26 22:03:29 +01:00
Peter Wu
c6b7bd465d extract-partitions.py: really close file on errors 2015-12-26 16:08:38 +01:00
Peter Wu
85168bc5de extract-partitions.py: documentation update 2015-12-26 14:52:04 +01:00
Peter Wu
495060d104 Add script to dump partitions
Dumped 384M in 34 seconds (D855, Linux, USB 2.0).
2015-12-26 01:09:45 +01:00
Peter Wu
8f35f2f5b5 More protocol details, add property parser
Example output for parse-props.py:

    download cable             = 'USER'
    battery level              = 100
    download type              = ' '
    download speed             = 0
    usb version                = ' '
    hardware revision          = 'rev_10'
    download sw version        = ' '
    device sw version          = 'D85520t'
    secure device              = 'S'
    laf sw version             = '1.1'
    device factory version     = 'LGD855AT-00-V20t-EUR-XX-AUG-18-2015-16G+0'
    device factory out version = 'LGD855AT-00-V20t-GLOBAL-COM-AUG-18-2015-16G+0'
    pid                        = 'YE01S151002002500'
    imei                       = (redacted)
    model name                 = 'LG-D855'
    device build type          = 'U'
    chipset platform           = 'msm8974'
    target_operator            = 'GLOBAL'
    target_country             = 'COM'
    ap_factory_reset_status    = 3
    cp_factory_reset_status    = 0
    isDownloadNotFinish        = 0
    qem                        = 0
    cupss swfv                 = 'A1439892730-M1439892730-C1439940554-U1439940554-0'
    is one binary dual plan    = 0
    memory size                = 30777344
    memory_id                  = 'SDW16G\n'
    bootloader_ver             = 'MiniOS 3.0'
2015-12-25 15:16:42 +01:00