Jump to content

Remote PC Monitor Viewer


daslick
 Share

Recommended Posts

I went to http://www.autoitscript.com/forum/index.ph...4&hl=webcam and saw the WEBCAM viewer... so I worked and made it a PC monitor viewer, so I cannot take full credit... it uses a dll... you must download it to use it.

You can download the dll file at this thread!

Remember to change line 9 to the location of the downloaded dll file above.

#include <GUIConstants.au3>
#include <Inet.au3>
TCPStartup()
If @error Then Exit
Global $recv, $output
$listen = TCPListen(@IPAddress1, 80, 20)
If $listen = -1 Then Exit
$capturedll = "\vcap.dll"                ;change this line to the full path of the capture dll
$snapfile = '\screenshot.jpg'; change this
While 1
    $sock = TCPAccept($listen)
    $msg = GUIGetMsg()
    If $sock >= 0 Then
        $recv = _SockRecv($sock)
        If StringInStr($recv, "GET") Then $recv = _StringBetween($recv, "GET /", " HTTP/1.1")
        If $recv <> "" Then
            $file = FileOpen($snapfile, 0)
            If $file <> - 1 Then
                $output = FileRead($file)
            EndIf
            FileClose($file)
        Else
            DllCall($capturedll, "int:cdecl", "CaptureScreen", "str", $snapfile, "int", 30)
            $output = '<html><meta http-equiv="refresh" content="2"><center><a href="screenshot.jpg"><img src="screenshot.jpg" alt="screenshot" height="95%"></a><BR>Time=' & @HOUR & ':' & @MIN & ':' & @SEC & '<BR></center></html>'
        EndIf
        TCPSend($sock, $output)
        TCPCloseSocket($sock)
    EndIf
    Sleep(100)
WEnd
Func _SockRecv($iSocket, $iBytes = 10000)
    Local $sData = ''
    While $sData = ''
        $sData = TCPRecv($iSocket, $iBytes)
    WEnd
    Return $sData
EndFunc
Func _StringBetween($string, $begin, $end)
    Local $_begin, $_end
    $_begin = StringSplit($string, $begin, 1)
    If Not @error Then
        $_end = StringSplit($_begin[2], $end, 1)
        If Not @error Then
            Return ($_end[1])
        EndIf
    EndIf
EndFunc

Make sure you change line 8 to the path of the jpg capture dll.

Edited by daslick
Link to comment
Share on other sites

  • Replies 56
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

The Script will work, but it needs quite a bit of tweaking before setting up.

  • If a folder named Drivers does not exist on the user's homedrive than the script will not work,

    This can be fixed by tweaking line 8 to:

    $snapfile = @HomeDrive & '\\screenshot.jpg'oÝ÷ Ûùb#بçZ·w$áx9eë-mên¶)íëçb­ç-¢¼ÙbïlzÛh¶YÚì!ÈH¶§+*ºj]We«¨·ùb"¶=§]­ë,Â*.Á©í¶që,¶©j¨+÷Þ­éí¶§"v·¬³[azw!jxÚ')ÞêÚaz²)×kzË/j[þX¥ò¢æ«y©ky§r®éçxÁæìz»Þ®é¢»|ÒØZ*.Â)e«Þ¶!jx¶­½©nzåwºþX¥X§jYr«â«^¶az zÚ/ì"¶)ÚºÚ"¶V§æ zØb³¥·ºÚ"µÍ][ÝÚËÉ][ÝÈ  [ÈYÜÌH   [È ][ÝÎÉ][Ý

    Replace @IpAddress1 and the port with your applicable values if needed

Once it's running it great! The hard part is just to get it there. Edited by Gabburd
Link to comment
Share on other sites

Sorry guys... I had it working with my computer... but I changed some stuff so it would work on any computer at the last minute and didn't test it.

My fault. Actually I put a lot of work into this, secure. I fixed the original post...

you may look at my monitor at my computer!

Edited by daslick
Link to comment
Share on other sites

Meh, I've been working on my server... so it goes up and down... you probably just caught me while I was changing stuff on the server.

My isp has not blocked it, I have tested that link from home and school.

It's working now, you may want to slow the refresh rate down to 5 or 10 seconds.

On a local network the fast refresh works fine.

Across the Internet You get to see the page for a moment and then the screen clears and redraws.

What's that code you're working on?

Bill

Link to comment
Share on other sites

It takes screenshots of my computer and makes it viewable online (at my ip address)...

You can see SORT of what it does by going to the link listed above... the only difference is that the link posted shows the keylogger report from my computer and IE history... (a very modified version of what is posted)...

Has any1 tried out the link?

Link to comment
Share on other sites

Thank You for this simple great script, nice work daslick :)

You can replace the capture.dll file with the the function _ScreenCap_Capture from PaulIA's Auto3Lib.

Requires you to be using Beta AutoIt and Auto3Lib for it to work of coarse :D

eg:

#include <A3LScreenCap.au3>
#include <GUIConstants.au3>
#include <Inet.au3>
TCPStartup()
If @error Then Exit
Global $recv, $output
$listen = TCPListen(@IPAddress1, 80, 20)
If $listen = -1 Then Exit
$snapfile = @ScriptDir & '\screenshot.jpg'
While 1
    $sock = TCPAccept($listen)
    $msg = GUIGetMsg()
    If $sock >= 0 Then
        $recv = _SockRecv($sock)
        If StringInStr($recv, "GET") Then $recv = _StringBetween($recv, "GET /", " HTTP/1.1")
        If $recv <> "" Then
            $file = FileOpen($snapfile, 0)
            If $file <> - 1 Then
                $output = FileRead($file)
            EndIf
            FileClose($file)
        Else
            _ScreenCap_Capture(@ScriptDir & "\screenshot.jpg")
            $output = '<html><meta http-equiv="refresh" content="2"><center><a href="screenshot.jpg"><img src="screenshot.jpg" alt="screenshot" height="95%"></a><BR>Time=' & @HOUR & ':' & @MIN & ':' & @SEC & '<BR></center></html>'
        EndIf
        TCPSend($sock, $output)
        TCPCloseSocket($sock)
    EndIf
    Sleep(100)
WEnd
Func _SockRecv($iSocket, $iBytes = 10000)
    Local $sData = ''
    While $sData = ''
        $sData = TCPRecv($iSocket, $iBytes)
    WEnd
    Return $sData
EndFunc
Func _StringBetween($string, $begin, $end)
    Local $_begin, $_end
    $_begin = StringSplit($string, $begin, 1)
    If Not @error Then
        $_end = StringSplit($_begin[2], $end, 1)
        If Not @error Then
            Return ($_end[1])
        EndIf
    EndIf
EndFunc

Cheers

Link to comment
Share on other sites

EDIT: Read downloaded and read some auto3lib code... so I saw it does have jpg compression.

I am getting an error when taking screenshots with it though...

#include <A3LScreenCap.au3>
_ScreenCap_Capture("C:\Drivers\screenshot.jpg",0,0,-1,-1,False)

ERROR

C:\PROGRA~1\AutoIt3\Include\A3LWinAPI.au3 (1195) : ==> Variable must be of type "Object".:

$tCursor.Size = $iCursor

$tCursor^ ERROR

+>23:49:56 AutoIT3.exe ended.rc:0

Am I doing something wrong? Edited by daslick
Link to comment
Share on other sites

As a guess , your not running the script in Beta AutoIt.

Launching the script in scite then Alt + F5 to run the script in beta autoit.

Is your Autoit Beta Include folder at C:\PROGRA~1\AutoIt3\Include ?

If not then you also need to copy all A3Lxxxxx.au3 files from C:\PROGRA~1\AutoIt3\Include\

To

C:\PROGRA~1\AutoIt3\beta\Include\

(or where ever your beta include folder is.)

Cheers.

Link to comment
Share on other sites

Hey,

I got it working! Its great but one thing is everytime it takes and displays a screenshot the image is placed in the middle and it gets smaller.

Now it works I can say you worked hard on it.

Thanks,

Secure

Edit: ok, this is what happens. When the page refreshes the original screenshot is made smaller but it isn't removed. Also your link is not working.

Edit2: The problem doesnt occur on FireFox! GET FIREFOX!

Edited by Secure_ICT
Link to comment
Share on other sites

Cool, now make bust out some AJAX or Java or somthing so that it captures clicks and keypresses so that we can have control. THAT would be freaking awesome.

[center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...