?? unit1.pas
字號(hào):
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, sChip, Mask;
type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
Label2: TLabel;
Button2: TButton;
Button3: TButton;
Edit1: TEdit;
Edit2: TEdit;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
hKey: THandle;
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
if(hKey = INVALID_HANDLE_VALUE) then
begin
hKey := OpensChip($ffff, nil);
if(hKey = INVALID_HANDLE_VALUE) then
begin
Application.MessageBox('No schip find!', 'test', MB_OK);
end;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
hKey := INVALID_HANDLE_VALUE;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if(hKey <> INVALID_HANDLE_VALUE) then
begin
ClosesChip(hKey);
end;
end;
//read
procedure TForm1.Button2Click(Sender: TObject);
var
index, value: WORD;
I: Integer;
ReadPassword: DWORD;
pPass: PChar;
begin
if(hKey = INVALID_HANDLE_VALUE) then
begin
Application.MessageBox('Open schip first!', 'test', MB_OK);
end
else
begin
//maybe a try...except clause
I := StrToInt(Edit1.Text);
index := I;
ReadPassword := $ffffffff;
pPass := @ReadPassword;
if(ReadsChipMem(hKey, pPass, index, @value) = TRUE) then
begin
Edit2.Text := IntToStr(value);
end
else
begin
Application.MessageBox('Read schip error!', 'test', MB_OK);
end;
end;
end;
procedure TForm1.Button3Click(Sender: TObject);
var
index, value: WORD;
I: Integer;
WritePassword: DWORD;
pPass: PChar;
begin
if(hKey = INVALID_HANDLE_VALUE) then
begin
Application.MessageBox('Open schip first!', 'test', MB_OK);
end
else
begin
//maybe a try...except clause
I := StrToInt(Edit1.Text);
index := I;
I := StrToInt(Edit2.Text);
value := I;
WritePassword := $ffffffff;
pPass := @WritePassword;
if(WritesChipMem(hKey, pPass, index, value) = TRUE) then
begin
Application.MessageBox('Write schip ok!', 'test', MB_OK);
end
else
begin
Application.MessageBox('Write schip error!', 'test', MB_OK);
end;
end;
end;
end.
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -