Sony PC companion is official, it will download firmware through the app and install it to your phone. Flashtool isn't official but is trusted - although you do need to source and download the relevant firmware yourself to flash to the device (making it more difficult and maybe less secure than the official Sony software.)

Neither will install malware on your phone (just don't download it from a dodgy website).