|
从网上找了段汇编码,请问这是ARM的吗?这么嵌入VS2005使用?
comment *
rc4_setkey proto :DWORD, :DWORD
rc4_crypt proto :DWORD, :DWORD
.data?
rc4keytable db 256 dup(?)
.code
rc4_setkey proc ptrInkey:DWORD, ptrInkey_length:DWORD
xor ebx,ebx
@_r1:
mov [rc4keytable+ebx],bl
inc ebx
cmp ebx,256
jnz @_r1
mov esi,ptrInkey
xor eax,eax
xor ebx,ebx
xor ecx,ecx
xor edi,edi
@_r3:
mov al,[rc4keytable+ecx]
add bl,byte ptr [esi+edi]
add bl,al
mov dl,[rc4keytable+ebx]
mov [rc4keytable+ecx],dl
mov [rc4keytable+ebx],al
inc edi
cmp edi,ptrInkey_length
jl @_r2
xor edi,edi
@_r2:
inc ecx
cmp ecx,256
jnz @_r3
ret
rc4_setkey endp
rc4_crypt proc ptrIndata:DWORD, ptrIndata_length:DWORD
xor eax,eax
xor ebx,ebx
xor edi,edi
xor edx,edx
mov esi,ptrIndata
@_r1:
mov cl,[rc4keytable+1+eax]
add dl,cl
mov bl,[rc4keytable+edx]
mov [rc4keytable+edx],cl
add bl,cl
mov bl,[rc4keytable+ebx]
xor [esi+edi],bl
inc eax
inc edi
cmp ptrIndata_length,edi
jnz @_r1
ret
rc4_crypt endp
|
|