Example 2b

From SkullSecurity
Revision as of 17:40, 17 November 2008 by Ron (talk | contribs)
Jump to navigation Jump to search
Stop hand.png This page is under construction. USE AT YOUR OWN RISK!

This is the third (and, basically, final) part of the Starcraft CDKey Decode. I'm going to present the code only, not the answer (although you can find the finished product around). This may cover things we haven't talked about (like a function call and local variables, for example).

As usual, esi is a pointer to the cdkey.

.text:1901B26C                 mov     [esp+6FCh+hashKey], 13AC9741h
.text:1901B274                 mov     ebx, 0Bh
.text:1901B279 loc_1901B279:                           ; CODE XREF: sub_1901AA30+887�j
.text:1901B279                 movsx   eax, byte ptr [ebx+esi]
.text:1901B27E                 push    eax             ; int
.text:1901B27F                 call    _toupper
.text:1901B284                 add     esp, 4
.text:1901B287                 cmp     al, 37h
.text:1901B289                 mov     byte ptr [ebx+esi], al
.text:1901B28D                 jg      short loc_1901B2A7
.text:1901B28F                 mov     ecx, [esp+6FCh+hashKey]
.text:1901B293                 mov     dl, cl
.text:1901B295                 and     dl, 7
.text:1901B298                 xor     dl, al
.text:1901B29A                 shr     ecx, 3
.text:1901B29D                 mov     byte ptr [ebx+esi], dl
.text:1901B2A1                 mov     [esp+6FCh+hashKey], ecx
.text:1901B2A5                 jmp     short loc_1901B2B6
.text:1901B2A7 ; ---------------------------------------------------------------------------
.text:1901B2A7 loc_1901B2A7:                           ; CODE XREF: sub_1901AA30+85D�j
.text:1901B2A7                 cmp     al, 41h
.text:1901B2A9                 jge     short loc_1901B2B6
.text:1901B2AB                 mov     cl, bl
.text:1901B2AD                 and     cl, 1
.text:1901B2B0                 xor     cl, al
.text:1901B2B2                 mov     byte ptr [esp+ebx+6FCh+cdkey], cl
.text:1901B2B6 loc_1901B2B6:                           ; CODE XREF: sub_1901AA30+875�j
.text:1901B2B6                                         ; sub_1901AA30+879�j
.text:1901B2B6                 dec     ebx
.text:1901B2B7                 jns     short loc_1901B279