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:

!define CF_FILEGROUPDESCRIPTOR 49332

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: http://msdn.microsoft.com/en-gb/libr...(v=vs.85).aspx

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:

FILEGROUPDESCRIPTOR (
cItems
item_1(
dwFlags
...
cFileName[MAX_PATH] #not a pointer either
)
item_2(
...
)
item_cItems-1(
...
)
)
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...