Reverse engineering a set of complex scripts