summaryrefslogtreecommitdiffstats
path: root/rbutil/sansapatcher/sansapatcher.c
AgeCommit message (Collapse)AuthorFilesLines
2021-12-24rbutil: Merge rbutil with utils folder.Dominik Riebeling1-975/+0
rbutil uses several components from the utils folder, and can be considered part of utils too. Having it in a separate folder is an arbitrary split that doesn't help anymore these days, so merge them. This also allows other utils to easily use libtools.make without the need to navigate to a different folder. Change-Id: I3fc2f4de19e3e776553efb5dea5f779dfec0dc21
2013-01-22Remove 64bit warning by using C99 fixed width format specifier.Dominik Riebeling1-11/+11
Change-Id: I422d0a7ca91170b27171178ad6a8d7ff7ac32570
2013-01-01sansapatcher: move sectorbuf pointer into sansa_t structure.Dominik Riebeling1-53/+51
Similar as the ipod_t structure for ipodpatcher the sansa_t structure holds all relevant information for sansapatcher. Put the global sansa_sectorbuf pointer into it as well. Change-Id: Iad08ef6aafc49609c3d0d556914246f230ee0179
2011-12-04sansapatcher: factor out handling of bundled bootloaders.Dominik Riebeling1-51/+46
Instead of handling bundled bootloaders in the sansapatcher functions leave that to the caller. This removes the need to have Rockbox Utility specific parts in sansapatcher. sansa_add_bootloader() now operates on an already loaded bootloader. For loading a convenience function sansa_read_bootloader() is added. This also introduces a new check on loading to prevent installing an e200 bootloader on a c200 (and vice versa). These changes will allow building a libsansapatcher for linking with Rockbox Utility later. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31144 a1c6a512-1295-4272-9138-f99709370657
2009-11-08Rename print_error() in ipodpatcher and sansapatcher.Dominik Riebeling1-1/+1
Both patchers use the same function name with one being removed when building for rbutil. This gets in the way trying to move the patchers to libraries, and it also results a linking dependency of sansapatcher on ipodpatcher. Renaming the function makes both more self-contained and avoids potential issues if the functions happen to not do the same. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23568 a1c6a512-1295-4272-9138-f99709370657
2009-05-01Make sure the global buffers for ipodpatcher and sansapatcher get allocated ↵Dominik Riebeling1-1/+1
and freed only once. Fixes segfaults when the bootloader install class was instanciated multiple times. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20835 a1c6a512-1295-4272-9138-f99709370657
2008-08-31Replaced TAB characters by spaces in sansapatcherBertrik Sikken1-30/+30
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18368 a1c6a512-1295-4272-9138-f99709370657
2008-08-31Fix missing sansa_close when scanning for sansas in sansapatcher.cBertrik Sikken1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18367 a1c6a512-1295-4272-9138-f99709370657
2008-07-28Redo r18136 a little cleanerBertrik Sikken1-4/+5
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18141 a1c6a512-1295-4272-9138-f99709370657
2008-07-27Make sure to always use the initial key for decryption of mi4 files in ↵Bertrik Sikken1-2/+4
sansapatcher. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18136 a1c6a512-1295-4272-9138-f99709370657
2008-07-27Added mi4 key for sansa c200 OF version 01.01.07Bertrik Sikken1-2/+3
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18135 a1c6a512-1295-4272-9138-f99709370657
2008-07-16Let sansa_list_images() return the number of mi4 images found.Dominik Riebeling1-3/+9
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18074 a1c6a512-1295-4272-9138-f99709370657
2008-07-14Make functions in sansapatcher static and their arguments const if possible.Bertrik Sikken1-12/+11
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18037 a1c6a512-1295-4272-9138-f99709370657
2008-07-14Fix FS#9002 - Bootloader on c200 shows "target id: e200"Bertrik Sikken1-4/+5
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18035 a1c6a512-1295-4272-9138-f99709370657
2008-06-30When scanning for Ipod / Sansa close the disc handle of every tried disc, ↵Dominik Riebeling1-0/+3
not only for successful checks. Fixes "no Sansa found" issues with rbutil on w32 after autodetection was used. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17893 a1c6a512-1295-4272-9138-f99709370657
2008-06-28Updated our source code header to explicitly mention that we are GPL v2 orDaniel Stenberg1-2/+4
later. We still need to hunt down snippets used that are not. 1324 modified files... http://www.rockbox.org/mail/archive/rockbox-dev-archive-2008-06/0060.shtml git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17847 a1c6a512-1295-4272-9138-f99709370657
2008-06-17Rename variables sectorbuf and verbose to avoid clashes in rbutil. Cleanup ↵Dominik Riebeling1-56/+56
exports a bit. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17730 a1c6a512-1295-4272-9138-f99709370657
2008-05-11Make sansapatcher check and report permission denied errors.Dominik Riebeling1-21/+35
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17461 a1c6a512-1295-4272-9138-f99709370657
2007-10-20Support database rebuild disabling when USB is connected for all e200 OF ↵Barry Wardell1-2/+23
versions. Some people may have to update the OF (to any version they want) using sansapatcher before it will work. This just ensures that the NVPARAMS are in a good state and we can be sure where to look for the rebuild flag.The c200 OF doesn't reboot before rebuilding the database, so our trick won't ever work there. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15225 a1c6a512-1295-4272-9138-f99709370657
2007-10-14Add support for installing/replacing the bootloader in the PPBL section of ↵Barry Wardell1-0/+44
the firmware partition. Allows installation of the Rockbox bootloader in place of the Sandisk one. This expects a plain bootloader binary with no header. Our Rockbox bootloader successfully boots both Rockbox and the OF when installed in this way. This makes it easy to get to a state where e200tool is required, so care is advised. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15108 a1c6a512-1295-4272-9138-f99709370657
2007-09-19Cosmetic - Change the way the detected type of Sansa is displayed and bump ↵Dave Chapman1-2/+2
version to 0.4-svn. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14756 a1c6a512-1295-4272-9138-f99709370657
2007-09-19Initial attempt at c200 support - you now need both a "firmware.mi4" file ↵Dave Chapman1-8/+93
(c200 bootloader) and "PP5022.mi4" file (e200 bootloader) to compile. sansapatcher should detect the device type and install the correct bootloader. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14755 a1c6a512-1295-4272-9138-f99709370657
2007-09-19Allow FAT16 partitions (for c200)Björn Stenberg1-1/+4
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14753 a1c6a512-1295-4272-9138-f99709370657
2007-09-19four more keys that are funDaniel Stenberg1-2/+7
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14752 a1c6a512-1295-4272-9138-f99709370657
2007-08-22Accept both 0x0b and 0x0c as valid FAT32 partition types in the partition tableDave Chapman1-3/+5
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14435 a1c6a512-1295-4272-9138-f99709370657
2007-08-02Fix a couple of warnings. Also fix a bug where the offset wasn't being ↵Barry Wardell1-12/+12
reported right in errors when it was past 4GB. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14140 a1c6a512-1295-4272-9138-f99709370657
2007-08-02Add --update-original-firmware (or -of) option to sansapatcher. This allows ↵Barry Wardell1-33/+124
for changing the original firmware version when the rockbox bootloader is also present. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14138 a1c6a512-1295-4272-9138-f99709370657
2007-07-29Add -W to CFLAGS in Makefile and fix generated warnings. Also close a file ↵Dave Chapman1-7/+19
handle which was being left open git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14069 a1c6a512-1295-4272-9138-f99709370657
2007-05-03Make rbutil compile on Mac OS XDave Chapman1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13316 a1c6a512-1295-4272-9138-f99709370657
2007-05-03Support for Sansa E200 in rbutilDominik Wenger1-6/+12
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13315 a1c6a512-1295-4272-9138-f99709370657
2007-05-03Remove some unused functions, no functional changeDave Chapman1-36/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13314 a1c6a512-1295-4272-9138-f99709370657
2007-03-21Some more sanity checks - don't recognise the new bootloader installed via ↵Dave Chapman1-4/+23
the old method as a valid E200 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12878 a1c6a512-1295-4272-9138-f99709370657
2007-03-17Add Rockbox magic (RBOFe200) to the end of the mi4 header in the original ↵Dave Chapman1-1/+5
firmware. This may not be needed, but completes the set of RBBL for the bootloader, RBOS for Rockbox itself, and RBOF for the original firmware. Also add more info to an error message. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12818 a1c6a512-1295-4272-9138-f99709370657
2007-03-16Some code rearrangement and function renaming to help incorporation into ↵Dave Chapman1-30/+9
rbutil without clashing with ipodpatcher. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12797 a1c6a512-1295-4272-9138-f99709370657
2007-03-15Add a further safety check - don't allow users to install old bootloaders ↵Dave Chapman1-0/+5
with sansapatcher git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12796 a1c6a512-1295-4272-9138-f99709370657
2007-03-15Oops, forgot to add the dummy DSA signature to created MI4 images/filesDave Chapman1-0/+4
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12795 a1c6a512-1295-4272-9138-f99709370657
2007-03-15Implement the ability to embed a bootloader in sansapatcher - the --install ↵Dave Chapman1-14/+21
option installs the embedded bootloader, and running without any parameters will cause a prompt to be displayed asking the user if they want to install, uninstall or cancel. sansapatcher now requres a PP5022.mi4 file (the Rockbox bootloader) in the current directory when building. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12794 a1c6a512-1295-4272-9138-f99709370657
2007-03-15Correct the svn:keywordsDave Chapman1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12793 a1c6a512-1295-4272-9138-f99709370657
2007-03-15Initial commit of sansapatcher - an installation tool for the Sansa E200.Dave Chapman1-0/+702
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12792 a1c6a512-1295-4272-9138-f99709370657