求:通过机器码获得注册码的完整方案(700分,不够可加)(100分)

  • 主题发起人 主题发起人 oceanwave
  • 开始时间 开始时间
高手如云,哈

但是不要让很多软件都用同一种算法来注册喔,哈

[8]
 
to 沈浪:

{$IFDEF }{$ENDIF}这是伪编译指令,这在使用在不兼容的系统中常用到,这也就是
程序跨平台的重要指令,可能还有其它的…

-----------------------------
仅为个人意见,如果有什么不对的,见谅,请高手更正…
我是一个初学Delphi的,呵
 
有高手可以帖出读取物理硬盘的序列号吗?
我想这个方式可能会好一点

建议注册码采用CpuID+HD_SER+MAC,只有这些东东是不会
常改变的,这样可以减少作者的一些工作,否则常给别人换注册码很累,最好还能做
到网上较验,否则一个用户多个注册码的话也是挺棘手的事。

可以在网络上封掉某个注册码!

至于如果没有网卡,这一栏置零或空值,再用其它一些特征码进行加密,我想不可能就只
用一种特征码进行加密吧?
[8][8][8][8][8][8][8][8][8][8][8][8][8][8]
 
就我所了解的都是用硬盘的物理序列号来加密的.
这种方法好.


所以,现在的问题了是大家能贴出一篇能获取硬盘物理序列号的源代码出来..
我有,但是只能获wd的硬盘的,maxtor的好像得不到....
 
TurboPower OnGard
 
gz

very good !

good good study

day day up!
 
关注下列问题,一定对你有益:
http://delphibbs.com/delphibbs/dispq.asp?lid=1743719
http://delphibbs.com/delphibbs/dispq.asp?lid=1742072
http://delphibbs.com/delphibbs/dispq.asp?lid=1655569
http://delphibbs.com/delphibbs/dispq.asp?lid=1786356
 
得到硬盘物理号及简单的算法:我贴出,我都是用它,挺好的,哈哈!
unit ISDNUNIT;

interface

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

type
TSrbIoControl=packed record
HeaderLength: ULONG;
Signature: Array[0..7] of char;
Timeout: ULONG;
ControlCode: ULONG;
ReturnCode: ULONG;
Length: ULONG;
END;
SRB_IO_CONTROL=TSrbIoControl;
PSrbIoControl=^TSrbIoControl;

TIDERegs=packed record
bFeaturesReg: Byte;
bSectorCountReg: Byte;
bSectorNumberReg: byte;
bCyllowReg: byte;
bCylhighreg:byte;
bDriveHeadReg: byte;
bCommandReg: byte;
bReserved: byte;
end;
IDEREGS=TIDERegs;
PIDERegs=^TIDERegs;

TSendCmdInParams=packed record
cBufferSize: DWORD;
irDriveRegs: TIDEREGS;
bDriveNumber:byte;
bReserved: Array[0..2] of byte;
dwReserved: Array[0..3] of DWORD;
bBUFFER: array[0..10] of byte;
end;
SENDCMDINPARAMS=TSendCmdInParams;
PSendcmdinparams=^Tsendcmdinparams;

TIdSector=packed record
wGenConfig: word;
wNumCyls: word;
wReserved: word;
wNumHeads: word;
wBytesPerTrack: word;
wBytesPerSector:word;
wSectorsPerTrack:word;
wVendorUnique: array[0..2] of word;
sSerialNumber: Array[0..19] of char;
wBufferType: word;
wBufferSize : word;
wECCSize: word;
sFirmwareRev: array[0..7] of char;
sModelNumber: array[0..39] of char;
wMorevendorUnique: word;
wDoubleWordIO: WORD;
wcapabilities:word;
wreservedL:word;
wPIOTiming:word;
wDMATiming:word;
wBS:WORD;
wNUMcurrentCYls:word;
wNUMcurrentHeads:word;
wNUMCurrentsectorsPerTRACK:WORD;
ulCurrentSectorCapacity:ULONG;
wMultSectorStuff:Word;
ulTotalAddressableSectors:ULONG;
wSingleWordDMA:Word;
wMultiwordDMA:word;
bReserved: Array[0..127] of byte;
end;
PIdSector=^TidSECTOR;

type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
procedure FormActivate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }


end;
// procedure ChangeByteorder(var data; Size:INTEGER);
// Function readhdserial:string;
// FUNCTION ENCRyPT(serial:string):string;
var
Form1: TForm1;
serial:string;
inputserial:string;
CONST
IDENTIFY_BUFFER_SIZE=512;
DataSize=sizeof(TSendCmdInParams)-1+IDENTIFY_BUFFER_SIZE;
IOCTL_SCSI_MINIPORT=$0004d008;
IOCTL_SCSI_MINIPORT_IDENTIFY=$001b0501;
IDE_ID_FUNCTION=$EC;
BufferSize=1280;
implementation

{$R *.DFM}

procedure ChangeByteorder(var data; size:integer);
var
ptr:PChar;
i:INTEGER;
C:CHAR;
BEGIN
ptr:=@data;
for i:=0 to (size shr 1)-1 do
begin
c:=ptr^;
ptr^:=(ptr+1)^;
(ptr+1)^:=c;
Inc(ptr,2);
end;
end;

function readhdserial:string;
var
hDevice:THandle;
cbBYTESReturned:DWORD;
pindata:PSendCmdInParams;
//pide:Pideregs;
pOutData:Pointer;
Buffer:Array[0..BufferSize-1] of Byte;
srbCONTROL:tSrbIoControl absolute Buffer;
begin
result:='';
Fillchar(Buffer,buffersize,#0);
hDevice:=CreateFile('//./Scsi0:',GENERIC_READ or GENERIC_WRITE,
FILE_SHARE_READ or FILE_SHARE_WRITE,nil,OPEN_EXISTING,0,0);
if hDevice=INVALID_HANDLE_VALUE then exit;
try
srbControl.HeaderLength:=sizeof(SRB_IO_CONTROL);
System.Move('SCSIDISK',srbControl.signature,8);
srbcontrol.timeout:=2;
srbcontrol.Length:=datasize;
srbcontrol.ControlCode:=IOCTL_SCSI_MINIPORT_IDENTIFY;
pInData:=PSendCmdInparams(pchar(@buffer)+sizeof(SRB_IO_CONTROL));
pOutData:=pInData;
with pInDATA^ DO
begin
cBuffersize:=IDENTIFY_BUFFER_SIZE;
bDriveNumber:=0;
// irDriveRegs:=0;
with irDriveRegs do
begin
bFeaturesreg:=1;
bsectorcountreg:=1;
bsectornumberreg:=1;
bcyllowreg:=0;
bcylhighreg:=0;
bdriveheadreg:=$A0;
bcommandreg:=IDE_ID_FUNCTION;
end;
end;
if not DeviceIoControl(hDevice,IOCTL_SCSI_MINIPORT,
@Buffer,BufferSize,@buffer,buffersize,cbbytesreturned,nil) then

exit;
with Pidsector(pchar(poutdata)+16)^ do
begin
changebyteorder(sSerialNUMber,sizeof(sserialnumber));
setstring(result,sserialnumber,sizeof(sserialnumber));
end;
finally
closehandle(hdevice);
end;
end;

*******简单算法**************
你可以扩充
function encrypt(serial:string):string;   
var
i:DwoRD;
LEN:DWORD;
R:DWORD;
begin
R:=0;
LEN:=LENGTH(SERIAL);
FOR I:=1 TO LEN DO
BEGIN
R:=R+DWORD(SERIAL);
R:=R * 10;
END;
RESULT:=INTTOSTR(R);
END;
 
上面的方法是怎么在程序中调用的啊.
 
第2,3项应该自己写!
 
有价值的问题,收藏
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
2K
DelphiTeacher的专栏
D
后退
顶部