added 3dsx support

This adds 3dsx support
Don't use malloc.