Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Bastle gerade an einem Legacydriver in C, habe "komische" Fehlermeldung.

Empfohlene Antworten

Veröffentlicht


#include "ntddk.h"


NTSTATUS DriverEntry( IN PDRIVER_OBJECT theDriverObject,

IN PUNICODE_STRING theRegistryPath)

{

  DbgPrint("Hello World!");

  return STATUS_SUCCESS;

}



//Entladefunktion

VOID OnUnload( IN PDRIVER_OBJECT DriverObject )

{

     DbgPrint("OnUnload called\ n");

}


NTSTATUS DriverEntry( IN PDRIVER_OBJECT theDriverObject, 

                      IN PUNICODE_STRING theRegistryPath )

{

  DbgPrint("I loaded!");


//In theDriverObject gibt es einen Zeiger auf die Entladefunktion.

//Diese wird initialisiert. 

theDriverObject->DriverUnload = OnUnload; 

return STATUS_SUCCESS;


}
Ich habe mir das Windows DDK installiert und bin in das VZ gewechselt, wo mein Treiber (Code siehe oben) unter dem namen mydriver.c liegt. Ich habe auch strikt nach Anleitung in dasselbe VZ eine Datei SOURCES abgelegt:

TARGETNAME=MYDRIVER

TARGETPATH=OBJ

TARGETTYPE=DRIVER

SOURCES=mydriver.c

... sowie zu guter Letzt eine Datei MAKEFILE:

!INCLUDE $(NTMAKEENV)\makefile.def

Wenn ich nun build in die Eingabeaufforderung eingebe, dann enter, erscheint diese Fehlermeldung:

1>errors in directory c:\myrootkit

1>c:\myrootkit\mydriver.c(16) : error C2084: function 'NTSTATUS DriverEntry(PDRIVER_OBJECT,PUNICODE_STRING)' already has a body

1>link : error LNK1181: cannot open input file 'c:\myrootkit\objchk_wxp_x86\i386\mydriver.obj'

Aus dem Fehler auf S. 16 werde ich partout nicht schlau - wieso meint "er" denn quasi, dass es einen Methodenrumpf zuviel gibt??

  • Autor

Danke Klotzi!! Jetzt habe ich es umgestrickt. Kannst Du oder jemand mir noch einen guten Treiber-Lader empfehlen? osrloader kann ich nicht starten, gibt es da Alternativen?

#include "ntddk.h"


VOID OnUnload(IN PDRIVER_OBJECT DriverObject)

{


  DbgPrint("Onunload called\n");

}


NTSTATUS DriverEntry( IN PDRIVER_OBJECT theDriverObject, IN PUNICODE_STRING theRegistryPath)

{

  DbgPrint("I loaded!");

 theDriverObject->DriverUnload = OnUnload;

  return STATUS_SUCCESS;


}

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.