Hepatocellular carcinoma (HCC) is one of the most common malignant tumors globally and often develops on the foundation of chronic liver disease or cirrhosis. Cirrhosis is a clinically prevalent chronic progressive liver disease characterized by diffuse liver damage resulting from long-term or repeated actions of 1 or more etiological factors. However, the impact of CENPF and nuclear division cycle 80 (NDC80) genes on rehabilitation nursing of HCC and cirrhosis remains unclear. HCC and cirrhosis datasets GSE63898 and GSE89377 profile files were downloaded from the gene expression omnibus database generated on platforms GPL13667 and GPL6947, respectively. Differentially expressed genes (DEGs) screening, weighted gene co-expression network analysis (WGCNA), construction and analysis of protein–protein interaction (PPI) networks, functional enrichment analysis, gene set enrichment analysis (GSEA), survival analysis, immune infiltration analysis, and comparative toxicogenomics database (CTD) analysis were conducted. Gene expression heatmaps were plotted. miRNAs regulating central DEGs were selected through TargetScan. A total of 626 DEGs were identified. According to gene ontology (GO) analysis, they were primarily enriched in small molecule metabolic processes, drug metabolic processes, binding of identical proteins, and lipid metabolic processes. Kyoto Encyclopedia of Gene and Genome (KEGG) analysis results indicated that the target genes were mainly enriched in metabolic pathways, phagosomes, glycine, serine, and threonine metabolism. The construction and analysis of the PPI network revealed 3 core genes (NDC80, CENPF, RRM2). Gene expression heatmaps showed that core genes (CENPF, NDC80) were highly expressed in HCC and cirrhosis samples. CTD analysis found that 2 genes (CENPF and NDC80) were associated with liver, jaundice, ascites, fever, dyspepsia, and hepatic encephalopathy. CENPF and NDC80 are highly expressed in HCC and cirrhosis, and CENPF and NDC80 might be the biomarkers of rehabilitation nursing of HCC and cirrhosis.