i just did replaced the hood latch cable. it's a two

job because you have to remove the battery tray and it is a little fidgetty.
first off, if the problem is the hood latch is not returning it might be a case of the latch or your cable just needing lubrication. inspect the plastic ferrules at either end of the cable and if they are intact you might be able to lubricate the hoodlatch springs and the cable without replacing the cable. google "lubing bicycle cables" for some pointers but basically you force lubrication into the cable housing while sliding the cable back and forth as much as you can..
mine was broken at the plastic ferrule at the hood latch end of the cable that held it in place broke. this resulted in too much movement in the cable and i could not get the hood to open without pulling the cable inside the truck with pliers.
to replace the cable
-remove the hoodlatch and disconnect the cable from it
-carefully remove the plastic stay clamp hidden in the crossmember housing about 6 inches from the hoodlatch that holds the cable in place. you squeeze it from outside the cross member to do this. remove it from the cable and keep it. this piece is important because without it the cable can move around and you lose leverage. order a new one if you can get one.
-remove the battery and battery tray.
-locate the cable where it emerges from the cross member through the outside headlight bulb hole.
--pull the cable out of the cross member from the battery tray end taking care to note the routing.
-disconnect the cable from the hood release lever inside the truck
-trace the cable inside the truck to where it goes through the firewall. you will need to remove a small triangular brace holding an ecu module in place to see clearly. push about 6 inches of cable through into the engine bay.
-go to the engine compartment and locate where the cable emerges from the firewall. once you have slack and have seen it from the floorpan side it is easy to spot. it is located under a wiring loom.
--on my truck the cable actually gets wrapped into the wiring loom for about 12". rather than unwrap the loom i cut the old cable with cable cutters using the slack i made pushing it through the firewall. it then pulled right out of the loom and i later use zip ties to reattach it.
--pull one end of the cable out into the battery tray taking care to follow the route as it goes. basically it goes right along the wheelwell at the corner underneath everything
--pull the other half of the cable out from inside the truck taking care to note the small rubber grommit hole it fits into at the firewall.
--start the new cable from the floorpan side (ball end goes into the engine bay). push about 12" into the engine bay. make sure you push the cable housing and don't let any cable stick out or it may kink.
-go to the engine bay side and pull the cable through (much easier to pull)
--snake the new cable under everything to the battery tray. be careful doing this because the ball end gets stuck if you try to pull it out. i used a piece of cooper house ground wire bent into a hook to help fish it.
--install the hood lever end into the lever hosuing inside the truck then pull the rest of the cable through from the battery tray end for final fitment.
--use a couple of zap straps to tie the cable to the wiring loom it used to be threaded through and also one to secure the cable inside the truck.
--thread the cable through the outer headlight bulb hole and up abd along the crossmember.
--install the cable end into the hoodlatch, then lube and reinstall the hoodlatch. the bottom bolt is a pita.
--install the little plastic cable stay that goes into the crossmember.
--test it to make sure it works and feels right before you close the hood! if you
--reinstall the battery tray and battery.