When I need to attach something and there is foam between the item I am mounting and the substrate I cut out an area of the foam and replace that section with a piece of wood.
The original latches for the Campster
, the upper latch was attached through the popup roof, on through the plywood liner of that roof and then into the fitting itself.
The bottom hook for the latch was screwed through the fiberglass rim of the opening and on into the 1 x 2 wood outside the rim.
I really like the latches, so easy to use and very strong. It is terrific that they are still being sold as brand new affordable replacement parts. I did not know they were hood latches for Jeeps until my friend saw them and recognized them immediately.
They really do work great, there is no need to reinvent the wheel and go looking for a substitute latch. If you look you will likely see the four pairs of holes where the hooks used to mount. You could install the hooks in those holes than hook in the upper part and mark your new roof on the inside for the bolt locations. Use some marine bedding compound in the bolt holes that go through the popup roof, that will keep the water out.