Thread: Desktop of remote PC

  1. #1
    Unregistered
    Guest

    Desktop of remote PC

    I am writing a client-server application in which the client needs to get a picture of the desktop of the PC on which the server is running.

    I know that BitBlt() allows me to get a picture of my own desktop and display it in a view in my application but does anyone know how to transfer the picture of the desktop to the client application so that it gets it.

    If anyone even has hints, PLEASE tell me !!!
    Thanks.

  2. #2
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    can we say "R.A.T"?

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    32
    Okay I'm assuming this is for some stupid little trojan program you are trying to make that will "mimic" all the other lame trojans out there. Despite this little fact I will give you an idea of how to do this.

    What you need to do is read the current vid memory into an array of chars, or ints or whatever they are stored as. Then simply begin by sending the information back to the client over the open socket. I haven't done much with vid memory but I know you will have to use something like DirectX in order to get to vid memory (well unless you right your own inline assembly function that gives you direct access to vid memory).

    Good luck. But if you are trying to program a trojan. I suggest you don't go any further. People will just be really angry with you and if they get your "trojan" on their PC they may not be willing to offer anymore help on this board to you. (Well I know I wouldn't.)
    cerion
    Use the code Luke.

  4. #4
    BubbleMan
    Guest

    Post I have used..

    I have used Sub7 2.2 before. It's pretty good. You can lose friends that way, though. I stopped doing it a long time ago. Oh yeah, I'm only 14!!

  5. #5
    Registered User
    Join Date
    Sep 2001
    Posts
    32
    Well they are just stupid to even use. Well they can be good programs to do in order to get some good basics into windows/DirectX(or assembly if your doing it that way). But if your doing it for a legit administrative program for remote access to PCs then perhaps it's a good program to do.
    cerion
    Use the code Luke.

  6. #6
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    >but does anyone know how to transfer the picture
    >of the desktop to the client application so that it gets it.

    Uhm... do you have the communication of your client-server
    application developed ? If so, just send the picture object
    you get. If not: go and read up on sockets, most likely
    Winsock.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  7. #7
    Former Member
    Join Date
    Oct 2001
    Posts
    955
    Let the man do whatever he wants, if he wants to do a trojan, it's his problem.

    I can only help you with the desktop image grabbing, but I'm sorry, I can't help you how to send the image through a network.

    use:

    HBITMAP HBitmap=CreateCompatibleBitmap(GetDC(GetDesktopWin dow()),1280,1024);

    and, when you do that, you get a HBitmap with all the information of the desktop, you can try sending the raw HBITMAP data through your winsock (or whatever you're using)

    the HBITMAP struct is as follows:

    typedef struct tagBITMAP {
    LONG bmType;
    LONG bmWidth;
    LONG bmHeight;
    LONG bmWidthBytes;
    WORD bmPlanes;
    WORD bmBitsPixel;
    LPVOID bmBits;
    } BITMAP, *PBITMAP;

    the bmBits member describes the bitmap as-is.


    But I suggest you send the whole thing, receive it in another BITMAP struct and try to read it somehow(maybe the raw data, reading bmBitsPerPixel/8 bytes and treating it as a pixel), I am looking through the MSDN library and I can't find anything.

    -Good Luck
    Oskilian

  8. #8
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    >>Let the man do whatever he wants, if he wants to do a trojan, it's his problem.

    Till it hits your system or costs you time because your ISP is affected.

    >>HBITMAP HBitmap=CreateCompatibleBitmap(GetDC(GetDesktopWin
    dow()),1280,1024);


    This will use resources as the system BMP can not be replaced on close and the DC released.

  9. #9
    Former Member
    Join Date
    Oct 2001
    Posts
    955
    Yes, it´s actually HIS problem, and, maybe, he´s not making a trojan, maybe he´s doing anything else...

    well, 1280x1024 is a little big, but he could try lowering its resolution by blitting it into a smaller bitmap.
    It was just an idea.


    Oskilian

  10. #10
    Registered User
    Join Date
    Oct 2001
    Posts
    34
    There is really only one way to become a security expert and that is to be on the other side first...

    ya gotta be able to create things in order to know how to stop them.

  11. #11
    Registered User
    Join Date
    Aug 2001
    Posts
    403

    hmm.. debate on ethics & programming?

    i feel like having one view the post in the general discussions area to join (don't wanna litter)

  12. #12
    Former Member
    Join Date
    Oct 2001
    Posts
    955
    Yes, I don't want to turn this into an ethics vs programming chat, If he came here, he was looking for our help, so, I think the best thing we can do is help him, Now, it's his problem what he does with it, not ours, so, anyway he can't blame us (or at least, he shouldn't).

    And maybe he DOES need that, and maybe he could have gotten fired for not knowing how to do this...

    Oskilian

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Remote debug not working in Visual Studio 2003
    By Bassquake in forum Tech Board
    Replies: 12
    Last Post: 08-22-2008, 12:11 PM
  2. TV remote control software for PC
    By spank in forum Tech Board
    Replies: 1
    Last Post: 08-26-2007, 06:37 AM
  3. Replies: 1
    Last Post: 10-27-2006, 01:21 PM
  4. Remote PC Control
    By LuckY in forum Windows Programming
    Replies: 3
    Last Post: 03-26-2003, 10:19 AM