[DEV][TOOL] kernel.sin unpacker {UPDATED for Z1 and above!}

Search This thread

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
THIS IS FOR ADVANCED/EXPERIENCED USERS ONLY


[ info ]

hello devs/users this should be a useful tool (its just a small perl script) for u guys... i have modified the popular unpack-bootimg.pl script to support the (new) kernel.sin files... so it will basically unpack kernel.sin to zImage and ramdisk, ramdisk will also be extracted...


[ requirements ]

  1. linux machine
  2. perl


[ supported devices ]

  • Xperia X10 (GB update, custom kernels for unlocked bootloaders)
  • Xperia 2011, 2012, 2013 H1 devices
  • Xperia 2013 H2 devices onwards with dt.img extraction support


[ download link ]

unpack-kernelsin.pl


[ usage ]

Code:
./unpack-kernelsin.pl kernel.sin


icon8.gif


Enjoy!
 
Last edited:

andrewddickey

Senior Member
Jan 23, 2011
198
74
Awesome job DooM!
Just one more reason for me to get more into linux.

Thanks for all that you do!
 
Awesome job DooM!
Just one more reason for me to get more into linux.

Thanks for all that you do!

Use Ubuntu or back|track 5 r1 which is what I am using right now also it has flash player plugin pre installed unlike ubuntu 11.04. Also as lons as you know a bit about security penetration then bt5r1 is the best linux distro;)
 

Blagus

Inactive Recognized Developer
Jun 10, 2010
1,324
1,048
Also, are you sure 1F 8B is enough? Because I see a lot of 1F 8B in kernel.sin, while 1F 8B 08 is the kernel magic for SE devices.
 

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
Wouldn't perl work on Windows too? split_bootimg.pl works fine on both Windows and Linux...

well it should as long as u have the required binaries in place

Also, are you sure 1F 8B is enough? Because I see a lot of 1F 8B in kernel.sin, while 1F 8B 08 is the kernel magic for SE devices.

1F 8B has been enough for Xperia X10, Arc, Neo, Play, Mini, Mini Pro, Ray (as i have made insecure kernels for all those devices using this same file)
 

Blagus

Inactive Recognized Developer
Jun 10, 2010
1,324
1,048
1F 8B has been enough for Xperia X10, Arc, Neo, Play, Mini, Mini Pro, Ray (as i have made insecure kernels for all those devices using this same file)

I remember seeing a lot of 1F 8B strings through X8 images, so you maybe want to add support for them by adding 08 and you won't break support for already supported ones.

Sent from my R800i
 
  • Like
Reactions: DooMLoRD

Bin4ry

Inactive Recognized Developer
Nov 14, 2008
2,007
5,907
Berlin
Little correction here ;-)
1F8B08 is the tar.gz magic number and has nothing to do with SE :p

But you are right its safer to search for the whole magic.

Regards

Also, are you sure 1F 8B is enough? Because I see a lot of 1F 8B in kernel.sin, while 1F 8B 08 is the kernel magic for SE devices.



Sent from my LT15i using Tapatalk
 

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
I remember seeing a lot of 1F 8B strings through X8 images, so you maybe want to add support for them by adding 08 and you won't break support for already supported ones.

Sent from my R800i

oh ok, u have the x10mini/x8 right? can u please check on those kernel.sin files using this change which u suggested?

Little correction here ;-)
1F8B08 is the tar.gz magic number and has nothing to do with SE :p

But you are right its safer to search for the whole magic.

Regards

Sent from my LT15i using Tapatalk

Thanks Bin4ry! did u get my p.m.?

safer and proper way - parse SIN header, extract payload, parse ELF header in payload, extract program tables.

everything other, like signature search and heuristic analyze, can work, but can fail ;)

can u kindly post the hex delimiters for those parts/sections?

may be u can provide us with the tool to unpack kernel.sin, since u posted the tool to make a custom one ;)
 

lzyllp

Senior Member
Dec 30, 2010
601
236
fuzhou
I use sudo ./unpack-kernelsin.pl kernel.sin
but it say command not found
someone can help me?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 41
    THIS IS FOR ADVANCED/EXPERIENCED USERS ONLY


    [ info ]

    hello devs/users this should be a useful tool (its just a small perl script) for u guys... i have modified the popular unpack-bootimg.pl script to support the (new) kernel.sin files... so it will basically unpack kernel.sin to zImage and ramdisk, ramdisk will also be extracted...


    [ requirements ]

    1. linux machine
    2. perl


    [ supported devices ]

    • Xperia X10 (GB update, custom kernels for unlocked bootloaders)
    • Xperia 2011, 2012, 2013 H1 devices
    • Xperia 2013 H2 devices onwards with dt.img extraction support


    [ download link ]

    unpack-kernelsin.pl


    [ usage ]

    Code:
    ./unpack-kernelsin.pl kernel.sin


    icon8.gif


    Enjoy!
    7
    D
    Deleted member 3665957
    safer and proper way - parse SIN header, extract payload, parse ELF header in payload, extract program tables.

    everything other, like signature search and heuristic analyze, can work, but can fail ;)
    4
    Little correction here ;-)
    1F8B08 is the tar.gz magic number and has nothing to do with SE :p

    But you are right its safer to search for the whole magic.

    Regards

    Also, are you sure 1F 8B is enough? Because I see a lot of 1F 8B in kernel.sin, while 1F 8B 08 is the kernel magic for SE devices.



    Sent from my LT15i using Tapatalk
    2
    you are right i try it today and it worked perfectly! but how can i build boot.img from this files?:confused:

    https://github.com/freexperia/boot_tools/blob/master/build-bootimg-mogami/makeit.sh
    1
    nice work! can you make one in ms-dos batch version? :D

    aZuZu u are the expert at porting linux stuff to windows ;)