OK, that's good. But, that does not explain the "same thing happened there" statement, unless one can run software from such a backup. (I use SuperDuper! for my backups, and by booting to that backup, I can run stuff off of it. It is just about the same as having another machine).
Now, what you will need to do is to try and find a Time Machine backup that was made
prior to the issues you are having.
Next, boot your iMac to the (hidden) Recovery HD partition. This link describes how to do that, and what its capabilities are:
https://support.apple.com/en-us/HT201314
You would then first select #4, Disk Utility, from that menu. You then have 2 choices:
A. Have Disk Utility Verify and Repair your internal drive (this will also indicate how "healthy" the drive is). If it finds any issues, and fixes them, reboot your iMac normally, and see if the issue goes away.
B. If that does not fix it, or if you want to just start off right away, have Disk Utility Erase and Format your internal drive.
Once that completes, select #2, "Reinstall macOS". What that will do is obtain the latest version of Sierra, OS 10.12.3, from Apple's servers, and proceed to do a fresh, clean, "virgin" installation of OS 10.12.3. This will take some time.
Finally, select #1, and select that "good" Time Machine backup.
One caveat, though, is that it is not known for sure if the "nefarious" issue, although not executed, is on whatever backup you choose.
There is another possible way to proceed. Do you have any critical Quark Xpress files you need? If not, then download and install the excellent freeware program AppCleaner (available from here:
https://freemacsoft.net/appcleaner/), drop the Quark Xpress icon (should be in your Applications folder) onto AppCleaner, and you will then be presented a list of all the files associated with Quark Xpress. After all that stuff is deleted, you could then install Quark Xpress, and see if your issue gets solved.