Hi and welcome to HCM.
Unfortunately this sounds very serious to me.
Obviously this is terminal stage of liver cancer
and this is one of the worst cancers. Today there is almost nocontraindications for anasthesia so it doesnt mean he is better. I cant predict without findings but condition is very serious. I dont know reason for endoscopy
,they might suspect of
All in all I wish you good health and I hope for the best .