Friday, November 24, 2006

Enhanced Windows XP RDP Client (mstsc.exe)

For any computer guru with a monitor (or multiple monitors for that matter) that displays a resolution greater than 1600 x 1200 knows that the Windows XP/2003 RDP client has a hard coded limitation of 1600 x 1200. No amount of registry hacking, command line switches, or ini modifying can fix this limitation.

A few weeks a go a personal challenge was extended to me to reverse engineer Microsoft's RDP protocol and enable resolutions of 4096 x 2048 to match the new Vista RDP Client. For anyone who knows me you know that I love a personal challenge, especially a technical one. So the adventure began. First I had to determine whether the limitation was in the protocol itself or just the client implementation. So I copied over the Windows Vista RDP client in hopes that it would work on Windows XP. I was pleasantly surprised to find that indeed it did work on XP and furthermore, it supported resolutions of 4096 x 2048. After establishing the fact that the limitation was in the client itself and not the protocol I was able to narrow down the files limiting the resolution: mstsc.exe and mstscax.dll.

The next step was to determine what and how I needed to modify one or both of those files to enhance the resolution. First I busted out one of my favorite Hex Editors in hopes a quick edit would resolve my little dilema, no dice. I would have to dig deeper. With the help of IDA Pro, Ollydbg and APIMonitor I was able to narrow it down to a few different calls to functions that used the Win32 API to call the GetSystemMetrics funciton. I found that the GetSystemMetrics was returning the correct max resolution, but the functions calling it were modifying the return values if they were above 1600 and 1200. So essentially what I did was modify a handful of functions and swap out the hex value 0x640 with 0x1000 and 0x4b0 with 0x800 and I had a XP RDP client running at 4096 x 2048.

I have attached a copy of both the original and the modified XP RDP client.

**Update**
Microsoft just released their RDP 6.0 client for Windows XP/2003 which supports resolutions of 4096x2048.


Downloads:
Original Windows XP RDP Client
Resolution Enhanced XP RDP Client

2 comments:

Brittany said...

Jamesy, I know you are busy, but you haven't done any techie geek stuff on here since November! I check every 1/2 hour and have since November to see if you have updated, but alas, you have abandon your blog for bigger and better things like... oh I don't know mini claymation. I don't understand one thing that is posted on here, yet I read them, so get posting! I love you bro! I miss you!

Brittany said...

OK, time for the real blog. About yourself and your family and your favorite sister. Hop on it bro~