Custom VNC

Questions about programming languages and debugging
Post Reply
User avatar
FaoX
suck-o-fied!
suck-o-fied!
Posts: 76
Joined: 07 Sep 2007, 16:00
16
Contact:

Custom VNC

Post by FaoX »

I'm looking for either a toolkit or tutorials on building your own VNC server. Cross platform preferred. I've played with a lot of RATs and the like but I want to build my own, so I can customize and optimize it for what I want out of it. As usual any advice or information is always appreciated.
\"The OS is detected as NetBSD (it will even run on your toaster).\"

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Re: Custom VNC

Post by ayu »

I've honestly never tried it before as I've made use of existing VNC code so far.
But here's something that seems like a good start.
And keeping it cross platform I would simply use directives for capturing when used on different platforms.
So basically write library with functions within directives of the same name that is used the same on all platforms.

The one below would be used for Windows.

Code: Select all

http://stackoverflow.com/questions/5069104/fastest-method-of-screen-capturing

Code: Select all

void dump_buffer()
{
   IDirect3DSurface9* pRenderTarget=NULL;
   IDirect3DSurface9* pDestTarget=NULL;
     const char file[] = "Pickture.bmp";
   // sanity checks.
   if (Device == NULL)
      return;

   // get the render target surface.
   HRESULT hr = Device->GetRenderTarget(0, &pRenderTarget);
   // get the current adapter display mode.
   //hr = pDirect3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT,&d3ddisplaymode);

   // create a destination surface.
   hr = Device->CreateOffscreenPlainSurface(DisplayMde.Width,
                         DisplayMde.Height,
                         DisplayMde.Format,
                         D3DPOOL_SYSTEMMEM,
                         &pDestTarget,
                         NULL);
   //copy the render target to the destination surface.
   hr = Device->GetRenderTargetData(pRenderTarget, pDestTarget);
   //save its contents to a bitmap file.
   hr = D3DXSaveSurfaceToFile(file,
                              D3DXIFF_BMP,
                              pDestTarget,
                              NULL,
                              NULL);

   // clean up.
   pRenderTarget->Release();
   pDestTarget->Release();
}
"The best place to hide a tree, is in a forest"

User avatar
FaoX
suck-o-fied!
suck-o-fied!
Posts: 76
Joined: 07 Sep 2007, 16:00
16
Contact:

Re: Custom VNC

Post by FaoX »

Well that's a start for seeing but what about inputs? I feel like keyboard wouldn't be to hard to get done but I feel the mouse may be riddled with problems.
\"The OS is detected as NetBSD (it will even run on your toaster).\"

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Re: Custom VNC

Post by ayu »

Need to rush to work so can't lookup any examples right now.
But I've written code before that just gets the coordinates of the mouse (and changes it) so that shouldn't be too hard.
"The best place to hide a tree, is in a forest"

Post Reply