[Sony Xperia M] alvinhochun:
Partitions information of internal storage

I dumped the internal storage (`cat /dev/block/mmcblk0 > full.img`) and tried to get some useful information from that. Took me ages to do that. Since I dumped the file on-line, userdata and cache partitions are dirty, but that doesn't affect much, does it huh?

Strangely both the GPT partition tables have corrupted CRC, but they looks fine so I just used it.

Anyway I don't have any experience hacking emmc devices, but let's see if I'm helpful:

GPT fdisk (gdisk) version 0.8.1

Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present

Found valid GPT with protective MBR; using GPT.
Disk full.img: 7733248 sectors, 3.7 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Partition table holds up to 28 entries
First usable sector is 34, last usable sector is 7733214
Partitions will be aligned on 256-sector boundaries
Total free space is 107998 sectors (52.7 MiB)

Number Start (sector) End (sector) Size Code Name
1 256 4351 2.0 MiB FFFF TA
2 4352 4607 128.0 KiB FFFF sbl1
3 4608 5119 256.0 KiB FFFF sbl2
4 5120 5631 256.0 KiB FFFF s1sbl2
5 5632 6655 512.0 KiB FFFF sbl3
6 6656 7679 512.0 KiB FFFF aboot
7 7680 8703 512.0 KiB FFFF tz
8 8704 8959 128.0 KiB FFFF alt_sbl1
9 8960 9471 256.0 KiB FFFF alt_sbl2
10 9472 9983 256.0 KiB FFFF alt_s1sbl2
11 9984 11007 512.0 KiB FFFF alt_sbl3
12 11008 12031 512.0 KiB FFFF alt_aboot
13 12032 13055 512.0 KiB FFFF alt_tz
14 13056 14079 512.0 KiB FFFF rpm
15 14080 15103 512.0 KiB FFFF alt_rpm
16 16384 49151 16.0 MiB 8300 LTALabel
17 49152 90111 20.0 MiB FFFF boot
18 90112 221183 64.0 MiB 0700 modem
19 221184 227327 3.0 MiB FFFF modemst1
20 229376 235519 3.0 MiB FFFF modemst2
21 237568 243711 3.0 MiB FFFF fsg
22 243712 253951 5.0 MiB FFFF ramdump
23 253952 286719 16.0 MiB FFFF FOTAKernel
24 286720 294911 4.0 MiB 8300 persist
25 294912 2752511 1.2 GiB 8300 system
26 2752512 3264511 250.0 MiB 8300 cache
27 3268608 7634910 2.1 GiB 8300 userdata

Partitions content attempt to be identified with `file`:

full.img: x86 boot sector; partition 1: ID=0xee, starthead 0, startsector 1, 7733247 sectors, extended partition table (last)\011, code offset 0x0
loop0p1.img: DOS executable (block device driver)
loop0p2.img: data
loop0p3.img: data
loop0p4.img: data
loop0p5.img: data
loop0p6.img: Hitachi SH big-endian COFF object, not stripped
loop0p7.img: data
loop0p8.img: data
loop0p9.img: data
loop0p10.img: data
loop0p11.img: data
loop0p12.img: Hitachi SH big-endian COFF object, not stripped
loop0p13.img: data
loop0p14.img: data
loop0p15.img: data
loop0p16.img: Linux rev 1.0 ext4 filesystem data, UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (extents) (large files)
loop0p17.img: ELF 32-bit LSB executable, ARM, version 1, statically linked, stripped
loop0p18.img: x86 boot sector, code offset 0x3c, OEM-ID "MSDOS5.0", sectors/cluster 32, root entries 512, Media descriptor 0xf8, sectors/FAT 17, heads 255, sectors 131072 (volumes > 32 MB) , serial number 0xbc614e, unlabeled, FAT (16 bit)
loop0p19.img: data
loop0p20.img: data
loop0p21.img: data
loop0p22.img: ELF 32-bit LSB executable, ARM, version 1, statically linked, stripped
loop0p23.img: ELF 32-bit LSB executable, ARM, version 1, statically linked, stripped
loop0p24.img: Linux rev 1.0 ext2 filesystem data (mounted or unclean), UUID= xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (extents) (large files) (huge files)
loop0p25.img: Linux rev 1.0 ext4 filesystem data, UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (extents) (large files)
loop0p26.img: Linux rev 1.0 ext4 filesystem data, UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (needs journal recovery) (extents) (large files)
loop0p27.img: Linux rev 1.0 ext4 filesystem data, UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (needs journal recovery) (extents) (large files)

Meaningful guess of what the partitions may contain (actually pretty obvious):

p17 (boot) - Kernel? Binary code which starts the kernel? vmlinux? (*) My copy: https://dl.dropboxusercontent.com/u/39080136/c1905/loop0p17.img

p23 (FOTAKernel) - Same as above, but downloaded by FOTA for update purpose

p24 (persist) - Mounted as `/persist`, ext2

p25 (system) - System partition, mounted as `/system`, ext4

p26 (cache) - Cache partition, mounted as `/cache`, ext4

p27 (userdata) - Data partition, mounted as `/data`, ext4

(*) For my firmware 15.1.C.1.17, at offset 0x3db7 you can find "Uncompressing Linux...", and at offset 0x4053 you can find the gzip magic number. So...

$ tail -c +16468 loop0p17.img |gunzip > blah.bin

gzip: stdin: decompression OK, trailing garbage ignored

... I think this dumped the stock kernel. Uploaded it here: https://dl.dropboxusercontent.com/u/39080136/c1905/probably_stock_kernel.bin

The partition is probably the vmlinux.

I hope I can do something to find the initrd, can't find it yet...