home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
back2roots/padua
/
padua.7z
/
padua
/
ftp.vapor.com
/
microdot-1
/
md1_src_02.lzx
/
directmakekey.c
< prev
next >
Wrap
C/C++ Source or Header
|
2014-05-19
|
515b
|
33 lines
int main( void )
{
long maillen,headoffs;
void *mailbuf;
BPTR f;
ULONG decodedkey[256], chk = 0;
int keylen, longlen;
int c;
f = Open( "key", MODE_OLDFILE );
if( !f )
return( 10 );
keylen = Read( f, decodedkey, 4096 );
Close( f );
longlen = decodedkey[7];
decodedkey[9] = NULL;
for( c = 0; c < longlen; c++ )
chk += decodedkey[ 8 + c ];
decodedkey[9] = -chk;
/* Extrahieren */
f=Open("ram:microdot.key",MODE_NEWFILE);
if(f)
{
Write(f,decodedkey,keylen);
Close(f);
}
return( 0 );
}