you can try to decompress the tree patch & see how the verification system works..
i only just got into gsc coding (or C in general :p) so i'm afraid i can't help you there..
I'd look into other existing patches with verification & *cough* copy/paste *cough* that code