path: root/utils/nwztools/upgtools
AgeCommit message (Collapse)AuthorFilesLines
2020-10-11nwztools: fix wrongly generate MD5 filesAmaury Pouly1-0/+1
When generating the MD5 using -z index,name the tool would add the entry but forgot to increase the file size, hence truncating the file. Change-Id: Ibd3c594722ab46350cda60d158666fe34a96e922
2020-10-11nwztools: re-implement MD5 on WindowsAmaury Pouly2-2/+27
I forgot to fixup the windows up and missed it because of conditional compilation Change-Id: I526c765b9d56508815941ecb9b9dbac7ea407cf0
2020-10-11nwztool: fix computationAmaury Pouly1-1/+1
It turns out the calculation gives the right result for the wrong reason, this fixes it. Change-Id: I36053c8993b5ae1e85380da59546ffade265fb3f
2020-10-11nwztools/upgtool: add support for MD5Amaury Pouly3-4/+159
When compressing, it is possible to tell the tool to add an entry to the MD5 file (index 1), it is still necessary to give an empty file for that index. To do so, pass the option "-z idx,name" insteas of "-z idx". This will create an entry of the form "size md5 name". For instance "-z 6,system.img". When decompressing, if one passes "-z idx,name" instead of "-z idx", the tool will decompress and check against the value in the MD5 file. Change-Id: Ifb945f6121644ae9105265d2d83ce6067301c5b2
2020-10-11nwztool/upgtools: add NW-A55 and DMP-Z1 KAS, reorganize listAmaury Pouly1-7/+8
Change-Id: I24bc6b15c954540cfa9b4f176ecbf817b1b641e7
2020-10-11nwztool/upgtool: add support for compressionAmaury Pouly4-31/+134
To decompress some output file(s), simply pass -z <idx> where idx is the index of the file to decompress, starting from 0. For example upgtool -e NW_WM_FW.UPG -o tmp/ -m nw-wm1a -z 6 -z 7 to decompress files 6 and 7. To compress file, use the same options: upgtool -c NW_WM_FW.UPG -m nw-wm1a -z 2 md5sum.txt system.img Change-Id: I1ef0b3e02c98e58154f1a959fb1ad70ad2ce6500
2020-10-11nwztools/upgtools: add support for windowsAmaury Pouly9-91/+240
In order to avoid the crypto++ mess, the code uses the Windows Cryptography API, which is standard. There is also some makefile magic to cross-compile: make PREFIX=i686-w64-mingw32- EXE_EXT=.exe I selected the option so that it should statically link supports libraries used by gcc (slsj and libwinpthread). Change-Id: Iaf07da23afe81ed217fb3921ce13367c5441514d
2020-10-11nwztools: add support for new UPG format on post-WM1/A30 devicesAmaury Pouly10-258/+446
The new code supports reading and writing UPG files. I kept the old keysig search code but it only supports the old format (the new format has too long keys anyway). Since we now have to support two types of encryption(DES and AES), I reorganized the crypto routines and clean-up some code. Change-Id: Ie9be220ec2431ec6d0bd11699fa0493b62e1cec2
2020-10-11nwztools: fix MW-WM1/A30 KAS, fix KAS lengthAmaury Pouly1-2/+3
Split WM1A/WM1Z because they don't have the same KAS. On newer devices, the KAS is actually 64 bytes, not 60. The strange thing is that "get_dnk_nvp kas" returns 60 bytes whereas "get_dnk_prop kas" returns 64, not sure why. Change-Id: I944d3d838209ba58388439af0cdf5d7c74f1f7fc
2020-05-17nwztool/scsitool: add brute-forced kasAmaury Pouly1-0/+1
Change-Id: I692b06c7c456bfa4395aa2aa848fdc664bd203d4
2020-05-17nwztools/scsitool: fix compile issue with some version of cryptoppAmaury Pouly1-1/+1
Change-Id: Ia20f0142a2b08bddd61a0056f49c8e4c9ed49caa
2019-01-25Fix host build of mkimxboot, mknwzboot, nwztools, and rbutil with crypto++Solomon Peachy3-9/+24
Necessary to get working builds on my Fedora 29 system. Change-Id: Ia6232427c959629ade9a85fc412738f688facedb
2017-10-22nwztools/upgtools: make the tool print the whole kas, not just 16 bytesAmaury Pouly1-1/+1
Change-Id: I9daca9148b7aaea905a765dfeb95faf6fb7198b1
2017-10-20nwztools: add KAS for NW-A40 seriesAmaury Pouly1-0/+1
Change-Id: I6e22ba0a58eb62dcc9f2025ee7233f5afae1bbec
2017-10-07nwztools: add NW-ZX300 KAS, extracted from a deviceAmaury Pouly1-0/+1
Now this is very weird, is it yet another format/encryption? Change-Id: I119dec1e6d636a99508fb1394de27237ca3ab814
2017-09-19upgtools: fix bug in brute force searchAmaury Pouly1-6/+8
DES ignores the parity bit of each byte (making the 64-bit key really 56-bit), but the current code skipped the parity bit of each half-byte, thus missing some keys. Change-Id: Ia523ebb944e458905b7de1742df151df22166150
2017-09-17Add support for the NWZ-E350bootloader_nwze350_v1Amaury Pouly1-0/+1
Strangely it has the SAME encryption key as the E450. Either they didn't bother changing it or more likely they have exactly the same internals and a slightly different case. Change-Id: I39ab88845b3e40db34160c2e61dde421f391df44
2017-06-13nwztools: add KAS for NW-S10 (brute-forced using upgtool)Amaury Pouly1-0/+1
Change-Id: Ia37818faee29130ffe3690c83f85a39bd35637e0
2017-04-25nwztools/upgtools: misc fixesIgor Skochinsky2-0/+6
* added KAS for nwz-x1000 (extracted from an NWZ-X1060 via "get_dnk_nvp kas") * hint that -o is needed when extracting Change-Id: Ic91c448aa058a22c8ddcae54726f628f7cf60f6b
2017-04-25nwztools/upgtools: add key for NWZ-A840Amaury Pouly1-0/+1
Change-Id: I0a191db1970e64b5ced518c68861392ba342404f
2017-01-14nwztools/upgtools: add real KAS for NW-ZX100 and fix typoAmaury Pouly1-1/+1
Change-Id: I4e4679d6e92c1c0fc8a03db5201aee39d82b24b2
2017-01-08nwztools: add various info about S740, S750, S640, E050Amaury Pouly1-0/+1
Change-Id: I2cc887ce2824a2d0b9aeb2a89df662c621c28750
2017-01-08nwztools: forgot fileAmaury Pouly1-0/+175
Change-Id: I4341f2af71675cb795987ecc5ce12104445a9d97
2017-01-08nwztools/upgtools: add real NW-A20 kasAmaury Pouly1-1/+1
Change-Id: I88fb2aefafbc7820a49847fbf0888de9cf81bd3f
2017-01-08Makefile cleanupsAmaury Pouly1-2/+2
Change-Id: I69b8b81d357553c979682d42097eba864c951512
2017-01-08nwztools: add NW-WM1 kasAmaury Pouly1-0/+1
Like the NW-A30, we don't know how to use it, but record it anyway. Change-Id: Iebd26637253613625a4885afe88695ad3ffb0605
2017-01-08nwztools: add A35 model and KASAmaury Pouly1-0/+3
We don't know the encryption method, the KAS is completely different but it might be useful to record it anyway for future purposes. MID extracted from device, Japanese NW-A35. Change-Id: I4c4bb5b063da99003b5c316061d8c490b77428a4
2017-01-08nwztool/upgtools: replace NWZ-A10 kas by the real oneAmaury Pouly1-1/+1
Extracted from a target. Change-Id: Ieb4aff15f332a681142a7079c1adf3b1da31de24
2017-01-08nwztools: rename nwz-a20 to nw-a20, that was a typoAmaury Pouly1-1/+1
Change-Id: I88ae7391732c6f41c3c4adccce2ddf0a92142067
2017-01-04nwztools: cleanup crypto, switch MD5 to Crypto++Amaury Pouly9-53/+108
We already use Crypto++ for DES anyway, and using OpenSSL is not great because of its incompatible licence. Change-Id: I78771b84c1708795a0c0c30afa5bdfe4885dea4e
2017-01-04nwztools/upg: move upg handling to its own file, completely rework kas handlingAmaury Pouly6-386/+361
This was a huge mess, the new is much cleaner hopefully. Change-Id: I43663d021dc8bc31662d3923e1c3da22d987ebf9
2017-01-04nwztools/upgtools: add more brute force algorithmsAmaury Pouly3-21/+169
Allow to search for hex with upper case and alphanumeric. This is *much* slower of course. Change-Id: I41a2fc63c4b2220c21147b711098ebc37ddb3527
2016-11-14Add KAS for NWZ-E470Marcin Bukat1-0/+1
Change-Id: I1b8272a486ba2377e5047855acda3f80aa92c232
2016-11-11nwztools/upgtools: cleanupAmaury Pouly1-3/+4
There is no need to store the key and sig since those are derived from the KAS anyway. Change-Id: I228913b1cb32e496db265e9a7aaf3bb4200a9f6b
2016-10-31nwztools/upgtools: sanitize series name and add keysAmaury Pouly1-5/+8
Unify series names: e46x -> e460 to be consistent with Sony' name. Add keys for various players that were cracked using upgtools. The real KAS would need to be extracted from a target but at least we can open/create firmware upgrades. Change-Id: Id23a10e10170d7f6330c6699bf205c4df5ddebfe
2016-10-27nwztools/upgtools: rewrite keysig brute force searchAmaury Pouly7-106/+299
The new search has two new features: - it takes advantage of the fact that DES keys are only 56-bit long (and not 64) - it is now multithreaded As a proof of concept, I ran it on the A10 series firmware upgrade and was able to find the key in a few seconds using 4 threads. The search is still limited to ascii hex passwords (seems to work on all devices I have tried thus far). Change-Id: Ied080286d2bbdc493a6ceaecaaadba802b429666
2016-08-30nwztools: cleanup the codeAmaury Pouly6-274/+267
There was a lot of copy and paste, and the code was just crap. This commit tries to clarify the code and also document the encryption procedure. Hopefully I didn't break anything. Change-Id: I257793010e7cf94f2b090b30bb8608359d3886e3
2016-08-30upgtools: add NWZ-E45x Series key and signatureAmaury Pouly1-0/+1
Also fix a typo in the script makefile Change-Id: Ie747d8b99ca0f6a98bbcaf1c82e66c7788f00e6e
2016-08-30upgtools: small cleanupsAmaury Pouly1-32/+26
KAS was in its own structure for historical reasons, but it's stupid now. Change-Id: Ie8d69ac6d489337cd857ace1abe5b1e4b1177172
2016-08-17nwztools: upgrade upgtools and add dumping scriptAmaury Pouly1-20/+4
Change-Id: I315d1010ce5477c0112f4a890156b360e8123e11
2012-11-13upgtools: allow creation of a UPG archive + improvementsAmaury Pouly4-43/+320
Change-Id: I9c3e2eb95f7eb6d41591b006328fd720dfcf93a5
2012-11-03Introduce upgtools for sony nwz playersAmaury Pouly10-0/+1078
This tool can unpack UPG archives for firmware updates. Change-Id: I32f5f1a84759198c7af4a4ecfd7aa65eaeda567a