Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Serial number
#1
you know the serial number u get when u type dir C:\ is there a way you can read it with qbasic. and then save it to the file
url=http://www.spreadfirefox.com/?q=affiliates&id=0&t=79][Image: safer.gif][/url]
Reply
#2
It's meant to be used as an executable with the drive letter specified after the command, e.g.,

DISKSER C

If you want it to output the serial number to a file, where I print out SER$ do something like

OPEN "FILENAME" FOR OUTPUT AS #1
PRINT#1,SER$
CLOSE#1

(When you run the program, if you don't want to change the serial number, just press Enter at the prompt for the new one.)



IF COMMAND$="" THEN END
TYPE REGISTERS
AX AS INTEGER
BX AS INTEGER
CX AS INTEGER
DX AS INTEGER
BP AS INTEGER
SI AS INTEGER
DI AS INTEGER
FLAGS AS INTEGER
DS AS INTEGER
ES AS INTEGER
END TYPE
DIM INREGS AS REGISTERS,OUTREGS AS REGISTERS,A(1 TO 13) AS INTEGER
DIM SM AS INTEGER,OS AS INTEGER
SM=VARSEG(A(1)) : OS=VARPTR(A(1))
INREGS.AX=&H6900
INREGS.BX=ASC(LEFT$(COMMAND$,1))-64
INREGS.DX=OS
INREGS.DS=SM
CALL INTERRUPTX(&H21,INREGS,OUTREGS)
DEF SEG=SM
DISKR$=HEX$(PEEK(OS+3))+HEX$(PEEK(OS+2))
13 IF LEN(DISKR$)<4 THEN DISKR$="0"+DISKR$ : GOTO 13
DISKL$=HEX$(PEEK(OS+5))+HEX$(PEEK(OS+4))
14 IF LEN(DISKL$)<4 THEN DISKL$="0"+DISKL$ : GOTO 14
SER$=DISKL$+"-"+DISKR$
PRINT
PRINT "Your current serial number is ";SER$;"."
PRINT
LINE INPUT "4 (hex) bytes in new serial number (separated by spaces)?";NEWSER$
IF NEWSER$<>"" THEN
CALL PARSE(NEWSER$," ",B1$,S$)
CALL PARSE(S$," ",B2$,S1$)
CALL PARSE(S1$," ",B3$,B4$)
POKE OS+5,VAL("&H"+B1$)
POKE OS+4,VAL("&H"+B2$)
POKE OS+3,VAL("&H"+B3$)
POKE OS+2,VAL("&H"+B4$)
INREGS.AX=&H6901
INREGS.BX=ASC(LEFT$(COMMAND$,1))-64
INREGS.DX=OS
INREGS.DS=SM
CALL INTERRUPTX(&H21,INREGS,OUTREGS)
END IF
END
SUB PARSE(S$,DL$,S1$,S2$)
DIM N AS INTEGER,I AS INTEGER
N=LEN(S$)
IF N=0 THEN GOTO TERM
S1$=S$
S2$=""
I=INSTR(S$,DL$)
IF I=0 THEN GOTO TERM
S1$=LTRIM$(RTRIM$(MID$(S$,1,I-1)))
S2$=LTRIM$(RTRIM$(MID$(S$,I+1,N-I)))
TERM:
END SUB
ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
Reply
#3
thanx
url=http://www.spreadfirefox.com/?q=affiliates&id=0&t=79][Image: safer.gif][/url]
Reply
#4
thanx
url=http://www.spreadfirefox.com/?q=affiliates&id=0&t=79][Image: safer.gif][/url]
Reply
#5
.
ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
Reply
#6
do i have to make up my own CALL INTERRUPTX
url=http://www.spreadfirefox.com/?q=affiliates&id=0&t=79][Image: safer.gif][/url]
Reply
#7
command-line and got "Subprogram undefined"? Smile Also, if you're going to run it from the interpreter, you need to set the COMMAND$ variable to your drive letter. (It's under the Run menu.)
ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)