I tryed it, but it copy only 1 byte...
This is the code:
;Listener(receive file)
svrcom=CreateTCPServer(9015)
If svrcom<>0 Then
Print "Server started successfully."
Else
Print "Server failed to start."
End
End If
While Not KeyHit(1)
strstream=AcceptTCPStream(svrcom)
If strstream Then
Print ReadString$(strstream)
WaitKey()
End
Else
Print "Attempting messages..."
Delay 1000
End If
Wend
End
;Server(send file)
strmcom=OpenTCPStream("127.0.0.1",9015)
file = ReadFile("agent.exe")
fileout=ReadFile("agent2.exe")
If strmcom<>0 Then
Print "Client Connected successfully."
Else
Print "Server failed to connect."
WaitKey
End
End If
While Not Eof(file)
linea = ReadByte( file )
WriteByte(strmcom,linea)
Wend
CloseFile( file )
CloseFile(fileout)
Print "Completed sending message..."
This is the code:
;Listener(receive file)
svrcom=CreateTCPServer(9015)
If svrcom<>0 Then
Print "Server started successfully."
Else
Print "Server failed to start."
End
End If
While Not KeyHit(1)
strstream=AcceptTCPStream(svrcom)
If strstream Then
Print ReadString$(strstream)
WaitKey()
End
Else
Print "Attempting messages..."
Delay 1000
End If
Wend
End
;Server(send file)
strmcom=OpenTCPStream("127.0.0.1",9015)
file = ReadFile("agent.exe")
fileout=ReadFile("agent2.exe")
If strmcom<>0 Then
Print "Client Connected successfully."
Else
Print "Server failed to connect."
WaitKey
End
End If
While Not Eof(file)
linea = ReadByte( file )
WriteByte(strmcom,linea)
Wend
CloseFile( file )
CloseFile(fileout)
Print "Completed sending message..."