Delphi-PRAXiS
Seite 2 von 4     12 34      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi openlibsys.org Open source driver (https://www.delphipraxis.net/113252-openlibsys-org-open-source-driver.html)

Muetze1 5. Mai 2008 23:47

Re: openlibsys.org Open source driver
 
Zitat:

Zitat von Razor
Delphi-Quellcode:
  ho := ExtractFilePath(application.ExeName) + 'WinRing0x64.DLL';

  if FileExists(ho) then
  begin
    RING0 := LoadLibrary(PChar(Pfad));   // build "ho" and use "Pfad"? Copy&Paste error

    if RING0 > 0 then                    // why > 0?  see MSDN documentation: it states != NULL
      showmessage('loaded');
  end;
end;

Be more accurate on the basics! This is fundamental for such applications as you want to build...

Razor 6. Mai 2008 07:50

Re: openlibsys.org Open source driver
 
Here we this more alike :) .Works!

Delphi-Quellcode:
Const
ring: THandle;

procedure tform1.Load;
VAR
Pfad: AnsiString;

begin
Pfad := ExtractFilePath(application.ExeName) + 'WinRing0x64.DLL';


if FileExists(Pfad) then
begin

form1.Color:=clgreen;

ring := LoadLibrary(PChar(Pfad));

if ring = 0 then

showmessage('loaded');

end;
end;


Now for the functions,this is wrong i know,but if it says it has no params and return value then i thought why not but this wont work.I have clearly no idea how to call how to call a function off an dll. :oops:
Delphi-Quellcode:
type
  TInitializeDll = function(InitializeDll) stdcall;
From the manual

Zitat:

InitializeDll
This function initializes the DLL.

Syntax
VOID InitializeDll();Parameters
None
Return Values
None

Remarks
This function must be called before using any other function in the DLL.

Requirements
WinRing0 1.0.6 or later



Zitat:

bool InitWinRing0()
{
InitializeDll();

DWORD status = GetDllStatus();

switch (status)
{
case 1:
MessageBox(NULL, L"WinRing0 Unsupported platform", L"WinRing0 Error!", MB_OK);
return false;
case 2:
MessageBox(NULL, L"WinRing0 Driver not loaded", L"WinRing0 Error!", MB_OK);
return false;
case 3:
MessageBox(NULL, L"WinRing0 Driver not found", L"WinRing0 Error!", MB_OK);
return false;
case 4:
MessageBox(NULL, L"WinRing0 Driver unloaded by other process", L"WinRing0 Error!", MB_OK);
return false;
case 5:
MessageBox(NULL, L"WinRing0 Driver not loaded because of executing on Network Drive", L"WinRing0 Error!", MB_OK);
return false;
case 6:
MessageBox(NULL, L"WinRing0 Unknown error", L"WinRing0 Error!", MB_OK);
return false;
}

return true;
}

Muetze1 6. Mai 2008 08:48

Re: openlibsys.org Open source driver
 
I am frightened, that you have not learned some basics. Learn the basics!

What is the difference between function and procedure? If there is none, we do not need two identifiers in the Delphi language...

Razor 6. Mai 2008 09:01

Re: openlibsys.org Open source driver
 
Ofcourse theres a difrence
Delphi-Quellcode:
var
  Form1: TForm1;
  ring: THandle;


implementation

{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
load;
end;

procedure tform1.Load;
VAR
Pfad: AnsiString;

  Intalize: procedure(InitializeDll: Pointer); stdcall;
begin
Pfad := ExtractFilePath(application.ExeName) + 'WinRing0x64.DLL';


if FileExists(Pfad) then
begin

form1.Color:=clgreen;

ring := LoadLibrary(PChar(Pfad));

if ring = 0 then
Intalize:= GetProcAddress(ring,'InitializeDll');
if Assigned(Intalize) then
showmessage('intalized');
showmessage('loaded');

end;
end;
Like this?

Assertor 6. Mai 2008 09:45

Re: openlibsys.org Open source driver
 
Hi Razor,

Zitat:

Zitat von Razor
Remember who told you about this first ;).

Yes: I told the bcdedit fixes availability first :? See thread here. By the way: I wrote about bcdedit in November 2006...

Zitat:

Zitat von Razor
type “bcdedit /set loadoptions DDISABLE_INTEGRITY_CHECKS” without the quotes (and no the DD is not a typo).
Reboot and enjoy being able to use unsigned drivers in Vista x64.

And just for your interest: AFAIK has Microsoft released an security update (released long time before Vista SP1) disabling the possibility to circumvent this protection in x64...

So, no go for your x64 Driver without Digital Signature or F8 on boot...

Cheers Assertor

devidespe 6. Mai 2008 09:52

Re: openlibsys.org Open source driver
 
As far as I know does the driver within WinRing0 have a Verisign certification and is runable under Vista x64 even without the BCDEdit option.

That option was originally a way for developers to test their X64 drivers, as long as the Verisign certification process is running.

Muetze1 6. Mai 2008 10:03

Re: openlibsys.org Open source driver
 
Zitat:

Zitat von Razor
Like this?

Does it work as aspected?

What about all the warnings and hints of your source? Why do you access the global Form1 variable in a method of TForm1? What about a basic source code formating?

Razor 6. Mai 2008 10:08

Re: openlibsys.org Open source driver
 
This what ive done so far,error comes up i uploaded the image..

http://img504.imageshack.us/img504/3955/captureke1.jpg

Delphi-Quellcode:
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure load;
    procedure Button1Click(Sender: TObject);

     
  private
    { Private declarations }
  public
    { Public declarations }

  end;




var
  Form1: TForm1;
  ring: THandle;
   procedure InitializeDll(); stdcall; external 'WinRing0x64.dll';
 
implementation

{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
load;
end;


procedure tform1.Load;
VAR
  Pfad: AnsiString;
begin
Pfad := ExtractFilePath(application.ExeName) + 'WinRing0x64.dll';


if FileExists(Pfad) then
begin


ring := LoadLibrary(PChar(Pfad));

if ring = 0 then
form1.Color:=clgreen;
 showmessage('loaded');
  end;
 InitializeDll();
end;

end.

Muetze1 6. Mai 2008 12:00

Re: openlibsys.org Open source driver
 
So the imports of the WinRing0x64.dll could not be resolved by the module loader.

devidespe 6. Mai 2008 12:44

Re: openlibsys.org Open source driver
 
Set a debug breakpoint before the line:

Delphi-Quellcode:
ring := LoadLibrary(PChar(Pfad));
and check the content of the Pfad variable. Maybe some backslash is missing.


Alle Zeitangaben in WEZ +1. Es ist jetzt 02:44 Uhr.
Seite 2 von 4     12 34      

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