# GBM probability of hitting non constant barrier

I know there is a formula for probability of hitting a constant barrier for GBM/BM (See page 651 in Martinagle Methods in Financial Modelling). Is there a formula for non-constant barrier?

The barrier I am interested in is a step function of time to maturity.

i.e. $$barrier(t) = 5 - 1\mathbb{X}_{t\geq0.5}, t$$ is time to maturity.