The story goes that after the death of Chancellor Zhuge Liang, Liu Shan, the later ruler of Shu Han, grew increasingly neglectful of state affairs. The eunuch Huang Hao, originally a Commandant of Equipage, gradually gained favor and rising power through his skill in discerning Liu Shan's intentions and his smooth talk and flattery. All major and minor matters of state had to pass through Huang Hao's hands first; bribery became widespread, and discipline and order collapsed. General Jiang Wei, carrying on the legacy of Marquis Wu, campaigned north against Cao Wei year after year. Although there were victories and defeats on both sides, Shu Han's national strength gradually waned, and with Huang Hao monopolizing power at court, there were many constraints. Deeply worried, Jiang Wei submitted several memorials accusing Huang Hao of being treacherous and treacherous evil, and calling for his execution.
However, Liu Shan merely said, 'Huang Hao is nothing but a minor eunuch attendant. I know his character well—why need you worry about him?'
Despite Jiang Wei's earnest remonstrations, he was not heeded, and instead saw Huang Hao grow even more domineering. Huang Hao's faction spread throughout the court and countryside; anyone who wished to present advice to Liu Shan first had to seek Huang Hao's approval. If they did not comply, he would create obstacles and obstruct them in every possible way. Worthy ministers at court, such as Zhuge Zhan and Dong Jue, were all feared by him. Jiang Wei once strongly advised Liu Shan, saying that having Huang Hao long in the palace might breed great calamity, and suggested sending him away. Upon learning of this, Huang Hao tearfully told Liu Shan, 'I have been honored by Your Majesty's deep grace; how would I dare harbor other intentions? It is the Grand General who wishes to frame me as disloyal!'
Liu Shan believed his words and instead blamed Jiang Wei for meddling.
Thus, Huang Hao grew even more favored from then on, his authority overwhelming the court and the country. Loyal ministers and righteous men at court, seeing his great power, all dared to be angry but not to speak out. Watching Shu Han gradually fall into decay with serious internal troubles, Jiang Wei was burning with anxiety and extremely worried. At that time, the Cao Wei generals Deng Ai and Zhong Hui each guarded the borders, waiting for an opportunity to act. Jiang Wei knew well that with powerful enemies watching outside and treacherous sycophants disrupting governance within, if Huang Hao was not removed, the state would not survive. However, Liu Shan was weak-willed, easily swayed and biased toward slanderous talk, and Jiang Wei's repeated remonstrations had no effect.