Tor: What happens if my device is already compromised?

Malware with access to your device can read what you type or see before Tor encrypts it, and may use its own network connection.

Short answer

Malware with access to your device can read what you type or see before Tor encrypts it, and may use its own network connection. Tor Browser cannot repair the operating system or remove malware. Stop using the device for sensitive work, investigate or reinstall it from trusted media, and change exposed credentials from a clean device.

Sources

Tor Project: Tor Browser best practices.