?? idg2.asm
字號:
; In-Depth Guitar v2.0 Key Generator
; By CrackZ (24/02/99).
; Use tasm /zi idg2.asm and then tlink /v idg2
; to generate idg2.exe.
; Simplistic scheme.
; Uppercase user name, add together all letter values, omit the spaces,
; multiply result by 88D8h (35072 dec), then insert hyphens xxx-xxxx-xx.
.MODEL SMALL
.STACK 100h
.386
.DATA
input DB 1Eh,0 ; Max 30 for name length
prompt DB 'Input your Registration Name (min. 1 letter): ','$'
done DB 'Your Registration No. is: ','$'
lf DB 0ah,0dh,'$'
logo DB 0ah,0dh, '------------------------------------',0ah,0dh
DB ' In-Depth Guitar v2.0 Key Generator ',0ah,0dh
DB ' By CrackZ (24/02/99) ',0ah,0dh
DB '------------------------------------',0ah,0dh
DB 0ah,0dh,'$'
.CODE
START: MOV AX,@DATA
MOV DS,AX
MOV ES,AX
LEA EDX,[logo]
MOV AH,09h
INT 21h ;Display Logo.
LEA EDX,[prompt]
MOV AH,09h
INT 21h ;Prompt.
LEA EDX,[input]
MOV AH,0Ah
INT 21h ;Get registration name.
LEA EDI,input+2
MOVZX EBX, BYTE PTR [EDI-1] ;Name length in EBX.
CMP BX,1h ;Check its at least 1.
JB endprg ;Too short, gracefully exit.
JMP inits ;Else do calculation routine.
inits: XOR AX,AX
XOR CX,CX ;Clear some registers.
PUSH BX ;And push the namelength on the stack.
uppercasename:
MOVZX ECX, BYTE PTR [EDI] ;Name pointer.
CALL toupper ;UPPERCASE.
ADD EAX,ECX ;Add to EAX.
MOV BYTE PTR [EDI],CL
INC DI ;Shift store.
DEC BX
JNZ uppercasename
docalc: IMUL EAX,088D8h
MOV CX,0Ah ;Move CX to 10 for output routine.
POP BX ;Name length.
SUB DI,BX ;Reset DI.
XOR BX,BX ;Clear BX.
out0: XOR EDX,EDX
DIV ECX
ADD EDX,30h
PUSH EDX
INC EBX
TEST EAX,EAX
JNZ out0
out1: POP EDX ;Get character from the stack.
MOV BYTE PTR [EDI+EAX],DL
INC EAX
CMP AX,3h
JZ addhyphen
CMP AX,7h
JZ addhyphen
JMP out2
out2: TEST EBX,EBX
DEC EBX ;Decrement counter.
JNZ out1
CALL fixups
SUB DI,2h
JMP final
;----------Functions Section----------
addhyphen:
MOV BYTE PTR [EDI+EAX], 2Dh ;Add hyphen.
INC DI ;Now increment the store.
JMP out2
fixups: CMP AX,9h
JGE fixend1
JMP fixend2
fixend1:
MOV BYTE PTR [EDI+EAX],'$' ;End char.
RET
fixend2:
MOV CX,AX ;Store actual length in CX.
MOV BX,9h
SUB BX,CX ;BX holds how many to add.
fix2loop:
MOV BYTE PTR [EAX+EDI],30h ;Add 0's as required.
INC AX
DEC BX
TEST BX,BX
JNZ fix2loop
MOV BYTE PTR [EDI+EAX],'$'
RET
toupper:
CMP CL,20h
JZ toupspace
CMP CL,61h
JL toupreturn
CMP CL,7Ah
JG toupreturn
SUB CL,20h
RET
toupreturn:
RET
toupspace:
XOR CX,CX
RET
final: LEA EDX,[lf]
MOV AH,09h
INT 21h ;Linefeed.
LEA EDX,[done]
MOV AH,09h
INT 21h
LEA EDX,[EDI]
MOV AH,09h
INT 21h
endprg: LEA EDX,[lf]
MOV AH,09h
INT 21h
MOV AX,4C00h
INT 21h
END START
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -