Based on 1.8.0 rdesktop sources