AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Dateisystem-Hooks

Ein Thema von PeterPanino · begonnen am 12. Sep 2007 · letzter Beitrag vom 8. Okt 2007
Antwort Antwort
PeterPanino

Registriert seit: 4. Sep 2004
1.451 Beiträge
 
Delphi 10.4 Sydney
 
#1

Dateisystem-Hooks

  Alt 12. Sep 2007, 01:37
Hallo, ich bin auf der Suche nach einer Möglichkeit, Dateisystem-Hooks zu installieren, um bei der Änderung/Erzeugung/Löschung von beliebigen Dateien im Dateisystem benachrichtigt zu werden.

Hier habe ich etwas gefunden, das aber in C geschrieben ist:

Another example of file system hooks (CLIB)

Wer weiß, wie man das nach Delphi Win32 übersetzen könnte?
  Mit Zitat antworten Zitat
hoika

Registriert seit: 5. Jul 2006
Ort: Magdeburg
8.270 Beiträge
 
Delphi 10.4 Sydney
 
#2

Re: Dateisystem-Hooks

  Alt 12. Sep 2007, 06:29
Hallo,

dir ist schon klar, dass es in Deinem Bsp hier um Novell-Netware geht ?

Was du brauchst, ist ein sogenannter Filter-Treiber fürs Dateiystem.
Ob du allerdings in Delphi dafür Bsp-e findest,
glaube ich nicht.

Warum reciht das normale Notification für bestimmte Verzeichnisse nicht ?


Heiko
PS:
Genauso einen Treiber hatte damals Sony bei Ihrem Rootkit benutzt.
Naja, und Virenscanner benutzen sowas auch.
Heiko
  Mit Zitat antworten Zitat
Mordilion

Registriert seit: 18. Mär 2004
Ort: Niederkassel
26 Beiträge
 
RAD-Studio 2009 Arc
 
#3

Re: Dateisystem-Hooks

  Alt 12. Sep 2007, 08:23
Also mir ist eigentlich bekannt, dass es auch ohne Treiber geht.

Du musst nur herausfinden wie du die Windows-API-Funktionen Hookst. Also müsstest du alle CreateFile-API-Funktionen, etc. hooken und dann sollte es gehen.

Hatte mal vor ewigkeiten das selbe Prinzip für den Netzwerkverkehr gemacht. Habe allerdings den Source nicht mehr.


Gruß
Mordi
Für das große Chaos haben wir Computer. Die übrigen Fehler machen wir von Hand.
  Mit Zitat antworten Zitat
Nuclear-Ping
(Gast)

n/a Beiträge
 
#4

Re: Dateisystem-Hooks

  Alt 12. Sep 2007, 10:25
Vielleicht hilft dir das weiter: http://assarbad.net/en/stuff/tutorials/hooks/

JediVCL hat auch ein paar Hook-Units dabei (JvShellHook, JvWinHook, ...).

Im Anhang hab ich dir mal 'ne Unit dran gehangen, die ich vor Jahren mal im Netz irgendwo gefunden hab. Ich glaub das war von irgendeinem Hook-Tutorial von Assarbad oder so (kann mich auch grad täuschen).
Hab damit mal rumgespielt und mal angeguckt. Entsprechend sieht sie auch aus, hoffe sie compiled noch durch. Naja, zum Prinzip verstehen sollte es reichen.
Angehängte Dateien
Dateityp: pas hooksunit_273.pas (17,6 KB, 23x aufgerufen)
  Mit Zitat antworten Zitat
PeterPanino

Registriert seit: 4. Sep 2004
1.451 Beiträge
 
Delphi 10.4 Sydney
 
#5

Re: Dateisystem-Hooks

  Alt 12. Sep 2007, 15:19
Zitat von hoika:
Warum reciht das normale Notification für bestimmte Verzeichnisse nicht ?
Weil dies nicht den Namen der betreffenden Datei zurückgibt.
  Mit Zitat antworten Zitat
suni

Registriert seit: 19. Sep 2007
17 Beiträge
 
#6

Re: Dateisystem-Hooks

  Alt 8. Okt 2007, 06:23
Ist eine Gute idee das Projekt. Ich habe vor langer Zeit mal eine Komponente gefunden die sich TWatch nennt ,mit hilfe dieser Komponente ist es möglich das System auf Änderungen überwachen zu lassen
Ich hab dir mal eine RAR erstellt die du im Anhang findest...
Hoffe ich konnte mit meinem Beitrag hier im Forum auch mal etwas Helfen bzw ein Problem lösen...

Mfg
Sunni

Hier mal eine genauere Beschreibung der Komponente
Code:
The TWatch Component V1.10

I am very interested in any application
that uses this component (or any other application you wrote).
If so, mail me (not the program, just an URL or similar) !
(mail address below)

Installation:
=============
1. Copy the files Watch.pas and watch.dcr to the directory where
you store your components (or let it where it is)
2. In Delphi, select Component|Install Component. In the
following dialog enter the path and filename of
Watch.pas and hit OK.
3. Now the TWatch Component is available in the
Component palette under Bome.
4. Load watchdll.dpr into Delphi and compile it. It creates
the dll "watchdll.dll".
5. This library must be in the search path or in the directory of
the program in which you want to use TWatch. The dll is loaded
and unloaded dynamically when needed, in order to prevent Delphi
to load it when installing the component.

Description
===========
This component enables you to track some system events.
Currently implemented are Shell events (i.e. Activation,
Creation, Closure of Applications), and Keyboard events
(when something is typed in another application) and
Mouse events (everything what the mouse does).

The shell events have one drawback: The name parameter is
identical for all instances of a watched program. You
can only use the Handle parameter of the event to distinguish
different instances of the same application.

This component is designed for Delphi 2, 3, 4. It is not tested
with Delphi 5.

Note: the source for watchdll.dll is in the project watchdll.dpr.

How to use it
=============
Be sure that only one instance/program uses this component
at any time. You can use TOneInstance for that instance,
you can download that from [url]http://www.bome.com/[/url] in the
delphi components area.

Different to previous versions of this component, you
must now call the Start and Stop methods in order to
start / stop watching of a specific type.

Your main program MUST make sure that this component is
freed properly. The easiest way of doing this is to put a
line like "Watch1.Free;" in the main forms OnClose or OnDestroy
event handler. Delphi seems to "forget" to free components'
when closing the application.

Properties:
- NotifyOwnEvents: Whether an event shall be sent when
the own application receives a shell event
- RepeatedEvents: When you activate different windows
of the same application, each time an
event is sent. If you set this to false,
only the first event will be sent.

Events:
- OnActivateShellWindow: Occurs when the shell window is activated
(i.e. the desktop)
- OnWindowActivated: Occurs when any program is activated
- OnWindowCreated: Occurs when a program starts
- OnWindowDestroyed: Occurs when a program closes
- OnKeyNative: A raw key event, occurs everytime something with the
keyboard happens.
- OnMouseDown: Occurs when a mouse button is pressed
- OnMouseMove: Occurs when the mouse moves
- OnMouseUp: Occurs when a mouse button is released

Note on Mouse events:
Even if they contain the ShiftState, the Shift and Ctrl values will
never be set, regardless whether these keys are actually pressed
or not. You could combine it with a key hook to generate the "right"
mouse events.

ideas for enhancements:
- make it usable for multiple applications...
- of course, add the other hooks
- use toAscii in order to get an Ascii-Character of a key
- let the dll get some information about the window
in which are typed the keys
- possibility to change messages before they are processed by the
watched application
- let the dll change specific things while in context
of another program e.g. add to every menu an own menu...
or just get some information about that program

Copyright
=========
(c) 1997-2000 by Florian Bömers

send any comments, proposals, enhancements etc. to:
[email]delphi@bome.com[/email]


new versions on:
[url]http://www.bome.com/[/url]
Angehängte Dateien
Dateityp: rar watch110_182.rar (43,7 KB, 42x aufgerufen)
  Mit Zitat antworten Zitat
sk0r

Registriert seit: 1. Mai 2007
181 Beiträge
 
Delphi 7 Enterprise
 
#7

Re: Dateisystem-Hooks

  Alt 8. Okt 2007, 07:48
Ich glaube das geht, indem du im explorer folgende APIs hookst:

ZwCreateFile
ZwOpenFile
ZwQueryDirectoryFile
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 23:05 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz