I had the same problem with my Grampian
mast. When I bought the boat, the electrical
had given up the ghost and the VHF
cable had been pinched and was no longer sound. So I pulled off the mast foot and peered inside. Ugh. The previous owner had poured poorly mixed 2 part foam into the mast to secure the electrical cables
and the VHF
lead. ( all the halliards were externaly run)
What I had was a partly expanded mass here n there with solid non expanded foam in pools every where else. All the leads were submerged in this muck. So I ended up sticking the mast into our sail racks about head
high and opened up both ends. I then took some PVC conduit, and attached a chisel to one end, then started chiseling out the gunk and bits of wire. Every once in a while I'd put the hose from my 10 gallon shop vac on the mast and suck out all the lumps. It took about 3 weeks of evenings to chisel it all out.
Once that was done I made up the electrical and VHF into one package, tied into a loom with nylon cord and put that into the mast. Secured it at both ends and then packed the mast with foam rubber nerf balls. these were large enough to have to compress some as they went in, and I measured the mast so they were evenly spaced every couple of feet. I used my piece of conduit with a ply wood pad on it to push the balls up until they were where I wanted them. I believe there were something like 15 or 16 balls in there. (got them from Toys R Us)
I then put the caps back on, and put the mast up. Worked a charm.