I am on 3 UK also.
Have done this many times .
As you have S off you can change your cid (customer or carrier id) from H3G__001 (which is 3 UK)
to so called super cid which is
11111111 (eight 1's)
When in bootloader fastboot usb mode
C:\adb> fastboot oem writecid 11111111
This will allow you to use any version RUU for your model.
Best one is WWE version which has 401 in the place where yours had 771.
I have always been unlocked when doing this. As you have got S off I will assume you can unlock bootloader.
Then download to your pc the appropriate ruu, I would suggest file (very long filename, I will just list first part of filename - will edit post to add download link)
Download this to your pc
It's a large file 990 MB .
The following will delete all your data, photos, video, music, txt , etc (phone number should remain in SIM ) so BE SURE TO COPY FROM PHONE TO PC ANYTHING YOU WANT TO KEEP.
Then connect your HTC One to your pc with usb cable (usb 2, preferably) and simply run the program you've just downloaded .
Your phone can be either in fastboot mode or with android running, doesn't matter which .
Follow on screen instructions, ticking boxes as appropriate.
Total process takes approximately ten minutes from starting the program to finish.
When finished you will be on stock 1.28.401.6 which is original Android 4.1.1
However if you wish you can easily update Ota (over the air) through successive versions up to 4.2 by entering settings then about then software updates then check now
Hope this helps
Sent from my HTC One using xda app-developers app