24" imac from 2008 as a monitor for macbook pro
I'm afraid not.
It is hardware-dependent, not software.

The earliest model to support Target Display Mode was the Late 2009 iMac.

See : Use your iMac as a display with Target Display Mode