Each smg file is the image of it's group code, and image format may differ from each other. For example CG35.smg is the image of boot ram drive, so you need some special tricks to edit it (http://elinux.org/Android_on_OMAP).
As for CG39.smg it's the ext3 image of /system. You can change it easily on linux mouting it as a loopback device, like this:
mount -o loop CG39.smg /mnt/system
XDA Developers was founded by developers, for developers. It is now a valuable resource for people who want to make the most of their mobile devices, from customizing the look and feel to adding new functionality. Are you a developer?