How does TRIM Enabler work?
The Trim Enabler patches the following Kext-File

/System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage


which checks if the ssd is a 3rd-party or Apple Branded SSD:



you can also enable trim manually by looking for all 'Apple' occurrences in the file and patching them in a hex-editor or via terminal:

##1. Backup old file
    $sudo cp /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage
/System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage.original

##2. Patch the file to enable TRIM support
    $sudo perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00{1,20})[^\x00]{9}(\x00{1,20}\x51)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage

##3. Clear the system kernel extension cache

   $sudo kextcache -system-prelinked-kernel

   $sudo kextcache -system-caches