- kinda weak in my opinion - it just looks for a few calls / subs that can be potentially dangerous if not checked. It does not check for buffer exploitations and the like.
- I'm not saying it's a bad app, just nothing special. I could do this in the command line with some perl expressions just as easily.
- Maybe some one would be nice enough to find a nicer (more extensive) code analyzer.
atomix
Nov 4 2003, 10:13 AM
great program by a cool guy. SrcSec written by Bob of dtors.net will check your c coding for insecure programming. this is extremely useful because insecure coding can lead to potential exploitation and manipulation of programs.
atomix
Nov 4 2003, 10:18 AM
win32 version. had to get rid of all the sleep()'s for it to compile.
wicked
Nov 4 2003, 11:02 PM
Ive got some nice code here Coder will paste a sample below ain't got anything to do with the above post though.... see what you think... it's bin done in Delphi.
is apart of a program that I use often called Genius Posted Else Where in here. monitors ports on computer very nice look and feel if you ask me.
procedure TfrmStats.ShowStats(Stat : TStat); var StatList : TCounterList; i : Integer; begin case Stat of stTCP : begin StatList := TCPStats1; Caption := 'TCP/IP Statistics'; end; stUDP : begin StatList := UDPStats1; Caption := 'UDP/IP Statistics'; end; stIP : begin StatList := IPStats1; Caption := 'IP Statistics'; end; stICMP : begin StatList := ICMPStats1; Caption := 'ICMP Statistics'; end; else Exit; end; for i := 0 to StatList.Count - 1 do begin with dxtlStats.Add do begin Strings[0] := StatList.Counters[i].Name; Strings[1] := IntToStr(StatList.Counters[i].Value); end; end; if dxtlStats.Count > 0 then begin with dxtlStats.Items[0] do begin Focused := True; MakeVisible; end; end; ShowModal; Release; end;
procedure TfrmStats.FormShow(Sender: TObject); begin SetForegroundWindow(Handle); end;
procedure TfrmStats.dxtlStatsCustomDraw(Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxTreeListColumn; const AText: String; AFont: TFont; var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean); begin if ANode.HasChildren then Exit; if ASelected then begin AColor := clHighlight; end else begin if ANode.Parent = nil then begin if (ANode.Index mod 2 = 0) then begin AColor := clWindow; AFont.Color := clWindowText; end else begin AColor := clInfoBk; AFont.Color := clInfoText; end; end else begin if ANode.Index mod 2 = 0 then begin AColor := clWindow; AFont.Color := clWindowText; end else begin AColor := clInfoBk; AFont.Color := clInfoText; end; end; end; end;
var frmCurrentConnections: TfrmCurrentConnections;
implementation
uses current_stats, nslookup, portinfo;
{$R *.DFM}
procedure TfrmCurrentConnections.CreateParams(Var params: TCreateParams ); begin inherited; Params.WndParent := GetDesktopWindow; Params.ExStyle := Params.ExStyle and not WS_EX_TOOLWINDOW or WS_EX_APPWINDOW; end;
procedure TfrmCurrentConnections.dxbbTCPClick(Sender: TObject); begin with TfrmStats.Create(nil) do ShowStats(stTCP); end;
procedure TfrmCurrentConnections.dxbbUDPClick(Sender: TObject); begin with TfrmStats.Create(nil) do ShowStats(stUDP); end;
procedure TfrmCurrentConnections.dxbbIPClick(Sender: TObject); begin with TfrmStats.Create(nil) do ShowStats(stIP); end;
procedure TfrmCurrentConnections.dxbbICMPClick(Sender: TObject); begin with TfrmStats.Create(nil) do ShowStats(stICMP); end;
procedure TfrmCurrentConnections.dxbcFilterChange(Sender: TObject); begin dxblbRefreshClick(nil); end;
procedure TfrmCurrentConnections.dxbbCloseClick(Sender: TObject); begin Close; end;
procedure TfrmCurrentConnections.FormCreate(Sender: TObject); begin if FOptions.FlatAppMenus then begin dxBarManager1.Style := bmsFlat; dxBarManager1.SunkenBorder := False; end else begin dxBarManager1.Style := bmsEnhanced; dxBarManager1.SunkenBorder := True; end; with TIniFile.Create(SameDir(INI_FILE)) do begin dxbcFilter.ItemIndex := ReadInteger('Current Connections','Filter',2); dxbbShowCaptions.Down := ReadBool('Current Connections','Show Button Captions',True); Free; end; dxbbShowCaptionsClick(nil); LoadStateFromReg(Self,'Current Connections'); end;
procedure TfrmCurrentConnections.FormShow(Sender: TObject); begin SetForegroundWindow(Handle); if dxbcFilter.ItemIndex = 2 then dxblbRefreshClick(nil); end;
procedure TfrmCurrentConnections.FormClose(Sender: TObject; var Action: TCloseAction); begin Action := caFree; end;
procedure TfrmCurrentConnections.dxbbCopyLocalPortClick(Sender: TObject); begin if dxdbgConnections.SelectedCount > 0 then Clipboard.AsText := dxmdConnections.FieldByName('LocalPort').AsString; end;
procedure TfrmCurrentConnections.dxbbCopyRemoteIPClick(Sender: TObject); begin if dxdbgConnections.SelectedCount > 0 then Clipboard.AsText := dxmdConnections.FieldByName('RemoteIP').AsString; end;
procedure TfrmCurrentConnections.dxbbCopyRemotePortClick(Sender: TObject); begin if dxdbgConnections.SelectedCount > 0 then Clipboard.AsText := dxmdConnections.FieldByName('RemotePort').AsString; end;
procedure TfrmCurrentConnections.dxbbCustomizeClick(Sender: TObject); begin dxdbgConnections.ColumnsCustomizing; end;
procedure TfrmCurrentConnections.FormDestroy(Sender: TObject); begin with TIniFile.Create(SameDir(INI_FILE)) do begin WriteInteger('Current Connections','Filter',dxbcFilter.ItemIndex); WriteBool('Current Connections','Show Button Captions',dxbbShowCaptions.Down); Free; end; SaveStateToReg(Self,'Current Connections'); end;
procedure TfrmCurrentConnections.dxdbgConnectionsCustomDraw( Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont; var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean); var G : TdxDBGrid; begin if ANode.HasChildren then Exit; G := Sender as TdxDBGrid; if ASelected then begin AColor := clHighlight; end else begin if ANode.Parent = nil then begin if ((egoLoadAllRecords in G.Options) and (ANode.Index mod 2 = 0)) or (not (egoLoadAllRecords in G.Options)) and (G.DataSource.DataSet.RecNo mod 2 = 0) then begin AColor := clWindow; AFont.Color := clWindowText; end else begin AColor := clInfoBk; AFont.Color := clInfoText; end; end else begin if ANode.Index mod 2 = 0 then begin AColor := clWindow; AFont.Color := clWindowText; end else begin AColor := clInfoBk; AFont.Color := clInfoText; end; end; end; end;
procedure TfrmCurrentConnections.dxbbExportAllClick(Sender: TObject); begin if SaveDialog1.Execute then begin case SaveDialog1.FilterIndex of 1 : dxdbgConnections.SaveToHTML(SaveDialog1.FileName,True); 2 : dxdbgConnections.SaveAllToTextFile(SaveDialog1.FileName); 3 : dxdbgConnections.SaveToXLS(SaveDialog1.FileName,True); end; end; end;
procedure TfrmCurrentConnections.dxbbExportSelectedClick(Sender: TObject); begin if SaveDialog1.Execute then begin case SaveDialog1.FilterIndex of 1 : dxdbgConnections.SaveToHTML(SaveDialog1.FileName,False); 2 : dxdbgConnections.SaveSelectedToTextFile(SaveDialog1.FileName); 3 : dxdbgConnections.SaveToXLS(SaveDialog1.FileName,False); end; end; end;
procedure TfrmCurrentConnections.dxBarManager1BarAdd(Sender: TdxBarManager; ABar: TdxBar); begin ABar.AllowQuickCustomizing := False; end;
procedure TfrmCurrentConnections.dxbbLookupIPClick(Sender: TObject); begin with TfrmNSLookup.Create(nil) do begin edLookup.Text := dxmdConnections.FieldByName('RemoteIP').AsString; Show; dxbbLookupClick(nil); end; end;
procedure TfrmCurrentConnections.dxbbLookupLocalPortClick(Sender: TObject); begin with TfrmPortInfo.Create(nil) do begin Show; LookupPort(dxmdConnections.FieldByName('LocalPort').AsInteger); end; end;
procedure TfrmCurrentConnections.dxbbLookupRemotePortClick( Sender: TObject); begin with TfrmPortInfo.Create(nil) do begin Show; LookupPort(dxmdConnections.FieldByName('RemotePort').AsInteger); end; end;
procedure TfrmCurrentConnections.dxblbCopyClick(Sender: TObject); begin dxdbgConnections.CopySelectedToClipboard; end;
procedure TfrmCurrentConnections.dxblbRefreshClick(Sender: TObject); var i : Integer; begin Screen.Cursor := crAppStart; StatusBar1.SimpleText := 'Checking...'; dxmdConnections.Active := False; dxmdConnections.Active := True; dsConnections.DataSet := nil; case dxbcFilter.ItemIndex of 0 : Conns.Protocols := [tcp_ip]; 1 : Conns.Protocols := [udp_ip]; 2 : Conns.Protocols := [udp_ip,tcp_ip]; end; Conns.Refresh; for i := 0 to Conns.ConnCount - 1 do begin with Conns.Connections[i] do begin dxmdConnections.AppendRecord([i, IpProtoName, LocalPort, RemoteIpString, RemotePort, StateString]); dxmdConnections.First; end; end; dsConnections.DataSet := dxmdConnections; dxdbgConnections.Refresh; if dxdbgConnections.Count > 0 then begin with dxdbgConnections.Items[0] do begin Focused := True; MakeVisible; end; end; StatusBar1.SimpleText := ''; Screen.Cursor := crDefault; end;
procedure TfrmCurrentConnections.dxbbShowCaptionsClick(Sender: TObject); begin SetBigButtonText(Self, dxbbShowCaptions.Down); end;
end.
Also need dfm files will Attach all of the above for any Delphi Compilers to Look at.
Enjoy!
Wkd.
ps: Will Remove Annoying Code 2morro.
pps: Will Leave Attachment with short Description.
Laterz.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.