Autor Beitrag
CyberStorm
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 33

WIN 98, WIN XP
D4 Prof, D6 Pers
BeitragVerfasst: Mi 26.06.02 21:37 
Hi

Wo werden eigentlich die Datei Attribute in einer Datei abgespeichert. Ist es Möglich mit Delphi darauf zuzugreifen und diese zu ändern?

- Nach so einem gewissen Virus sind nämlich sämtliche meiner mp3 und Bilder Dateien versteckt und das coole WinDoof kann diese nicht wieder zur Normalform bringen. :twisted:

Mit freundlichen Grüßen
CyberStorm
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: Mi 26.06.02 21:57 
Hi,

klar ist das möglich.

1. Mit FindFirst, FindNext, FindClose kannst du auch versteckte Dateien suchen. Ein Beipiel findest du in der Online Hilfe. Über das searchRect kannst du auch sämtliche Attribute auslesen.
2. Solltest du nur die Attribute einer einzelen Datei lesen wollen kannst du alternativ FileGetAttr verwenden.
3. Um Attribute zu ändern steht FileSetAttr zur verfügung. Auch hierzu gibt die Online-Hilfe gerne auskumpft.

Viel Erfolg
Klabautermann
CyberStorm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 33

WIN 98, WIN XP
D4 Prof, D6 Pers
BeitragVerfasst: Mi 26.06.02 22:18 
Hi

Thx, das funtzt,
Denn wer brauch schon WinDoof :lol:

mfg
CyberStorm
Delta7
Hält's aus hier
Beiträge: 12



BeitragVerfasst: Do 27.06.02 15:52 
Zitat:
- Nach so einem gewissen Virus sind nämlich sämtliche meiner mp3 und Bilder Dateien versteckt und das coole WinDoof kann diese nicht wieder zur Normalform bringen.


schon mal attrib c:\*.* /s -h versucht ?
:wink:

_________________
Ein Byte hat 8 Bit. Wer's nicht glaubt, soll seinen Rechner aufschrauben und nachzählen.
CyberStorm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 33

WIN 98, WIN XP
D4 Prof, D6 Pers
BeitragVerfasst: Fr 28.06.02 15:08 
Hoi

@ Delta7, da liegt ja das Problem, mit Win32 oder Batch Befehlen läßt sich da ja nix verändern. Aber trotzdem danke

mfg
CyberStorm
Cyberbob
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Mo 01.07.02 21:17 
Titel: Der Virus
Dieser nette virus hört sich sehr stark nach dem I love you an! nennt deine mp3's um(mit virus text), versteckt die originalen und löscht alle Bilder... Armer kerl...
CyberStorm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 33

WIN 98, WIN XP
D4 Prof, D6 Pers
BeitragVerfasst: Mo 01.07.02 21:30 
Hi,
exakt der Virus;

Der süße ist 11,8 Kb groß. Naja:
Es waren ja nur ca. 8000 Dateien befallen.

Aber jetzt habe ich seinen Quellcode. Ma schauen was ich damit mache 8) 8)

mfg
CyberStorm
mexx2k
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 60



BeitragVerfasst: Do 30.08.07 09:00 
Ich nutze die FindFirst und FindNext Funktion, allerdings, wenn ich meine komplette c:\ festplatte damit durchsuche und dabei jede Datei zähle (Ordner ausgeschlossen), komme ich auf 140000 dateien. Windows kommt mit der 'Eigenschaften'-Anzeige aber auf 160000... meine vermutung ist, dass die versteckten dateien und ordner ausgelassen werden. in wie fern könnte ich da recht haben?
Jakob Schöttl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Do 30.08.07 11:10 
@mexx2k: eigentlich kannst du mit FindFirst und FindNext - glaub ich - sogar mehr Dateien anzeigen, als mit dem WindowsExplorer.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
faReadOnly
faHidden
faSysFile
faVolumeID
faDirectory
faArchive
faSymLink


dazu gibt es noch die Konstante faAnyFile. Bei faAnyFile ist aber faSymLink, faVolumeID und faSysFile nicht dabei.

Also probier mal, dass du auch nach den anderen Attributen suchst:

ausblenden Delphi-Quelltext
1:
2:
3:
const faEveryFile = (faAnyFile or faSymLink or faVolumeID or faSysFile);
//und dann so...
if (<DateiAttribute> and faEveryFile) <> 0 then DateiZurListeHinzufügen;
mexx2k
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 60



BeitragVerfasst: Do 30.08.07 14:35 
ausblenden 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:
function Tmp3_Explorer.count_daten(_RootDir:String;iCount:Integer):integer;
var
  Rec : TSearchRec;
begin
  FindFirst(_RootDir+'\*.*', faAnyFile,Rec);
  FindNext(Rec);

  if FindNext(Rec)=0 then
   begin
     repeat
       //frmzentral.mp3.Add(_RootDir+'\'+Rec.Name);
       //wenn der Eintrag ein Verzeichnis ist, ebenfalls durchgehen
       if (Rec.Attr and faDirectory = faDirectory) then begin
         iCount := count_daten(_RootDir+'\'+Rec.Name,iCount);
       end
       else begin
         iCount := iCount+1;
       end;
     until FindNext(Rec)<>0;
   end;
   Findclose(Rec);
   result:=iCount;
end;


^^
hiermit komme ich auf meinem lokalen rechner auf ca. 140 000 Files, wenn ich als Pfad C:\ übergebe.
wenn ich allerdings in meinem explorer alles sichtbare unter c:\ markiere und auf eigenschaften gehe, sagt er mir, er findet über 160 000 Files.
Jakob Schöttl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Do 30.08.07 14:56 
eben, du suchst ja nur nach faAnyFile.. ok, machs mal so:

ausblenden 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:
function Tmp3_Explorer.count_daten(_RootDir:String;iCount:Integer):integer;
const faEveryFile = (faAnyFile or faSymLink or faVolumeID or faSysFile); //<-- das hier noch einfügen!
var
  Rec : TSearchRec;
begin
  FindFirst(_RootDir+'\*.*', faEveryFile,Rec); //<-- und das hier!
  FindNext(Rec);

  if FindNext(Rec)=0 then
   begin
     repeat
       //frmzentral.mp3.Add(_RootDir+'\'+Rec.Name);
       //wenn der Eintrag ein Verzeichnis ist, ebenfalls durchgehen
       if (Rec.Attr and faDirectory = faDirectory) then begin
         iCount := count_daten(_RootDir+'\'+Rec.Name,iCount);
       end
       else begin
         iCount := iCount+1;
       end;
     until FindNext(Rec)<>0;
   end;
   Findclose(Rec);
   result:=iCount;
end;


Zuletzt bearbeitet von Jakob Schöttl am Do 30.08.07 15:26, insgesamt 1-mal bearbeitet
mexx2k
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 60



BeitragVerfasst: Do 30.08.07 15:21 
faEveryFile kennt er nicht?
Jakob Schöttl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Do 30.08.07 15:23 
eben deswegen hab ich ja die konstante in der zweiten zeile von meinem quelltext definiert, schau nochmal oben
mexx2k
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 60



BeitragVerfasst: Do 30.08.07 15:27 
ouh, die zeile hab ich übersehen.
jetzt findet er statt 140000 --> 146000, aber keine 160000... gibts noch ein paar tricks?
Jakob Schöttl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Do 30.08.07 19:36 
also mehr weiß ich leider nicht... aber immerhin ;)
mexx2k
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 60



BeitragVerfasst: Fr 31.08.07 08:03 
Gibt es denn Systemfiles die für den normalen User nicht sichtbar sind?
Auch wenn ich in den Ordneroptionen "Alle Dateien und Ordner anzeigen" aktiviert habe?
Jakob Schöttl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Fr 31.08.07 09:11 
ja, gibt es: der Ordner RECYCLER im Grundverzeichnis eines Laufwerks kann ich mir mit FindFirst/FindNext anzeigen lassen und auch alle Unterordner öffnen, auch Dateien. Mit dem Windows-Explorer geht das allerdings nicht.
mexx2k
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 60



BeitragVerfasst: Fr 31.08.07 09:35 
hm naja, diese ordner nimmt mein findfirst ja aber mit