📄 sgasm.asm
字号:
.386
donnees segment para public use16
PName dw 0
SName db 12 dup (0)
EnterN db 13,10,'KeyGenerator for SoundGadgetPro v1.2.4 by PcNinJa[99]'
db 13,10,13,10,'Enter Registeration Name (6 chars min): $'
TooShort db 13,10,'Name must be 6 chars long at least',13,10,'$'
NFound db 13,10,'File SGPRO.EXE not found',13,10,'$'
RegKey db 13,10,'Registeration Key: $'
Rest1 db 0
FileN db 'SGPRO.EXE',0
Key db 0
BHex db 4 dup (0)
donnees ends
code segment para public use16
assume cs:code,ds:donnees
debut:
mov ax,donnees
mov ds,ax
mov ah,09h
mov dx,offset EnterN
int 21h
mov byte ptr[offset PName],20h ; 32 chars max
xor ax,ax
mov ah,0ah
mov dx,offset PName
int 21h
cmp byte ptr[offset PName+1],6h
jae NameOK
mov ah,09h
mov dx,offset TooShort
int 21h
mov ax,4c00h
int 21h ; exit because name is too short
NameOK:
xor ax,ax
mov al,byte ptr[offset SName]
mov cl,15h
div cl
mov byte ptr[offset Rest1],ah
xor cx,cx
xor ax,ax
mov cl,byte ptr[offset Rest1]
mov al,byte ptr[offset Rest1]
add cx,cx ; cx = 2M
add cx,cx ; cx = 4M
add cx,cx ; cx = 8M
add cx,ax
add cx,ax
add cx,ax
add cx,ax
add cx,ax ; cx = 13M
mov ax,3d02h
mov dx,offset FileN
int 21h ; opening sgpro.exe
jb NotFound
jmp FileFound
NotFound:
mov ah,09h
mov dx,offset NFound
int 21h
mov ax,4c00h ; not found -> exit
int 21h
FileFound:
xchg ax,bx
mov ax,4200h
mov dx,35d8h
add dx,cx
mov cx,3
int 21h
mov ah,3fh
mov cx,1
mov dx,offset Key
int 21h ; reading good XOR KEY
mov ah,3eh
int 21h ; closing the file
;::::::::::::::::::::::::::::::::::::::::::::::::::
mov ah,09h
mov dx,offset RegKey
int 21h ; "Registration key: "
mov ax,0dh
call AffByteHex
xor cx,cx
mov cl,byte ptr[PName+1] ; cx = name size
sub cx,1
mov dx,1
FindCode:
xor ax,ax
mov al,byte ptr[offset Key]
mov bp,dx
xor al,byte ptr[offset SName+bp]
call AffByteHex
add dx,2
cmp dx,cx
ja Fin
jmp FindCode
;:::::::::::::::::::::::::::::::::::::::::::::::::::
Fin:
mov ax,4c00h
int 21h
AffByteHex proc near
; display the byte in AL
push dx
mov ah,0h
mov dl,10h
div dl
cmp al,9
ja Lettre
add al,'0'
jmp D1
Lettre:
add al,037h
D1:
mov byte ptr[offset BHex],al
cmp ah,9
ja Lettre2
add ah,'0'
jmp D2
Lettre2:
add ah,037h
D2:
mov byte ptr[offset BHex+1],ah
mov byte ptr[offset BHex+2],'$'
mov dx,offset BHex
mov ax,0900h
int 21h
pop dx
ret
endp
code ends
pile segment para stack use16 'stack'
db 2048 dup(?)
pile ends
end debut
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -