Generating function

How can a generating function of the damped harmonic oscillator be found/derived to obtain a Hamiltonian of the undamped oscillator after the appropriate canonical transformation of the coordinates?