I don't think your cable has come loose because you wouldn't be able to open it if it were loose,if the end of the cable is sticking out on the lock that is the way it should be.Your problem is that the lock is stuck open,spray the whole lot with plenty of WD40 or similar(penetrating oil),the hook bit on the bonnet pushes into the 'U' shaped bit on the lock and it springs over to the right so clipping in over the U bit,when you pull the lever it pulls the lock open.It is stuck open.
Rich
October 2008