BBS: Inland Empire Archive
Date: 04-07-92 (09:32) Number: 94
From: MATT HART Refer#: NONE
To: RICHARD VANNOY Recvd: NO
Subj: A SHAREWARE TIMELOCK Conf: (2) Quik_Bas
RV> EXTERNAL: Methods that depend on something external to the
RV> program to set or determine the key.
RV> - Hidden files in the same, root, or some other
RV> - Programs that read characteristics (BIOS info, video
RV> type, etc.) of the hardware to develop a fingerprint
RV> that is unique to one machine, or a very small
RV> percentage of existing machines.
This routine will allow you to easily read the contents of memory:
; PRINTMEM.ASM Matt Hart
; Place the contents of memory into a string.
; DECLARE SUB PrintMem(Strg$, BYVAL Segment%, BYVAL Offset%)
; Set Strg$ = SPACE$(NumBytesToRead)
PrintMem PROC USES DS ES SI DI, Strg:Word, SegNum:Word, OffNum:Word
MOV AX,SegNum ; Segment into AX
MOV SI,OffNum ; Offset into SI
MOV BX,Strg ; Addr of Strg Descriptor into BX
MOV DI,[BX+2] ; Addr of Strg's first byte into DI
MOV CX,[BX] ; Length of Strg into CX
MOV DX,DS ; DS into DX - can't do MOV ES,DS directly
MOV ES,DX ; ES:DI is now destination
MOV DS,AX ; DS:SI is now source, CX has num bytes
REP MOVSB ; Move DS:SI into ES:DI for CX times
RET ; Back to BASIC
Now, to develop a fingerprint of the machine, read in
information from upper memory:
Strg$ = SPACE$(16384)
Segment = 64
Offset = 0
CALL PrintMem(Strg$,BYVAL Segment,BYVAL Offset)
To verify, read it back in, then:
OldStrg$ = SPACE$(16384)
IF OldStrg$ <> NewStrg$ THEN PRINT "Not the same machine!!!"
Strg$ = "" : OdlStrg$ = ""
* Origin: Midnight Micro! V.32/REL (918)451-3306 (1:170/600)