Quote(18:54:49) [x86] iago: cdkeys are actually 14 characters, though
(18:54:50) [x86] iago: 0..13
(18:55:04) JoeTheOdd (ICQ): their 14 characters?
(18:55:04) [x86] iago: but it's doing a checksum of 0..12
(18:55:06) [x86] iago: yes
(18:55:13) [x86] iago: I think?
(18:55:20) JoeTheOdd (ICQ): grabs sc case
(18:55:28) JoeTheOdd (ICQ): 4, 5, 4
(18:55:32) JoeTheOdd (ICQ): 13 chars
(18:55:35) [x86] iago: ok shush
(18:55:38) JoeTheOdd (ICQ): :P
(18:55:40) [x86] iago: no proving me wrong
(18:55:43) [x86] iago: I was thinking 5-4-5
(18:55:44) JoeTheOdd (ICQ): I BEAT IAGO!
(18:55:47) [x86] iago: You win this roudn!
(18:55:50) [x86] iago: round*
We were discussing the ASM version of the SC key-checking method on install.
SHUT UP
Yes, Mr. 14.
IAGO SUCKLES LITTLE MONKEY MEN ON THE BEACH IN WALES
Look what I reverse-engineered today mommy!
Public Function VerifySCkey(key As String) As Boolean
Dim eax As Integer, _
ebx As Integer, _
ecx As Integer, _
edx As Integer, _
esp As Integer, _
ebp As Integer, _
edi As Integer, _
esi As Integer
eax = 3 'mov eax, 3
esi = 1 'mov esi, ecx ;set esi = ecx (pointer to CD-Key)
ecx = 0 'xor ecx, ecx
Top: 'Top:
edx = Mid(key, esi, 1) 'movsx edx, byte ptr [ecx+esi] ;moves first number of cd-key to edx
edx = edx = &H30 'sub edx, 30h
edi = eax * 2 'lea edi, [eax+eax]
edx = edx Xor edi 'xor edx, edi
eax = eax + edx 'add eax, edx
ecx = ecx + 1 'inc ecx
If ecx < &HC Then GoTo Top 'cmp ecx, 0Ch
'jl short Top
edx = 0 'xor edx, edx
ecx = &HA 'mov ecx, 0Ah
edx = eax Mod ecx 'div ecx ;edx = eax % ecx (eax = checksum, ecx = 10)
eax = Mid(key, 13, 1) 'movsx eax, byte ptr [esi+0Ch] ;eax = last num of key
'18 movsx edx, dl ;"this line does nothing" -iago
edx = edx + &H30 'add edx, 30h (see line 6)
If eax <> edx Then eax = 0
VerifySCkey = CBool(eax)
'20 cmp eax, edx ;compare eax to eax (eax = last num of key, edx = result of checksum mod 10)
'21 jnz bottom ;if not equal jump to bottom
'22 mov eax, 1 ;if we didn't jump, set eax to 1
'23 ret ;return eax
End Function
...
wth does the code mean?
Look at the name of the function, knob ;)
Or a bunch of the comments he added.
me = confused. ???me just sees a bunch of ecx edx or w/e that make no sense.
nvm now i get it.
Those are variables :P
Quote from: iago on March 13, 2005, 06:01:13 PM
Those are variables :P
But they are registers in assembly :P
I said "in assemly".
It didn't work, yago. :(. It always says my key is invalid. People go and fix my code kthx.