I experimented with this using a rom of Emerald on my PSP, but not sure how this works on 3DS. Am I having to run the randomizer on a CIA to install later (in which case will it override any legit/unrandomized game installed) or can I simply apply a randomizer to code.bin and add the result as a patch via luma?