# Remote PC Monitor Viewer

## 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.

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

##### Share on other sites

This doesnt do anything. Nothing at all. No errors, no screenshot, nothing.

##### Share on other sites

I get a "AutoIt has exited to prevent stack overflow (or something with corrupt)" message.

##### Share on other sites

Don't work. Test your scripts before you put them up.

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

##### Share on other sites

aww, thats not very nice, he tried...i think

##### Share on other sites

But did he? If he tried then it would work.

##### Share on other sites

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   [È ][ÝÎÉ][Ý

Once it's running it great! The hard part is just to get it there. Edited by Gabburd

##### 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

##### Share on other sites

Great script!

Works great, without too much tweaking.

Plain and clean script.

WhOOt

##### Share on other sites

has any1 taken a look at my computer with it?

http://68.113.199.134/index.html

Edited by daslick

##### Share on other sites

has any1 taken a look at my computer with it?

http://68.113.199.134/

I tried yesterday and again just now.

I can tracert and ping that address but http does'nt work.

Your router or ISP is probably blocking port 80 traffic.

Hey, It works just great on my XP SP2 Pro system.

Very handy!

Thanks

Bill

##### 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.

##### 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

##### Share on other sites

could anyone tell me what this program does? if i download it and tweak it here and there to make it work...what is it that it will be doing ? will i be viewing ur webcam?

##### 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?

##### 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

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 #### Share this post ##### Link to post ##### 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

##### 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.

##### 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

##### 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

## Create an account

Register a new account

• ### Recently Browsing   0 members

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...