you can do it either by using specialised ICs for IR remotes or with a microcontroller. If you choose the first option then you might have some problems finding those ICs since a lot of them are discontinued.
what about finding a replacement....i have an old tv and my sister sat on the remote and broke it in 2 pieces....i tried with tape and so on, to make it work for a bit, but i still had to find a replacement...
you can find new remotes wich are replacing the old ones...