" يقوم بتصدير السيريال إلى تكست او حتى قيمة ريجسترى
تستعمله بعد ذلك فى الدلفى" , أظن هذا كافي لكسر الحماية .
"و عموما لغة الدلفى على حد علمى لا تنفذ الى هذا العمق
و غير مؤهلة لإستخراج هذا الرقم" , عليك بالمطالعة أكثر !!
بالتوفيق,,
تستعمله بعد ذلك فى الدلفى" , أظن هذا كافي لكسر الحماية .
"و عموما لغة الدلفى على حد علمى لا تنفذ الى هذا العمق
و غير مؤهلة لإستخراج هذا الرقم" , عليك بالمطالعة أكثر !!
كود :
{**********************************************************}
{ Open source sample. }
{ Free to use. }
{ Coded By Dark666e | 19-12-2010 AORETEEM }
{**********************************************************}
library Real_Hard_Drive_ID;
{$WARNINGS OFF}{$HINTS OFF}
{$O ON}{$OVERFLOWCHECKS Off}
uses
Windows, Messages;
const
SMART_RCV_DRIVE_DATA = $7C088;
type
TIdeRegs = packed record
bFeaturesReg,
bSectorCountReg,
bSectorNumberReg,
bCylLowReg,
bCylHighReg,
bDriveHeadReg,
bCommandReg,
bReserved: Byte;
end;
TSMART_RCV_DRIVE_InDATA = packed record
dwBufferSize: DWORD;
irDriveRegs: TIdeRegs;
bDriveNumber: Byte;
bReserved: array[1..3] of Byte;
dwReserved: array[1..4] of DWORD;
bBuffer: Byte;
end;
TDriverStatus = packed record
bDriverError: Byte;
bIDEError: Byte;
bReserved: array[1..2] of Byte;
dwReserved: array[1..2] of DWORD;
end;
TSMART_RCV_DRIVE_OutDATA = packed record
dwBufferSize: DWORD;
dsDriverStatus: TDriverStatus;
bBuffer: array[1..512] of Byte;
end;
function FixName(HardId: string): string;
var
_i: Byte;
begin
Result := '';
_i := 1;
while _i <= Length(HardId) do
begin
if HardId[_i] <> ' ' then
Result := Result + HardId[_i + 1] + HardId[_i];
_i := _i + 2;
end;
end;
function GetRealHardId: string;stdcall;
var
Tmp: string;
hDevice: Thandle;
InBuffer: TSMART_RCV_DRIVE_InDATA;
OutBuffer: TSMART_RCV_DRIVE_OutDATA;
pBytesReturned: dword;
begin
Result := '';
hDevice := CreateFileA('\\.\PhysicalDrive0'
, GENERIC_READ + GENERIC_WRITE
, FILE_SHARE_READ + FILE_SHARE_WRITE
, nil
, OPEN_EXISTING
, 0
, 0);
if hDevice = Dword(-1) then Exit;
FillChar(InBuffer, SizeOf(TSMART_RCV_DRIVE_InDATA), 0);
FillChar(OutBuffer, $21, 0);
with InBuffer do
begin
dwBufferSize := $200;
bDriveNumber := 0;
irDriveRegs.bSectorCountReg := 1;
irDriveRegs.bSectorNumberReg := 1;
irDriveRegs.bDriveHeadReg := $0A0;
irDriveRegs.bCommandReg := $0EC;
end;
if DeviceIoControl(hDevice, SMART_RCV_DRIVE_DATA
, @InBuffer, SizeOf(InBuffer)
, @OutBuffer, SizeOf(OutBuffer)
, pBytesReturned, nil) then
if OutBuffer.dsDriverStatus.bDriverError = 0 then begin
begin
SetLength(Tmp, 20);
Move(OutBuffer.bBuffer[21], Tmp[1], 20);
Result := FixName(Tmp);
end;
CloseHandle(hDevice);
end;
end;
exports
GetRealHardId;
end.I'M Fly Like A G6

