We investigate the properties of both the prompt and X-ray afterglows of gamma-ray bursts ( GRBs ) in the burst frame with a sample of 33 Swift GRBs . Assuming that the steep decay segment in the canonical X-ray afterglow lightcurves is due to the curvature effect , we fit the lightcurves with a broken power-law to derive the zero time of the last emission epoch of the prompt emission ( t _ { 1 } ) and the beginning as well as the end time of the shallow decay segment ( t _ { 2 } and t _ { 3 } ) . We show that both the isotropic peak gamma-ray luminosity ( L _ { peak, \gamma } ) and gamma-ray energy ( E _ { iso, \gamma } ) are correlated with the isotropic X-ray energy ( E _ { iso,X } ) of the shallow decay phase and the isotropic X-ray luminosity at t _ { 2 } ( L _ { X,t _ { 2 } } ) . We infer the properties of the progenitor stars based on a model proposed by Kumar et al . who suggested that both the prompt gamma-rays and the X-ray afterglows are due to the accretions of different layers of materials of the GRB progenitor star by a central black hole ( BH ) . We find that most of the derived masses of the core layers are M _ { c } = 0.1 \sim 5 M _ { \odot } , and their average accretion rates in the prompt gamma-ray phase are \dot { M _ { c } } = 0.01 \sim 1 M _ { \odot } /s , with a radius of r _ { c } = 10 ^ { 8 } \sim 10 ^ { 10 } cm . The rotation parameter is correlated with the burst duration , being consistent with the expectation of collapsar models . The estimated radii and the masses of the fall-back materials for the envelope layers are r _ { e } = 10 ^ { 10 } \sim 10 ^ { 12 } cm and M _ { e } = 10 ^ { -3 } \sim 1 M _ { \odot } , respectively . The average accretion rates in the shallow decay phase are correlated with those in the prompt gamma-ray phase , but they are much lower , i.e. , \dot { M } _ { e } = 10 ^ { -8 } \sim 10 ^ { -4 } M _ { \odot } /s . The r _ { e } values are smaller than the photospheric radii of Wolf-Rayet ( WR ) stars . In our calculation , we assume a uniform mass of the central BH ( M _ { BH } = 10 M _ { \odot } ) . Therefore , we may compare our results with simulation results . It is interesting that the assembled mass density profile for the bursts in our sample is well consistent with the simulation for a pre-supernova star with mass M = 25 M _ { \odot } .