https://github.com/Jimmy-Z/twlnf/blob/master/arm9/source/tmd.c
Just like that, if stock title.tmd exist, use it and generate the signature ticket in SD:/ticket//.tik
Alos sdnand can run modified/region invalid dsiware, so we can simply skip invalid region check and sha1 check of .app file.
This is my fork: wzhy90/twlnf_sd@b995ef3#diff-fd92d51bd33848db6c20f8e986de3f07
After that, I can backup/restore the region free Nintendogs from china with the stock title.tmd and modified .app rom in Settings - Data Manager