Update: UltraVNC 1.4.3.6 and UltraVNC SC 1.4.3.6: https://forum.uvnc.com/viewtopic.php?t=37885
Important: Please update to latest version before to create a reply, a topic or an issue: https://forum.uvnc.com/viewtopic.php?t=37864
Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://x.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc
Important: Please update to latest version before to create a reply, a topic or an issue: https://forum.uvnc.com/viewtopic.php?t=37864
Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://x.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc
Data hiding
Data hiding
I want data hiding to be apart of UltraVNC i.e. when the remote client is connected to the server some of the priviliged information on the server(for example details about a person should be blurred) should not be visible to the client.
Is there an API to acheive this? If not, What are the other alternatives?
Is there an API to acheive this? If not, What are the other alternatives?
Re: Data hiding
How would the viewer have any idea what should or should not be visible? No VNC solution can do this as far as I'm aware.
-Ben
Re: Data hiding
when the server copies the screen interms of small rectangles into the buffers to send to the client/viewer, it should be able to get the co-ordiantes of the textfields and blurr its content. Now the blurred content should be visible at the client side.
Re: Data hiding
VNC has no idea what the contents of the screen updates actually are. It's just "painting" the remote screen for the local client.
Someone correct me if I'm wrong, but I'm pretty sure I'm not.
Someone correct me if I'm wrong, but I'm pretty sure I'm not.
-Ben
- Rudi De Vos
- Admin & Developer
- Posts: 6863
- Joined: 2004-04-23 10:21
- Contact:
Re: Data hiding
From vnc point, you send bitmaps, no application data.
This would require a lot of code...yes you could write some code that based on some user input detect the edit fields.
But then this would break the copyrects ( move a window, as this isn't handled with bitmaps)
This is nothing we gonna do, not general enough to spend time on it.
This would require a lot of code...yes you could write some code that based on some user input detect the edit fields.
But then this would break the copyrects ( move a window, as this isn't handled with bitmaps)
This is nothing we gonna do, not general enough to spend time on it.
Re: Data hiding
thanks for the replies! Now I am in the last step of what I want to acheive. All I need is to get the bitmap of the screen at the winvnc.sln file.
Since the uVNC server creates a bitmap of the server screen, I need to know where in winvnc.sln will I get hold of the bitmap object?
Since the uVNC server creates a bitmap of the server screen, I need to know where in winvnc.sln will I get hold of the bitmap object?
- Rudi De Vos
- Admin & Developer
- Posts: 6863
- Joined: 2004-04-23 10:21
- Contact:
Re: Data hiding
Look for m_backbuffer
Screen -> this is copied to Thebuffer ( memorybuffer desktop)
Thebuffer -> is copied to m_backbuffer ( memorybuffer send to the viewer)
As starting point you can use the function that write a red rectangle on the viewer to warn for UAC.
void
vncDesktop::WriteMessageOnScreen(char * tt,BYTE *scrBuff, UINT scrBuffSize)
Instead of overwriting the rectangle you can use some blur function to manipulate the old pixels.
Screen -> this is copied to Thebuffer ( memorybuffer desktop)
Thebuffer -> is copied to m_backbuffer ( memorybuffer send to the viewer)
As starting point you can use the function that write a red rectangle on the viewer to warn for UAC.
void
vncDesktop::WriteMessageOnScreen(char * tt,BYTE *scrBuff, UINT scrBuffSize)
Instead of overwriting the rectangle you can use some blur function to manipulate the old pixels.
Re: Data hiding
This is the scene now, I have created a bitmap of the screen with the data blurred using an external applicaiton,which I have created. Now all I want to do is "AND" (bit multiplication) this bitmap with the original bitmap created by the uVNC server. After the bits are multiplied, the bitmap is sent to the viewer by the server which is then displayed at the viewer.
For doing the bit multiplication I have to find the bitmap created at the uVNC server.
For doing the bit multiplication I have to find the bitmap created at the uVNC server.
- Rudi De Vos
- Admin & Developer
- Posts: 6863
- Joined: 2004-04-23 10:21
- Contact:
Re: Data hiding
You makes it harder this it should be.
You have a buffer of the full screen m_backbuffer ( Width/Height/stride (sizeof a line)/pixels size(8-32bit) is known)
[pixel1,pixel2,...] row1
[pixel1,pixel2,...] row2
You need to extract a rect ( x,y,w,h) in a temp buffer, does your math and put the temp buffer back.
That's all.... the hardest is to know the correct rect that need to be blured.
You have a buffer of the full screen m_backbuffer ( Width/Height/stride (sizeof a line)/pixels size(8-32bit) is known)
[pixel1,pixel2,...] row1
[pixel1,pixel2,...] row2
You need to extract a rect ( x,y,w,h) in a temp buffer, does your math and put the temp buffer back.
That's all.... the hardest is to know the correct rect that need to be blured.
Re: Data hiding
Is there an API from which I can convert the m_backbuff to a bitmap file? so that I can view what exactly m_backbuff holds at a particular point of time.
Also what are m_ScaledBuff and m_mainbuff used for?
Also what are m_ScaledBuff and m_mainbuff used for?
- Rudi De Vos
- Admin & Developer
- Posts: 6863
- Joined: 2004-04-23 10:21
- Contact:
Re: Data hiding
m_mainbuff= copy of server screen
m_ScaledBuff= copy of server screen, but scaled when server site scaling is used
m_backbuffer= You do exact the same as the viewer do on his screen in this local buffer. The buffer is a copy of the
viewer screen. VNC compare m_mainbuff with this buffer to check for changes
The format of the buffer is a DIB
see
http://msdn.microsoft.com/en-us/library ... s.85).aspx
There are functions to convert DIB to bitmaps.
m_ScaledBuff= copy of server screen, but scaled when server site scaling is used
m_backbuffer= You do exact the same as the viewer do on his screen in this local buffer. The buffer is a copy of the
viewer screen. VNC compare m_mainbuff with this buffer to check for changes
The format of the buffer is a DIB
see
http://msdn.microsoft.com/en-us/library ... s.85).aspx
There are functions to convert DIB to bitmaps.
Re: Data hiding
In which part of the source code is the the bitmap buffer(having the server screen) sent back to the viewer?
- Rudi De Vos
- Admin & Developer
- Posts: 6863
- Joined: 2004-04-23 10:21
- Contact:
Re: Data hiding
The bitmap himself is never send, we only send difference
Sample
change rects ( 0,0,50,50),(100,150,60,800),(x,y,w,h)
vncclient.cpp:vncClient::SendRectangles(const rfb::RectVector &rects)
Each rect is send seperate
vncClient::SendRectangle(const rfb::Rect &rect)
Data is also encoded and some encoders send data insite the encoder ( like zrle)
Sample
change rects ( 0,0,50,50),(100,150,60,800),(x,y,w,h)
vncclient.cpp:vncClient::SendRectangles(const rfb::RectVector &rects)
Each rect is send seperate
vncClient::SendRectangle(const rfb::Rect &rect)
Data is also encoded and some encoders send data insite the encoder ( like zrle)
Re: Data hiding
Since the m_mainbuff has the copy of the server screen, I want to mask(merge) the copy of the the server screen with a bitmap stored on the disk.
In which part of the source code can I perform this action? i.e since there are several references to m_mainbuff where do I get hold of the copy of the server screen?
In which part of the source code can I perform this action? i.e since there are several references to m_mainbuff where do I get hold of the copy of the server screen?
- Rudi De Vos
- Admin & Developer
- Posts: 6863
- Joined: 2004-04-23 10:21
- Contact:
Re: Data hiding
The m_mainbuff is a representaion of the screen, or the framebuffer in case you use the driver.
In both cases the buffer is updated several times a second.
If you would write your data to it, it would be overwritten a few ms later.
In both cases the buffer is updated several times a second.
If you would write your data to it, it would be overwritten a few ms later.
Re: Data hiding
In which part of the code is the difference taken(between m_mainbuf and m_backbuff) ? so that I can mask the contents of m_mainbuf and the bitmap stored on the disk.
- Rudi De Vos
- Admin & Developer
- Posts: 6863
- Joined: 2004-04-23 10:21
- Contact:
Re: Data hiding
Now we back on start
first of my answers was
first of my answers was
This function write a bitmap to the buffer and send it to the client....this is exact what you want to do.Look for m_backbuffer
Screen -> this is copied to Thebuffer ( memorybuffer desktop)
Thebuffer -> is copied to m_backbuffer ( memorybuffer send to the viewer)
As starting point you can use the function that write a red rectangle on the viewer to warn for UAC.
void
vncDesktop::WriteMessageOnScreen(char * tt,BYTE *scrBuff, UINT scrBuffSize)
Re: Data hiding
Yeah, thats exactly what I want to do.
So I have to replace the m_membitmap with the bitmap I want to load right?
******************************************************************************
vncDesktop::WriteMessageOnScreen(char * tt,BYTE *scrBuff, UINT scrBuffSize)
{
// Select the memory bitmap into the memory DC
RECT rect;
SetRect(&rect, 0,0, 300, 120);
COLORREF bgcol =RGB(0xff, 0x00, 0x00); //bazingaa
COLORREF oldtxtcol =SetTextColor(m_hmemdc, RGB(0,0,254)); //bazingaa
COLORREF oldbgcol =SetBkColor( m_hmemdc, bgcol);
HBRUSH backgroundBrush = CreateSolidBrush(bgcol);
HANDLE handleImage;
handleImage = LoadImage(0,"C:\\Users\\310154757\\Documents\\Visual Studio 2010\\Projects\\bitmap\\bitmap\\screen.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
HBITMAP oldbitmap;
if ((oldbitmap = (HBITMAP) SelectObject(m_hmemdc, handleImage)) == NULL)
return;
FillRect(m_hmemdc, &rect, backgroundBrush);
DrawText(m_hmemdc,tt,strlen(tt),&rect,DT_CENTER | DT_VCENTER);
// Select the old bitmap back into the memory DC
//DWORD err= GetLastError();
//ExtTextOut(m_hmemdc, 0, 0, ETO_OPAQUE,&rect,tt,strlen(tt), NULL);
SetBkColor( m_hmemdc, oldbgcol);
SetTextColor(m_hmemdc, oldtxtcol);
SelectObject(m_hmemdc, oldbitmap);
DeleteObject(backgroundBrush);
CopyToBuffer(rect, scrBuff, scrBuffSize);
}
*************************************************************************
doesnt seem to work. I guess its not being written to the buffer which is sent to the viewer.
How do I write it to the buffer?
So I have to replace the m_membitmap with the bitmap I want to load right?
******************************************************************************
vncDesktop::WriteMessageOnScreen(char * tt,BYTE *scrBuff, UINT scrBuffSize)
{
// Select the memory bitmap into the memory DC
RECT rect;
SetRect(&rect, 0,0, 300, 120);
COLORREF bgcol =RGB(0xff, 0x00, 0x00); //bazingaa
COLORREF oldtxtcol =SetTextColor(m_hmemdc, RGB(0,0,254)); //bazingaa
COLORREF oldbgcol =SetBkColor( m_hmemdc, bgcol);
HBRUSH backgroundBrush = CreateSolidBrush(bgcol);
HANDLE handleImage;
handleImage = LoadImage(0,"C:\\Users\\310154757\\Documents\\Visual Studio 2010\\Projects\\bitmap\\bitmap\\screen.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
HBITMAP oldbitmap;
if ((oldbitmap = (HBITMAP) SelectObject(m_hmemdc, handleImage)) == NULL)
return;
FillRect(m_hmemdc, &rect, backgroundBrush);
DrawText(m_hmemdc,tt,strlen(tt),&rect,DT_CENTER | DT_VCENTER);
// Select the old bitmap back into the memory DC
//DWORD err= GetLastError();
//ExtTextOut(m_hmemdc, 0, 0, ETO_OPAQUE,&rect,tt,strlen(tt), NULL);
SetBkColor( m_hmemdc, oldbgcol);
SetTextColor(m_hmemdc, oldtxtcol);
SelectObject(m_hmemdc, oldbitmap);
DeleteObject(backgroundBrush);
CopyToBuffer(rect, scrBuff, scrBuffSize);
}
*************************************************************************
doesnt seem to work. I guess its not being written to the buffer which is sent to the viewer.
How do I write it to the buffer?
Re: Data hiding
the control while debugging never enters the function - void vncDesktop::WriteMessageOnScreen(char * tt,BYTE *scrBuff, UINT scrBuffSize)
so making changes there is not helping.
so making changes there is not helping.
Re: Data hiding
I am able to mask my bitmap with the contents of the "databuf" buffer and view the output in an image file saved on a disk. but the problem is databuf contents are not being sent to the viewer.
- Rudi De Vos
- Admin & Developer
- Posts: 6863
- Joined: 2004-04-23 10:21
- Contact:
Re: Data hiding
WriteMessageOnScreen function is used
winvnc.exe running as application
You open a window that require UAC, while the UAC popup is shown, the viewer show a message "the the remote need to press the UAC"
This is done with this function
Search for WriteMessageOnScreen in the src and find the spot(s) where it is called.
For testing just remove the the if so WriteMessageOnScreen is called even without the UAC case.
winvnc.exe running as application
You open a window that require UAC, while the UAC popup is shown, the viewer show a message "the the remote need to press the UAC"
This is done with this function
Search for WriteMessageOnScreen in the src and find the spot(s) where it is called.
For testing just remove the the if so WriteMessageOnScreen is called even without the UAC case.
Re: Data hiding
below is the WriteMessageOnScreen(char * tt,BYTE *scrBuff, UINT scrBuffSize) function.
I dont see it writing to the UAC anywhere. Please help!
*********************************************************************************************
void vncDesktop::WriteMessageOnScreen(char * tt,BYTE *scrBuff, UINT scrBuffSize)
{
// Select the memory bitmap into the memory DC
RECT rect;
SetRect(&rect, 0,0, 300, 120);
COLORREF bgcol =RGB(0xff, 0x00, 0x00); //bazingaa
COLORREF oldtxtcol =SetTextColor(m_hmemdc, RGB(0,0,254)); //bazingaa
COLORREF oldbgcol =SetBkColor( m_hmemdc, bgcol);
HBRUSH backgroundBrush = CreateSolidBrush(bgcol);
HBITMAP oldbitmap;
if ((oldbitmap = (HBITMAP) SelectObject(m_hmemdc, m_membitmap)) == NULL)
return;
FillRect(m_hmemdc, &rect, backgroundBrush);
DrawText(m_hmemdc,tt,strlen(tt),&rect,DT_CENTER | DT_VCENTER);
// Select the old bitmap back into the memory DC
//DWORD err= GetLastError();
//ExtTextOut(m_hmemdc, 0, 0, ETO_OPAQUE,&rect,tt,strlen(tt), NULL);
SetBkColor( m_hmemdc, oldbgcol);
SetTextColor(m_hmemdc, oldtxtcol);
SelectObject(m_hmemdc, oldbitmap);
DeleteObject(backgroundBrush);
CopyToBuffer(rect, scrBuff, scrBuffSize);
}
************************************************************
I dont see it writing to the UAC anywhere. Please help!
*********************************************************************************************
void vncDesktop::WriteMessageOnScreen(char * tt,BYTE *scrBuff, UINT scrBuffSize)
{
// Select the memory bitmap into the memory DC
RECT rect;
SetRect(&rect, 0,0, 300, 120);
COLORREF bgcol =RGB(0xff, 0x00, 0x00); //bazingaa
COLORREF oldtxtcol =SetTextColor(m_hmemdc, RGB(0,0,254)); //bazingaa
COLORREF oldbgcol =SetBkColor( m_hmemdc, bgcol);
HBRUSH backgroundBrush = CreateSolidBrush(bgcol);
HBITMAP oldbitmap;
if ((oldbitmap = (HBITMAP) SelectObject(m_hmemdc, m_membitmap)) == NULL)
return;
FillRect(m_hmemdc, &rect, backgroundBrush);
DrawText(m_hmemdc,tt,strlen(tt),&rect,DT_CENTER | DT_VCENTER);
// Select the old bitmap back into the memory DC
//DWORD err= GetLastError();
//ExtTextOut(m_hmemdc, 0, 0, ETO_OPAQUE,&rect,tt,strlen(tt), NULL);
SetBkColor( m_hmemdc, oldbgcol);
SetTextColor(m_hmemdc, oldtxtcol);
SelectObject(m_hmemdc, oldbitmap);
DeleteObject(backgroundBrush);
CopyToBuffer(rect, scrBuff, scrBuffSize);
}
************************************************************
- Rudi De Vos
- Admin & Developer
- Posts: 6863
- Joined: 2004-04-23 10:21
- Contact:
Re: Data hiding
vncdesktopthread.cppSearch for WriteMessageOnScreen and find the spot(s) where it is called.
Code: Select all
if (vncService::InputDesktopSelected()==2)
{
m_desktop->m_buffer.WriteMessageOnScreen("UltraVVNC running as application doesn't \nhave permission to acces \nUAC protected windows.\n\nScreen is locked until the remote user \nunlock this window");
rfb::Rect rect;
rect.tl = rfb::Point(0,0);
rect.br = rfb::Point(300,120);
rgncache.assign_union(rect);
Make sureFor testing just remove the the if
Code: Select all
m_desktop->m_buffer.WriteMessageOnScreen("UltraVVNC running as application doesn't \nhave permission to acces \nUAC protected windows.\n\nScreen is locked until the remote user \nunlock this window");
rfb::Rect rect;
rect.tl = rfb::Point(0,0);
rect.br = rfb::Point(300,120);
rgncache.assign_union(rect);
Code: Select all
if (vncService::InputDesktopSelected()==2)
Code: Select all
//screensize_changed=true;
}
m_desktop->m_buffer.WriteMessageOnScreen("UltraVVNC running as application doesn't \nhave permission to acces \nUAC protected windows.\n\nScreen is locked until the remote user \nunlock this window");
rfb::Rect rect;
rect.tl = rfb::Point(0,0);
rect.br = rfb::Point(300,120);
rgncache.assign_union(rect);
if (vncService::InputDesktopSelected()==2)
{
if (m_desktop->startw8)
{