Problems with 74HC595 and ULN2003 to drive 12V 7 segment

Your writeRegister is all wrong. You need to write / use a routine that sends a byte serially and then call multiple such routines to send a series of bytes. And the end of it, strobe the data - to avoid flickering.

Let say you have a functioned called hc595-write() that sends just one byte. You then can write a function to send a series of bytes this way:

Void writeRegister(unsigned char *str, unsigned char n)
For (I = 0; I < n; i++)
Hc595-write(str[ a]);