OgUtil Unit
Enter topic text here.
Types
{$IFDEF Win16}
DWord = LongInt;
PDWord = ^DWord;
TGUID = GUID; {Delphi 1.0 defines it as GUID - Delphi 2.0 defines it as TGUID}
AnsiChar = Char;
PAnsiChar = PChar;
{$ENDIF}
{$IFNDEF FPC}
PByte = ^Byte;
PByteArray = ^TByteArray;
TByteArray = array [0..MaxStructSize div SizeOf(Byte) - 1] of Byte;
PLongInt = ^LongInt;
{$ENDIF}
PLongIntArray = ^TLongIntArray;
TLongIntArray = array [0..MaxStructSize div SizeOf(LongInt) - 1] of LongInt;
Constants
DefAutoCheck = True;
DefAutoDecrease = True;
DefCheckSize = True;
DefStoreCode = False;
DefStoreModifier = False;
DefStoreRegString = False;
OgVersionStr = '1.15';
{magic values}
DaysCheckCode = Word($649B);
DateCheckCode = Word($A4CB);
NetCheckCode = Word($9341);
RegCheckCode = Word($D9F6);
SerialCheckCode = Word($3C69);
UsageCheckCode = Word($F3D5);
SpecialCheckCode = Word($9C5B);
{$IFDEF Win32}
MaxStructSize = 1024 * 2000000; {2G}
{$ELSE}
MaxStructSize = 1024 * 64 - 1; {64K}
{$ENDIF}
DefCodeType = ctDate;
DefKeyType = ktRandom;
Exceptions
EOnGuardException = class(Exception);
EOnGuardBadDateException = class(EOnGuardException); {!!.15}
EOnGuardClockIssueException = class(EOnGuardException);
Variables
StrRes : TOgStringResource;
Routines
Generate Key Routines
Modifier Routines
Hash Routines
Mixing Routines
Utility Routines
OgFormatDate
Max
Min
XorMem
MyHashElf
GetDiskSerialNumber
GetDriveType
HiWord
CoCreateGuid
timeGetTime
Date Code
Days Code
Registration Code
IsRegCodeRegisteredTo
Serial Number Code
Special Code
Usage Code
{$IFDEF Win16}
function GetDiskSerialNumber(Drive : AnsiChar) : LongInt;
{$ENDIF}
{$IFDEF LINUX}
function GetDiskSerialNumber(Drive : AnsiChar) : LongInt;
function MyHashElf(const Buf; BufSize : LongInt) : LongInt;
{$ENDIF}
function Max(A, B : LongInt): LongInt;
function Min(A, B : LongInt) : LongInt;
procedure XorMem(var Mem1; const Mem2; Count : Cardinal);
function OgFormatDate(Value : TDateTime) : string; {!!.09}
{$IFDEF KYLIX}
function GetDriveType(drive:Integer): Integer;
function HiWord(I: DWORD):Word;
function CoCreateGuid(out guid: TGUID): HResult;
function timeGetTime: DWord;
{$ENDIF}
{$IFDEF FPC}
{$IFDEF LINUX}
function GetDriveType(drive:Integer): Integer;
function HiWord(I: DWORD):Word;
function CoCreateGuid(out guid: TGUID): HResult;
function timeGetTime: Cardinal;
{$ENDIF}
{$IFDEF FREEBSD}
function GetDriveType(drive:Integer): Integer;
function HiWord(I: DWORD):Word;
function CoCreateGuid(out guid: TGUID): HResult;
function timeGetTime: Cardinal;
{$ENDIF}
{$ENDIF}