The Secure Mobipocket Decoder is based on MobiPocket's Java Reader. If you give it the right PID, it explodes the secure file into its constituent (plain text) HTML and images. It is not as complete as (say) ConvertLIT for MS Reader files in that there is not a non-DRM MOBI output option. It is in the wild but not widely available, see
Secure Mobipocket Decoder is no more....
Since it needs the PID, it won't work on secure AZW files unless the PID is discoverable.
I think Amazon should provide the PID to allow secure MOBI files (licenced to the Kindle's PID) to be downloaded. One argument against this might be the existence of the Secure Mobipocket Decoder, although security based on hiding a 10 character PID is very weak. If this is a concern, then they could use two PIDs on the Kindle - one for AZW e-books and the other for secure MOBI e-books.