Hmm.. Hvis du har problemer med å lese fra registret, så kan du prøve dette (det virker):
Du kan bruke dette med å skrive i mIRC: //echo $dll(mIRC_DLL.dll, RegRead,)
library mIRC_DLL;
uses
Registry;
function StrCopy(Dest: PChar; const Source: PChar): PChar;
asm
PUSH EDI
PUSH ESI
MOV ESI,EAX
MOV EDI,EDX
MOV ECX,0FFFFFFFFH
XOR AL,AL
REPNE SCASB
NOT ECX
MOV EDI,ESI
MOV ESI,EDX
MOV EDX,ECX
MOV EAX,EDI
SHR ECX,2
REP MOVSD
MOV ECX,EDX
AND ECX,3
REP MOVSB
POP ESI
POP EDI
end;
function RegRead(mWnd, aWnd: THandle; Data, Parms: PChar; Show, NoPause: Boolean): Integer; stdcall;
var
Reg: TRegistry;
begin
Reg := TRegistry.Create;
Reg.RootKey := LongWord($80000002); // HKEY_LOCAL_MACHINE
if Reg.OpenKey('SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion', False) then
StrCopy(Data, PChar(Reg.ReadString('ProductName')))
else
StrCopy(Data, nil);
Reg.Free;
Result := 3;
end;
exports
RegRead;
begin
end.
Du kan også bruke dette med å skrive i mIRC: /dll mIRC_DLL.dll RegRead
library mIRC_DLL;
uses
Registry;
function StrCopy(Dest: PChar; const Source: PChar): PChar;
asm
PUSH EDI
PUSH ESI
MOV ESI,EAX
MOV EDI,EDX
MOV ECX,0FFFFFFFFH
XOR AL,AL
REPNE SCASB
NOT ECX
MOV EDI,ESI
MOV ESI,EDX
MOV EDX,ECX
MOV EAX,EDI
SHR ECX,2
REP MOVSD
MOV ECX,EDX
AND ECX,3
REP MOVSB
POP ESI
POP EDI
end;
function RegRead(mWnd, aWnd: THandle; Data, Parms: PChar; Show, NoPause: Boolean): Integer; stdcall;
var
Reg: TRegistry;
begin
Reg := TRegistry.Create;
Reg.RootKey := LongWord($80000002); // HKEY_LOCAL_MACHINE
if Reg.OpenKey('SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion', False) then
StrCopy(Data, PChar('echo ' + Reg.ReadString('ProductName')))
else
StrCopy(Data, nil);
Reg.Free;
Result := 2;
end;
exports
RegRead;
begin
end.
Håper det hjelper
Mvh
DiZpel