[Xperia Z5 Android Development] munjeni:
If somebody experienced is interesting for this pm me!

------------------------------------------------------------------------
Nougat Trim Area PoC kernel image patcher by Munjeni @ 2017
------------------------------------------------------------------------

hash:0x868268B9 calc_hash:0x868268B9
hash:0xC373AFE1 calc_hash:0xC373AFE1
hash:0x4BD345EB calc_hash:0x4BD345EB
device: D5503
serial number: CB5A1XFEFL
drm key: 0001046B 0010 6A 2A F6 D7 7E CB 98 15 A8 94 E5 02 13 B2 A8 27
Trim area dump is a valid.
Locked bootloader.
Deleting old folder ramdisk if exist...
if exist ramdisk (rd ramdisk /s/q)
returned: 0.
New directory ramdisk created.
Using existing folder "out"
opening kernelX.sin
kernelX.sin is Sony sin format.
Converting...
Proccessing kernelX.sin...
File size: 0x12583CD
Sin header size: 0x918
Sin data size: 0x80000
Found MMCF magic string!
GPTP len: 0xc0
GPTP_UUID: c8db502f-14fc-e493-4a9d-496fba338b45
Extracting part 1 type: LZ4A
|-- packed data offset: 0x0
|-- unpacked data size: 0x1000000
|-- packed data size: 0x9fca9b
|-- unpacked data offset: 0x0
|------ curr sin poss: 0x938
|------ start sin poss: 0x9e0
|------ now sin poss: 0x9fd47b
|------ now out poss: 0x0
|------ successfully decompressed part 1 data.
|------ Filetype ELF.
|------ now sin poss next: 0x98c
|------ t=0x54 d=0x54
Extracting part 2 type: LZ4A
|-- packed data offset: 0x9fca9b
|-- unpacked data size: 0xb82df3
|-- packed data size: 0x85af52
|-- unpacked data offset: 0x1000000
|------ curr sin poss: 0x98c
|------ start sin poss: 0x9fd47b
|------ now sin poss: 0x12583cd
|------ now out poss: 0x1000000
|------ successfully decompressed part 2 data.
|------ now sin poss next: 0x9e0
|------ t=0xa8 d=0x54
|--- now out poss: 0x1b82df3
Sin file verification ok.
Extracting...
out/converted.file extracted.
Renaming to out/kernelX.sin.elf succeed.
Done.
Using existing folder "out"
opening out/kernelX.sin.elf
Extracting file out/kernelX.sin.elf
ELF magic found
Entry point : 0x20080000
Class : 64-bit objects
Program Header start : 0x40
Program Header size : 0x38
Program Header count : 3
PH[0], type=1, offset=0x000000E8, virtual=0x20080000, phy=0x20080000, size=0x013952A8
PH[1], type=1, offset=0x01395390, virtual=0x22000000, phy=0x22000000, size=0x006A79E7
PH[2], type=1, offset=0x01A3CD77, virtual=0x21E00000, phy=0x21E00000, size=0x0014503C
0. Dumping out/boot.img-zImage
1. Dumping out/boot.img-ramdisk.gz
2. Dumping out/boot.img-dt
Seeking to cmdline address = 0x01B81DBB
3. Dumping cmdline to out/boot.img-cmdline
Done.
Gunziping...
setting up infflate...
infflating...
infflate returned: 0
gzpipe: ok.
unziped: ok.
Extracting ramdisk.cpio...
Searching for file_contexts...
ramdisk/file_contexts.bin@0644 file is binary.
Converting ramdisk/file_contexts.bin@0644 to plaintext...
Converted.
Patching file "ramdisk/init.sony-platform.rc@0750"
Patching file "ramdisk/init.sony-platform.rc@0750"
Patching file "ramdisk/ueventd.rc@0644"
Patching file "ramdisk/file_contexts@0644"
Converting plaintext file_contexts to binary...
Converted.
Create ta scipt.
Create busybox.
TA.img (TA.img) installed.
Making sepolicy backup: ramdisk/backupsepolicy@0644
Patching sepolicy...
libsepol.policydb_index_others: security: 1 users, 2 roles, 1379 types, 0 bools
libsepol.policydb_index_others: security: 1 sens, 1024 cats
libsepol.policydb_index_others: security: 63 classes, 18237 rules, 0 cond rules
Success
libsepol.policydb_index_others: security: 1 users, 2 roles, 1379 types, 0 bools
libsepol.policydb_index_others: security: 1 sens, 1024 cats
libsepol.policydb_index_others: security: 63 classes, 18237 rules, 0 cond rules
Success
libsepol.policydb_index_others: security: 1 users, 2 roles, 1379 types, 0 bools
libsepol.policydb_index_others: security: 1 sens, 1024 cats
libsepol.policydb_index_others: security: 63 classes, 18238 rules, 0 cond rules
Success
libsepol.policydb_index_others: security: 1 users, 2 roles, 1379 types, 0 bools
libsepol.policydb_index_others: security: 1 sens, 1024 cats
libsepol.policydb_index_others: security: 63 classes, 18239 rules, 0 cond rules
Success
libsepol.policydb_index_others: security: 1 users, 2 roles, 1379 types, 0 bools
libsepol.policydb_index_others: security: 1 sens, 1024 cats
libsepol.policydb_index_others: security: 63 classes, 18239 rules, 0 cond rules
Success
libsepol.policydb_index_others: security: 1 users, 2 roles, 1379 types, 0 bools
libsepol.policydb_index_others: security: 1 sens, 1024 cats
libsepol.policydb_index_others: security: 63 classes, 18240 rules, 0 cond rules
Success
libsepol.policydb_index_others: security: 1 users, 2 roles, 1379 types, 0 bools
libsepol.policydb_index_others: security: 1 sens, 1024 cats
libsepol.policydb_index_others: security: 63 classes, 18241 rules, 0 cond rules
Success
libsepol.policydb_index_others: security: 1 users, 2 roles, 1379 types, 0 bools
libsepol.policydb_index_others: security: 1 sens, 1024 cats
libsepol.policydb_index_others: security: 63 classes, 18241 rules, 0 cond rules
Success
libsepol.policydb_index_others: security: 1 users, 2 roles, 1379 types, 0 bools
libsepol.policydb_index_others: security: 1 sens, 1024 cats
libsepol.policydb_index_others: security: 63 classes, 18242 rules, 0 cond rules
Success
-------------------------------------------------------------------------------------------
No users script found in current directory.
Right now you have chance to modify folder "ramdisk" manualy, press any key when done!
If you need to automate ramdisk modification, make an script.sh (lin) or script.bat (win),
and put in the same dir with nougat_ta_poc.
-------------------------------------------------------------------------------------------

Press any key to continue . . .
Repacking ramdisk...
ramdisk.cpio done.
Making ramdisk.gz
defflating...
defflate returned: 0
setting up infflate...
infflating...
infflate returned: 0
gzpipe: ok.
gzip: ok.
ramdisk.gz done.
No QCDT magic string.
Packing new_boot.img
cmdline="androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 androidboot.bootdevice=7824900.sdhci lpm_levels.
sleep_disabled=1 zram.backend=z3fold earlyprintk"
base="0x00000000"
pagesize="4096"
ramdiskoff="0x22000000"
defflating...
defflate returned: 0
setting up infflate...
infflating...
infflate returned: 0
gzpipe: ok.
gzip: ok.
zImage-dtb , dt appended.
making new_boot.img
new_boot.img created.
Done.

Press any key to continue . . .