AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) Delphi Hardware Access without Driver?Possible?
Thema durchsuchen
Ansicht
Themen-Optionen

Hardware Access without Driver?Possible?

Ein Thema von nanix · begonnen am 20. Dez 2009 · letzter Beitrag vom 24. Dez 2009
Antwort Antwort
Seite 1 von 2  1 2      
nanix
(Gast)

n/a Beiträge
 
#1

Hardware Access without Driver?Possible?

  Alt 20. Dez 2009, 23:12
Hello!

I saw Mitec components and it can access direct memory (DMA) , SMBIOS and lots more!
How is this possible?
  Mit Zitat antworten Zitat
hathor
(Gast)

n/a Beiträge
 
#2

Re: Hardware Access without Driver?Possible?

  Alt 21. Dez 2009, 10:43
MSIC.dll

Delphi-Quellcode:
{*******************************************************}
{                                                       }
{       MiTeC System Information Component              }
{                 MSIC interface                        }
{       version 9.0.0 for Delphi 5,6,7,2005             }
{                                                       }
{       Copyright © 1997,2005 Michal Mutl               }
{                                                       }
{*******************************************************}

unit MSIC_Intf;

interface

uses Windows;

const
  SO_CPU = $0001;
  SO_Machine = $0002;
  SO_Devices = $0004;
  SO_Display = $0008;
  SO_Network = $0010;
  SO_Media = $0020;
  SO_Memory = $0040;
  SO_Storage = $0080;
  SO_USB = $0100;
  SO_Engines = $0200;
  SO_APM = $0400;
  SO_Disk = $0800;
  SO_OS = $1000;
  SO_Printers = $2000;
  SO_Software = $4000;
  SO_Startup = $8000;
  SO_Processes= $10000;
  SO_Monitor = $20000;


  SO_All = SO_CPU or SO_Machine or SO_Devices or SO_Display or SO_Network or SO_Media or
          SO_Memory or SO_Engines or SO_STORAGE or SO_USB or SO_APM or SO_Disk or SO_OS or
          SO_Printers or SO_Software or SO_Startup or SO_Processes or SO_Monitor;


type
  TShowSystemOverviewModal = procedure; stdcall;
  TGenerateXMLReport = procedure(Topics: DWORD; Filename: PChar); stdcall;

var
  MSIC_DLL: THandle = 0;
  ShowSystemOverviewModal: TShowSystemOverviewModal = nil;
  GenerateXMLReport: TGenerateXMLReport = nil;
const
  MSIC_DLL_Name = 'MSIC.DLL';

implementation

initialization
  MSIC_DLL:=GetModuleHandle(MSIC_DLL_Name);
  if MSIC_DLL=0 then
    MSIC_DLL:=LoadLibrary(MSIC_DLL_Name);
  if MSIC_DLL<>0 then begin
    @ShowSystemOverviewModal:=GetProcAddress(MSIC_DLL,'ShowSystemOverviewModal');
    @GenerateXMLReport:=GetProcAddress(MSIC_DLL,'GenerateXMLReport');
  end;
finalization
  if MSIC_DLL<>0 then
    FreeLibrary(MSIC_DLL);
end.
  Mit Zitat antworten Zitat
nanix
(Gast)

n/a Beiträge
 
#3

Re: Hardware Access without Driver?Possible?

  Alt 21. Dez 2009, 10:44
Yes but how does it do it?

MSIC.Dll is for other languages.To get info from the component.

But i was thinking how does it get Ring 0 Access without driver.
  Mit Zitat antworten Zitat
Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
44.053 Beiträge
 
Delphi 12 Athens
 
#4

Re: Hardware Access without Driver?Possible?

  Alt 21. Dez 2009, 11:00
MiTeC System Information Components are also available as Delphi DCUs.
Neuste Erkenntnis:
Seit Pos einen dritten Parameter hat,
wird PoSex im Delphi viel seltener praktiziert.
  Mit Zitat antworten Zitat
nanix
(Gast)

n/a Beiträge
 
#5

Re: Hardware Access without Driver?Possible?

  Alt 21. Dez 2009, 11:02
Yes but i think i have been misunderstood here.And i have source of these components.Anyway the components
use cpu detection for that you need to read registers from CPU.And if you do it in usermode BSOD!
  Mit Zitat antworten Zitat
Benutzerbild von JamesTKirk
JamesTKirk

Registriert seit: 9. Sep 2004
Ort: München
604 Beiträge
 
FreePascal / Lazarus
 
#6

Re: Hardware Access without Driver?Possible?

  Alt 22. Dez 2009, 21:21
Well, I think either they've written a driver in C (the usual way) or they are using the API provided by the NT kernel to usermode (part of them is available from Win32, too, I think) - and yes, the kernel provides much information about the hardware it's running on

Regards,
Sven
Sven
[Free Pascal Compiler Entwickler]
this post is printed on 100% recycled electrons
  Mit Zitat antworten Zitat
nanix
(Gast)

n/a Beiträge
 
#7

Re: Hardware Access without Driver?Possible?

  Alt 22. Dez 2009, 22:43
I dont understand why dont you translate Kmdkit4D to lazarus.It works but cant produce X64 sys driver.It already has all functions.
Angehängte Dateien
Dateityp: rar kmdkit4d_0.08_161.rar (2,42 MB, 17x aufgerufen)
  Mit Zitat antworten Zitat
Benutzerbild von JamesTKirk
JamesTKirk

Registriert seit: 9. Sep 2004
Ort: München
604 Beiträge
 
FreePascal / Lazarus
 
#8

Re: Hardware Access without Driver?Possible?

  Alt 23. Dez 2009, 10:45
By only using available documentation like MSDN, books about Windows internals and the source code of ReactOS I can be (mostly) sure that my code will be free of copyright problems. The last I'd want for the Free Pascal / Lazarus community is a copyright infringement.

x64 is only a small problem. All I'd need for it is a VM with a 64-bit Windows and some small adjustments inside the compiler. But first I want to test everything on a system I can debug and that is ReactOS which is currently only supports 32-bit. And most important: I first need to fully understand how the NT kernel (including driver development) works.

Regards,
Sven
Sven
[Free Pascal Compiler Entwickler]
this post is printed on 100% recycled electrons
  Mit Zitat antworten Zitat
nanix
(Gast)

n/a Beiträge
 
#9

Re: Hardware Access without Driver?Possible?

  Alt 23. Dez 2009, 18:21
Drivers in delphi are just as good as one written in C.Sorry but its true!

If you have any test things that you want me to test PM me.I got an x64 cpu.

Its not that delphi can't make drivers.It can but its format won't link sys files.Thats we just use a makefile
  Mit Zitat antworten Zitat
Benutzerbild von JamesTKirk
JamesTKirk

Registriert seit: 9. Sep 2004
Ort: München
604 Beiträge
 
FreePascal / Lazarus
 
#10

Re: Hardware Access without Driver?Possible?

  Alt 24. Dez 2009, 21:24
Zitat von nanix:
Drivers in delphi are just as good as one written in C.Sorry but its true!
I never doubted this. This is the reason I began the port of Free Pascal in the first place.

Zitat von nanix:
If you have any test things that you want me to test PM me.I got an x64 cpu.
My current plan is to test this with a x86 QEMU VM. I only need to get a x64 version of a 2003 or XP (as I'm a stundent I'm able to download this legally ). But I might come back to one, once the first tests are successful.

Zitat von nanix:
Its not that delphi can't make drivers.It can but its format won't link sys files.Thats we just use a makefile
This is not the REASON. The format of sys files is not different to that of "normal" Windows executable. The only real differences are the following:
  • The subsystem field is set to PE_SUBSYSTEM_NATIVE (value 1)
  • The file may only link to ntoskrnl.exe and hal.dll (and other drivers like ndis.sys)
  • The checksum needs to be set
  • The entry point must be different

The points 1, 3 and 4 can be done with external tools (my port only needs a tool for point 3), but the second point relies on a modified RTL that uses the correct functions.

You are using a makefile, because it simplifies all these things which force Delphi to produce device drivers. (this "forcing" is not meant in a negative way - don't get me wrong here)

Regards,
Sven
Sven
[Free Pascal Compiler Entwickler]
this post is printed on 100% recycled electrons
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 1 von 2  1 2      


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 18:27 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