Lensless imaging is a popular research field because of its small size, wide field-of-view, and low aberration in recent years. However, some traditional lensless imaging methods suffer from slow convergence, mechanical errors, and conjugate solution interference, which limit their further application and development. In this work, we proposed a lensless imaging method based on a spatial light modulator (SLM) with unknown phase modulation values. In our imaging system, the SLM is utilized to modulate the wavefront of the object. When the phase modulation values of the SLM are inaccurate or unknown, conventional algorithms such as amplitude-phase retrieval (APR) or the extended ptychographic iterative engine (ePIE) fail to reconstruct the complex amplitude information of the object. To address this challenge, we introduce a novel approach that combines ptychographic scanning along a spiral path with the ePIE algorithm, enabling accurate reconstruction of the original image. We further analyze the effect of modulation function and the characteristics of the coherent light source on the quality of the reconstructed image. The experiments show that the proposed method is superior to traditional methods in terms of recovering speed and accuracy, with the recovering resolution up to 14