Archive: RDP ClipBoard

RDP ClipBoard
I've been working on a way of extracting the copy/paste file data (FileGroupDescriptorW format) from the Clipboard in a Remote Desktop session, here's what I have so far:


System::Call 'user32::OpenClipboard(i 0)'
System::Call 'user32::GetClipboardData(i${CF_FILEGROUPDESCRIPTOR}) i.r0'
System::Call '*$0(i.r1,i.r2)'
DetailPrint "$1|$2"
System::Call 'user32::CloseClipboard()'

I can get the number of files that I've copied from the local computer in $1 but instead of returning a pointer it an Array structure with all the file details in, all I get in $2 is "16484".

Here's the structure details from MSDN:

Does anyone know how I can get the details from the FILEDESCRIPTOR structure output into an array?

I'm pretty sure you have to use RegisterClipboardFormat to get CF_FILEGROUPDESCRIPTOR!

Anyway, $2 is not a pointer, its the start of the first item struct.

The memory layout is:

cFileName[MAX_PATH] #not a pointer either
The way you should deal with this is, $0 + 4 is the start of the first item, then in a loop access the item data and increment your pointer/memory address by the size of a FILEDESCRIPTOR...