Main idea of the design is to read value from every pin through buffer and put zero on input pins by selectively connecting it to the ground while it's pulled up by default (with optional short circuit to +5V to provide optional power on some pins):
READ is a signal that connects one out of 4 octal buffers to data bus (OUTPUT). ZERO BIT is a signal from one bit of one out of 4 octal registers storing data for every single input pin of tested device. Resistor 100 Ohm is a kind of protection against accidental connecting output pins of device to ground. Pull-up resistor 10 KOhm is making sure that all pins will have at least "1" on them (also it will work for open-drain outputs of the tested device).