The program is about 600 lines of C code....
That's not all that difficult.I kind of wish you hadn't done that, but since I didn't warn you off earlier, I guess I shouldn't complain.
The usual way to attack this sort of problem is to update the module that has fallen behind and reset all the passwords by hand. Good OS design intentionally puts roadblocks in the way of direct password recovery.