📄 ctmailer.asm
字号:
; CTMailer v1.55 Key Generator
; CrackZ (20/12/98).
; Use tasm /zi ctmailer.asm and then tlink /v ctmailer
; to generate ctmailer.exe
.MODEL SMALL
.STACK 100h
.386
.DATA
fill DB 12h dup (' ')
input DB 20h,0 ; Max 30.
prompt DB 'Input your Registration Name (min 1 char): ','$'
done DB 'Your Registration Code is: ','$'
lf DB 0ah,0dh,'$'
logo DB 0ah,0dh, '------------------------------',0ah,0dh
DB ' CTMailer v1.55 Key Generator ',0ah,0dh
DB ' by CrackZ ',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 EDX,[lf]
MOV AH,09h
INT 21h ;Linefeed.
XOR EAX,EAX
XOR EBX,EBX
XOR ECX,ECX
XOR EDX,EDX
XOR EDI,EDI
XOR ESI,ESI
XOR EBP,EBP ;Clear all available registers.
LEA ESI,input+2 ;Name in ESI.
MOVZX EBX, BYTE PTR [ESI-01] ;Length in EBX.
MOV EBP,0B0Fh ;CTMAILER default value.
begin: MOVSX ECX, BYTE PTR [ESI+EDI] ;Use EDI as loop control.
CALL toupper
MOV EDX,ECX
AND EDX, 80000001h
JNS nsign1
DEC EDX
OR EDX,0FFFFFFFEh
INC EDX
nsign1: JNZ nzero1
LEA EAX, [ECX+4*ECX+0Ah]
LEA EBP, [EBP+2*EAX]
JMP nxtchar
nzero1: ADD EBP,ECX
JMP nxtchar
nxtchar:
INC EDI ;Name pointer.
DEC EBX ;Decrement length.
TEST EBX,EBX ;Check.
JNZ begin
;We'll just do some preparations here.
PUSH EBP ;Save first value on stack.
MOV EBP,EDI ;Store length in EBP.
XOR EDI,EDI ;EDI=0.
MOV EBX,0F0Ch ;CTMAILER default value.
JMP part2 ;Now the 2nd stage.
toupper:
CMP ECX,61h
JL return
CMP ECX,7Ah
JG return
SUB ECX,20h
RET
return: RET
; Stage 2 (EBP holds the first of our key values, EBX will hold the 2nd).
part2: MOVSX ECX, BYTE PTR [ESI+EDI] ;Use EDI as loop control.
CALL toupper
MOV EAX,ECX
MOV EDX,ECX
AND ECX,80000001h
JNS nsign2
DEC ECX
OR ECX,0FFFFFFFEh
INC ECX
nsign2: JNZ nzero2
ADD EBX,EDX
JMP nxtchar2
nzero2: LEA EDX, [EAX+4*EAX+0Ah]
LEA EBX, [EBX+2*EDX]
JMP nxtchar2
nxtchar2:
INC EDI ;Increment name pointer.
DEC EBP ;Decrement length.
TEST EBP,EBP
JNZ part2
POP EBP ;Restore 1st value.
CMP EBX,EBP
JL p3mv1
JMP p3mv2
p3mv1: MOV EAX,EBP
SUB EAX,EBX
JMP part3
p3mv2: MOV EAX,EBX
SUB EAX,EBP
JMP part3
part3: ADD EAX,64h
MOV EDI,EBX ;Store 2nd.
PUSH EAX
MOV EAX,EBP
POP EBP
XOR EBX,EBX
LEA EBX,[fill]
XOR EBX,EBX
XOR ESI,ESI ;Track code.
MOV ECX,0ah
JMP final1
final1: CALL output ;1st part.
MOV BYTE PTR [EAX],2Dh ;Add 1st hyphen.
MOV ESI,EAX ;Store length of 1st.
INC ESI ;Add the hyphen.
MOV EAX,EDI ;Prepare 2nd part.
CALL output ;2nd part.
ADD ESI,EAX ;Add length of 2nd code.
MOV BYTE PTR [ESI],2Dh ;2nd hyphen.
MOV EAX,EBP ;Get 3rd part.
INC ESI ;Increment store area.
CALL output ;Output 3rd.
ADD ESI,EAX ;Add the length of the 3rd part of the code.
JMP addend
; Now we are ready to output the string.
;-----Functions-----
output: XOR EDX,EDX
DIV ECX
ADD EDX,30h ;Add 30h.
PUSH EDX ;Stack it.
INC EBX ;Increment counter.
TEST EAX,EAX
JNZ output
XOR EDX,EDX
XOR EAX,EAX
@loop: POP EDX ;Get character from the stack.
MOV BYTE PTR [ESI+EAX],DL
INC EAX
TEST EBX,EBX
DEC EBX ;Decrement counter.
JNZ @loop
RET
addend: MOV BYTE PTR [ESI],'$' ;Paste end character to the registration code.
XOR DI,DI
XOR DX,DX
LEA EDX,[done]
MOV AH,09h
INT 21h ;"Your Registration Code is".
LEA EDX,[EDI]
MOV AH,09h
INT 21h ;Print registration code.
endprg: LEA EDX,[lf]
MOV AH,09h
INT 21h
MOV AX,4C00h
INT 21h
END START
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -