I have obtained them legally.Are these badges you obtained legitimately through Badge Arcade? If I'm not mistaken, those are tied to your NNID, so it doesn't matter what is on your SD card as far as those are concerned. If they're badges you installed yourself using homebrew, can't you just install them again?
Oh.I don't know what you think you're talking about. Software you downloaded from the eShop can be downloaded again; likewise software you installed via FBI.
And I have checkpoint backups!The encryption is mostly irrelevant as long as a System Format hasn't been done – creating a new Nintendo 3DS folder isn't going to affect that. It's just a matter of locating the save data in the apporpriate folders and copying it back again after re-installation. (Also Anti Savegame Restore might have to be accounted for in some situations.)
No, I haven't.I thought he had formatted?