A method of waveform inversion for earthquake rupture process