Autor Beitrag
Airtrox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 109


Delphi 7
BeitragVerfasst: So 04.10.09 13:01 
Hey
ich habe etwas gegooglet und einen Code gefunden, mit dem man die ID der Festplatte auslesen kann:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
procedure TForm1.Button1Click(Sender: TObject);
var
  pRootPathName:        Array[0..MAX_PATH] of Char;
  pVolumeNameBuffer:      Array[0..MAX_PATH] of Char;
  iVolumeSerialNumber:    Cardinal;

  iMaximumComponentLength:   DWORD;
  iFileSystemFlags:       DWORD;

  cc : Cardinal;

begin

  cc := 0;
  pRootPathName := 'C:\';  // Welche Festplatte soll ausgelesen werden
  GetVolumeInformation( pRootPathName,pVolumeNameBuffer,Sizeof(pVolumeNameBuffer)-1,@iVolumeSerialNumber,iMaximumComponentLength,iFileSystemFlags,nil,0 );
  cc := iVolumeSerialNumber;
  edit1.text := Format('%.8x', [cc]);   // achstellig, lässt sich auch 12stellig oder höher ausgeben
end;


Starte ich so ein Programm, wird es als Trojaner erkannt. Ich verstehe jedoch nicht wieso, bzw. wie ich es "entschärfen" kann.

lg
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19340
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: So 04.10.09 13:14 
Da kannst du nur das fertige Programm als False Positive an den Antivirenhersteller schicken, damit die das korrigieren.

Zudem ist die Frage wieviele Scanner es denn erkennen. Meistens sind das ohnehin nur Antivir und ähnliche Programme, was mich mittlerweile eher weniger interessiert.
Das kannst du hier einmal testen: www.virustotal.com/de/
Airtrox Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 109


Delphi 7
BeitragVerfasst: So 04.10.09 13:18 
Ich habe es auf der Seite getestet, wo du geschrieben hast: www.virustotal.com/d...da8ccbb47-1254653623
Von 3 Virenscannern wird es erkannt :shock:
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19340
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: So 04.10.09 13:28 
Bei den Meldungen liegt das aber eher daran, dass du Internetfunktionen im Programm hast. Dass jetzt durch diese zusätzliche Funktion die Heuristik anspringt, ist eben Zufall.
Airtrox Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 109


Delphi 7
BeitragVerfasst: So 04.10.09 13:35 
Internetfunktionen? Ich habe außer dem Code oben (und den Uses) nichts weiteres drin. Ich versteh das nicht.
hathor
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 04.10.09 14:03 
Unter ID der Festplatte verstehe ich etwas anderes:
www.delphi-forum.de/....php?p=452697#452697
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19340
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: So 04.10.09 14:27 
user profile iconAirtrox hat folgendes geschrieben Zum zitierten Posting springen:
Internetfunktionen? Ich habe außer dem Code oben (und den Uses) nichts weiteres drin.
Dann kann ich das nicht reproduzieren (getestet mit D2006 und D2007). Und eigentlich ist das auch nichts was die Trojanerheuristik auslösen sollte. Was ist das denn für eine Delphiversion? Noch Delphi 7 oder sowas?

Am besten häng bitte einfach einmal das ganze Testprojekt inkl. Exe an.
Airtrox Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 109


Delphi 7
BeitragVerfasst: So 04.10.09 14:42 
Jap ich habe Delphi 7

die source:
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Label1: TLabel;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  pRootPathName:        Array[0..MAX_PATH] of Char;
  pVolumeNameBuffer:      Array[0..MAX_PATH] of Char;
  iVolumeSerialNumber:    Cardinal;

  iMaximumComponentLength:   DWORD;
  iFileSystemFlags:       DWORD;

  cc : Cardinal;

begin

  cc := 0;
  pRootPathName := 'C:\';  // Welche Festplatte soll ausgelesen werden
  GetVolumeInformation( pRootPathName,pVolumeNameBuffer,Sizeof(pVolumeNameBuffer)-1,@iVolumeSerialNumber,iMaximumComponentLength,iFileSystemFlags,nil,0 );
  cc := iVolumeSerialNumber;
  edit1.text := Format('%.12x', [cc]);   // achstellig, lässt sich auch 12stellig oder höher ausgeben
end;

end.
Einloggen, um Attachments anzusehen!
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: So 04.10.09 15:30 
Oh Delphi 7? Da läuten bei mir die Alarmglocken...
Das könnte der Delphi-Virus sein: www.delphi-forum.de/...onen+lt+7_94232.html

_________________
In the beginning was the word.
And the word was content-type: text/plain.
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19340
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: So 04.10.09 16:08 
Der Original-Virus heißt ja anders, aber ich schau mir die Exe gerade in einer Sandbox kurz an bzw. vergleiche mit einer von einer sauberen Delphiinstallation erzeugten.

// EDIT:
Ich kann das bei einer sauberen Delphiinstallation im virtuellen PC reproduzieren mit dem obigen Code. Da bleibt nur den Herstellern die Datei einzuschicken. Bzw. sinnvollerweise dann das fertige Programm.
Airtrox Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 109


Delphi 7
BeitragVerfasst: So 04.10.09 17:19 
Also wenn ich den Code in ein Programm (ein größeres) einbinde, wird es nicht als Virus erkannt, so aber schon... laut Google ist das "Junk-Code" was auch immer damit gemeint ist