答复
是gray码 谁要早提醒我一下就好了 网上一搜一大堆
偶也偶的贴出来,虽然写的很滥.
代码:
GetEdx proc;获取crackme里面那个edx
mov ecx,1Fh
cdq
mov eax,Codelen
idiv ecx
mov eax,UserCode
mov ecx,edx
xor edx,edx
shr eax,cl
mov ecx,0ah
div ecx
mov eax,edx
inc Codelen
ret
GetEdx endp
GetCode proc ;开始计算注册码
mov esi,offset lala
@@: or ecx,0FFFFFFFFH
mov edi,offset haha
mov eax,1
repne scasb
not ecx
dec ecx
push ecx
.if ecx>=9h
pop ecx
ret
.elseif ecx==8
pop ecx
mov edi,offset haha
jmp @1
.endif
mov edi,offset haha
xor byte ptr [edi+ecx+1],1h
call GetEdx
mov ebx,0ah
pop ecx
add ebx,ecx
add ebx,2
sub ebx,eax
.if ebx>=0ah
sub ebx,0ah
.endif
add ebx,30h
mov byte ptr [esi],bl
inc esi
@1: xor byte ptr [edi],1h
call GetEdx
mov ebx,0Bh
sub ebx,eax
.if ebx>=0ah
sub ebx,0ah
.endif
add ebx,30h
mov byte ptr [esi],bl
inc esi
jmp @B
ret
GetCode endp