Phase behavior of confined fluid demonstrates significant deviation from that of bulk fluid because of the strong molecule-wall interaction and geometric constraint in confined space, resulting in the inapplicability of the classical cubic equation of state (EOS). The objective of this work is to modify the Peng-Robinson EOS (PR EOS) with respect to both the attractive parameter and the covolume term to reflect the impact of molecule-wall interaction and geometric constraint, respectively. The modified PR EOS is applied to compute the phase diagrams of CO2+n-C4H10 and CO2+n-C10H22 binary mixtures, CO2+n-C4H10+n-C10H22 ternary mixture, and CO2+Eagle Ford condensate in nanopores. In this work, correlations of both critical temperature and critical pressure shift with nanopore sizes are proposed to compute the confined attractive parameter and the confined covolume in the modified PR EOS. The proposed EOS model is validated by both the critical temperature and the critical pressure shift data collected from literature. Results demonstrate that confinement effect in nanopores impose an overall shrinkage to the two-phase diagrams of all the CO2-hydrocarbon systems. The upper dew-point pressure of the Eagle Ford condensate sample is calculated to be 2972.6 psi, with a suppression of 27.56% compared to the bulk value of 4103.6 psi. Moreover, the size of the two-phase region in the ternary diagram and the minimum miscibility pressure also decrease in confined space, which is in favor of the miscible gas injection enhanced oil recovery with a higher possibility of achieving first contact miscibility.