The number of new cases of hepatocellular carcinoma (HCC) worldwide reached 910,000, ranking the sixth, 80% HCC is associated with viruses, so exploring the molecular mechanism of viral carcinogenicity is imperative. The study showed that both HBV and HCV associated HCC and non-viral HCC have the same molecular phenotype (low gene expression and inhibition of immune pathways), but in the tumor immune micro-environment, there is excessive M2-type macrophage polarization in virus-associated hepatocellular carcinoma. To address this phenomenon, the data sets were analyzed and identified five hub genes (POLR2A, POLR2B, RPL5, RPS6, RPL23A) involved in viral gene expression and associated with PI3K-Akt-mTOR pathway activation by six algorithms. In addition, numerous studies have reported that M2-type macrophages participate in the hepatic fibro-pathological process of the development of HCC and are regulated by the PI3K-Akt-mTOR pathway. On this basis, the study showed that hepatitis virus causes abnormal expression of hub genes, leading to the activation of the pathway, which in turn promote the differentiation of M2-type macrophages and eventually promote the formation of liver fibrosis, leading to the occurrence of HCC. In addition, these hub genes are regulated by transcription factors and m6A enzyme, and have good prognosis and diagnostic value. With regard to drug reuse, the results suggest that patients with virus-related HCC for whom Cytidine triphosphate disodium salt and Guanosine-5’-Triphosphate are used as supplementary therapy, and may have a better prognosis. In conclusion, the study has identified novel molecules that are carcinogenic to hepatitis viruses and are expected to serve as molecular markers and targets for diagnosis and treatment.