1. Lisez le numéro de série de la carte mère
2. Lire le mot de passe du bios de récompense
3. Lire les informations du BIOS
4. Obtenir les informations sur la date du BIOS
=========================================
1. Lisez le numéro de série de la carte mère
Utilise Sha1, Base64;
fonction gethashedbiosinfo: string;
var
Sha1context: tsha1context;
Sha1digest: tsha1digest;
Commencer
// Obtenez les données du BIOS
SetString (résultat, PCHA (PTR ($ F0000)), 10000 $);
// Hash la chaîne
Sha1Init (sha1Context);
Sha1update (sha1Context, pChar (résultat), longueur (résultat));
Sha1final (sha1context, sha1digest);
SetString (résultat, pChar (@ sha1digest), sizeof (sha1digest));
// Renvoie la chaîne de hachage codée en caractères imprimables
Résultat: = B64Encode (résultat);
fin;
fonction getBiOSInfoastext: String;
var
P, Q: PCHA;
Commencer
Q: = NIL;
P: = PCHA (PTR ($ FE000));
répéter
Si q <> nil alors commencez
Sinon (p ^ dans [# 10, # 13, # 32 .. # 126, # 169, # 184]) alors commencez
/ t if (p ^ = # 0) et (p - q> = 8) alors commencez
/ t Résultat: = résultat + trimRight (String (q)) + # 13 # 10;
/tendre;
/ tq: = nil;
fin;
fin d'autre
Si p ^ dans [# 33 .. # 126, # 169, # 184] alors
/ tq: = p;
Inc (p);
Jusqu'à P> PCHA (PTR ($ fffff));
Résultat: = TrimRight (résultat);
fin;
Procédure TForm1.FormCreate (Sender: Tobject);
Commencer
Memo1.lines.text: = getBiOSInfoastext;
fin;
==========================================
2. Attachez la lecture du mot de passe du bios (ce devrait être un article de Jingtao, mais l'ID n'est pas enregistré)
Unit AwardBiospas;
// Écrivez par lovejingtao
//http://www.138soft.com
interface
utilise des fenêtres, des sysutils;
fonction my_getbiospassword: string;
Mise en œuvre
Fonction CalcSiblePassword (PasswordValue: Word): String;
var
I: octet;
C: Char;
S: String [8];
Commencer
I: = 0;
Alors que PasswordValue <> 0 fait
Commencer
Inc (i);
Si 263 $> PasswordValue alors
Commencer
/ t si 80 $> PasswordValue alors
/ T S : = char (mot de passe)
/ t else si $ b0> mot de passe
/ T S : = char (mot de passe et 77 $)
/ t else si 11d $> mot de passe
/ T S : = char (30 $ ou (PasswordValue et 0 $))
/ t else si 114 $> PasswordValue alors
/ T commence
/ t s : = char (64 $ ou (mot de passe de mot de passe et 0 $));
/ t si '' 0 ''> s alors
/ t s : = char (octet (s ) + 8);
/tendre
/ t else si 1C2> PasswordValue alors
/ t s : = char (70 $ ou (mot de passe et 03 $)))
/ t else si 1e 4> mot de passe
/ t s : = char (30 $ ou (mot de passe et 03 $)))
/ t else
/ T commence
/ t s : = char (70 $ ou (mot de passe de mot de passe et 0 $));
/ t si '' z '' <s alors
/ t s : = char (octet (s ) - 8);
/tendre;
fin
autre
S : = char (30 $ ou (PasswordValue et 3 $));
PasswordValue: = (PasswordValue - octet (s )) SHR 2;
fin;
S [0]: = char (i);
PasswordValue: = I SHR 1;
tandis que PasswordValue <je fais
Commencer {c'est à faire parce que le prix commence à calculer avec la dernière lettre}
C: = s [octet (s [0]) - i + 1];
S [octet (s [0]) - i + 1]: = s ;
S : = C;
Déc (i);
fin;
CalcSiblePassword: = s;
fin;
Fonction ReadcMos (off: octet): octet;
var
Valeur: octet;
Commencer
ASM
xor hache, hache
Déplacez-vous, hors
Out 70h, Al
Dans Al, 71h
Valeur de mouvement, Al
fin;
ReadcMos: = valeur;
fin;
fonction my_getbiospassword: string;
var
superpw, userpw: word;
S: String;
Commencer
Si win32platform <> ver_platform_win32_nt alors // pas nt
Commencer
pChar (@superpw) [0]: = char (readcmos (1C $));
pChar (@superpw) [1]: = char (ReadcMos (1D 1D));
pChar (@userpw) [0]: = char (readcmos (64 $));
pChar (@userpw) [1]: = char (readcmos (65 $));
S: = '' Le mot de passe SuperUser est: '' + calcSiblepassword (superpw) + # 13 + '' Le mot de passe utilisateur est: '' + calcSiblePassword (userpw);
Résultats: = s;
fin
autre
Résultat: = '' Le système utilisateur est NT et le mot de passe biso ne peut pas être obtenu! '';
fin;
fin.
==========================================
3. Lire les informations du BIOS
{Le programme utilise la plate-forme Windows 95/2000, détecte automatiquement le type de système, puis passe différents appels}
utilise BioShelp;
Procédure tform1.button1Click (expéditeur: tobject);
var
Décharge: TrombiosDump;
I: entier;
Commencer
Readrombios (Dump, rrbmautomatic);
pour i: = 1 à $ 000fffff - $ 000f0000 - 1 do
Memo1.lines.add (intohex (dump [i + $ 000fffff], 2));
fin;
(************************************************* ************************************
* / t / t / t / t / t / t / t / t / t / t / t / t *
* Aide du BIOS - Lire les biographies ROM sur Windows 95/98 / SE / ME / NT / 2K / XP / T / T *
* / t / t / t / t / t / t / t / t / t / t / t / t *
* Copyright (C) 2001, Nico Bendlin ([email protected]) / T / T / T *
* / t / t / t / t / t / t / t / t / t / t / t / t *
* Compiler: Delphi 4.03 / 5.01 / 6.00 / T / T / T / T / T / T / T *
* Version: 1.03, 2001-09-02 / t / t / t / t / t / t / t / t *
* / t / t / t / t / t / t / t / t / t / t / t / t *
**************************************************** ******* *****************************************)
{Postum Scriptum: Désolé pour le mauvais anglais, je l'ai écrit à la hâte}
Unité BioShelp;
{$ Aligner sur}
{$ Minenumsize 4}
interface
usages
Fenêtres;
taper
PromBiosDump = ^ trombiosDump;
TrombiosDump = array [$ 000f0000 .. $ 000ffff] d'octet;
taper
TreadrombiOSMethod = (
rrbmautomatic, / t / t / t / t / t {type de système d'exploitation automatique et utilisez la méthode appropriée}
rrbmGericric, / t / t / t / t / t / t {Utilisez le programme com 16 bits pour vider le bios}
rrbmmemory, / t / t / t / t / t {lire à partir de la mémoire (win9x) / t / t}
rrbmphysical / t / t / t / t / t {lire à partir de l'objet de mémoire physique (winnt)}
));
Fonction Readrombios (Var Dump: TrombiosDump; Méthode: TreadrombiOSMethod;
Timeout: DWORD = Infinite): Boolean;
fonction getrombiosbuffer (construp: trombiosDump; adresse: pointeur;
Var Buffer; BufferSize: Cardinal): Cardinal;
fonction getrombiosstring (const demp: trombiosDump; adresse: pointeur): chaîne;
Fonction getrombioslonglong (CONS DIMP: TrombiosDump; Adresse: pointeur): LongLong;
fonction getrombiosdword (const demp: trombiosDump; adresse: pointeur): dword;
fonction getRombiOSword (const demp: trombiosDump; adresse: pointeur): word;
fonction getrombiosbyte (CONSUR: trombiosDump; adresse: pointeur): octet;
Mise en œuvre
{################################################### ################################################### ## #################################################### ##
# / t / t / t / t / t / t / t / t / t / t / t / t #
# / t / t / t méthode générique / t / t / t / t #
# / t / t / t / t / t / t / t / t / t / t / t / t #
# Créez un dossier temporaire, enregistrez un programme COM 16 bits (Romdump.com), # #
# Exécuter le programme redirigé vers un fichier (Rom.dmp, Romdump.com vide simplement le #
# Memory Range F000: 0000-F000: FFFF à STDOUT), lisez le fichier de vidage dans le tampon, #
# et enfin nettoyer tous les fichiers et répertoires temporaires./t/t #
# / t / t / t / t / t / t / t / t / t / t / t / t #
# (La fonction Romdumpcode est spécifique à x86, ce que j'ai écrit pour générer 16 bits #
Le code # avec l'aide du compilateur Delphi 23 bits, n'essayez jamais d'exécuter le #
# pseudo-code dans votre programme!
# / t / t / t / t / t / t / t / t / t / t / t / t #
#################################################### ####################################################### ########################################}
{* Internal * - Code pseudo 16 bits}
taper
PromDumpCodeInfo = ^ tromdumpCodeInfo;
TromDumpCodeInfo = (rdcistart, rdCiend, rdCisize);
Fonction _RomDumpCode (info: TromDumpCodeInfo): pointeur;
var
CodeStart: pointeur;
Codeend: pointeur;
Commencer
ASM
/ t jmp @@ end
/ T {* Begin * Code 16 bits}
/ T {- Ne l'utilisez jamais dans votre programme! -}
/ t {com qui écrit rom-bios à stdout}
@@Commencer:
/ T {Dump F000: 0000-F000: FFFE}
/ T XOR EDX, EDX // DS = 0xf000;
/ t MOV DH, 0F0H
/ T Mov DS, Edx
/ T XOR EDX, EDX // DX = 0x0000;
/ T XOR ECX, ECX // CX = 0XFFFF;
/ t dec ecx
/ t xor ebx, ebx // bx = 0x0001;
/ T Inc Ebx
/ t mov ah, 40h // doscall (0x40);
/ T int 21h
/ t jc @@ quitter // sur l'erreur Exit;
/ T {Dump F000: FFFF}
/ T XOR EDX, EDX // DS = 0xf000;
/ t MOV DH, 0F0H
/ T Mov DS, Edx
/ T XOR EDX, EDX // dx = 0xffff;
/ T dec Edx
/ T XOR ECX, ECX // CX = 0x0001;
/ T Inc Ecx
/ t MOV EBX, ECX // bx = 0x0001;
/ t mov ah, 40h // doscall (0x40);
/ T int 21h
/ t jc @@ quitter // sur l'erreur Exit;
/ t Mov al, 0 // pas d'erreur; al = 0
@@Sortie:
/ t MOV AH, 4CH // DOSCALL (0x4c);
/ T int 21h
@@Fin:
/ t {* end * code 16 bits}
/ t MOV Codestart, offset @@ start
/ t mov codeend, offset @@ end
fin;
Informations sur le cas de
rdcistart:
Résultat: = CodeStart;
RDCIEND:
Résultat: = Codeend;
rdcisize:
Résultat: = Pointer (Cardinal (codeEnd) - Cardinal (CodeStart));
autre
Résultat: = nil;
fin;
fin;
{* Interne * - Enregistrer le code 16 bits pour fichier}
Fonction _RomDumpCodeToFile (const FileName: String): Boolean;
var
Comfile: Thandle;
Taille: Cardinal;
Commencer
Résultat: = false;
Comfile: = CreateFile (pChar (nom de fichier), generic_write, file_share_read, nil,
Create_always, file_attribute_normal, 0);
Si comfile <> invalid_handle_value alors
essayer
Résultat: = WriteFile (Comfile, _RomDumpCode (rdcistart) ^,
Cardinal (_romdumpcode (rdCisize)), taille, nil) et
(Size = cardinal (_RomDumpCode (rdCisize)));
Si ce n'est pas les résultats, alors
DeleteFile (PCHA (nom de fichier));
Enfin
CloseHandle (Comfile);
fin;
fin;
{* Internal * - Exécuter le code 16 bits redirigé vers le fichier}
Fonction _RomDumpCodeExECUTE (const Com, DMP: String; Timeout: DWORD): Boolean;
var
ComSpec: String;
SI: tStartupinfo;
pi: tprocessinformation;
Commencer
Résultat: = false;
SetLength (comSpec, max_path);
SetLength (comSpec,
GetenvironmentVariable ('' comSpec '', pChar (@comSpec [1]), max_path));
Si la longueur (comSpec)> 0 alors
Commencer
Fillchar (si, sizeof (tstartupinfo), 0);
si.cb: = sizeof (tstartupinfo);
si.dwflags: = startf_useshowwindow;
si.wshowwindow: = sw_hide;
Si CreateProcess (nil, phar (comSpec + '' / c '' + com + ''> '' + dmp),
nil, nil, false, create_new_console ou create_new_process_group, nil,
nil, si, pi) alors
essayer
Résultat: = waitForsingleObject (pi.hprocess, timeout) <> wait_timeout;
Enfin
CloseHandle (pi.hprocess);
CloseHandle (pi.hthread);
fin;
fin;
fin;
Fonction DirectoryExists (const Dir: String): Boolean;
var
Att: dword;
Commencer
Attr: = getFileAtTributes (pChar (dir));
Résultat: = (attr <> $ ffffffff) et
(Attr et file_attribute_directory = file_attribute_directory);
fin;
{Obtenir le bios vider la voie générique}
Fonction ReadRombiOS16 (Var Buffer: TrombiosDump; Timeout: DWORD): Boolean;
const
Tempsub = '' ~ romdmp '';
Comname = '' romdump.com '';
Dmpname = '' rom.dmp '';
var
Temppath: String;
Tempdir: String;
Tempidx: entier;
Tempidxstr: String;
Comfile: String;
DMPFILE: String;
Dmphandle: thandle;
Écrit: DWORD;
Commencer
Résultat: = false;
SetLength (temppath, max_path);
SetLength (temppath, getTempath (max_path, pChar (@Tempath [1])));
Si la longueur (temppath)> 0 alors
Commencer
if (temppath [la longueur (temppath)] <> '' / '') alors
Temppath: = temppath + '' / '';
Tempidx: = 0;
répéter
Inc (tempidx);
Str (tempidx, tempidxstr);
Tempdir: = temppath + tempsub + tempidxstr;
jusqu'à ce que je ne sois pas répertoire (tempdir);
Si CreatedIrectory (phar (tempdir), nil) alors
essayer
Tempdir: = tempdir + '' / '';
Comfile: = tempdir + comname;
Dmpfile: = tempdir + dmpname;
Si _RomDumpCodetoFile (Comfile)
essayer
Si _RomDumpCodeExecute (Comfile, dmpfile, temps mort)
Commencer
/ t dmphandle: = createFile (pChar (dmpfile), générique_read,
/ t file_share_read ou file_share_write, nil, open_existing, 0, 0);
/ t si dmphandle <> invalid_handle_value alors
/ t essayez
/ T fillchar (tampon, sizeof (trombiosdump), 0);
/ t Résultat: = ReadFile (dmphandle, tampon, taille de (trombiosdump),
/ t écrit, nil) et (écrit = sizeof (trombiosDump));
/ t enfin
/ t CloseHandle (dmphandle);
/tendre;
fin;
Enfin
DeleteFile (PCHA (DMPFILE));
DeleteFile (PCHA (Comfile));
fin;
Enfin
Removedirectory (pChar (tempdir));
fin;
fin;
fin;
{################################################### ################################################### ## #################################################### ##
# / t / t / t / t / t / t / t / t / t / t / t / t #
Méthode directe # / t / t / t (win9x) / t / t / t #
# / t / t / t / t / t / t / t / t / t / t / t / t #
# En raison du fait que Windows 95/98 / ME mappe le BIOS dans chaque processus Win32 #
# Pour l'accès en lecture, il est très simple de remplir le tampon à partir de la mémoire./T #
# / t / t / t / t / t / t / t / t / t / t / t / t #
#################################################### ####################################################### ########################################}
Fonction ReadrombiOS9x (tampon var: trombiosdump): booléen;
Commencer
Résultat: = false;
essayer
Fillchar (tampon, sizeof (trombiosdump), 0);
Déplacer (pointeur (bas (trombiosdump)) ^, tampon, taille de (trombiosdump));
Résultat: = true;
sauf
// ignorer les exceptions
fin
fin;
{################################################### ################################################### ## #################################################### ##
# / t / t / t / t / t / t / t / t / t / t / t / t #
Méthode de mémoire physique # / t / t (winnt) / t / t / t #
# / t / t / t / t / t / t / t / t / t / t / t / t #
# Sur Windows nt Le BIOS ROM n'est disponible que via l'objet du noyau nommé #
# '' / Device / PhysicalMemory ''. Car il est impossible d'ouvrir des objets du noyau dans #
# Mode utilisateur avec fonctions API Win32 standard Nous utilisons NTAVEAPI de NT dans #
# Ntdll.dll ("nt-layer") à savoir zwopensection./t/t/t/t #
# / t / t / t / t / t / t / t / t / t / t / t / t #
# (Remarque: la plupart du temps, il existe deux versions de chaque fonction ZWXXX et NTXXX. Le #
# Seule la différence de mode du noyau est que la version NTXXX fonctionne en considération- # #
# Ration to Security tandis que Zwxxx pas.
# / t / t / t / t / t / t / t / t / t / t / t / t #
# Au début, la section est ouverte avec ZwoPensection.
# ZWMAPVIEWOFSECTION, ZWUNMAPVIEWOFSECTION et NTCLOSE.
# plus complexe et il n'y a pas besoin de cela.
# Dans le mode utilisateur "très simple" =) Nous utilisons maintenant MapViewoffile, UnmapViewoffile, #
# et clôture pour cartographier une fenêtre de mémoire (le BIOS ROM) dans notre processus.
# / t / t / t / t / t / t / t / t / t / t / t / t #
# En raison du fait que Zwopensection renvoie les codes d'erreur NT en cas d'échec #
# Nous devons le traduire par un code d'erreur Win32 (RTLNTSTATUSTODOSERROR).
# Toutes les fonctions spécifiques NT sont chargées dynamiquement - car les applications #
# devrait commencer sur les systèmes Win9x =) / T / T / T / T / T / T #
# / t / t / t / t / t / t / t / t / t / t / t / t #
#################################################### ####################################################### ########################################}
{Pour plus d'informations, voir Windows 2000 / XP DDK}
{Cela fonctionne également sur Windows NT 4.0, utilisez ntdll.dll}
taper
Ntstatus = entier;
const
Status_success = ntstatus (0);
Status_invalid_handle = ntstatus ($ C0000008);
Status_access_denided = ntstatus ($ C0000022);
taper
Punicodestring = ^ tunicodestring;
Tunicodestring = enregistrement emballé
Longueur: mot;
MaximumLength: word;
Tampon: pwidechar;
fin;
const
Obj_inherit = 00000002;
Obj_permanent = 00000010 $;
Obj_exclusive = 00000020 $;
Obj_case_insensitive = 00000040 $;
Obj_openif = 00000080 $;
Obj_openLink = 00000100 $;
Obj_kernel_handle = $ 00000200;
Obj_valid_attributes = $ 000003f2;
taper
POBjectAttributes = ^ tobjectAttributes;
Tobjectattributes = enregistrement
Longueur: Ulong;
RootDirectory: Thandle;
ObjectName: Punicodestring;
Attributs: Ulong;
SecurityDescriptor: PScurityDescriptor;
SecurityQualityofService: PScurityqualityofService;
fin;
const
ObjectPhysicalMemoryDeviCeName = '' / Device / PhysicalMemory '';
ObjectPhysicalMemoryName: tunicodestring = (
Longueur: longueur (objectPhysicalMemoryDeviceName) * 2;
MaximumLength: longueur (objectphysicalmemorydeviceName) * 2 + 2;
Tampon: objectphysicalmemorydeviceName;
));
ObjectPhysicalMemoryAccessMask: Access_mask = section_map_read;
ObjectPhysicalMemoryAttributes: TobjectAttributes = (
Longueur: Tailleof (TobjectAttributes);
RootDirectory: 0;
ObjectName: @ObjectPhysicalMemoryName;
Attributs: obj_case_insensitive;
SecurityDescriptor: NIL;
SecurityqualityofService: NIL;
));
taper
Tfnzwopensection = fonction (out sectionhandle: thandle;
Désiré ACCESSION: Access_mask;
stdcall;
TfnrtlntStatUstodoSerror = fonction (status: ntstatus): dword;
const
ntdll = '' ntdll.dll '';
var
Zwopensection: tfnzwopensection;
RtlntStatUstodoSerror: tfnrtlntStatUstodoSerror;
fonction readrombiosnt (var tampon: trombiosDump; timeout: dword): booléen;
var
Ntlayer: hmodule;
Statut: ntstatus;
Section: Thandle;
Vue: pointeur;
Commencer
Résultat: = false;
Ntlayer: = getModuleHandle (ntdll);
Si ntlayer = 0 alors
SetLasterRor (error_call_not_implélement)
autre
Commencer
Si ce n'est pas affecté (zwopensection) alors
Zwopensection: = getProcAddress (ntlayer, '' zwopensection '');
Si ce n'est pas affecté (RtlntStatUstodoserror)
RtlntStatUstodoSerror: = getProcaddress (ntlayer, '' rtlntStatUstodoSerror '');
Sinon (attribué (zwopensection) et affecté (rtlntstatustodoserror)) alors
SetLasterRor (error_call_not_implélement)
autre
Commencer
Statut: = Zwopensection (section, objectphysicalmemoryaccessmask,
@ObjectPhysicalMemoryAttributes);
statut de cas de
Status_success:
/ t essayez
/ t View: = mapViewoffile (section, objectphysicalmemoryaccessmask, 0,
/ t Low (trombiosdump), sizeof (trombiosdump));
/ t si attribué (voir) puis
/ t essayez
/ T fillchar (tampon, sizeof (trombiosdump), 0);
/ t se déplacer (vue ^, tampon, sizeof (trombiosdump));
/ t Résultat: = true;
/ t enfin
/ t UnmapViewoffile (vue);
/tendre;
/ t enfin
/ t CloseHandle (section);
/tendre;
Status_access_dened:
/ t Résultat: = readrombios16 (tampon, délai d'attente);
autre
Setlasterror (rtlntstatustodoserror (statut))
fin;
fin;
fin;
fin;
{################################################### ################################################### ## #################################################### ##
# / t / t / t / t / t / t / t / t / t / t / t / t #
# / t / t / t readrombios / t / t / t / t #
# / t / t / t / t / t / t / t / t / t / t / t / t #
#################################################### ####################################################### ########################################}
Fonction Readrombios (Var Dump: TrombiosDump; Méthode: TreadrombiOSMethod;
Timeout: DWORD = Infinite): Boolean;
Commencer
Résultat: = false;
méthode de cas de
rrbmautomatic:
if (entier (getversion) <0) alors
essayer
Résultat: = readrombiOS9x (Dump);
sauf
Résultat: = ReadRombiOS16 (Dump, Timeout);
fin
autre
Résultat: = readrombiosnt (Dump, timeout);
rrbmGeneric:
Résultat: = ReadRombiOS16 (Dump, Timeout);
rrbmmemory:
Résultat: = readrombiOS9x (Dump);
rrbmphysical:
Résultat: = readrombiosnt (Dump, timeout);
autre
SetLasterRor (error_invalid_parameter);
fin;
fin;
{################################################### ################################################### ## #################################################### ##
# / t / t / t / t / t / t / t / t / t / t / t / t #
# Utilitaires pour simplifier l'accès aux données en tant que types standard génériques #
# / t / t / t / t / t / t / t / t / t / t / t / t #
#################################################### ####################################################### ########################################}
fonction getrombiosbuffer (construp: trombiosDump; adresse: pointeur;
Var Buffer; BufferSize: Cardinal): Cardinal;
Commencer
Résultats: = 0;
if (cardinal (adresse)> = bas (trombiosdump)) et
(Cardinal (adresse) <= high (trombiosdump)) puis
Commencer
Résultat: = BufferSize;
if (cardinal (adresse) + tampersize> high (trombiosdump)) puis
Résultat: = High (trombiosDump) - Cardinal (adresse) + 1;
Déplacer (vidage [cardinal (adresse)], tampon, résultat);
fin;
fin;
fonction getrombiosstring (const demp: trombiosDump; adresse: pointeur): chaîne;
Commencer
Résultats: = '' '';
if (cardinal (adresse)> = bas (trombiosdump)) et
(Cardinal (adresse) <= high (trombiosdump)) puis
Résultat: = String (pChar (@dump [cardinal (adresse)]));
fin;
Fonction getrombioslonglong (CONS DIMP: TrombiosDump; Adresse: pointeur): LongLong;
taper
Plonglong = ^ longlong;
Commencer
Résultats: = 0;
if (cardinal (adresse)> = bas (trombiosdump)) et
(Cardinal (adresse) <= high (trombiosdump) - sizeof (longlong) + 1) puis
Résultat: = plonglong (@dump [cardinal (adresse)]) ^;
fin;
fonction getrombiosdword (const demp: trombiosDump; adresse: pointeur): dword;
Commencer
Résultats: = 0;
if (cardinal (adresse)> = bas (trombiosdump)) et
(Cardinal (adresse) <= high (trombiosdump) - sizeof (dword) + 1) puis
Résultat: = pdword (@dump [cardinal (adresse)]) ^;
fin;
fonction getRombiOSword (const demp: trombiosDump; adresse: pointeur): word;
Commencer
Résultats: = 0;
if (cardinal (adresse)> = bas (trombiosdump)) et
(Cardinal (adresse) <= high (trombiosdump) - taille (mot) + 1) puis
Résultat: = pword (@dump [cardinal (adresse)]) ^;
fin;
fonction getrombiosbyte (CONSUR: trombiosDump; adresse: pointeur): octet;
Commencer
Résultats: = 0;
if (cardinal (adresse)> = bas (trombiosdump)) et
(Cardinal (adresse) <= élevé (trombiosdump) - taille (octet) + 1) puis
Résultat: = pbyte (@dump [cardinal (adresse)]) ^;
fin;
fin.
==========================================
4. Obtenir les informations sur la date du BIOS
{------------------------------------------------- ---------------------------------}
{Obtenez les informations de date du BIOS, on estime qu'elle peut s'appliquer en vertu de 2000, mais elle peut nécessiter une autorisation}
fonction getBiOSDate1: String;
var
Tampon: tableau [0..8] de char;
N: dword;
Commencer
ReadProcessMemory (GetCurrentProcess,
Ptr ($ ffff5),
@Tampon,
8,
N);
Tampon [8]: = # 0;
Résultat: = strpas (tampon)
fin;
fonction getBiOSDate2: String;
Commencer
Résultat: = String (PCHA (PTR ($ ffff5)));
fin;