-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v0.9 + WiFi (AP) support and indicator
- Loading branch information
1 parent
d7b4c45
commit 8a76556
Showing
29 changed files
with
475 additions
and
295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
unit tun2socks_scan_trd; | ||
|
||
{$mode objfpc}{$H+} | ||
|
||
interface | ||
|
||
uses | ||
Classes, Forms, Controls, SysUtils, Process, Graphics; | ||
|
||
type | ||
Tun2SocksScan = class(TThread) | ||
private | ||
|
||
{ Private declarations } | ||
protected | ||
var | ||
ResultStr: TStringList; | ||
|
||
procedure Execute; override; | ||
procedure ShowStatus; | ||
|
||
end; | ||
|
||
implementation | ||
|
||
uses unit1; | ||
|
||
{ TRD } | ||
|
||
procedure Tun2SocksScan.Execute; | ||
var | ||
ScanProcess: TProcess; | ||
begin | ||
FreeOnTerminate := True; //Уничтожать по завершении | ||
|
||
while not Terminated do | ||
try | ||
ResultStr := TStringList.Create; | ||
|
||
ScanProcess := TProcess.Create(nil); | ||
|
||
ScanProcess.Executable := 'bash'; | ||
ScanProcess.Parameters.Add('-c'); | ||
ScanProcess.Options := [poUsePipes, poWaitOnExit]; | ||
|
||
ScanProcess.Parameters.Add( | ||
'if [[ $(ip -br a | grep tun2socks) ]]; then echo "yes"; else echo "no"; fi'); | ||
|
||
ScanProcess.Execute; | ||
|
||
ResultStr.LoadFromStream(ScanProcess.Output); | ||
Synchronize(@ShowStatus); | ||
|
||
Sleep(1000); | ||
finally | ||
ResultStr.Free; | ||
ScanProcess.Free; | ||
end; | ||
end; | ||
|
||
//Отображение статуса | ||
procedure PortScan.ShowStatus; | ||
begin | ||
with MainForm do | ||
begin | ||
if ResultStr[0] = 'yes' then | ||
begin | ||
Shape1.Brush.Color := clLime; | ||
ApplyBtn.Enabled := False; | ||
end | ||
else | ||
begin | ||
Shape1.Brush.Color := clYellow; | ||
ApplyBtn.Enabled := True; | ||
end; | ||
|
||
Shape1.Repaint; | ||
end; | ||
end; | ||
|
||
end. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.