Porting all of dd functionality would go beyound our current possibilities - even for the new format feature I will have to rely on somewhat unconventional methods. Oh well. Lossless EmuNAND formatting, I might think about it if we do a PC version of this. It might also already be possible. Easeus has a commandline (and GUI) tool called
Partition Master which can also resize partitions. That combined with either EmuNAND tool or Decrypt9 should do the job (not without user interaction, though). It should work with other partitioning tools, too, you just have to make sure the master boot record is correctly formatted right from the start (read on).
For setting up from scratch (assuming the SD card is not already correctly partitioned), has to be partitioned (1 partition only!) with fdisk (or parted, or GPT fdisk), then formatted with the tool of your choice. Nintendo recommends
this. Maybe with the Nintendo recommended tool you don't even need fdisk or the like. You'd just need to check if there is a
standard (classic, generic) MBR in sector 1 (the first 512 byte).
File selector, I might think about it. It wouldn't be that difficult to do. As for the naming (ticket.db and ticket_emu.db) - it is difficult to find a scheme that works for everyone in all cases. If I call it 'ticket.db' regardless of where it comes from, well you'd have no way of dumping both files in one step. As of now, when dumping (on EmuNAND), the file is called ticket_emu.db, and when injecting ticket.db is selected. Any idea how to handle that better? (apart from the file selector, cause I will still need some time for this).