summaryrefslogtreecommitdiff
path: root/utils/imxtools
AgeCommit message (Collapse)Author
2020-10-18sbtools: Change crypto wrapper implementation to C.Dominik Riebeling
There's nothing C++ left. Change-Id: I98d8406215287c02b56029ed7c0e2b0e645bbcf1
2020-10-18sbtools: convert crypto to libtomcrypt.Dominik Riebeling
Replace the use of crypto++ with tomcrypt, which is much smaller and C. This gets rid of various build issues for systems that don't ship crypo++ (i.e. everything except Linux.) Change-Id: Ic0799e17b94935c71b14765cf9a2a7ea2b0adc7a
2020-10-18imxtools: Replace use of "byte" with its underlying uint8_t.Dominik Riebeling
libtomcrypt uses a macro "byte" which conflicts with this type. Since the underlying type is uint8_t and there's no real benefit from using a custom type use the actual underlying type. Change-Id: I982c9b8bdcb657b99fa645a5235303af7afda25b
2020-06-21sbtools: Avoid calling pkg-config on each compiler invocation.Dominik Riebeling
Only expand pkg-config calls once by making the compiler flags simply expanded variables. Makes things more predicable and slightly faster. Change-Id: Ie2ed066f205a95ec8a7708cefeb29e9989815db6
2020-03-29FS13192: rbutil: Fix linking error on Fedora 32 betaSolomon Peachy
Change-Id: I350553db037ad9f65aced3f974afeaeee3fe822a
2019-11-09rbutil: fix windows cross compile (via M cross environment)Franklin Wei
This fixes a couple of issues when cross-compiling for windows: - lib builds (i.e. mks5lboot) were overriding the cross CC/CXX with the native CC, producing incompatible binaries. - Qt made the accessibility plugin part of the core library, so we no longer need to import it. Change-Id: I9d884aee62dfa51d3624a3fa9b99c23b3b375f20
2017-01-16imxtools/sbtools: switch SHA1 implementation to Crypto++Amaury Pouly
The current implementation was custom and super slow. Since we use Crypto++ anyway, we might as well get use a good implementation. Change-Id: I761ad7401653471e54000e1c2bc3d9882378112f
2017-01-16imxtools/sbtools: switch AES implementation to Crypto++Amaury Pouly
Instead of having our own copy of the AES code, use a good library to do that. Crypto++ is well-maintained, supports a lot of ciphers, works on many OSes, and is optimized for many architectures. Change-Id: I7d7d24b47993206d7338c5f9bac8bbdd3915a667
2017-01-16imxtools/sbtools: various fixesAmaury Pouly
Change bug() macro, fix memory leaks, always use -h for help, fix usage(), fix comment, remove useless macro Change-Id: I30554b5e07e6f2845560a570808603cf8c4da5ad
2017-01-16imxtools/sbtools: rework cryptographyAmaury Pouly
It was a mess, a mix of crypto_* and cbc_mac calls. I made everything call crypto functions, and also separate key setup from cryptographic operations, this will be useful to speed up the code in the upcoming commits. Drop support for "usbotp" key, since the crypto code for that was never mainlined and we can always get the keys from a device as long as we have code execution (using the DCP debug registers). Change-Id: I7aa24d12207ffb744225d1b9cc7cb1dc7281dd22
2017-01-16imxtools: correctly read unencrypted images in raw modeAmaury Pouly
Change-Id: I87830b81a017f36d2887d9c289d09812f227b157
2017-01-16imxtools: rework key/IV overriding logicAmaury Pouly
The overriding of the IV and real key should be the exception, there is no need to manually set them to false. Change-Id: Id66754f20a79aa5c1a991839345d1242e0aa587d
2017-01-16imxtools: rework sb file productionAmaury Pouly
The old code had some annoying way of dealing with padding by adding explicit instructions to the stream, which is 1) ugly 2) not in par with freescale tools. The trick, which this new version implements, is to put the useful length of the section in the section header, and the actual (with padding) length in the boot tag. This way the tools can just ignore padding instruction by reading the section header, and the bootloader can still load the image because it uses the boot tags. Also correctly handle the case where the first section does not start right after the header (there is a bug in freescale tools for this case by the way). There is an ambiguity in the way the padding instructions should be encrypted: the bootloader should logically treat them as regular instruction of the section stream, but it appears the freescale tools do not generate them as part of the stream and instead encrypt them like boot tags, which is stupid because there is no way the bootloader could decrypt them, and anyway we don't care because the bootloader doesn't decrypt them at all. Change-Id: Iabdc1d1f9f82d374779bf03efb75c2c3998f5b5d
2017-01-07imxtools: various fixes for WindowsAmaury Pouly
Don't use colors since the terminal doesn't support it. Also packing is broken on MinGW so use #pragma pack when compiling for windows, this is also supported by MSCV. Change-Id: I635649d52ed5f2e0af46cb9ca2ec325955b2ddb2
2017-01-07imxtools: move firmware read/write to libraryAmaury Pouly
Split the ugly firmware read/write into a API function and a much simplified code. Also the code can now report progress. Change-Id: I3f998eaf0c067c6da42b1d2dd9c5a5bf43c6915d
2017-01-07imxtools/scsitools: move stmp scsi api to its own fileAmaury Pouly
No code modification code, just moving code around. Change-Id: I30744d3994aa7540f4b5b158f31b51959d5d8586
2017-01-07imxtools/scsitools: rework stmp scsi APIAmaury Pouly
Sanitize the whole library by hiding most of the horrible details of the implementation. This means that all logical/drive/table attributes are exported in structures that are internally filled by higher-level API functions. This makes the code much more readable and prepares for a split between scsitool and the stmp scsi library. Change-Id: Id85d450b25cf99cd7c0896c6fc35bcd00babe9e1
2017-01-07imxtools/scsitools: use new SCSI libraryAmaury Pouly
The function names and prototypes are also normalized so make subsequent reworks easier. Change-Id: Ifa5d64aa144b11f8c087517ddc904744e3037361
2017-01-07Add multiplatform library for raw SCSI commandsAmaury Pouly
Several tools need to perform raw SCSI commands, and we need to support Linux, Windows and Mac OS, without pulling tons of dependencies to build it easily. This very simple library has no dependency and supports Linux. TODO: - windows - mac os Change-Id: I496f5ad2490bd3e96ad962d31cce4e511a523c3a
2017-01-01imxtools: fix bug aes128 (did not update cbc-macp)Amaury Pouly
Although this does bug is never triggered because we never decrypt and use the resulting CBC-MAC, it's a major overlook. Change-Id: I3c5d318e6428d528483bf888ea284e9ded3889f0
2016-04-08qeditor: port to the new hwstub library and add featuresAmaury Pouly
This commit adds support for the version of the hwstub library, which requires a lot of changes. It also adds some editing features, such as register access and much better editing of fields using the mouse (double click on a field to be able to resize and move it). Change-Id: I3c4e4cc855cb44911c72bc8127bad841b68efe52
2014-12-20sb1: fix buggy comparisonAmaury Pouly
cppcheck reported: [rockbox/utils/imxtools/sbtools/sb1.c:440]: (warning) Comparison of a boolean expression with an integer other than 0 or 1. Thanks to Thomas Jarosch Change-Id: I0078232706d4014a1f2acea310a7a0d0edf7788b
2014-09-07sbtools: add option to ignore sha1 errorsAmaury Pouly
Change-Id: I6bf9e4671e57f8ff3f436660e8ecb561027a036c
2014-09-07sbtools: use default transfer size if it cannot be probedAmaury Pouly
A older commit removed this ability but it tends to be a problem since the HID driver can prevent probing of transfer size which then needs to be entered by hand on the command line. Change-Id: Ie5a556ffdcc2adec0e1c984810983e19136b6473
2014-02-22imxtools/scsitools: increase SCSI delay to 10 secondsAmaury Pouly
On some OSes like Windows or if running in a virtual machine, the one second timeout might be too short. Change-Id: I717f7a2aaed1cb3d40e8fbe6f9b1081b43ceea95
2014-02-22imxtools/scsitool: add progress indicatorAmaury Pouly
Change-Id: I061ddac4f882156139e38fa6d495fee86271a6aa
2014-02-22imxtools/scsitool: improve output formattingAmaury Pouly
Change-Id: Ifc5b5252e1342f381356f7bd5c2fed5ad8beddfe
2013-12-24imxtools/scsitools: tool can now write a firmware using SCSIAmaury Pouly
Change-Id: Iac803d4b2d48319a1a32d1101f5041d20174c7a1
2013-12-06imxtools/sbtools/sb1: fix parsing/debug bug about jump/call argumentsAmaury Pouly
Change-Id: Ib406cfc03ced6c8689ed467c154d6a7447a34e5c
2013-12-06imxtools/sbtools/elf: fix debug codeAmaury Pouly
Change-Id: If043eb214417a41f71e6c05fc6a725eb8f983373
2013-12-06elftosb: fix crash on invalid command fileAmaury Pouly
Change-Id: Ifef61b7ca6a391960d1d696ba455e0d14462c967
2013-10-10imxtools/scsitools: document some of the SCSI vendor commandsAmaury Pouly
Change-Id: I534fc467aad960c61b54d202096823d5c2c9a5e9
2013-10-09imxtools/sbloader: rewrite hid codeAmaury Pouly
Rewrite code with proper documentation: it uses a UMS like CBW/CSW to wrap commands and status. Change-Id: I10476c87aaea96d4b9e54f8c1c266835c8e89721
2013-10-09imxtools/sbtools: always probe report size for HID recovery modeAmaury Pouly
Some older versions of the ROM (TA3 for example), use a 64 byte report size instead of 1024, so hardcoding 1024 is just a bad idea. Change-Id: I720c4465cfe2f519bffa307175614bba58766dce
2013-09-18imxtools: add pin map and decoding toolAmaury Pouly
Also add the tool which was used to generate the map on wiki. Change-Id: I54f3474028b5fa75348564437ec1b46ba20f071b
2013-09-10imxtools/efltosb: fix extern() in db filesAmaury Pouly
Change-Id: I5f1acd619b2f280e709d2bd06a28a3e88cc05e27
2013-09-05imxtools/scsitools: add option to extract firmware from the deviceAmaury Pouly
Change-Id: Ib8cbf2f864a9375575cea0edbba48f740bf8f12e
2013-08-22sbtools: fix elf section namingAmaury Pouly
Change-Id: I4500bf70028af26cc4b8136f111f527e1396d16e
2013-08-22sbtools: more work on sbtoelf and elftosb, support more attributesAmaury Pouly
Now handle timestamp, sb minor version, component/product versions, section flags. Change-Id: I35313efe60c28f04ea3732b36e5e01be3213cf9e
2013-08-22sbtools: factor code in command parserAmaury Pouly
Change-Id: I790c373b8a0319cdb00650d3c59919bd4b0b96f6
2013-08-22sbtools: now generate a db file along with with elf/rsrc filesAmaury Pouly
Now always generate a "make.db" file which aims at being the exact representation of the file, ie running sbtoelf and elftosb using the generated command file should produce the exact same file (except for the random paddings). We still miss the support for some option parsing to achieve that though. Change-Id: Ib7d6b241f7855fd35225df8ab8e0711f69d9ee5a
2013-08-22sbtools: fix buffer overflowAmaury Pouly
Change-Id: I7b1c963e58eec88da215722ec219569a0a5a9cea
2013-08-21sbtools: fix redAmaury Pouly
Change-Id: I28b7d4d59d8f14abbba2a70e2bdea6987b6a3a98
2013-08-21sbtools: more code refactoringAmaury Pouly
Factor all printf method with a unique one defined in misc.h Change-Id: I58fbf8916b76e873a2e6678506d2c8aece7834ec
2013-08-10sbtools: more printf fixingAmaury Pouly
Change-Id: Id617297c196b381fd1c381da3eff4345e3157529
2013-08-06sbtools: fix output printingAmaury Pouly
The code used printf instead of the provided printf functions, resulting in strange output. Change-Id: I2c7c2531d8d54ecdea97e8c189d18d351320ca7d
2013-08-06sbtools: fix handling of NOP instructionsAmaury Pouly
Change-Id: I05ab8176f368a6e2d075dfb2059692871e0c00b3
2013-08-06elf: fix handling of virtual/physical addressesAmaury Pouly
Remove the hackish elf_translate_addresses which should not have existed in the first place, on write always compute the physical address of a section using elf_translate_virtual_address which makes it possible to specify any virtual to physical mapping and fail nicely if there is none. Change-Id: I4f436945e90280a6fd9430de6c642dbeb8e23d40
2013-08-06sbtools: various fixesAmaury Pouly
Change-Id: I82c4642aea325cf22d66e9b49fc2d47319cd70eb
2013-08-06sbtools: standard sb print function is now standardAmaury Pouly
Change-Id: I2746bfff9a360ef4fc823853859609ffed5d2b67