ET99加密狗模拟之读取数据

经过分析官方提供的et99 API ,写出下面读取数据的程序,delphi 代码,成品不贴

library FT_ET99_API;
{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }
uses
Windows,
Messages,
SysUtils,
Classes,
Graphics,
Controls,
Forms,
Dialogs,
StdCtrls;
{$R *.res}
function et_FindToken(pid:pchar;var count:cardinal):integer;stdcall;
begin
count:=1;
showmessage('FindToken=>Pid:['+strpas(pid)+']'+#13+#10+'count:['+inttostr(count)+']');
result:=$0;
end;
function et_OpenToken(var handle:THandle;pid :pchar; index :cardinal):integer;stdcall;
begin
showmessage('OpenToken=>Pid:['+strpas(pid)+']'+#13+#10+'index:['+inttostr(index)+']');
result:=$0;
end;
function et_CloseToken(handle:THandle):integer;stdcall;
begin
showmessage('et_CloseToken');
result:=$0;
end;
function et_Verify(handle:THandle; flags : cardinal; pin: pchar):integer;stdcall;
begin
showmessage('et_Verify =>flags:['+inttostr(flags)+']'+#13+#10+'pin:['+strpas(pin)+']');
result:=$0;
end;
function et_Read(handle:THandle; offset : cardinal; Len : cardinal; buffer512:pchar):integer;stdcall;
begin
showmessage('et_Read =>buffer:['+strpas(buffer512)+']'+#13+#10+'offset:['+inttostr(offset)+']'+#13+#10+'len:['+inttostr(len)+']');
result:=$0;
end;
function et_Write(handle:THandle; offset : cardinal; Len : cardinal; buffer512:pchar):integer;stdcall;
begin
showmessage('et_Write =>buffer:['+strpas(buffer512)+']'+#13+#10+'offset:['+inttostr(offset)+']'+#13+#10+'len:['+inttostr(len)+']');
result:=$0;
end;
function et_GetSN(handle:THandle; buffer512:pchar):integer;stdcall;
begin
showmessage('et_GetSN =>buffer:['+strpas(buffer512)+']');
result:=$0;
end;
exports
et_FindToken,et_OpenToken,et_CloseToken,et_Verify,et_Read,et_Write,et_GetSN;

begin
end.

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: