In an exercise I am asked to prove the following Wald's identities: let $S_n$ be a simple random walk and $T$ a stopping time. Then for all $\lambda \in \mathbb R,$ $$ \mathbb E(e^{\lambda S_1}) = 1 \Rightarrow \mathbb E(e^{\lambda S_T})=1. $$ I can easily prove this from the property of martingales.
However (although not asked in the exercise), I think we should be able to deduce the moment generating function of $S_T$ from this. However things does not quite work.
If $$ \mathbb E(e^{zS_1})=e^{\gamma}, $$
then define $\tilde S_n = S_n - n\gamma/z.$ We have $$ \mathbb E(e^{z \tilde S_1}) = 1, $$ and so $\mathbb E(e^{z \tilde S_T}) = 1.$ So $$ \mathbb E(e^{zS_T -T\gamma}) =1. $$
However, it is hard to separate $T$ from $S_T.$ They may not be independent.
Can we obtain the moment generating function (or characteristic function) of $S_T$ in this way?