manuganji,
Well, after searching some old backup CD's I found the numlock.com
program......and I was wrong......it was 8 bytes not 7. I won't be
able to get to my source for another 3 weeks. I'll send it to you
to view when I find it.
In the mean time, I wrote another program that logged each powerup
of a friends work computer so he could tell what time, and how many
times it had been powered up while he was gone. He disguised it as
a video driver being loaded.
Code:
;=============================================================================
DOSSEG
.MODEL TINY
.CODE
ORG 0100h ;this is a COM file
start:
jmp start2 ;jump over local data
;----------------------------------------------------------
; Declare the 32 bytes to be evaluated here...
;----------------------------------------------------------
DB 13 DUP (0)
BITES DB 40h ;original data to test for serial
DB 41h ;number - located at 110
DB 42h
DB 43h
DB 44h
DB 45h
DB 46h
DB 47h
DB 48h
DB 49h
DB 50h
DB 51h
DB 52h
DB 53h
DB 54h
DB 55h
DB 56h
DB 57h
DB 58h
DB 59h
DB 60h
DB 61h
DB 62h
DB 63h
DB 64h
DB 65h
DB 66h
DB 67h
DB 68h
DB 69h
DB 70h
DB 71h
DATA0 DB 32 DUP (0) ;first set is NOT so look at it -130
DATA1 DB 32 DUP (1) ;rotated data one bit - 150
DATA2 DB 32 DUP (2) ;rotated data two bits - 170
DATA3 DB 32 DUP (3) ;rotated data three bits - 190
DATA4 DB 32 DUP (4) ;rotated data four bits - 1B0
DATA5 DB 32 DUP (5) ;rotated data five bits - 1D0
DATA6 DB 32 DUP (6) ;rotated data six bits - 1F0
DATA7 DB 32 DUP (7) ;rotated data seven bits - 210
DATA8 DB 32 DUP (8) ;rotated data eitht bits - 230
JUNK DB 32 DUP (255) ;end of area to inspect - 250
NUMBYTES DW 32 ;32 data values
;=============================================================================
;----------------------------------------------------------
; Declare additional functions here...
;----------------------------------------------------------
; ---------------------------------------------------------------------
; This routine zeros the data areas.
; Entry: DI=destination CX=bytes to zero AX=0
; Exit: returns
; ---------------------------------------------------------------------
zerodata PROC NEAR
xor al, al ;zero register
mov cx, [NUMBYTES] ;do for 32 bytes
cld ;increment
rep stosb
RET
zerodata ENDP
; ---------------------------------------------------------------------
; This routine does a NOT on each byte then stores it in DATA 0.
; Entry: CX=number of bytes SI=source DATA1=destination
; Exit: returns
; ---------------------------------------------------------------------
PNOT PROC NEAR
donot:
lodsb ;get byte pointed to by SI
not al ;invert all bits
stosb ;store them for now
loop donot ;do all 32 bytes
RET
PNOT ENDP
; ---------------------------------------------------------------------
; This routine rotates each byte left by one bit.
; Entry: CX=number of bytes SI=source DATA1 thru 8=destination
; Exit: returns
; ---------------------------------------------------------------------
PROL PROC NEAR
dorol:
lodsb ;get byte pointed to by SI
rol al,1 ;invert all bits
stosb ;store them for now
loop dorol ;do all 32 bytes
RET
PROL ENDP
start2:
;----------------------------------------------------------
; Code for MAIN goes here...
;----------------------------------------------------------
push cs ;make CS=DS=ES
push cs
pop ds
pop es
; mov cx, [NUMBYTES]
; mov di, offset DATA0 ;zero data area 0
; call zerodata
; mov cx, [NUMBYTES]
; mov di,offset DATA1 ;zero data area 1
; call zerodata
; mov cx, [NUMBYTES]
; mov di,offset DATA2 ;zero data area 2
; call zerodata
; mov cx, [NUMBYTES]
; mov di,offset DATA3 ;zero data area 3
; call zerodata
; mov cx, [NUMBYTES]
; mov di,offset DATA4 ;zero data area 4
; call zerodata
; mov cx, [NUMBYTES]
; mov di,offset DATA5 ;zero data area 5
; call zerodata
; mov cx, [NUMBYTES]
; mov di,offset DATA6 ;zero data area 6
; call zerodata
; mov cx, [NUMBYTES]
; mov di,offset DATA7 ;zero data area 7
; call zerodata
; mov cx, [NUMBYTES]
; mov di,offset DATA8 ;zero data area 8
; call zerodata
mov cx, [NUMBYTES] ;try NOT data bytes
mov si, offset BITES ;source
mov di, offset DATA0 ;destination
call pnot ;NOT all bits
mov cx, [NUMBYTES] ;try shift left data bytes
mov si, offset BITES ;source
mov di, offset DATA1 ;destination
call prol ;TIMES 1 BIT 1
mov cx, [NUMBYTES] ;try shift left data bytes
mov si, offset BITES ;source
mov di, offset DATA2 ;destination
call prol ;TIMES 2 BIT 2
mov cx, [NUMBYTES] ;try shift left data bytes
mov si, offset BITES ;source
mov di, offset DATA3 ;destination
call prol ;TIMES 4 BIT 3
mov cx, [NUMBYTES] ;try shift left data bytes
mov si, offset BITES ;source
mov di, offset DATA4 ;destination
call prol ;TIMES 8 BIT 4
mov cx, [NUMBYTES] ;try shift left data bytes
mov si, offset BITES ;source
mov di, offset DATA5 ;destination
call prol ;TIMES 16 BIT 5
mov cx, [NUMBYTES] ;try shift left data bytes
mov si, offset BITES ;source
mov di, offset DATA6 ;destination
call prol ;TIMES 32 BIT 6
mov cx, [NUMBYTES] ;try shift left data bytes
mov si, offset BITES ;source
mov di, offset DATA7 ;destination
call prol ;TIMES 64 BIT 7
mov cx, [NUMBYTES] ;try shift left data bytes
mov si, offset BITES ;source
mov di, offset DATA8 ;destination
call prol ;TIMES 128 BIT 8
mov ah,04ch ;normal exit
mov al,0
int 21h
END start
and here was the batch file to assemble/link it.
Code:
erase logpwrup.com
erase logpwrup.exe
erase logpwrup.bak
d:\turboc\tasm /zi logpwrup
d:\turboc\tlink /v /l /x logpwrup
td logpwrup
As you can tell I used tasm versus MASM, but they worked the same.
Now you can play.
Documentation:
Code:
LOGPWRUP
PURPOSE: LOGPWRUP will save the DATE and TIME of system power up
in a text file that is specified from the command line.
This file can be placed anywhere on your hard disk as
long as the specified path exists.
LOADING: Run LOGPWRUP from within your AUTOEXEC.BAT file to store
SYSTEM RESETS or POWER UP conditions.
LOGPWRUP C:\PATHA\PATHB\PATHC\POWERUP.LOG
DATE and TIME will be saved to Drive C, PathA,
PathB, PATHC in POWERUP.LOG
If you want to get sneaky and try to disguise what this
program is doing just rename the LOGPWRUP.EXE file to
SETVIDEO.COM and use the following command within your
AUTOEXEC.BAT file.
SETVIDEO C:\PATHA\PATHB\PATHC\EGA.DRV
Most folks will assume that an EGA Driver is being loaded
by not knowing what the program really does.
NOTE: LOGPWRUP will not create any subdirectories on
your drive, so they must exist when the program
is executed. It will not log any WARM BOOTS, but
can be easily modified to log these if they are
needed.
lkraemer
Bookmarks