FINALLY!I wrote my keygen in MASM using the UCR Standard Library (hope that's not cheating according to Laz's rules but I'm new to ASM programming and I'll take all the help I can get ;)
Source goes something like this:
.xlist
include stdlib.a
includelib stdlib.lib
.list .386
option segment:use16
dseg segment para public 'data'
pDWORD typedef far ptr dword
txtName byte 128 dup (?)
txtCompany byte 128 dup (?)
dwNumber dword ?
pNumber pDWORD dwNumber
bNameTable word 42,-21,12,-67,124,125,61,-59,-55,1,124
word -6,-44,104,-94,125
bCompanyTable word -22,20,43,63,87,-100,-16,124,13,14,-1,2
word 54,74,25,14
bCount word ?
dseg ends
cseg segment para public 'code'
assume cs:cseg, ds:dseg
Main proc
mov ax, dseg
mov ds, ax
mov es, ax
meminit
print
byte "This program will compute a serial number",cr,lf
byte "for Acoustica 2.0",cr,lf,lf
byte "Enter your name: ",0
lesi txtName
gets
print
byte "Enter your company name: ",0
lesi txtCompany
gets
xor eax, eax
xor ebx, ebx
xor ecx, ecx
xor esi, esi
start: mov cl, txtName[bx]
cmp cl, 0
je company
inc bx
mov bCount, bx
and bx, 15
add bx, bx
movsx eax, bNameTable[bx]
mul cx
add esi, eax
mov bx, bCount
jmp start
company: xor ebx, ebx
company2: mov cl, txtCompany[bx]
cmp cl, 0
je done
inc bx
mov bCount, bx
and bx, 15
add bx, bx
movsx eax, bCompanyTable[bx]
mul cx
add esi, eax
mov bx, bCount
jmp company2
done: mov eax, esi
mov ebx, 100000
xor edx, edx
div ebx
mov dwNumber, edx
printf
byte "Your serial: AC200-%\05ld",cr,lf,lf,0
dword dwNumber
Quit: ExitPgm
Main endp
cseg ends
sseg segment para stack 'stack'
stk byte 1024 dup ("stack ")
sseg ends
zzzzzzseg segment para public 'zzzzzz'
LastBytes byte 16 dup (?)
zzzzzzseg ends
end Main
I'm not gonna touch #3 :)
Good luck!
Thanks for a great project LaZ!!!!