A Formal Method Applied to Reverse Engineering