Sonoff_DIY_tool for Sonoff version > 3.4
Put your device into DIY mode (refer to http://developers.sonoff.tech/sonoff-diy-mode-api-protocol.html for more info)
Once you have your device in DIY mode download the .exe in the releases tab and run it, it should detect your device automatically, if not your wifi might not support mDNS service, if that is the case you can't use this program.
If the tool is detecting your device and you want to change it's firmware, you have to click the firmware flash button, a dialogue box should appear, enter the new firmware, select the device you want to change the firmware (flash device list button and yes) and click okay, the process should start.
This version of the tool has been testesd with a sonoff mini, but should work with the sonoff basic and the sonoff RF with last sonoff.bin versions.
Official tool: https://github.com/itead/Sonoff_Devices_DIY_Tools
Sonoff API manual: http://developers.sonoff.tech/sonoff-diy-mode-api-protocol.html