#include "FiveWin.ch"
function Main()
CheckIt()
return nil
function CheckIt()
local cArray := FillArray(), aInfo
if Fddig1( 0 ) < 7
MsgAlert( "No Key drive in the USB port!" )
return 0
endif
Accdd1( cArray )
aInfo = GetValues( cArray )
MsgInfo( aInfo[ 1 ], "LicType" )
MsgInfo( aInfo[ 2 ], "TokenId1" )
MsgInfo( aInfo[ 3 ], "TokenId3" )
return nil
DLL FUNCTION ACCDD1( pValues AS LPSTR ) AS VOID PASCAL ;
FROM "Accdd1" LIB "Aas973.dll"
DLL FUNCTION FDDIG1( nVal AS LONG ) AS LONG PASCAL ;
FROM "Fddig1" LIB "Aas973.dll"
#pragma BEGINDUMP
#include <hbapi.h>
#include <windows.h>
static LONG accm[] = {
0,
0x...,
0x...,
0x...,
0x...,
0x...,
0x...,
0x...,
0x...,
0x...
};
HB_FUNC( FILLARRAY )
{
LONG acck[ 100 ];
LONG accNa, accUr;
int i;
srand( GetTickCount() );
accUr = rand();
for( i = 1; i < 100; i++ )
acck[ i ] = rand();
for( i = 1; i < 100; i++ )
accUr = acck[ ( acck[ i ] ^ ( accUr & 0x0ff ) ) % 99 ] ^ ( accUr >> 8 );
accUr = ( accm[ 6 ] ^ accUr ) & 0x0ffff;
hb_retclen( ( char * ) acck, 100 * sizeof( LONG ) );
}
HB_FUNC( GETVALUES )
{
LONG * acck = ( LONG * ) hb_parc( 1 );
LONG accr1, accr2, accr3, accr4;
LONG accNa, accUr;
LONG LicType, TokenId1, TokenId2;
BOOL OrigDrive;
accNa = ( acck[ 99 ] ^ accm[ 5 ] ) & 1061109567;
accr1 = accm[ 1 ] ^ acck[ LOBYTE( LOWORD( accNa ) ) ];
accr2 = accm[ 2 ] ^ acck[ HIBYTE( LOWORD( accNa ) ) ];
accr3 = accm[ 3 ] ^ acck[ LOBYTE( HIWORD( accNa ) ) ];
accr4 = accm[ 4 ] ^ acck[ HIBYTE( HIWORD( accNa ) ) ];
OrigDrive = accr4 == ( ( ( accr2 - ~accr1 / accUr ) ^ accr3 ) - accUr );
LicType = TokenId1 = TokenId2 = 0;
hb_reta( 3 );
if( OrigDrive )
{
LicType = acck[ 64 + ( HIBYTE( HIWORD( accNa ) ) % 35 ) ] ^ acck[ LOBYTE( LOWORD( accNa ) ) ];
if( LicType == ( accm[ 1 ] ^ accm[ 3 ] ^ accm[ 4 ] ^ accm[ 5 ] ) )
LicType = 1;
else
if( LicType == ( accm[ 1 ] ^ accm[ 2 ] ^ accm[ 4 ] ^ accm[ 5 ] ) )
LicType = 2;
else
LicType = 0;
TokenId1 = accm[ 7 ] ^ acck[ LOBYTE( LOWORD( accNa ) ) + 1 ];
TokenId2 = accm[ 8 ] ^ acck[ HIBYTE( LOWORD( accNa ) ) + 1 ];
hb_stornl( LicType, -1, 1 );
hb_stornl( TokenId1, -1, 2 );
hb_stornl( TokenId2, -1, 3 );
}
else
{
hb_stornl( 0, -1, 1 );
hb_stornl( 0, -1, 2 );
hb_stornl( 0, -1, 3 );
}
}
#pragma ENDDUMP
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 52 guests