AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Projekte Unit zur VM detection + Testprogramm
Thema durchsuchen
Ansicht
Themen-Optionen

Unit zur VM detection + Testprogramm

Ein Thema von Zacherl · begonnen am 23. Sep 2007 · letzter Beitrag vom 11. Jul 2010
 
Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#31

Re: Unit zur VM detection + Testprogramm

  Alt 14. Aug 2009, 16:26
Hi,

Ist ja nicht viel.. und eigentlich Größtenteils nur Kosmetik:

Alles aus der Unit VMDetection.pas

1)
Delphi-Quellcode:
type
  TxDTEntry = record
    GDTBase: DWord;
    IDTBase: DWord;
    LDTRBase: DWord;
    GDTLimit: Word;
    IDTLimit: Word;
  end;

// ==>

// Code natürlich entsprechend der neuen Namen anpassen
TxDTEntry = record
    GDTOffset: DWord;
    IDTOffset: DWord;
    LDTROffset: DWord;
    GDTSize: Word;
    IDTSize: Word;
  end;
2)
Delphi-Quellcode:
type
  TxDT = record
    Limit,
    BaseLow,
    BaseHigh: Word;
  end;

// ==>

TxDT = packed record // packed würde ich bei solchen Sachen empfehlen!
    Size: Word;
    Offset: DWord;
  end;
3)
Delphi-Quellcode:
function GetIDTBase: DWord;
var
  IDT: TxDT;
begin
  asm
    SIDT IDT
  end;
  Result := (IDT.BaseHigh shl 16) or IDT.BaseLow;
end;

// ===>

function GetIDTOffset: DWord;
var
  IDT: TxDT;
begin
  asm
    SIDT IDT
  end;
  Result := IDT.Offset;
end;
4)

Delphi-Quellcode:
function GetIDTLimit: DWord;

// ==>

function GetIDTSize: DWord;
5)

Delphi-Quellcode:
function GetGDTBase: DWord;
var
  GDT: TxDT;
begin
  asm
    SGDT GDT
  end;
  Result := (GDT.BaseHigh shl 16) or GDT.BaseLow;
end;

// ==>

function GetGDTOffset: DWord;
var
  GDT: TxDT;
begin
  asm
    SGDT GDT
  end;
  Result := GDT.Offset;
end;
6)
Delphi-Quellcode:
function GetGDTLimit: DWord;

// ==>

function GetGDTSize: DWord;
7)

Delphi-Quellcode:
function GetLDTRBase: DWord;

// ==>

function GetLDTROffset: DWord;
Das sind wie du siehst und ich gesagt habe ja keine wirklichen großen Änderungen^^ Hab ja gesagt dass es etwas kleinlich ist, aber so finde ich den Code schöner bzw. verständlicher.

Gruß
Neutral General
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat
 


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 14:53 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz