You should also have someone with a good code reader look and see if there are any historical codes. An Autozone type (cheap) will not see the historical codes. You may end up taking it to a dealer for diagnosis and code reading. GM garages use what is called a Tech2 (or above) to work on these trucks. The Tech2 is a 2 way diagnostic tool and can program/set switches in the CPU. I have a good, but 1 way scanner that lets me see everything about my truck. Unfortunately a good code reader/diagnostic tool is a bit north of $500.00. We spent $1200 but I can see the injector balance rates, all the other PIDS, rail pressure, commanded vs actual etc etc etc. There is a lot to these trucks.
If you take it to a dealer to have them scan it with a Tech2 they will be able to tell if someone stuck a different program into the ECM. If they did, they will (for a charge of course) reprogram the truck back to stock.
As long as that truck has not been hurt, it will make you a good platform once you get it tweaked back into shape.