FORUMS
Remove All Ads from XDA

[TOOL] UnSIN ~ SIN v3/v4/v5 Unpacker [v1.12]

1,684 posts
Thanks Meter: 3,695
 
By IgorEisberg, Senior Member on 5th June 2015, 05:29 PM
Post Reply Email Thread
This tool was especially made for the new SIN v3 format used in Xperia Z3+/Z4 and Xperia Z4 Tablet (and more recent Xperia devices as well), as well as SIN v4 format introduced with Xperia XZ Premium and SIN v5 format introduced with Xperia XZ2 and Xperia XZ2 Compact.
This tool can unpack every SIN v3/v4/v5 file to it's contained binary or EXT4 file, the later can then be extracted with ImgExtractor or ext2explore to its inner files.

Special credits to @Androxyde (of Flashtool) for original Java SIN code, @tal.aloni for Sparse decompression method and Dino Chiesa for TAR extraction method.

SUPPORTED SIN FORMATS:
SIN v3 = Custom format (utilizing LZ4 compression)
SIN v4 = gzip + tar + Android sparse format
SIN v5 = tar + Custom sparse format (utilizing LZ4 compression)

REQUIREMENTS:
.NET Core (native binary) variant:
Windows: 64-bit support only. No other requirements.
Linux: 64-bit support only. No other requirements
.NET Framework variant: (discontinued)
Windows: At least .NET Framework 4.0 installed.
Linux: Mono for Linux

USAGE:
Just drag and drop a SIN file onto this EXE file, or write in Command Prompt "unsin system.sin" (or any other SIN image).
Make sure you have at least 6GB of free space on your hard drive, as the output EXT4 images are huge.

COMMAND-LINE OPTIONS:
unsin --- Intro, version and usage instructions.
unsin <file path 1> [<file path 2> ... <file path n>] --- Unpack specified *.sin file(s)
unsin -d --- Unpack all *.sin files in the current directory (non-recursive)
unsin -d <dir path 1> [<dir path 2> ... <dir path n>] --- Unpack all *.sin files in the specified directories (non-recursive)
unsin -dr --- Unpack all *.sin files in the current directory (recursive)
unsin -dr <dir path 1> [<dir path 2> ... <dir path n>] --- Unpack all *.sin files in the specified directories (recursive)

NOTES:
* The order of the options has no significance. (i.e. -dr is the same as -rd)
* The options are case-insensitive. (i.e. -d is the same as -D)

CHANGELOG:
v1.12 [October 1, 2019]:
- Added intro, version and usage instructions to binary (when executing without any arguments)
- .NET Core Windows x64 binary rebuilt with .NET Core 3.0 and file size reduced to ~1.8MB.
- .NET Core Linux x64 binary rebuilt with .NET Core 3.0 and file size reduced to ~2.1MB.
- The .NET Framework variant is discontinued, final version is v1.11.
v1.11 [August 12, 2019]:
- Added .NET Core native self-contained binaries: UnSIN 1.11 (Win x64).zip and UnSIN 1.11 (Linux x64).zip
v1.11 [May 31, 2019]:
- Fixed unsparsing of SINs containing non-EXT4 images that were split into multiple sparse parts. (mainly affecting recent modem.sin images)
v1.10 [June 12, 2018]:
- Fixed wrong implementation of FILL sparse chunk type that resulted in corrupted images in rare occasions.
v1.9 [April 9, 2018]:
- Workaround for certain SIN files that contain 2 unexpected 0x00 bytes, specifically on F5121 Oreo firmware's oem.sin files. Purpose of these bytes is unknown, probably reserved for future use, but can be safely skipped.
- Added command-line options by a user's request.
v1.8 [March 23, 2018]:
- Fixed a silly mistake that resulted in corrupted EXT4 images.
- Significantly optimized memory usage.
v1.7 [March 23, 2018]:
- Added support for SIN v5 (tar + Custom sparse format) files that were introduced in Xperia XZ2 and Xperia XZ2 Compact firmware.
v1.6 [June 29, 2017]:
- Removed some unnecessary stages, making the extraction a lot faster.
- Improved checking of available disk space, to accommodate for the removal of pre-assigned container file.
v1.5 [June 10, 2017]:
- Fixed extraction for SIN v4. Images can now be mounted properly.
v1.4 [June 6, 2017]:
- The extracted images are now identical to those extracted by Flashtool, and can be mounted properly.
- Fixed support for old SIN v3 formats that used a different partition information (i.e. Xperia C).
v1.3 [May 11, 2017]:
- Fixed SIN v4 support for non-sparse binaries.
v1.2 [May 10, 2017]:
- Added support for SIN v4 (gzip + tar + Android sparse format) files that were introduced in Xperia XZ Premium firmware. (NOTE: At least .NET Framework 4.0 is now required!)
v1.1 [December 1, 2016]:
- Algorithms were fixed to support large Nougat-based SIN files.
v1.0 [June 5, 2015]:
- Initial release.
Attached Files
File Type: zip UnSIN 1.11 (by Igor Eisberg).zip - [Click for QR Code] (13.5 KB, 1094 views)
File Type: zip UnSIN 1.12 (Win x64).zip - [Click for QR Code] (1.10 MB, 878 views)
File Type: zip UnSIN 1.12 (Linux x64).zip - [Click for QR Code] (893.3 KB, 182 views)
The Following 88 Users Say Thank You to IgorEisberg For This Useful Post: [ View ] Gift IgorEisberg Ad-Free
5th June 2015, 07:18 PM |#2  
Hamidreza2010's Avatar
Senior Member
Thanks Meter: 475
 
More
Its very good
Thanks
5th June 2015, 10:33 PM |#3  
ogunja's Avatar
Senior Member
Flag São Paulo
Thanks Meter: 654
 
Donate to Me
More
Thanks Bro. great idea and amazing job

Sent from my Sony Xperia Z3 ™ Single D6643 - Sen liked my work or my help click thanks!
Toni Junior
5th June 2015, 11:38 PM |#4  
a.hamameh96's Avatar
Senior Member
Flag Sinsheim
Thanks Meter: 256
 
Donate to Me
More
Awesome work mate
6th June 2015, 08:02 AM |#6  
Senior Member
Thanks Meter: 9
 
More
Thanks Bro. great idea and amazing job
6th June 2015, 09:14 AM |#7  
leso60's Avatar
Member
Thanks Meter: 7
 
More
Great Job (y)
8th June 2015, 09:43 PM |#8  
Rootk1t's Avatar
Senior Member
Thanks Meter: 613
 
More
Good work!

Also it unpacks old .sin files without problems
8th June 2015, 10:08 PM |#9  
IgorEisberg's Avatar
OP Senior Member
Thanks Meter: 3,695
 
Donate to Me
More
Quote:
Originally Posted by Rootk1t

Good work!

Also it unpacks old .sin files without problems

Yep, as long as they are v3.
8th June 2015, 10:22 PM |#10  
Rootk1t's Avatar
Senior Member
Thanks Meter: 613
 
More
Quote:
Originally Posted by IaguCool

Yep, as long as they are v3.

How can i determine version of .sin?
8th June 2015, 10:24 PM |#11  
IgorEisberg's Avatar
OP Senior Member
Thanks Meter: 3,695
 
Donate to Me
More
Quote:
Originally Posted by Rootk1t

How can i determine version of .sin?

Open the SIN file with a Hex Editor. The first byte should be 0x03. The next 3 bytes say "SIN" in ASCII.
The Following User Says Thank You to IgorEisberg For This Useful Post: [ View ] Gift IgorEisberg Ad-Free
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes