Autor Beitrag
Born-to-Frag
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: Di 18.07.06 14:33 
Hallo!

Ich habe hier einen Source mit dem ich (glaube ich :mrgreen:) den Product Key von meinem Windows auslesen kann..
Leider ist der Source in C++, was ich nicht kann.

Deswegen wollte ichi fragen ob ihn mir jemand übersetzen kann :)


ausblenden volle Höhe Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
#include <iostream>
#include <windows.h>

int main () {
    //Zeichenvorrat Buchstaben,Ziffern ohne AEIOU01 (24)
    UCHAR digits[] = {'B','C','D','F','G','H','J','K','M','P','Q','R','T','V','W','X','Y','2','3','4','6','7','8','9'};
    PUCHAR strresult = new UCHAR[26];
    PUCHAR buf = new UCHAR[200];
   
    HKEY key = NULL;
    DWORD datasize = 200;
    DWORD dwRet = 0;

    ZeroMemory((PVOID)strresult,26);

    dwRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion",0,KEY_READ,&key);                      
    dwRet = RegQueryValueEx(key,"DigitalProductID",NULL,NULL,(LPBYTE)buf,&datasize);
   
    if (dwRet != ERROR_SUCCESS) {
        return -1;
    }
   
    RegCloseKey(key);

    for (int i=24;i>=0;i--) {
        int x=0;

        for (int j=14;j>=0;j--) {
            x = (x<<8) + (buf+0x34)[j];
            (buf+0x34)[j] = x / 24;
            x = x % 24;
        }
        strresult[i]=digits[x];
    }
   
    std::cout << strresult;
   
    std::cin.get();
    return 0;
}


(Quelle)


greetz


EDIT: Konkret verwirren mich die Zeilen 17 (Muss ich das mit ReadBinaryData machen?), 29 und 30 (die Operatoren versteh ich einfach nicht)

_________________
Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.


Zuletzt bearbeitet von Born-to-Frag am Di 18.07.06 17:12, insgesamt 1-mal bearbeitet
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10181
Erhaltene Danke: 1254

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Di 18.07.06 16:21 
Moin!

Probier das mal so: ;)
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
function GetWinProductID: String;
  const
    Digits = 'BCDFGHJKMPQRTVWXY2346789';
  var
    Reg: TRegistry;
    Value: String;
    i,j,x: Integer;
begin
  Result := '';
  Reg := TRegistry.Create(KEY_READ);
  try
    Reg.RootKey := HKEY_LOCAL_MACHINE;
    Reg.OpenKey('SOFTWARE\Microsoft\Windows NT\CurrentVersion',FALSE);
    SetLength(Value,Reg.GetDataSize('DigitalProductID'));
    if (Length(Value) >= 67then begin
      Reg.ReadBinaryData('DigitalProductID',Value[1],Length(Value));
      for i := 24 downto 0 do begin
        x := 0;
        for j := 14 downto 0 do begin
          x := (x shl 8) +Ord(Value[53+j]);
          Value[53+j] := Char(x div 24);
          x := x mod 24;
        end;
        Result := Digits[x+1] +Result;
        if ( (i > 0and ((i mod 5) = 0) ) then
          Result := '-' +Result;
      end;
    end;
  finally
    Reg.Free;
  end;
end;

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Born-to-Frag Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: Di 18.07.06 16:23 
Wow, dankesehr Narses :flehan: :beer:

Die Funktion funktioniert einwandfrei :)


greetz

_________________
Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
Martin1966
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1068

Win 2000, Win XP
Delphi 7, Delphi 2005
BeitragVerfasst: Mi 19.07.06 09:46 
Ich hab die Funktion für die DL vorgeschlagen: www.delphi-library.d....php?p=374960#374960

_________________
Ein Nutzer der Ecke ;-)
Roy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 184

Windows7 Ultimate
Delphi 2007, NET, Embarcadero
BeitragVerfasst: Sa 10.10.15 12:26 
user profile iconNarses hat folgendes geschrieben Zum zitierten Posting springen:
Probier das mal so: ;)


Ich erhalte hierbei kein Ergebnis, Label bleibt leer

Moderiert von user profile iconNarses: Zitat gekürzt.
hathor
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 10.10.15 16:31 
Hier gibt es eine Lösung: function View_Win_Key: string;

www.swissdelphicente...showcode.php?id=2252

Kleine Änderung:
Reg := TRegistry.Create(KEY_READ OR KEY_WOW64_64KEY);

Funktioniert bei XE7, WIN8.1


Zuletzt bearbeitet von hathor am Sa 10.10.15 16:49, insgesamt 1-mal bearbeitet
SMO
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 120
Erhaltene Danke: 18


D2005 Personal
BeitragVerfasst: Sa 10.10.15 16:41 
user profile iconRoy hat folgendes geschrieben Zum zitierten Posting springen:
Ich erhalte hierbei kein Ergebnis, Label bleibt leer


Dann benutzt du wahrscheinlich ein 32-bit Programm in einem 64-bit Windows. Siehe MSDN.


ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
// Get Windows product key, adapted by SMO from open source examples
// tested on Windows 7 and 8.1
function GetWinProductKey: string;
const
  KeyOffset    = 52;
  Symbols      = 'BCDFGHJKMPQRTVWXY2346789';
  SymbolCount  = Length(Symbols);  // = 24
  RegKeyName   = 'SOFTWARE\Microsoft\Windows NT\CurrentVersion';
  RegValueName = 'DigitalProductID';
  // KEY_WOW64_64KEY = $0100;
  SRegOpenErrMsg = 'Error while opening registry key "%s":'#10'%s';
  SRegValueExistErrMsg = 'Registry value "%s" does not exist';
  SRegValueSizeErrMsg = 'Registry value "%s" is too small (%d bytes)';
var
  Reg: TRegistry;
  AAccess: Longword;
  DigitalProductID: array of Byte; // TBytes
  Decoded: string;
  i, j, x: Integer;
  IsWin8: Boolean;
begin
  AAccess := KEY_READ;
  // on a 64 bit OS, make sure to read the 64 bit version of the registry key
  if TOSVersion.Architecture = arIntelX64 then
    AAccess := AAccess or KEY_WOW64_64KEY;

  Reg := TRegistry.Create(AAccess);
  try
    Reg.RootKey := HKEY_LOCAL_MACHINE;
    if not Reg.OpenKey(RegKeyName, FALSE) then
      raise Exception.CreateFmt(SRegOpenErrMsg, [RegKeyName, Reg.LastErrorMsg]);
    if not Reg.ValueExists(RegValueName) then
      raise Exception.CreateFmt(SRegValueExistErrMsg, [RegValueName]);
    i := Reg.GetDataSize(RegValueName);
    if (i >= 67then
    begin
      SetLength(DigitalProductID, i);
      Reg.ReadBinaryData(RegValueName, DigitalProductID[0], i);
      // Windows 8 requires a tweak
      x := 66;
      IsWin8 := Odd(DigitalProductID[x] div 6);
      if IsWin8 then
        DigitalProductID[x] := DigitalProductID[x] and $F7;
      // decode
      SetLength(Decoded, 25);
      for i := High(Decoded) downto Low(Decoded) do
      begin
        x := 0;
        for j := 14 downto 0 do
        begin
          x := (x shl 8) + DigitalProductID[KeyOffset + j];
          DigitalProductID[KeyOffset + j] := x div SymbolCount;
          x := x mod SymbolCount;
        end;
        Decoded[i] := Symbols[Low(Symbols) + x];
      end;
      if IsWin8 then
        // discard the first symbol and insert an "N" somewhere in the middle
        Decoded := Copy(Decoded, 2, x) + 'N' + Copy(Decoded, 2 + x, MaxInt);
      // produce final output, separated with "-"
      for i := 0 to 4 do
      begin
        if i > 0 then Result := Result + '-';
        Result := Result + Copy(Decoded, 1 + i * 55);
      end;
    end
    else
      raise Exception.CreateFmt(SRegValueSizeErrMsg, [RegValueName, i]);
  finally
    Reg.Free;
  end;
end;



Edit: hathor war schneller, aber der Code, den er verlinkt hat, funktioniert nicht für Windows 8.x (und hat außerdem schlechte Fehlerbehandlung).
Edit2: Fehler korrigiert.


Zuletzt bearbeitet von SMO am Sa 10.10.15 17:26, insgesamt 2-mal bearbeitet
Roy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 184

Windows7 Ultimate
Delphi 2007, NET, Embarcadero
BeitragVerfasst: Sa 10.10.15 16:56 
Undefinierter Bezeichner
TOSVersion

TOSVersion

Moderiert von user profile iconNarses: Komplettzitat des letzten Beitrags entfernt.
SMO
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 120
Erhaltene Danke: 18


D2005 Personal
BeitragVerfasst: Sa 10.10.15 17:19 
user profile iconRoy hat folgendes geschrieben Zum zitierten Posting springen:
Undefinierter Bezeichner
TOSVersion


Hast du die Unit System.SysUtils eingebunden?
Falls ja, gibt es TOSVersion in deiner Delphi-Version wohl noch nicht.

Ersetze einfach "if TOSVersion.Architecture = arIntelX64 then" durch "if IsWow64Process then".
Wobei dieses IsWow64Process gemeint ist:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
function IsWow64Process: Boolean;
type
  TIsWow64Process = function(hProcess: THandle; var Wow64Process: BOOL): BOOL; stdcall;
// const kernel32 = 'kernel32.dll'; // defined in Winapi.Windows
var
  LIsWow64Process: TIsWow64Process;
  Wow64Process: BOOL;
begin
  Result := False;
  LIsWow64Process := GetProcAddress(GetModuleHandle(kernel32), 'IsWow64Process');
  if Assigned(LIsWow64Process) then
  begin
    if not LIsWow64Process(GetCurrentProcess, Wow64Process) then
      raise Exception.Create('Invalid handle');
    Result := Wow64Process;
  end;
end;
Roy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 184

Windows7 Ultimate
Delphi 2007, NET, Embarcadero
BeitragVerfasst: Sa 10.10.15 19:03 
Funktioniert nicht der code

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
// Get Windows product key, adapted by SMO from open source examples
// tested on Windows 7 and 8.1
function GetWinProductKey: string;
const
  KeyOffset    = 52;
  Symbols      = 'BCDFGHJKMPQRTVWXY2346789';
  SymbolCount  = Length(Symbols);  // = 24
  RegKeyName   = 'SOFTWARE\Microsoft\Windows NT\CurrentVersion';
  RegValueName = 'DigitalProductID';
  // KEY_WOW64_64KEY = $0100;
  SRegOpenErrMsg = 'Error while opening registry key "%s":'#10'%s';
  SRegValueExistErrMsg = 'Registry value "%s" does not exist';
  SRegValueSizeErrMsg = 'Registry value "%s" is too small (%d bytes)';
var
  Reg: TRegistry;
  AAccess: Longword;
  DigitalProductID: array of Byte; // TBytes
  Decoded: string;
  i, j, x: Integer;
  IsWin8: Boolean;
begin
  AAccess := KEY_READ;
  // on a 64 bit OS, make sure to read the 64 bit version of the registry key
     if not LIsWow64Process(GetCurrentProcess, Wow64Process) then
      raise Exception.Create('Invalid handle');
    Result := Wow64Process;
  end;

  Reg := TRegistry.Create(AAccess);
  try
    Reg.RootKey := HKEY_LOCAL_MACHINE;
    if not Reg.OpenKey(RegKeyName, FALSE) then
      raise Exception.CreateFmt(SRegOpenErrMsg, [RegKeyName, Reg.LastErrorMsg]);
    if not Reg.ValueExists(RegValueName) then
      raise Exception.CreateFmt(SRegValueExistErrMsg, [RegValueName]);
    i := Reg.GetDataSize(RegValueName);
    if (i >= 67then
    begin
      SetLength(DigitalProductID, i);
      Reg.ReadBinaryData(RegValueName, DigitalProductID[0], i);
      // Windows 8 requires a tweak
      x := 66;
      IsWin8 := Odd(DigitalProductID[x] div 6);
      if IsWin8 then
        DigitalProductID[x] := DigitalProductID[x] and $F7;
      // decode
      for i := 24 downto 0 do
      begin
        x := 0;
        for j := 14 downto 0 do
        begin
          x := (x shl 8) + DigitalProductID[KeyOffset + j];
          DigitalProductID[KeyOffset + j] := x div SymbolCount;
          x := x mod SymbolCount;
        end;
        Decoded := Symbols[Low(Symbols) + x] + Decoded;
      end;
      if IsWin8 then
        // discard the first symbol and insert an "N" somewhere in the middle
        Decoded := Copy(Decoded, 2, x) + 'N' + Copy(Decoded, x, MaxInt);
      // produce final output, separated with "-"
      for i := 0 to 4 do
      begin
        if i > 0 then Result := Result + '-';
        Result := Result + Copy(Decoded, 1 + i * 55);
      end;
    end
    else
      raise Exception.CreateFmt(SRegValueSizeErrMsg, [RegValueName, i]);
  finally
    Reg.Free;
  end;
end;


Moderiert von user profile iconMartok: Delphi-Tags hinzugefügt
SMO
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 120
Erhaltene Danke: 18


D2005 Personal
BeitragVerfasst: Sa 10.10.15 19:20 
user profile iconRoy hat folgendes geschrieben Zum zitierten Posting springen:
Funktioniert nicht der code

Könntest du vielleicht sagen, was genau nicht funktioniert? Und bitte nicht sinnlos den kompletten Code in deine Nachrichten kopieren.

Übrigens habe ich noch einen kleinen Fehler gefunden und korrigiert, also probier's nochmal mit dem aktuellen Code.
Welche Delphi-Version hast du, Delphi 2007?
Roy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 184

Windows7 Ultimate
Delphi 2007, NET, Embarcadero
BeitragVerfasst: Sa 10.10.15 19:23 
Windows7
Delphi7

welchen aktuellen code??
SMO
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 120
Erhaltene Danke: 18


D2005 Personal
BeitragVerfasst: Sa 10.10.15 19:44 
Na den Code in meinem ersten Beitrag oben.

Delphi 7 ist alt, das kann z.B. kein "Low()" für Strings und kennt auch noch nicht die Konstante KEY_WOW64_64KEY.
Mit etwas Eigeninitiative kannst du die paar Stellen, die Delphi 7 nicht versteht, sicher ändern. Kleine Anregung:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
function GetWinProductKey: string;
const
// ...
  SymbolCount = 24;
  KEY_WOW64_64KEY = $0100
// ...
begin
// ...
  if IsWow64Process then
    AAccess := AAccess or KEY_WOW64_64KEY;
// ...
    for i := Length(Decoded) downto 1 do
    begin
// ...
      Decoded[i] := Symbols[1 + x];
// ...
hathor
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 10.10.15 23:52 
Decoder geändert: Sollte jetzt mit WIN8.0 und WIN8.1 funktionieren.
Bitte mit WIN7.0 und WIN10 testen.

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
program WIN8_Info;

{$APPTYPE CONSOLE}

uses
{$if CompilerVersion < 21}
  SysUtils,
  Registry;
{$endif}
{$if CompilerVersion > 20}
  System.SysUtils,
  System.Win.Registry;
{$endif}

const KEY_WOW64_64KEY = 256; KEY_READ = 131097; HKEY_LOCAL_MACHINE = $80000002;


function BinToInt(Value: String): Integer;
var i, vSize: Integer;
begin
  Result := 0; vSize := Length(Value);
  for i := vSize downTo 1 do
    if Value[i] = '1' then begin Result := Result + (1 shl (vSize - i)); end;
end;

function DecodeProductKey8(Const HexSrc: Array Of Byte): String;
Const
  StarToffset: Integer = $34;
  EndOffset: Integer = $34 + 17;
  Digits: Array[0..23of Char =
  ('B','C','D','F','G','H','J','K','M','P','Q','R','T','V','W','X','Y','2','3','4','6','7','8','9');
  dLen: Integer = 29;
  KeyOffset :Integer = 52 ;
var
  Key  : Array Of Cardinal;
  Cur, X, I, K, Last : Integer;
  T    : String;
begin
  I := 24;
  SetLength(Key, dLen);
    for K := StarToffset To EndOffset do begin Key[K - StarToffSet] := HexSrc[K]; end;
  Key[14] := BinToInt(IntToStr(Key[14]));
    repeat
      Cur := 0; X := 14;
        repeat
          Cur := Cur * 256 ;
          Cur := (Key[X]) + Cur;
          Key[X] := Cur div 24 ;
          Cur := Cur Mod 24;
          X := X - 1;
        until X < 0;
      I := I - 1;
      Last := Cur;
      T := Digits[Cur] + T ;
    until I < 0;
  T :=  Copy(T,2,25);
  Insert('N', T, Last + 1);
    For X := 1 To 4 do begin Insert('-', T, X*6); end;
  Result := T;
end;

function View_Win8_Key: string;
var Reg: TRegistry;  HexBuf: array of BYTE; binarySize: INTEGER; PN,PID,DN: string;
begin
  Reg := TRegistry.Create(KEY_READ OR KEY_WOW64_64KEY);
  try
    Reg.RootKey := HKEY_LOCAL_MACHINE;
    if Reg.OpenKeyReadOnly('\SOFTWARE\Microsoft\Windows NT\CurrentVersion'then
    begin
      if Reg.GetDataType('DigitalProductId') = rdBinary then
      begin
        PN         := (Reg.ReadString('ProductName'));
        PID        := (Reg.ReadString('ProductID'));
        binarySize := Reg.GetDataSize('DigitalProductId');
        SetLength(HexBuf, binarySize);
        if binarySize > 0 then
        begin Reg.ReadBinaryData('DigitalProductId', HexBuf[0], binarySize); end;
      end;
    end;
  finally FreeAndNil(Reg); end;
  Result := ''; Result := DecodeProductKey8(HexBuf);
end;

//[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]
function GetWinProductID: String;
var Reg: TRegistry;
begin
  Reg := TRegistry.Create(KEY_READ OR KEY_WOW64_64KEY);
  try
    Reg.RootKey := HKEY_LOCAL_MACHINE;
    Reg.OpenKeyReadOnly('SOFTWARE\Microsoft\Windows NT\CurrentVersion');
    Result := Reg.ReadString('ProductID');
  finally Reg.Free; end;
end;

begin
      WriteLn('ProductID: '+GetWinProductID);
      WriteLn('Key: '+View_Win8_Key);
      Writeln; Writeln('Press Enter to exit'); Readln;
end.
Einloggen, um Attachments anzusehen!


Zuletzt bearbeitet von hathor am So 11.10.15 22:27, insgesamt 2-mal bearbeitet
SMO
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 120
Erhaltene Danke: 18


D2005 Personal
BeitragVerfasst: So 11.10.15 00:00 
user profile iconhathor hat folgendes geschrieben Zum zitierten Posting springen:
Link geht doch !


Wie ich bereits geschrieben habe, dieser Code funktioniert nicht mehr ab Windows 8!
Ja, er läuft und liefert ein Ergebnis, aber ein falsches.
Der Code von mir funktioniert auch für Windows 8 (Windows 10 noch nicht getestet).
Roy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 184

Windows7 Ultimate
Delphi 2007, NET, Embarcadero
BeitragVerfasst: So 11.10.15 07:47 
Ich habe auch Embarcadero XE7 ist das besser?
hathor
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 11.10.15 11:27 
user profile iconSMO hat folgendes geschrieben Zum zitierten Posting springen:
user profile iconhathor hat folgendes geschrieben Zum zitierten Posting springen:
Link geht doch !


Wie ich bereits geschrieben habe, dieser Code funktioniert nicht mehr ab Windows 8!
Ja, er läuft und liefert ein Ergebnis, aber ein falsches.
Der Code von mir funktioniert auch für Windows 8 (Windows 10 noch nicht getestet).


Endlich mal eine Aussage, mit der ich was anfangen kann!

Decoder oben geändert.

INFO:
www.nirsoft.net/util...t_cd_key_viewer.html


Zuletzt bearbeitet von hathor am So 11.10.15 14:42, insgesamt 1-mal bearbeitet
hathor
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 11.10.15 11:28 
user profile iconRoy hat folgendes geschrieben Zum zitierten Posting springen:
Ich habe auch Embarcadero XE7 ist das besser?


Ist ein Golf BJ 2015 besser als ein VW Käfer BJ xxxx ?
SMO
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 120
Erhaltene Danke: 18


D2005 Personal
BeitragVerfasst: So 11.10.15 14:33 
user profile iconhathor hat folgendes geschrieben Zum zitierten Posting springen:
Endlich mal eine Aussage, mit der ich was anfangen kann!

Decoder oben geändert.


Schön, jetzt funktioniert dein Code mit Windows 8, aber eben nicht mehr mit Windows 7. Meiner funktioniert für beide. ;)

Und wieso benutzt du "Key[14] := BinToInt(IntToStr(Key[14]))" anstatt "Key[14] := Key[14] and $F7"?
Die Variable "Last" ist außerdem überflüssig, hat immer denselben Wert wie Cur am Ende.
Roy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 184

Windows7 Ultimate
Delphi 2007, NET, Embarcadero
BeitragVerfasst: So 11.10.15 18:55 
Nichts zu machen, Funktioniert nicht unter Delphi7 und auch nicht unter Embarcadero XE7

Er kann mit dem hier alles nichts anfangen

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
{$APPTYPE CONSOLE}

uses
{$if CompilerVersion < 21}
  Windows,
  SysUtils,
  ActiveX,
  ComObj,
  Variants,
  Registry,
  Classes;
{$endif}
{$if CompilerVersion > 20}
  Winapi.Windows,
  System.SysUtils,
  Winapi.ActiveX,
  System.Win.ComObj,
  System.Variants,
  System.Win.Registry,
  System.Classes;
{$endif}


Moderiert von user profile iconNarses: Delphi-Tags hinzugefügt