Jump to content

Remote Server 1.3


themax90
 Share

Recommended Posts

Well I was stilling down one day and said, DAMN! AutoIt can control peoples computers really easy without them knowing. Well what if I made a remote control server for when people go on vacation and stuff! Yah! But how do I tell the computer what to do, TCP!

WARNING!

This code if used wrongly can infect computers without knowing, use at your own risk and please do not tamper with this code!

By downloading and reading this Topic you agree that whatever you do to change or compromise this code may lead to consquences and that you will hold yourself responsible for all legal action and consquences held against you. AutoIt, autoitscript.com, Max Gardner, and any of there associates to not claim responsiblity for your actions. By continuing you agree to the above!

Sorry that is needed for security reasons I ran tests and this can be easily used to exploit programs. I just deleted that part and will not release examples. If anyone in the autoit community find this offensive then please state so.

This is relitivly untested on open net, I am not sure if it will even work! It works on default address 127.0.0.1, and the IP addresses may need to be rewritten but what do I know, I dont have internet at my Main Location. So I hope it works, just not quite sure yet!

Run server.exe on the server computer to control and then run client anywhere on a non routered internet connection. And the rest is self explainitory, I got bored and never finished the api send file or the command view in the client, but the command info is below.

:EDIT: Re added the code Client

UDPStartUp ()
TCPStartup ()
Dim $RecvSocket = -1, $SendSocket = -1
#include <GuiConstants.au3>
$gui = GUICreate ("Client-Side Remote Control", 300, 295, (@DesktopWidth - 300) / 2, (@DesktopHeight - 295) / 2, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$ipset = GUICtrlCreateInput ("", 10, 10, 140, 20)
$reflist = GUICtrlCreateList ("", 10, 70, 160, 225)
$refinfo = GUICtrlCreateLabel ("Click on a command to receive information.", 180, 70, 110, 215, $SS_SUNKEN)
$engage = GUICtrlCreateButton ("Engage", 10, 40, 60, 20)
$disengage = GUICtrlCreateButton ("Disengage", 80, 40, 70, 20)
$openconsole = GUICtrlCreateButton ("Open Console", 160, 40, 130, 20)
$funlabel = GUICtrlCreateLabel ("Current Status: Idle", 160, 12.5, 130, 15, $SS_SUNKEN + $SS_CENTER)
GUISetState ()
GUICtrlSetState ($disengage, $GUI_DISABLE)
GUICtrlSetState ($openconsole, $GUI_DISABLE)
$console = GUICreate ("Console", 300, 430, (@DesktopWidth - 300) / 2, (@DesktopHeight - 430) / 2, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS, 0, $gui)
$transfer = GUICtrlCreateEdit ("", 10, 10, 280, 380, $WS_VSCROLL + $ES_READONLY)
$data = GUICtrlCreateInput ("", 10, 400, 230, 20)
$send = GUICtrlCreateButton ("Send", 245, 400, 50, 20)
GUISetState (@SW_HIDE, $console)
While 1
    $msg = GUIGetMsg (1)
    If $msg[0] = $GUI_EVENT_CLOSE And $msg[1] = $gui Then
        ExitLoop
    ElseIf $msg[0] = $engage And $msg[1] = $gui Then
        $ip = GUICtrlRead ($ipset)
        $ips = StringSplit ($ip, ".")
        If $ip = "" Or StringIsDigit ($ips[1]) = 0 Or StringIsDigit ($ips[2]) = 0 Or StringIsDigit ($ips[3]) = 0 Or StringIsDigit ($ips[4]) = 0 Then
            MsgBox (48, "INVALID!", "You have given an invalid Ip Address to engage!")
        Else
            SplashTextOn ("Engaging.....", "Enroute to engage computer.", 220, 20)
            GUICtrlSetState ($disengage, $GUI_ENABLE)
            GUICtrlSetState ($openconsole, $GUI_ENABLE)
            GUICtrlSetState ($engage, $GUI_DISABLE)
            GUISetState (@SW_SHOW, $console)
            $SendSocket = UDPOpen ($ip, 33158)
            Sleep (2000)
            $RecvSocket = TCPConnect ($ip, 33158)
            SplashOff ()
            UDPSend ($SendSocket, "~~hello-" & @IPAddress1)
        EndIf
    ElseIf $msg[0] = $disengage And $msg[1] = $gui Then
        UDPSend ($SendSocket, "~~bye")
        GUICtrlSetState ($disengage, $GUI_DISABLE)
        GUICtrlSetState ($openconsole, $GUI_DISABLE)
        GUICtrlSetState ($engage, $GUI_ENABLE)
        GUISetState (@SW_HIDE, $console)
        GUICtrlSetData ($transfer, "")
        UDPCloseSocket ($SendSocket)
        TCPCloseSocket ($RecvSocket)
        UDPShutdown ()
        TCPShutdown ()
        UDPStartUp ()
        TCPStartup ()
        MsgBox (0, "Reset", "Communications reset!")
    ElseIf $msg[0] = $openconsole And $msg[1] = $gui Then
        GUISetState (@SW_SHOW, $console)
    ElseIf $msg[0] = $GUI_EVENT_CLOSE And $msg[1] = $console Then
        GUISetState (@SW_HIDE, $console)
    ElseIf $msg[0] = $send And $msg[1] = $console Then
        $outdata = GUICtrlRead ($data)
        If $outdata <> "" And $outdata <> "~~bye" And $outdata <> "_Exit()" And $outdata <> "_Clr" Then
            GUICtrlSetData ($data, "")
            UDPSend ($SendSocket, $outdata)
            GUICtrlSetData ($transfer, GUICtrlRead ($transfer) & @CRLF & "Out<" & $outdata)
        ElseIf $outdata = "~~bye" Then
            UDPSend ($SendSocket, "~~bye")
            GUICtrlSetData ($data, "")
            GUICtrlSetState ($disengage, $GUI_DISABLE)
            GUICtrlSetState ($openconsole, $GUI_DISABLE)
            GUICtrlSetState ($engage, $GUI_ENABLE)
            GUISetState (@SW_HIDE, $console)
            GUICtrlSetData ($transfer, "")
            UDPCloseSocket ($SendSocket)
            TCPCloseSocket ($RecvSocket)
            UDPShutdown ()
            TCPShutdown ()
            UDPStartUp ()
            TCPStartup ()
            MsgBox (0, "Reset", "Communications reset!")
        ElseIf $outdata = "_Exit()" Then
            GUICtrlSetData ($data, "")
            $true = MsgBox (4, "Really?", "Doing this will disable the computer PERMANENTLY, are you sure you want to do this?")
            If $true = 6 And $true <> 7 Then
                UDPSend ($SendSocket, $outdata)
                GUICtrlSetState ($disengage, $GUI_DISABLE)
                GUICtrlSetState ($openconsole, $GUI_DISABLE)
                GUICtrlSetState ($engage, $GUI_ENABLE)
                GUISetState (@SW_HIDE, $console)
                GUICtrlSetData ($transfer, "")
                UDPCloseSocket ($SendSocket)
                TCPCloseSocket ($RecvSocket)
                UDPShutdown ()
                TCPShutdown ()
                UDPStartUp ()
                TCPStartup ()
            EndIf
        ElseIf $outdata = "_Clr" Then
            GUICtrlSetData ($data, "")
            GUICtrlSetData ($transfer, "")
        EndIf
    EndIf
    If $RecvSocket <> - 1 Then
        $indata = TCPRecv ($RecvSocket, 100)
        $indata2 = StringSplit ($indata, "-")
        If $indata <> "" Then
            If $indata = "~~send" Then
                FileDelete (@ScriptDir & "\temp.txt")
                While 1
                    $data2 = TCPRecv ($RecvSocket, 500)
                    If $data2 <> "" And $data2 = "~~done" Then
                        ExitLoop
                    ElseIf $data2 <> "" And $data2 <> "~~done" Then
                        FileWriteLine (@ScriptDir & "\temp.txt", $data2)
                    EndIf
                WEnd
            ElseIf $indata2[1] = "~~ready" Then
                FileDelete("temp." & $indata2[2])
                While 1
                    $b = TCPRecv ($RecvSocket, 1000000000)
                    If @error Then Exit
                    If $b <> "" Then ExitLoop
                WEnd
                $c = ""
                While 1
                    $c = $c & $b
                    $b = TCPRecv ($RecvSocket, 10000000000)
                    If @error Or $b == "" Then ExitLoop
                WEnd
                $z = _APIFileOpen(".\temp." & $indata2[2])
                _APIFileWrite($z, $c, 1)
                _APIFileClose($z)
            Else
                $read = GUICtrlRead ($transfer)
                If $read = "" Then
                    GUICtrlSetData ($transfer, "In>" & $indata)
                Else
                    GUICtrlSetData ($transfer, $read & @CRLF & "In>" & $indata)
                EndIf
            EndIf
        EndIf
    EndIf
WEnd
Exit
Func OnAutoItExit()
    UDPCloseSocket ($SendSocket)
    TCPCloseSocket ($RecvSocket)
    UDPShutdown ()
    TCPShutdown ()
EndFunc;==>OnAutoItExit

Server

; =======================================================;
;       AutoIt Remote Control Server     v 1.0         ;
;                  By : Max Gardner                    ;
;========================================================;
;   To control any personal computer wherever you are.   ;
;   Use the client to send a message in this format:    ;
;   _$commandname($commandpref[0],$commandpref[1],etc...);
;   Please make sure there is a underscore (_) followed;
;   by the command name.  Then an enclosure, with the   ;
;   prefs, NO SPACES, comma's seperating.              ;
;========================================================;
;========================;
;   Commands and Calls ;
;  ~~setfile-(filename);
;  ~~hello-(@clientsip);
;        ~~bye      ;
; ~~sendfile-($filename);
;  ~~apisend-(filename)*;
;       ~~issetfile  ;
; * in testing/not work.;
;========================;
#include <file.au3>
#include <inet.au3>
Dim $ConnectedSocket = -1
Global $file = -1
;Break(0)
;#NoTrayIcon
;==============;
; Start Server;
;==============;
UDPStartUp ()
TCPStartup()
Global $MainSocket = UDPBind("127.0.0.1", 33158)
Global $SendSocket = TCPListen("127.0.0.1", 33158)
;======================;
; Main While Statement;
;======================;
;  This gives special;
;  commands and calls.;
;======================;
While 1
    If $ConnectedSocket = -1 Then
        Global $ConnectedSocket = TCPAccept($SendSocket)
    EndIf
    $data = UDPRecv($MainSocket, 100)
    $data2 = StringLeft($data, 1)
    If $data <> "" And $data2 = "_" Then
        $data = StringSplit($data, "(")
        $command = $data[1]
        $data[2] = StringTrimRight($data[2], 1)
        $cmdpref = StringSplit($data[2], ",")
        If StringIsDigit($cmdpref[0]) And $cmdpref[0] <> "" And $cmdpref[0] >= 1 And $cmdpref[1] <> "" Then
            $preftoini = 1
            IniWrite($file, $command, "Prefs", $cmdpref[0])
            While $preftoini <> $cmdpref[0] + 1
                IniWrite($file, $command, $preftoini, $cmdpref[$preftoini])
                $preftoini = $preftoini + 1
            WEnd
        EndIf
        Call($command)
    ElseIf $data <> "" And $data2 <> "_" Then
        $data2 = StringSplit($data, "-")
        If $data2[1] = "~~setfile" Then
            Global $file = $data2[2]
            IniWrite($file, "MainInfo", "Remote Server By:", "Max Gardner")
            TCPSend($ConnectedSocket, "Main ini file set to " & $file)
        ElseIf $data2[1] = "~~sendfile" Then
            If FileExists($data2[2]) Then
                TCPSend($ConnectedSocket, "~~send")
                Sleep(500)
                $lines = _FileCountLines($data2[2])
                $a = 1
                While $a <> ($lines + 1)
                    TCPSend($ConnectedSocket, FileReadLine($data2[2], $a))
                    $a = $a + 1
                WEnd
                Sleep(100)
                TCPSend($ConnectedSocket, "~~done")
                Sleep(500)
                TCPSend($ConnectedSocket, "File sending complete!")
            Else
                TCPSend($ConnectedSocket, "File does not exist!")
            EndIf
        ElseIf $data2[1] = "~~issetfile" Then
            If $file = -1 Then
                TCPSend($ConnectedSocket, "Master data file is not set.")
            Else
                TCPSend($ConnectedSocket, "Master data file is set.")
            EndIf
        ElseIf $data2[1] = "~~apisend" Then
            $ext = StringSplit($data2[2], ".")
            TCPSend($ConnectedSocket, "~~ready-" & $ext[2])
            Sleep(1000)
            $z = _APIFileOpen($data2[2])
            $a = _APIFileRead($z, FileGetSize($data2[2]), 1)
            _APIFileClose($z)
            TCPSend($ConnectedSocket, $a)
            Sleep(1000)
            TCPSend($ConnectedSocket, "File sending complete.")
        ElseIf $data2[1] = "~~hello" Then
            TCPSend($ConnectedSocket, "Hello " & $data2[2] & "! We are now engaged.")
        ElseIf $data2[1] = "~~bye" Then
            TCPCloseSocket($ConnectedSocket)
            TCPCloseSocket($SendSocket)
            UDPCloseSocket($MainSocket)
            UDPShutdown ()
            TCPShutdown()
            UDPStartUp ()
            TCPStartup()
            Global $MainSocket = UDPBind("127.0.0.1", 33158)
            Global $SendSocket = TCPListen("127.0.0.1", 33158)
            $ConnectedSocket = -1
        EndIf
    EndIf
WEnd
Func OnAutoItExit ()
    UDPCloseSocket($MainSocket)
    UDPShutDown ()
    TCPCloseSocket($SendSocket)
    TCPCloseSocket($ConnectedSocket)
    TCPShutdown()
EndFunc ;==>OnAutoItExit
;=================================;
; Functions for internal computer;
;=================================;
Func _Exit ()
    Exit
EndFunc ;==>_Exit
Func _CD ()
    $oc = IniRead($file, "_CD", "1", -1)
    $drive = IniRead($file, "_CD", "2", -1)
    If $oc = -1 Or $drive = -1 Then
        TCPSend($ConnectedSocket, "Invalid number of parameters.")
    Else
        If $oc = "o" Then
            CDTray($drive, "Open")
        ElseIf $oc = "c" Then
            CDTray($drive, "Close")
        EndIf
    EndIf
EndFunc ;==>_CD
Func _DirCopy ()
    $source = IniRead($file, "_DirCopy", "1", -1)
    $dest = IniRead($file, "_DirCopy", "2", -1)
    If $source = -1 Or $dest = -1 Then
        TCPSend($ConnectedSocket, "Invalid number of parameters.")
    Else
        DirCopy($source, $dest)
        TCPSend($ConnectedSocket, "Directory copied.")
    EndIf
EndFunc ;==>_DirCopy
Func _DirCreate ()
    $dir2create = IniRead($file, "_DirCreate", "1", -1)
    If $dir2create = -1 Then
        TCPSend($ConnectedSocket, "Invalid number of parameters.")
    Else
        DirCreate($dir2create)
        TCPSend($ConnectedSocket, "Directory created.")
    EndIf
EndFunc ;==>_DirCreate
Func _DirExists ()
    $dir2check = IniRead($file, "_DirExists", "1", -1)
    If $dir2check = -1 Then
        TCPSend($ConnectedSocket, "Invalid number of parameters.")
    Else
        $exists = DirGetSize($dir2check, 1)
        $exists = IsArray($exists)
        If $exists = 1 Then
            TCPSend($ConnectedSocket, "Directory does exists.")
        ElseIf $exists = 0 Then
            TCPSend($ConnectedSocket, "Directory does not exists.")
        EndIf
    EndIf
EndFunc ;==>_DirExists
Func _DirMove ()
    $source = IniRead($file, "_DirMove", "1", -1)
    $dest = IniRead($file, "_DirMove", "2", -1)
    If $source = -1 Or $dest = -1 Then
        TCPSend($ConnectedSocket, "Invalid number of parameters.")
    Else
        DirMove($source, $dest)
        TCPSend($ConnectedSocket, "Directory moved.")
    EndIf
EndFunc ;==>_DirMove
Func _DirList ()
    $dir = IniRead($file, "_DirList", "1", -1)
    $output = IniRead($file, "_DirList", "2", -1)
    If $dir = -1 Or $output = -1 Then
        TCPSend($ConnectedSocket, "Invalid number of parameters.")
    Else
        $array = _FileFindAll($dir, "*.*", "")
        If $array = 0 Then
            TCPSend($ConnectedSocket, "Directory does not exist.")
        Else
            FileDelete($output)
            $a = 0
            While $a <> $array[0] + 1
                FileWriteLine($output, $array[$a])
                $a = $a + 1
            WEnd
            TCPSend($ConnectedSocket, "Output to " & $output)
        EndIf
    EndIf
EndFunc ;==>_DirList
Func _DirRemove()
    $dir2delete = IniRead($file, "_DirRemove", "1", -1)
    If $dir2delete = -1 Then
        TCPSend($ConnectedSocket, "Invalid number of parameters.")
    Else
        DirRemove($dir2delete, 1)
        TCPSend($ConnectedSocket, "Directory deleted.")
    EndIf
EndFunc ;==>_DirRemove
Func _ChangeWorkDir()
    $dir2change = IniRead($file, "_ChangeWorkDir", "1", -1)
    If $dir2change = -1 Then
        TCPSend($ConnectedSocket, "Invalid number of parameters.")
    Else
        FileChangeDir($dir2change)
        TCPSend($ConnectedSocket, "Directory changed to " & $dir2change & ".")
    EndIf
EndFunc ;==>_ChangeWorkDir
Func _FileCopy()
    $source = IniRead($file, "_FileCopy", "1", -1)
    $dest = IniRead($file, "_FileCopy", "2", -1)
    If $source = -1 Or $dest = -1 Then
        TCPSend($ConnectedSocket, "Invalid number of parameters.")
    Else
        FileCopy($source, $dest)
        TCPSend($ConnectedSocket, "File Copied!")
    EndIf
EndFunc ;==>_FileCopy
Func _FileDelete()
    $file2delete = IniRead($file, "_FileDelete", "1", -1)
    If $file2delete = -1 Then
        TCPSend($ConnectedSocket, "Invalid number of parameters.")
    Else
        FileDelete($file2delete)
        TCPSend($ConnectedSocket, "File Deleted!")
    EndIf
EndFunc ;==>_FileDelete
Func _FileExists()
    $file2check = IniRead($file, "_FileExists", "1", -1)
    If $file2check = -1 Then
        TCPSend($ConnectedSocket, "Invalid number of parameters.")
    Else
        $exists = FileExists($file2check)
        If $exists = 1 Then
            TCPSend($ConnectedSocket, "File does exists.")
        ElseIf $exists = 0 Then
            TCPSend($ConnectedSocket, "File does not exists.")
        EndIf
    EndIf
EndFunc ;==>_FileExists
Func _FileMove()
    $source = IniRead($file, "_FileMove", "1", -1)
    $dest = IniRead($file, "_FileMove", "2", -1)
    If $source = -1 Or $dest = -1 Then
        TCPSend($ConnectedSocket, "Invalid number of parameters.")
    Else
        FileMove($source, $dest)
        TCPSend($ConnectedSocket, "File Moved!")
    EndIf
EndFunc ;==>_FileMove
Func _ProcessKill()
    $process = IniRead($file, "_ProcessKill", "1", -1)
    If $process = -1 Then
        TCPSend($ConnectedSocket, "Invalid number of parameters.")
    Else
        ProcessClose($process)
        TCPSend($ConnectedSocket, "Process Closed!")
    EndIf
EndFunc ;==>_ProcessKill
Func _ProcessList()
    $output = IniRead($file, "_ProcessList", "1", -1)
    If $output = -1 Then
        TCPSend($ConnectedSocket, "Invalid number of parameters.")
    Else
        $array = ProcessList()
        $a = 0
        FileDelete($output)
        While $a <> $array[0][0] + 1
            FileWriteLine($output, $array[$a][0] & " " & $array[$a][1])
            $a = $a + 1
        WEnd
        TCPSend($ConnectedSocket, "Output to " & $output)
    EndIf
EndFunc ;==>_ProcessList
Func _Run()
    $filename = IniRead($file, "_Run", "1", -1)
    If $filename = -1 Then
        TCPSend($ConnectedSocket, "Invalid number of parameters.")
    Else
        Run($filename)
        TCPSend($ConnectedSocket, "Program Excuted.")
    EndIf
EndFunc ;==>_Run
Func _Shutdown()
    $code = IniRead($file, "_Shutdown", "1", -1)
    If $code = -1 Then
        TCPSend($ConnectedSocket, "Invalid number of parameters.")
    Else
        Shutdown($code)
    EndIf
EndFunc ;==>_Shutdown
Func _Time()
    TCPSend($ConnectedSocket, "The local time is " & @HOUR & ":" & @MIN & ":" & @SEC)
EndFunc ;==>_Time
Func _WinList()
    $output = IniRead($file, "_WinList", "1", -1)
    FileDelete($output)
    If $output = -1 Then
        TCPSend($ConnectedSocket, "Invalid number of parameters.")
    Else
        $array = WinList()
        $a = 0
        While $a <> $array[0][0] + 1
            FileWriteLine($output, $array[$a][0] & " " & $array[$a][1])
            $a = $a + 1
        WEnd
        TCPSend($ConnectedSocket, "Output to " & $output)
    EndIf
EndFunc ;==>_WinList
Func _WinKill()
    $win = IniRead($file, "_WinKill", "1", -1)
    If $win = -1 Then
        TCPSend($ConnectedSocket, "Invalid number of parameters.")
    Else
        WinKill($win)
        TCPSend($ConnectedSocket, "Window Closed.")
    EndIf
EndFunc ;==>_WinKill
;=================================================================;
; DirList functions, not made by me, many thanks for making dude!;
;=================================================================;
Func _FileFindAll($Path, $Mask = '*', $AttribFilter = 'dhs')
;Returns an array fo files in $Path matching $Mask and fitting $AttribFilter
    Dim $FileList[20], $FileListSize = 0, $hndFile_Search, $CurFile
    If _FileIsDir($Path) Then;Path exists and is a directory
        $hndFile_Search = FileFindFirstFile(_FileJoinPath($Path, $Mask))
        If $hndFile_Search <> - 1 Then; at least 1 file/directory exists
            $CurFile = FileFindNextFile($hndFile_Search)
            While Not @error;loop through found files
                If _FileFilterAttrib(_FileJoinPath($Path, $CurFile), $AttribFilter) And $CurFile <> '.' And $CurFile <> '..' Then;file passes attribute filter
                    $FileListSize = $FileListSize + 1
                    If $FileListSize >= UBound($FileList) Then ReDim $FileList[$FileListSize * 2];increase list size
                    $FileList[$FileListSize] = $CurFile
                EndIf
                $CurFile = FileFindNextFile($hndFile_Search)
            WEnd
            FileClose($hndFile_Search)
            $FileList[0] = $FileListSize
            ReDim $FileList[$FileList[0] + 1]
            Return $FileList
        EndIf
    EndIf
    Return 0
EndFunc ;==>_FileFindAll
Func _FileIsDir($Path)
;This function checkes to see if $FileName exists and if it is a Directory
    If StringInStr(FileGetAttrib($Path), 'D') Then Return 1
    Return 0
EndFunc ;==>_FileIsDir
Func _FileJoinPath($FileName1, $FileName2)
    Dim $PP1 = _FileParsePath($FileName1)
    Dim $PP2 = _FileParsePath($FileName2)
    If $PP2[0] <> '' Then Return $FileName2
    If StringLeft($PP2[1], 1) = '\' Then Return $PP1[0] & $PP2[1] & $PP2[2] & $PP2[3]
    If StringRight($FileName1, 1) <> '\' Then
        Return $FileName1 & '\' & $FileName2
    Else
        Return $FileName1 & $FileName2
    EndIf
EndFunc ;==>_FileJoinPath
Func _FileParsePath($filename)
    Dim $Return[4];Drive, Path, Name, Extension
    Dim $Len
    If StringMid($filename, 2, 1) = ":" Then
        $Return[0] = StringLeft($filename, 2)
        $filename = StringRight($filename, StringLen($filename) - 2)
    Else
        $Return[0] = ''
    EndIf
    $Len = StringInStr($filename, "\", 0, -1)
    $Return[1] = StringLeft($filename, $Len)
    $filename = StringRight($filename, StringLen($filename) - $Len)
    $Len = StringInStr($filename, ".", 0, -1)
    $Return[2] = StringLeft($filename, $Len - 1)
    $filename = StringRight($filename, StringLen($filename) - $Len + 1)
    $Return[3] = $filename
    Return $Return
EndFunc ;==>_FileParsePath
Func _FileFilterAttrib($filename, $Attrib)
;Checks $FileName against attributes listed in $Attrib
;Returns True/False
    Dim $Return = 0
    If FileExists($filename) Then
        Dim $FileAttrib, $i, $ch
        $Return = -1
        $FileAttrib = FileGetAttrib($filename)
        For $i = 1 To StringLen($Attrib)
            $ch = StringMid($Attrib, $i, 1)
            If StringIsUpper($ch) Then
           ;This attribute must be on the list
                If Not StringInStr($FileAttrib, $ch) Then $Return = 0
            Else
           ;This attribute must not be on the list
                If StringInStr($FileAttrib, StringUpper($ch)) Then $Return = 0
            EndIf
        Next
    EndIf
    Return $Return
EndFunc ;==>_FileFilterAttrib
Edited by AutoIt Smith
Link to comment
Share on other sites

DAMN! AutoIt can control peoples computers really easy without them knowing.

···

_CD($OC, $Drive)

    This will Open or Close $Drive

    If $OC = O Then Open

    If $OC = C Then Close

I'm sorry to have to ask but if this script is designed for people to install on their own computers and to use from another location then why is it designed to install/run without any prompts and why have you included a function to open/close the CD drive?
Link to comment
Share on other sites

Just have, it's really incomplete. I just started making it for no reason.

The Client and command info.txt should be all you need to know. No idea why I had the CD command, just felt like screwing around one time and added, do you like my server at all?

AutoIt Smith

Link to comment
Share on other sites

Actually, it doesn't appear to exhibit any questionable form of stealthiness like lack of tray icon, etc. I got the wrong idea when I read 'This code if used wrongly can infect computers without knowing' from your initial post. It's actually harmless in this respect (or at least the source code is).

I like the way it doesn't hog 100% CPU. You may or may not be interested in changing some of your If..ElseIf...EndIf blocks to Select..EndSelect which would make the code slightly more coherent.

It would be nice to be able to press Enter after typing a command into the client console and perhaps some simpler keywords would be better, like time instead of _Time()...

Hope you find some of those ideas useful!

Edit: Typo.

Edited by LxP
Link to comment
Share on other sites

lol yeah ive written plenty of those useless scripts when im bored :whistle:

(this post makes it so that i am the author of the most recent post in every topic in the v3 cripts&scraps section...lol)

Edited by theguy0000

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Link to comment
Share on other sites

this post makes it so that i am the author of the most recent post in every topic in the v3 cripts&scraps section...lol

Yes, and its very annoying that you are. Nobody really likes it when they see unread forum posts and then see that they are all by the same person making the same pointless comment in every thread. Its nice that you like these author's work but was it necessary to tell all of them all at once?
Link to comment
Share on other sites

  • 1 month later...

Hi,

I was trying your script but there seems to be something missing at the end if the script.....

>Running AU3Check...C:\Program Files\AutoIt3\SciTe\Defs\Unstable\Au3Check\au3check.dat
P:\Test\TestScripts\_ProbeerUit2.au3(427,57) : ERROR: syntax error
            "long", BitOR($GENERIC_READ, $GENERIC_WRITE)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
P:\Test\TestScripts\_ProbeerUit2.au3(95,60) : ERROR: _APIFileRead(): undefined function.
            $a = _APIFileRead($z, FileGetSize($data2[2]), 1)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
P:\Test\TestScripts\_ProbeerUit2.au3(96,29) : ERROR: _APIFileClose(): undefined function.
            _APIFileClose($z)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
Link to comment
Share on other sites

  • 2 weeks later...

does this script work for anyone? everytime i try to run it, i get errors Line 1 (File "C:\client.au3"):

UPDStartUp ()

^ ERROR

Error: Unknown function name.

and this on the server

Line 425 (File "C:\server.au3"):

$AFO_h = DllCall( "kernal32.dll", "CreateFile", "str", $szFile, "long", BitOR($GENERIC_READ, $GENERIC_WRITE), &

Error: "Func" statement has no matching "EndFunc".

Link to comment
Share on other sites

does this script work for anyone? everytime i try to run it, i get errors Line 1 (File "C:\client.au3"):

UPDStartUp ()

^ ERROR

Error: Unknown function name.

and this on the server

Line 425 (File "C:\server.au3"):

$AFO_h = DllCall( "kernal32.dll", "CreateFile", "str", $szFile, "long", BitOR($GENERIC_READ, $GENERIC_WRITE), &

Error: "Func" statement has no matching "EndFunc".

From looks of things you arent using the latest beta to run through this.

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

  • 2 weeks later...

Would this be this correct way to execute a command ?

_testsendthings

code i added.

Func _testsendthings()
Run("notepad.exe")
Sleep(500)
Send("This is a test")
EndFunc

Before i even added this, i got this error, and i am running the beta, the most recent beta to my knowledge

Line 50 (File "C:\server.au3"):

$data[2] = StringTrimRight($data[2], 1)

$data[2] = StringTrimRight(^ ERROR

Error: Array variable has incorrect number of subscripts or subscript dimension range exceeded.

Edited by Jabberwock
Link to comment
Share on other sites

Actually, it doesn't appear to exhibit any questionable form of stealthiness like lack of tray icon, etc. I got the wrong idea when I read 'This code if used wrongly can infect computers without knowing' from your initial post. It's actually harmless in this respect (or at least the source code is).

I like the way it doesn't hog 100% CPU. You may or may not be interested in changing some of your If..ElseIf...EndIf blocks to Select..EndSelect which would make the code slightly more coherent.

It would be nice to be able to press Enter after typing a command into the client console and perhaps some simpler keywords would be better, like time instead of _Time()...

Hope you find some of those ideas useful!

Edit: Typo.

i agree that it kinda gets annoying to have to press send instead of pressing enter.

Link to comment
Share on other sites

Ok guys, listen up just abit :P I wrote this 2 - 3 months ago and when I finish the ITS chat server and get it stable for a official 1.0 release then I will go back and redo most of this server okay :lmao: You can just add If _IsPressed('0D') Then Send(Blah)

:(

Link to comment
Share on other sites

Ya, heres another error,

Line 268 (File "C:\AutiIt3\rm.au3"):

Func OnAutoItExit ()

Error: Duplicate function name.

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Link to comment
Share on other sites

  • 5 years later...

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