Remove Win32 assembler files. They are always rebuilt (with some
choice of parameters) when they are needed.
This commit is contained in:
parent
863fe2ecac
commit
88f17a5e98
@ -1,906 +0,0 @@
|
|||||||
; Don't even think of reading this code
|
|
||||||
; It was automatically generated by bf-586.pl
|
|
||||||
; Which is a perl program used to generate the x86 assember for
|
|
||||||
; any of elf, a.out, BSDI,Win32, or Solaris
|
|
||||||
; eric <eay@cryptsoft.com>
|
|
||||||
;
|
|
||||||
TITLE bf-586.asm
|
|
||||||
.486
|
|
||||||
.model FLAT
|
|
||||||
_TEXT SEGMENT
|
|
||||||
PUBLIC _BF_encrypt
|
|
||||||
|
|
||||||
_BF_encrypt PROC NEAR
|
|
||||||
;
|
|
||||||
push ebp
|
|
||||||
push ebx
|
|
||||||
mov ebx, DWORD PTR 12[esp]
|
|
||||||
mov ebp, DWORD PTR 16[esp]
|
|
||||||
push esi
|
|
||||||
push edi
|
|
||||||
; Load the 2 words
|
|
||||||
mov edi, DWORD PTR [ebx]
|
|
||||||
mov esi, DWORD PTR 4[ebx]
|
|
||||||
xor eax, eax
|
|
||||||
mov ebx, DWORD PTR [ebp]
|
|
||||||
xor ecx, ecx
|
|
||||||
xor edi, ebx
|
|
||||||
;
|
|
||||||
; Round 0
|
|
||||||
mov edx, DWORD PTR 4[ebp]
|
|
||||||
mov ebx, edi
|
|
||||||
xor esi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, edi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor esi, ebx
|
|
||||||
;
|
|
||||||
; Round 1
|
|
||||||
mov edx, DWORD PTR 8[ebp]
|
|
||||||
mov ebx, esi
|
|
||||||
xor edi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, esi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor edi, ebx
|
|
||||||
;
|
|
||||||
; Round 2
|
|
||||||
mov edx, DWORD PTR 12[ebp]
|
|
||||||
mov ebx, edi
|
|
||||||
xor esi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, edi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor esi, ebx
|
|
||||||
;
|
|
||||||
; Round 3
|
|
||||||
mov edx, DWORD PTR 16[ebp]
|
|
||||||
mov ebx, esi
|
|
||||||
xor edi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, esi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor edi, ebx
|
|
||||||
;
|
|
||||||
; Round 4
|
|
||||||
mov edx, DWORD PTR 20[ebp]
|
|
||||||
mov ebx, edi
|
|
||||||
xor esi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, edi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor esi, ebx
|
|
||||||
;
|
|
||||||
; Round 5
|
|
||||||
mov edx, DWORD PTR 24[ebp]
|
|
||||||
mov ebx, esi
|
|
||||||
xor edi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, esi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor edi, ebx
|
|
||||||
;
|
|
||||||
; Round 6
|
|
||||||
mov edx, DWORD PTR 28[ebp]
|
|
||||||
mov ebx, edi
|
|
||||||
xor esi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, edi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor esi, ebx
|
|
||||||
;
|
|
||||||
; Round 7
|
|
||||||
mov edx, DWORD PTR 32[ebp]
|
|
||||||
mov ebx, esi
|
|
||||||
xor edi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, esi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor edi, ebx
|
|
||||||
;
|
|
||||||
; Round 8
|
|
||||||
mov edx, DWORD PTR 36[ebp]
|
|
||||||
mov ebx, edi
|
|
||||||
xor esi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, edi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor esi, ebx
|
|
||||||
;
|
|
||||||
; Round 9
|
|
||||||
mov edx, DWORD PTR 40[ebp]
|
|
||||||
mov ebx, esi
|
|
||||||
xor edi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, esi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor edi, ebx
|
|
||||||
;
|
|
||||||
; Round 10
|
|
||||||
mov edx, DWORD PTR 44[ebp]
|
|
||||||
mov ebx, edi
|
|
||||||
xor esi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, edi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor esi, ebx
|
|
||||||
;
|
|
||||||
; Round 11
|
|
||||||
mov edx, DWORD PTR 48[ebp]
|
|
||||||
mov ebx, esi
|
|
||||||
xor edi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, esi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor edi, ebx
|
|
||||||
;
|
|
||||||
; Round 12
|
|
||||||
mov edx, DWORD PTR 52[ebp]
|
|
||||||
mov ebx, edi
|
|
||||||
xor esi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, edi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor esi, ebx
|
|
||||||
;
|
|
||||||
; Round 13
|
|
||||||
mov edx, DWORD PTR 56[ebp]
|
|
||||||
mov ebx, esi
|
|
||||||
xor edi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, esi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor edi, ebx
|
|
||||||
;
|
|
||||||
; Round 14
|
|
||||||
mov edx, DWORD PTR 60[ebp]
|
|
||||||
mov ebx, edi
|
|
||||||
xor esi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, edi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor esi, ebx
|
|
||||||
;
|
|
||||||
; Round 15
|
|
||||||
mov edx, DWORD PTR 64[ebp]
|
|
||||||
mov ebx, esi
|
|
||||||
xor edi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, esi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
; Load parameter 0 (16) enc=1
|
|
||||||
mov eax, DWORD PTR 20[esp]
|
|
||||||
xor edi, ebx
|
|
||||||
mov edx, DWORD PTR 68[ebp]
|
|
||||||
xor esi, edx
|
|
||||||
mov DWORD PTR 4[eax],edi
|
|
||||||
mov DWORD PTR [eax],esi
|
|
||||||
pop edi
|
|
||||||
pop esi
|
|
||||||
pop ebx
|
|
||||||
pop ebp
|
|
||||||
ret
|
|
||||||
_BF_encrypt ENDP
|
|
||||||
_TEXT ENDS
|
|
||||||
_TEXT SEGMENT
|
|
||||||
PUBLIC _BF_decrypt
|
|
||||||
|
|
||||||
_BF_decrypt PROC NEAR
|
|
||||||
;
|
|
||||||
push ebp
|
|
||||||
push ebx
|
|
||||||
mov ebx, DWORD PTR 12[esp]
|
|
||||||
mov ebp, DWORD PTR 16[esp]
|
|
||||||
push esi
|
|
||||||
push edi
|
|
||||||
; Load the 2 words
|
|
||||||
mov edi, DWORD PTR [ebx]
|
|
||||||
mov esi, DWORD PTR 4[ebx]
|
|
||||||
xor eax, eax
|
|
||||||
mov ebx, DWORD PTR 68[ebp]
|
|
||||||
xor ecx, ecx
|
|
||||||
xor edi, ebx
|
|
||||||
;
|
|
||||||
; Round 16
|
|
||||||
mov edx, DWORD PTR 64[ebp]
|
|
||||||
mov ebx, edi
|
|
||||||
xor esi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, edi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor esi, ebx
|
|
||||||
;
|
|
||||||
; Round 15
|
|
||||||
mov edx, DWORD PTR 60[ebp]
|
|
||||||
mov ebx, esi
|
|
||||||
xor edi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, esi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor edi, ebx
|
|
||||||
;
|
|
||||||
; Round 14
|
|
||||||
mov edx, DWORD PTR 56[ebp]
|
|
||||||
mov ebx, edi
|
|
||||||
xor esi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, edi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor esi, ebx
|
|
||||||
;
|
|
||||||
; Round 13
|
|
||||||
mov edx, DWORD PTR 52[ebp]
|
|
||||||
mov ebx, esi
|
|
||||||
xor edi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, esi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor edi, ebx
|
|
||||||
;
|
|
||||||
; Round 12
|
|
||||||
mov edx, DWORD PTR 48[ebp]
|
|
||||||
mov ebx, edi
|
|
||||||
xor esi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, edi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor esi, ebx
|
|
||||||
;
|
|
||||||
; Round 11
|
|
||||||
mov edx, DWORD PTR 44[ebp]
|
|
||||||
mov ebx, esi
|
|
||||||
xor edi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, esi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor edi, ebx
|
|
||||||
;
|
|
||||||
; Round 10
|
|
||||||
mov edx, DWORD PTR 40[ebp]
|
|
||||||
mov ebx, edi
|
|
||||||
xor esi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, edi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor esi, ebx
|
|
||||||
;
|
|
||||||
; Round 9
|
|
||||||
mov edx, DWORD PTR 36[ebp]
|
|
||||||
mov ebx, esi
|
|
||||||
xor edi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, esi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor edi, ebx
|
|
||||||
;
|
|
||||||
; Round 8
|
|
||||||
mov edx, DWORD PTR 32[ebp]
|
|
||||||
mov ebx, edi
|
|
||||||
xor esi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, edi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor esi, ebx
|
|
||||||
;
|
|
||||||
; Round 7
|
|
||||||
mov edx, DWORD PTR 28[ebp]
|
|
||||||
mov ebx, esi
|
|
||||||
xor edi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, esi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor edi, ebx
|
|
||||||
;
|
|
||||||
; Round 6
|
|
||||||
mov edx, DWORD PTR 24[ebp]
|
|
||||||
mov ebx, edi
|
|
||||||
xor esi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, edi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor esi, ebx
|
|
||||||
;
|
|
||||||
; Round 5
|
|
||||||
mov edx, DWORD PTR 20[ebp]
|
|
||||||
mov ebx, esi
|
|
||||||
xor edi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, esi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor edi, ebx
|
|
||||||
;
|
|
||||||
; Round 4
|
|
||||||
mov edx, DWORD PTR 16[ebp]
|
|
||||||
mov ebx, edi
|
|
||||||
xor esi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, edi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor esi, ebx
|
|
||||||
;
|
|
||||||
; Round 3
|
|
||||||
mov edx, DWORD PTR 12[ebp]
|
|
||||||
mov ebx, esi
|
|
||||||
xor edi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, esi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor edi, ebx
|
|
||||||
;
|
|
||||||
; Round 2
|
|
||||||
mov edx, DWORD PTR 8[ebp]
|
|
||||||
mov ebx, edi
|
|
||||||
xor esi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, edi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
xor eax, eax
|
|
||||||
xor esi, ebx
|
|
||||||
;
|
|
||||||
; Round 1
|
|
||||||
mov edx, DWORD PTR 4[ebp]
|
|
||||||
mov ebx, esi
|
|
||||||
xor edi, edx
|
|
||||||
shr ebx, 16
|
|
||||||
mov edx, esi
|
|
||||||
mov al, bh
|
|
||||||
and ebx, 255
|
|
||||||
mov cl, dh
|
|
||||||
and edx, 255
|
|
||||||
mov eax, DWORD PTR 72[eax*4+ebp]
|
|
||||||
mov ebx, DWORD PTR 1096[ebx*4+ebp]
|
|
||||||
add ebx, eax
|
|
||||||
mov eax, DWORD PTR 2120[ecx*4+ebp]
|
|
||||||
xor ebx, eax
|
|
||||||
mov edx, DWORD PTR 3144[edx*4+ebp]
|
|
||||||
add ebx, edx
|
|
||||||
; Load parameter 0 (1) enc=0
|
|
||||||
mov eax, DWORD PTR 20[esp]
|
|
||||||
xor edi, ebx
|
|
||||||
mov edx, DWORD PTR [ebp]
|
|
||||||
xor esi, edx
|
|
||||||
mov DWORD PTR 4[eax],edi
|
|
||||||
mov DWORD PTR [eax],esi
|
|
||||||
pop edi
|
|
||||||
pop esi
|
|
||||||
pop ebx
|
|
||||||
pop ebp
|
|
||||||
ret
|
|
||||||
_BF_decrypt ENDP
|
|
||||||
_TEXT ENDS
|
|
||||||
_TEXT SEGMENT
|
|
||||||
PUBLIC _BF_cbc_encrypt
|
|
||||||
|
|
||||||
_BF_cbc_encrypt PROC NEAR
|
|
||||||
;
|
|
||||||
push ebp
|
|
||||||
push ebx
|
|
||||||
push esi
|
|
||||||
push edi
|
|
||||||
mov ebp, DWORD PTR 28[esp]
|
|
||||||
; getting iv ptr from parameter 4
|
|
||||||
mov ebx, DWORD PTR 36[esp]
|
|
||||||
mov esi, DWORD PTR [ebx]
|
|
||||||
mov edi, DWORD PTR 4[ebx]
|
|
||||||
push edi
|
|
||||||
push esi
|
|
||||||
push edi
|
|
||||||
push esi
|
|
||||||
mov ebx, esp
|
|
||||||
mov esi, DWORD PTR 36[esp]
|
|
||||||
mov edi, DWORD PTR 40[esp]
|
|
||||||
; getting encrypt flag from parameter 5
|
|
||||||
mov ecx, DWORD PTR 56[esp]
|
|
||||||
; get and push parameter 3
|
|
||||||
mov eax, DWORD PTR 48[esp]
|
|
||||||
push eax
|
|
||||||
push ebx
|
|
||||||
cmp ecx, 0
|
|
||||||
jz $L000decrypt
|
|
||||||
and ebp, 4294967288
|
|
||||||
mov eax, DWORD PTR 8[esp]
|
|
||||||
mov ebx, DWORD PTR 12[esp]
|
|
||||||
jz $L001encrypt_finish
|
|
||||||
L002encrypt_loop:
|
|
||||||
mov ecx, DWORD PTR [esi]
|
|
||||||
mov edx, DWORD PTR 4[esi]
|
|
||||||
xor eax, ecx
|
|
||||||
xor ebx, edx
|
|
||||||
bswap eax
|
|
||||||
bswap ebx
|
|
||||||
mov DWORD PTR 8[esp],eax
|
|
||||||
mov DWORD PTR 12[esp],ebx
|
|
||||||
call _BF_encrypt
|
|
||||||
mov eax, DWORD PTR 8[esp]
|
|
||||||
mov ebx, DWORD PTR 12[esp]
|
|
||||||
bswap eax
|
|
||||||
bswap ebx
|
|
||||||
mov DWORD PTR [edi],eax
|
|
||||||
mov DWORD PTR 4[edi],ebx
|
|
||||||
add esi, 8
|
|
||||||
add edi, 8
|
|
||||||
sub ebp, 8
|
|
||||||
jnz L002encrypt_loop
|
|
||||||
$L001encrypt_finish:
|
|
||||||
mov ebp, DWORD PTR 52[esp]
|
|
||||||
and ebp, 7
|
|
||||||
jz $L003finish
|
|
||||||
xor ecx, ecx
|
|
||||||
xor edx, edx
|
|
||||||
mov ebp, DWORD PTR $L004cbc_enc_jmp_table[ebp*4]
|
|
||||||
jmp ebp
|
|
||||||
L005ej7:
|
|
||||||
mov dh, BYTE PTR 6[esi]
|
|
||||||
shl edx, 8
|
|
||||||
L006ej6:
|
|
||||||
mov dh, BYTE PTR 5[esi]
|
|
||||||
L007ej5:
|
|
||||||
mov dl, BYTE PTR 4[esi]
|
|
||||||
L008ej4:
|
|
||||||
mov ecx, DWORD PTR [esi]
|
|
||||||
jmp $L009ejend
|
|
||||||
L010ej3:
|
|
||||||
mov ch, BYTE PTR 2[esi]
|
|
||||||
shl ecx, 8
|
|
||||||
L011ej2:
|
|
||||||
mov ch, BYTE PTR 1[esi]
|
|
||||||
L012ej1:
|
|
||||||
mov cl, BYTE PTR [esi]
|
|
||||||
$L009ejend:
|
|
||||||
xor eax, ecx
|
|
||||||
xor ebx, edx
|
|
||||||
bswap eax
|
|
||||||
bswap ebx
|
|
||||||
mov DWORD PTR 8[esp],eax
|
|
||||||
mov DWORD PTR 12[esp],ebx
|
|
||||||
call _BF_encrypt
|
|
||||||
mov eax, DWORD PTR 8[esp]
|
|
||||||
mov ebx, DWORD PTR 12[esp]
|
|
||||||
bswap eax
|
|
||||||
bswap ebx
|
|
||||||
mov DWORD PTR [edi],eax
|
|
||||||
mov DWORD PTR 4[edi],ebx
|
|
||||||
jmp $L003finish
|
|
||||||
$L000decrypt:
|
|
||||||
and ebp, 4294967288
|
|
||||||
mov eax, DWORD PTR 16[esp]
|
|
||||||
mov ebx, DWORD PTR 20[esp]
|
|
||||||
jz $L013decrypt_finish
|
|
||||||
L014decrypt_loop:
|
|
||||||
mov eax, DWORD PTR [esi]
|
|
||||||
mov ebx, DWORD PTR 4[esi]
|
|
||||||
bswap eax
|
|
||||||
bswap ebx
|
|
||||||
mov DWORD PTR 8[esp],eax
|
|
||||||
mov DWORD PTR 12[esp],ebx
|
|
||||||
call _BF_decrypt
|
|
||||||
mov eax, DWORD PTR 8[esp]
|
|
||||||
mov ebx, DWORD PTR 12[esp]
|
|
||||||
bswap eax
|
|
||||||
bswap ebx
|
|
||||||
mov ecx, DWORD PTR 16[esp]
|
|
||||||
mov edx, DWORD PTR 20[esp]
|
|
||||||
xor ecx, eax
|
|
||||||
xor edx, ebx
|
|
||||||
mov eax, DWORD PTR [esi]
|
|
||||||
mov ebx, DWORD PTR 4[esi]
|
|
||||||
mov DWORD PTR [edi],ecx
|
|
||||||
mov DWORD PTR 4[edi],edx
|
|
||||||
mov DWORD PTR 16[esp],eax
|
|
||||||
mov DWORD PTR 20[esp],ebx
|
|
||||||
add esi, 8
|
|
||||||
add edi, 8
|
|
||||||
sub ebp, 8
|
|
||||||
jnz L014decrypt_loop
|
|
||||||
$L013decrypt_finish:
|
|
||||||
mov ebp, DWORD PTR 52[esp]
|
|
||||||
and ebp, 7
|
|
||||||
jz $L003finish
|
|
||||||
mov eax, DWORD PTR [esi]
|
|
||||||
mov ebx, DWORD PTR 4[esi]
|
|
||||||
bswap eax
|
|
||||||
bswap ebx
|
|
||||||
mov DWORD PTR 8[esp],eax
|
|
||||||
mov DWORD PTR 12[esp],ebx
|
|
||||||
call _BF_decrypt
|
|
||||||
mov eax, DWORD PTR 8[esp]
|
|
||||||
mov ebx, DWORD PTR 12[esp]
|
|
||||||
bswap eax
|
|
||||||
bswap ebx
|
|
||||||
mov ecx, DWORD PTR 16[esp]
|
|
||||||
mov edx, DWORD PTR 20[esp]
|
|
||||||
xor ecx, eax
|
|
||||||
xor edx, ebx
|
|
||||||
mov eax, DWORD PTR [esi]
|
|
||||||
mov ebx, DWORD PTR 4[esi]
|
|
||||||
L015dj7:
|
|
||||||
ror edx, 16
|
|
||||||
mov BYTE PTR 6[edi],dl
|
|
||||||
shr edx, 16
|
|
||||||
L016dj6:
|
|
||||||
mov BYTE PTR 5[edi],dh
|
|
||||||
L017dj5:
|
|
||||||
mov BYTE PTR 4[edi],dl
|
|
||||||
L018dj4:
|
|
||||||
mov DWORD PTR [edi],ecx
|
|
||||||
jmp $L019djend
|
|
||||||
L020dj3:
|
|
||||||
ror ecx, 16
|
|
||||||
mov BYTE PTR 2[edi],cl
|
|
||||||
shl ecx, 16
|
|
||||||
L021dj2:
|
|
||||||
mov BYTE PTR 1[esi],ch
|
|
||||||
L022dj1:
|
|
||||||
mov BYTE PTR [esi], cl
|
|
||||||
$L019djend:
|
|
||||||
jmp $L003finish
|
|
||||||
$L003finish:
|
|
||||||
mov ecx, DWORD PTR 60[esp]
|
|
||||||
add esp, 24
|
|
||||||
mov DWORD PTR [ecx],eax
|
|
||||||
mov DWORD PTR 4[ecx],ebx
|
|
||||||
pop edi
|
|
||||||
pop esi
|
|
||||||
pop ebx
|
|
||||||
pop ebp
|
|
||||||
ret
|
|
||||||
$L004cbc_enc_jmp_table:
|
|
||||||
DD 0
|
|
||||||
DD L012ej1
|
|
||||||
DD L011ej2
|
|
||||||
DD L010ej3
|
|
||||||
DD L008ej4
|
|
||||||
DD L007ej5
|
|
||||||
DD L006ej6
|
|
||||||
DD L005ej7
|
|
||||||
L023cbc_dec_jmp_table:
|
|
||||||
DD 0
|
|
||||||
DD L022dj1
|
|
||||||
DD L021dj2
|
|
||||||
DD L020dj3
|
|
||||||
DD L018dj4
|
|
||||||
DD L017dj5
|
|
||||||
DD L016dj6
|
|
||||||
DD L015dj7
|
|
||||||
_BF_cbc_encrypt ENDP
|
|
||||||
_TEXT ENDS
|
|
||||||
END
|
|
File diff suppressed because it is too large
Load Diff
@ -1,297 +0,0 @@
|
|||||||
; Static Name Aliases
|
|
||||||
;
|
|
||||||
TITLE bn_mulw.c
|
|
||||||
.8087
|
|
||||||
F_TEXT SEGMENT WORD PUBLIC 'CODE'
|
|
||||||
F_TEXT ENDS
|
|
||||||
_DATA SEGMENT WORD PUBLIC 'DATA'
|
|
||||||
_DATA ENDS
|
|
||||||
_CONST SEGMENT WORD PUBLIC 'CONST'
|
|
||||||
_CONST ENDS
|
|
||||||
_BSS SEGMENT WORD PUBLIC 'BSS'
|
|
||||||
_BSS ENDS
|
|
||||||
DGROUP GROUP _CONST, _BSS, _DATA
|
|
||||||
ASSUME DS: DGROUP, SS: DGROUP
|
|
||||||
F_TEXT SEGMENT
|
|
||||||
ASSUME CS: F_TEXT
|
|
||||||
PUBLIC _bn_mul_add_words
|
|
||||||
_bn_mul_add_words PROC FAR
|
|
||||||
; Line 58
|
|
||||||
push bp
|
|
||||||
push bx
|
|
||||||
push si
|
|
||||||
push di
|
|
||||||
push ds
|
|
||||||
push es
|
|
||||||
mov bp,sp
|
|
||||||
; w = 26
|
|
||||||
; num = 24
|
|
||||||
; ap = 20
|
|
||||||
; rp = 16
|
|
||||||
xor si,si ;c=0;
|
|
||||||
mov di,WORD PTR [bp+16] ; load r
|
|
||||||
mov ds,WORD PTR [bp+18] ; load r
|
|
||||||
mov bx,WORD PTR [bp+20] ; load a
|
|
||||||
mov es,WORD PTR [bp+22] ; load a
|
|
||||||
mov cx,WORD PTR [bp+26] ; load w
|
|
||||||
mov bp,WORD PTR [bp+24] ; load num
|
|
||||||
|
|
||||||
shr bp,1 ; div count by 4 and do groups of 4
|
|
||||||
shr bp,1
|
|
||||||
je $L555
|
|
||||||
|
|
||||||
$L546:
|
|
||||||
mov ax,cx
|
|
||||||
mul WORD PTR es:[bx] ; w* *a
|
|
||||||
add ax,WORD PTR ds:[di] ; + *r
|
|
||||||
adc dx,0
|
|
||||||
adc ax,si
|
|
||||||
adc dx,0
|
|
||||||
mov WORD PTR ds:[di],ax
|
|
||||||
mov si,dx
|
|
||||||
;
|
|
||||||
mov ax,cx
|
|
||||||
mul WORD PTR es:[bx+2] ; w* *a
|
|
||||||
add ax,WORD PTR ds:[di+2] ; + *r
|
|
||||||
adc dx,0
|
|
||||||
adc ax,si
|
|
||||||
adc dx,0
|
|
||||||
mov WORD PTR ds:[di+2],ax
|
|
||||||
mov si,dx
|
|
||||||
;
|
|
||||||
mov ax,cx
|
|
||||||
mul WORD PTR es:[bx+4] ; w* *a
|
|
||||||
add ax,WORD PTR ds:[di+4] ; + *r
|
|
||||||
adc dx,0
|
|
||||||
adc ax,si
|
|
||||||
adc dx,0
|
|
||||||
mov WORD PTR ds:[di+4],ax
|
|
||||||
mov si,dx
|
|
||||||
;
|
|
||||||
mov ax,cx
|
|
||||||
mul WORD PTR es:[bx+6] ; w* *a
|
|
||||||
add ax,WORD PTR ds:[di+6] ; + *r
|
|
||||||
adc dx,0
|
|
||||||
adc ax,si
|
|
||||||
adc dx,0
|
|
||||||
mov WORD PTR ds:[di+6],ax
|
|
||||||
mov si,dx
|
|
||||||
;
|
|
||||||
add bx,8
|
|
||||||
add di,8
|
|
||||||
;
|
|
||||||
dec bp
|
|
||||||
je $L555
|
|
||||||
jmp $L546
|
|
||||||
;
|
|
||||||
;
|
|
||||||
$L555:
|
|
||||||
mov bp,sp
|
|
||||||
mov bp,WORD PTR [bp+24] ; load num
|
|
||||||
and bp,3
|
|
||||||
dec bp
|
|
||||||
js $L547
|
|
||||||
|
|
||||||
mov ax,cx
|
|
||||||
mul WORD PTR es:[bx] ; w* *a
|
|
||||||
add ax,WORD PTR ds:[di] ; + *r
|
|
||||||
adc dx,0
|
|
||||||
adc ax,si
|
|
||||||
adc dx,0
|
|
||||||
mov WORD PTR ds:[di],ax
|
|
||||||
mov si,dx
|
|
||||||
dec bp
|
|
||||||
js $L547 ; Note that we are now testing for -1
|
|
||||||
;
|
|
||||||
mov ax,cx
|
|
||||||
mul WORD PTR es:[bx+2] ; w* *a
|
|
||||||
add ax,WORD PTR ds:[di+2] ; + *r
|
|
||||||
adc dx,0
|
|
||||||
adc ax,si
|
|
||||||
adc dx,0
|
|
||||||
mov WORD PTR ds:[di+2],ax
|
|
||||||
mov si,dx
|
|
||||||
dec bp
|
|
||||||
js $L547
|
|
||||||
;
|
|
||||||
mov ax,cx
|
|
||||||
mul WORD PTR es:[bx+4] ; w* *a
|
|
||||||
add ax,WORD PTR ds:[di+4] ; + *r
|
|
||||||
adc dx,0
|
|
||||||
adc ax,si
|
|
||||||
adc dx,0
|
|
||||||
mov WORD PTR ds:[di+4],ax
|
|
||||||
mov si,dx
|
|
||||||
$L547:
|
|
||||||
mov ax,si
|
|
||||||
pop es
|
|
||||||
pop ds
|
|
||||||
pop di
|
|
||||||
pop si
|
|
||||||
pop bx
|
|
||||||
pop bp
|
|
||||||
ret
|
|
||||||
nop
|
|
||||||
|
|
||||||
_bn_mul_add_words ENDP
|
|
||||||
PUBLIC _bn_mul_words
|
|
||||||
_bn_mul_words PROC FAR
|
|
||||||
; Line 76
|
|
||||||
push bp
|
|
||||||
push bx
|
|
||||||
push si
|
|
||||||
push di
|
|
||||||
push ds
|
|
||||||
push es
|
|
||||||
xor si,si
|
|
||||||
mov bp,sp
|
|
||||||
mov di,WORD PTR [bp+16] ; r
|
|
||||||
mov ds,WORD PTR [bp+18]
|
|
||||||
mov bx,WORD PTR [bp+20] ; a
|
|
||||||
mov es,WORD PTR [bp+22]
|
|
||||||
mov cx,WORD PTR [bp+26] ; w
|
|
||||||
mov bp,WORD PTR [bp+24] ; num
|
|
||||||
$FC743:
|
|
||||||
mov ax,cx
|
|
||||||
mul WORD PTR es:[bx]
|
|
||||||
add ax,si
|
|
||||||
adc dx,0
|
|
||||||
mov WORD PTR ds:[di],ax
|
|
||||||
mov si,dx
|
|
||||||
dec bp
|
|
||||||
je $L764
|
|
||||||
;
|
|
||||||
mov ax,cx
|
|
||||||
mul WORD PTR es:[bx+2]
|
|
||||||
add ax,si
|
|
||||||
adc dx,0
|
|
||||||
mov WORD PTR ds:[di+2],ax
|
|
||||||
mov si,dx
|
|
||||||
dec bp
|
|
||||||
je $L764
|
|
||||||
;
|
|
||||||
mov ax,cx
|
|
||||||
mul WORD PTR es:[bx+4]
|
|
||||||
add ax,si
|
|
||||||
adc dx,0
|
|
||||||
mov WORD PTR ds:[di+4],ax
|
|
||||||
mov si,dx
|
|
||||||
dec bp
|
|
||||||
je $L764
|
|
||||||
;
|
|
||||||
mov ax,cx
|
|
||||||
mul WORD PTR es:[bx+6]
|
|
||||||
add ax,si
|
|
||||||
adc dx,0
|
|
||||||
mov WORD PTR ds:[di+6],ax
|
|
||||||
mov si,dx
|
|
||||||
dec bp
|
|
||||||
je $L764
|
|
||||||
;
|
|
||||||
add bx,8
|
|
||||||
add di,8
|
|
||||||
jmp $FC743
|
|
||||||
nop
|
|
||||||
$L764:
|
|
||||||
mov ax,si
|
|
||||||
pop es
|
|
||||||
pop ds
|
|
||||||
pop di
|
|
||||||
pop si
|
|
||||||
pop bx
|
|
||||||
pop bp
|
|
||||||
ret
|
|
||||||
nop
|
|
||||||
_bn_mul_words ENDP
|
|
||||||
PUBLIC _bn_sqr_words
|
|
||||||
_bn_sqr_words PROC FAR
|
|
||||||
; Line 92
|
|
||||||
push bp
|
|
||||||
push bx
|
|
||||||
push si
|
|
||||||
push di
|
|
||||||
push ds
|
|
||||||
push es
|
|
||||||
mov bp,sp
|
|
||||||
mov si,WORD PTR [bp+16]
|
|
||||||
mov ds,WORD PTR [bp+18]
|
|
||||||
mov di,WORD PTR [bp+20]
|
|
||||||
mov es,WORD PTR [bp+22]
|
|
||||||
mov bx,WORD PTR [bp+24]
|
|
||||||
|
|
||||||
mov bp,bx ; save a memory lookup later
|
|
||||||
shr bx,1 ; div count by 4 and do groups of 4
|
|
||||||
shr bx,1
|
|
||||||
je $L666
|
|
||||||
|
|
||||||
$L765:
|
|
||||||
mov ax,WORD PTR es:[di]
|
|
||||||
mul ax
|
|
||||||
mov WORD PTR ds:[si],ax
|
|
||||||
mov WORD PTR ds:[si+2],dx
|
|
||||||
;
|
|
||||||
mov ax,WORD PTR es:[di+2]
|
|
||||||
mul ax
|
|
||||||
mov WORD PTR ds:[si+4],ax
|
|
||||||
mov WORD PTR ds:[si+6],dx
|
|
||||||
;
|
|
||||||
mov ax,WORD PTR es:[di+4]
|
|
||||||
mul ax
|
|
||||||
mov WORD PTR ds:[si+8],ax
|
|
||||||
mov WORD PTR ds:[si+10],dx
|
|
||||||
;
|
|
||||||
mov ax,WORD PTR es:[di+6]
|
|
||||||
mul ax
|
|
||||||
mov WORD PTR ds:[si+12],ax
|
|
||||||
mov WORD PTR ds:[si+14],dx
|
|
||||||
;
|
|
||||||
add di,8
|
|
||||||
add si,16
|
|
||||||
dec bx
|
|
||||||
je $L666
|
|
||||||
jmp $L765
|
|
||||||
$L666:
|
|
||||||
and bp,3
|
|
||||||
dec bp ; The copied value of bx (num)
|
|
||||||
js $L645
|
|
||||||
;
|
|
||||||
mov ax,WORD PTR es:[di]
|
|
||||||
mul ax
|
|
||||||
mov WORD PTR ds:[si],ax
|
|
||||||
mov WORD PTR ds:[si+2],dx
|
|
||||||
dec bp
|
|
||||||
js $L645
|
|
||||||
;
|
|
||||||
mov ax,WORD PTR es:[di+2]
|
|
||||||
mul ax
|
|
||||||
mov WORD PTR ds:[si+4],ax
|
|
||||||
mov WORD PTR ds:[si+6],dx
|
|
||||||
dec bp
|
|
||||||
js $L645
|
|
||||||
;
|
|
||||||
mov ax,WORD PTR es:[di+4]
|
|
||||||
mul ax
|
|
||||||
mov WORD PTR ds:[si+8],ax
|
|
||||||
mov WORD PTR ds:[si+10],dx
|
|
||||||
$L645:
|
|
||||||
pop es
|
|
||||||
pop ds
|
|
||||||
pop di
|
|
||||||
pop si
|
|
||||||
pop bx
|
|
||||||
pop bp
|
|
||||||
ret
|
|
||||||
|
|
||||||
_bn_sqr_words ENDP
|
|
||||||
PUBLIC _bn_div64
|
|
||||||
_bn_div64 PROC FAR
|
|
||||||
push bp
|
|
||||||
mov bp,sp
|
|
||||||
mov dx, WORD PTR [bp+6]
|
|
||||||
mov ax, WORD PTR [bp+8]
|
|
||||||
div WORD PTR [bp+10]
|
|
||||||
pop bp
|
|
||||||
ret
|
|
||||||
_bn_div64 ENDP
|
|
||||||
F_TEXT ENDS
|
|
||||||
END
|
|
@ -1,360 +0,0 @@
|
|||||||
; Static Name Aliases
|
|
||||||
;
|
|
||||||
TITLE bn_mulw.c
|
|
||||||
.386
|
|
||||||
F_TEXT SEGMENT WORD USE16 PUBLIC 'CODE'
|
|
||||||
F_TEXT ENDS
|
|
||||||
_DATA SEGMENT WORD USE16 PUBLIC 'DATA'
|
|
||||||
_DATA ENDS
|
|
||||||
_CONST SEGMENT WORD USE16 PUBLIC 'CONST'
|
|
||||||
_CONST ENDS
|
|
||||||
_BSS SEGMENT WORD USE16 PUBLIC 'BSS'
|
|
||||||
_BSS ENDS
|
|
||||||
DGROUP GROUP _CONST, _BSS, _DATA
|
|
||||||
ASSUME DS: DGROUP, SS: DGROUP
|
|
||||||
F_TEXT SEGMENT
|
|
||||||
ASSUME CS: F_TEXT
|
|
||||||
PUBLIC _bn_mul_add_words
|
|
||||||
_bn_mul_add_words PROC FAR
|
|
||||||
; Line 58
|
|
||||||
push bp
|
|
||||||
push bx
|
|
||||||
push esi
|
|
||||||
push di
|
|
||||||
push ds
|
|
||||||
push es
|
|
||||||
mov bp,sp
|
|
||||||
; w = 28
|
|
||||||
; num = 26
|
|
||||||
; ap = 22
|
|
||||||
; rp = 18
|
|
||||||
xor esi,esi ;c=0;
|
|
||||||
mov di,WORD PTR [bp+18] ; load r
|
|
||||||
mov ds,WORD PTR [bp+20] ; load r
|
|
||||||
mov bx,WORD PTR [bp+22] ; load a
|
|
||||||
mov es,WORD PTR [bp+24] ; load a
|
|
||||||
mov ecx,DWORD PTR [bp+28] ; load w
|
|
||||||
mov bp,WORD PTR [bp+26] ; load num
|
|
||||||
shr bp,1 ; div count by 4 and do groups of 4
|
|
||||||
shr bp,1
|
|
||||||
je $L555
|
|
||||||
|
|
||||||
$L546:
|
|
||||||
mov eax,ecx
|
|
||||||
mul DWORD PTR es:[bx] ; w* *a
|
|
||||||
add eax,DWORD PTR ds:[di] ; + *r
|
|
||||||
adc edx,0
|
|
||||||
adc eax,esi
|
|
||||||
adc edx,0
|
|
||||||
mov DWORD PTR ds:[di],eax
|
|
||||||
mov esi,edx
|
|
||||||
;
|
|
||||||
mov eax,ecx
|
|
||||||
mul DWORD PTR es:[bx+4] ; w* *a
|
|
||||||
add eax,DWORD PTR ds:[di+4] ; + *r
|
|
||||||
adc edx,0
|
|
||||||
adc eax,esi
|
|
||||||
adc edx,0
|
|
||||||
mov DWORD PTR ds:[di+4],eax
|
|
||||||
mov esi,edx
|
|
||||||
;
|
|
||||||
mov eax,ecx
|
|
||||||
mul DWORD PTR es:[bx+8] ; w* *a
|
|
||||||
add eax,DWORD PTR ds:[di+8] ; + *r
|
|
||||||
adc edx,0
|
|
||||||
adc eax,esi
|
|
||||||
adc edx,0
|
|
||||||
mov DWORD PTR ds:[di+8],eax
|
|
||||||
mov esi,edx
|
|
||||||
;
|
|
||||||
mov eax,ecx
|
|
||||||
mul DWORD PTR es:[bx+12] ; w* *a
|
|
||||||
add eax,DWORD PTR ds:[di+12] ; + *r
|
|
||||||
adc edx,0
|
|
||||||
adc eax,esi
|
|
||||||
adc edx,0
|
|
||||||
mov DWORD PTR ds:[di+12],eax
|
|
||||||
mov esi,edx
|
|
||||||
;
|
|
||||||
add bx,16
|
|
||||||
add di,16
|
|
||||||
;
|
|
||||||
dec bp
|
|
||||||
je $L555
|
|
||||||
jmp $L546
|
|
||||||
;
|
|
||||||
;
|
|
||||||
$L555:
|
|
||||||
mov bp,sp
|
|
||||||
mov bp,WORD PTR [bp+26] ; load num
|
|
||||||
and bp,3
|
|
||||||
dec bp
|
|
||||||
js $L547m
|
|
||||||
|
|
||||||
mov eax,ecx
|
|
||||||
mul DWORD PTR es:[bx] ; w* *a
|
|
||||||
add eax,DWORD PTR ds:[di] ; + *r
|
|
||||||
adc edx,0
|
|
||||||
adc eax,esi
|
|
||||||
adc edx,0
|
|
||||||
mov DWORD PTR ds:[di],eax
|
|
||||||
mov esi,edx
|
|
||||||
dec bp
|
|
||||||
js $L547m ; Note that we are now testing for -1
|
|
||||||
;
|
|
||||||
mov eax,ecx
|
|
||||||
mul DWORD PTR es:[bx+4] ; w* *a
|
|
||||||
add eax,DWORD PTR ds:[di+4] ; + *r
|
|
||||||
adc edx,0
|
|
||||||
adc eax,esi
|
|
||||||
adc edx,0
|
|
||||||
mov DWORD PTR ds:[di+4],eax
|
|
||||||
mov esi,edx
|
|
||||||
dec bp
|
|
||||||
js $L547m
|
|
||||||
;
|
|
||||||
mov eax,ecx
|
|
||||||
mul DWORD PTR es:[bx+8] ; w* *a
|
|
||||||
add eax,DWORD PTR ds:[di+8] ; + *r
|
|
||||||
adc edx,0
|
|
||||||
adc eax,esi
|
|
||||||
adc edx,0
|
|
||||||
mov DWORD PTR ds:[di+8],eax
|
|
||||||
mov esi,edx
|
|
||||||
$L547m:
|
|
||||||
mov eax,esi
|
|
||||||
mov edx,esi
|
|
||||||
shr edx,16
|
|
||||||
pop es
|
|
||||||
pop ds
|
|
||||||
pop di
|
|
||||||
pop esi
|
|
||||||
pop bx
|
|
||||||
pop bp
|
|
||||||
ret
|
|
||||||
nop
|
|
||||||
_bn_mul_add_words ENDP
|
|
||||||
|
|
||||||
PUBLIC _bn_mul_words
|
|
||||||
_bn_mul_words PROC FAR
|
|
||||||
; Line 76
|
|
||||||
push bp
|
|
||||||
push bx
|
|
||||||
push esi
|
|
||||||
push di
|
|
||||||
push ds
|
|
||||||
push es
|
|
||||||
xor esi,esi
|
|
||||||
mov bp,sp
|
|
||||||
mov di,WORD PTR [bp+18] ; r
|
|
||||||
mov ds,WORD PTR [bp+20]
|
|
||||||
mov bx,WORD PTR [bp+22] ; a
|
|
||||||
mov es,WORD PTR [bp+24]
|
|
||||||
mov ecx,DWORD PTR [bp+28] ; w
|
|
||||||
mov bp,WORD PTR [bp+26] ; num
|
|
||||||
|
|
||||||
$FC743:
|
|
||||||
mov eax,ecx
|
|
||||||
mul DWORD PTR es:[bx]
|
|
||||||
add eax,esi
|
|
||||||
adc edx,0
|
|
||||||
mov DWORD PTR ds:[di],eax
|
|
||||||
mov esi,edx
|
|
||||||
dec bp
|
|
||||||
je $L764
|
|
||||||
;
|
|
||||||
mov eax,ecx
|
|
||||||
mul DWORD PTR es:[bx+4]
|
|
||||||
add eax,esi
|
|
||||||
adc edx,0
|
|
||||||
mov DWORD PTR ds:[di+4],eax
|
|
||||||
mov esi,edx
|
|
||||||
dec bp
|
|
||||||
je $L764
|
|
||||||
;
|
|
||||||
mov eax,ecx
|
|
||||||
mul DWORD PTR es:[bx+8]
|
|
||||||
add eax,esi
|
|
||||||
adc edx,0
|
|
||||||
mov DWORD PTR ds:[di+8],eax
|
|
||||||
mov esi,edx
|
|
||||||
dec bp
|
|
||||||
je $L764
|
|
||||||
;
|
|
||||||
mov eax,ecx
|
|
||||||
mul DWORD PTR es:[bx+12]
|
|
||||||
add eax,esi
|
|
||||||
adc edx,0
|
|
||||||
mov DWORD PTR ds:[di+12],eax
|
|
||||||
mov esi,edx
|
|
||||||
dec bp
|
|
||||||
je $L764
|
|
||||||
;
|
|
||||||
add bx,16
|
|
||||||
add di,16
|
|
||||||
jmp $FC743
|
|
||||||
nop
|
|
||||||
$L764:
|
|
||||||
mov eax,esi
|
|
||||||
mov edx,esi
|
|
||||||
shr edx,16
|
|
||||||
pop es
|
|
||||||
pop ds
|
|
||||||
pop di
|
|
||||||
pop esi
|
|
||||||
pop bx
|
|
||||||
pop bp
|
|
||||||
ret
|
|
||||||
nop
|
|
||||||
_bn_mul_words ENDP
|
|
||||||
PUBLIC _bn_sqr_words
|
|
||||||
_bn_sqr_words PROC FAR
|
|
||||||
; Line 92
|
|
||||||
push bp
|
|
||||||
push bx
|
|
||||||
push si
|
|
||||||
push di
|
|
||||||
push ds
|
|
||||||
push es
|
|
||||||
mov bp,sp
|
|
||||||
mov si,WORD PTR [bp+16]
|
|
||||||
mov ds,WORD PTR [bp+18]
|
|
||||||
mov di,WORD PTR [bp+20]
|
|
||||||
mov es,WORD PTR [bp+22]
|
|
||||||
mov bx,WORD PTR [bp+24]
|
|
||||||
|
|
||||||
mov bp,bx ; save a memory lookup later
|
|
||||||
shr bx,1 ; div count by 4 and do groups of 4
|
|
||||||
shr bx,1
|
|
||||||
je $L666
|
|
||||||
|
|
||||||
$L765:
|
|
||||||
mov eax,DWORD PTR es:[di]
|
|
||||||
mul eax
|
|
||||||
mov DWORD PTR ds:[si],eax
|
|
||||||
mov DWORD PTR ds:[si+4],edx
|
|
||||||
;
|
|
||||||
mov eax,DWORD PTR es:[di+4]
|
|
||||||
mul eax
|
|
||||||
mov DWORD PTR ds:[si+8],eax
|
|
||||||
mov DWORD PTR ds:[si+12],edx
|
|
||||||
;
|
|
||||||
mov eax,DWORD PTR es:[di+8]
|
|
||||||
mul eax
|
|
||||||
mov DWORD PTR ds:[si+16],eax
|
|
||||||
mov DWORD PTR ds:[si+20],edx
|
|
||||||
;
|
|
||||||
mov eax,DWORD PTR es:[di+12]
|
|
||||||
mul eax
|
|
||||||
mov DWORD PTR ds:[si+24],eax
|
|
||||||
mov DWORD PTR ds:[si+28],edx
|
|
||||||
;
|
|
||||||
add di,16
|
|
||||||
add si,32
|
|
||||||
dec bx
|
|
||||||
je $L666
|
|
||||||
jmp $L765
|
|
||||||
$L666:
|
|
||||||
and bp,3
|
|
||||||
dec bp ; The copied value of bx (num)
|
|
||||||
js $L645
|
|
||||||
;
|
|
||||||
mov eax,DWORD PTR es:[di]
|
|
||||||
mul eax
|
|
||||||
mov DWORD PTR ds:[si],eax
|
|
||||||
mov DWORD PTR ds:[si+4],edx
|
|
||||||
dec bp
|
|
||||||
js $L645
|
|
||||||
;
|
|
||||||
mov eax,DWORD PTR es:[di+4]
|
|
||||||
mul eax
|
|
||||||
mov DWORD PTR ds:[si+8],eax
|
|
||||||
mov DWORD PTR ds:[si+12],edx
|
|
||||||
dec bp
|
|
||||||
js $L645
|
|
||||||
;
|
|
||||||
mov eax,DWORD PTR es:[di+8]
|
|
||||||
mul eax
|
|
||||||
mov DWORD PTR ds:[si+16],eax
|
|
||||||
mov DWORD PTR ds:[si+20],edx
|
|
||||||
$L645:
|
|
||||||
pop es
|
|
||||||
pop ds
|
|
||||||
pop di
|
|
||||||
pop si
|
|
||||||
pop bx
|
|
||||||
pop bp
|
|
||||||
ret
|
|
||||||
_bn_sqr_words ENDP
|
|
||||||
|
|
||||||
PUBLIC _bn_div64
|
|
||||||
_bn_div64 PROC FAR
|
|
||||||
push bp
|
|
||||||
mov bp,sp
|
|
||||||
mov edx, DWORD PTR [bp+6]
|
|
||||||
mov eax, DWORD PTR [bp+10]
|
|
||||||
div DWORD PTR [bp+14]
|
|
||||||
mov edx,eax
|
|
||||||
shr edx,16
|
|
||||||
pop bp
|
|
||||||
ret
|
|
||||||
_bn_div64 ENDP
|
|
||||||
|
|
||||||
PUBLIC _bn_add_words
|
|
||||||
_bn_add_words PROC FAR
|
|
||||||
; Line 58
|
|
||||||
push bp
|
|
||||||
push bx
|
|
||||||
push esi
|
|
||||||
push di
|
|
||||||
push ds
|
|
||||||
push es
|
|
||||||
mov bp,sp
|
|
||||||
; w = 28
|
|
||||||
; num = 26
|
|
||||||
; ap = 22
|
|
||||||
; rp = 18
|
|
||||||
xor esi,esi ;c=0;
|
|
||||||
mov bx,WORD PTR [bp+18] ; load low r
|
|
||||||
mov si,WORD PTR [bp+22] ; load a
|
|
||||||
mov es,WORD PTR [bp+24] ; load a
|
|
||||||
mov di,WORD PTR [bp+26] ; load b
|
|
||||||
mov ds,WORD PTR [bp+28] ; load b
|
|
||||||
|
|
||||||
mov dx,WORD PTR [bp+30] ; load num
|
|
||||||
xor ecx,ecx
|
|
||||||
dec dx
|
|
||||||
js $L547a
|
|
||||||
|
|
||||||
$L5477:
|
|
||||||
mov eax,DWORD PTR es:[si] ; *a
|
|
||||||
add eax,ecx
|
|
||||||
mov ecx,0
|
|
||||||
adc ecx,0
|
|
||||||
add si,4 ; a++
|
|
||||||
add eax,DWORD PTR ds:[di] ; + *b
|
|
||||||
adc ecx,0
|
|
||||||
mov ds,WORD PTR [bp+20]
|
|
||||||
add di,4
|
|
||||||
mov DWORD PTR ds:[bx],eax
|
|
||||||
mov ds,WORD PTR [bp+28]
|
|
||||||
add bx,4
|
|
||||||
dec dx
|
|
||||||
js $L547a ; Note that we are now testing for -1
|
|
||||||
jmp $L5477
|
|
||||||
;
|
|
||||||
$L547a:
|
|
||||||
mov eax,ecx
|
|
||||||
mov edx,ecx
|
|
||||||
shr edx,16
|
|
||||||
pop es
|
|
||||||
pop ds
|
|
||||||
pop di
|
|
||||||
pop esi
|
|
||||||
pop bx
|
|
||||||
pop bp
|
|
||||||
ret
|
|
||||||
nop
|
|
||||||
_bn_add_words ENDP
|
|
||||||
F_TEXT ENDS
|
|
||||||
END
|
|
@ -1,953 +0,0 @@
|
|||||||
; Don't even think of reading this code
|
|
||||||
; It was automatically generated by cast-586.pl
|
|
||||||
; Which is a perl program used to generate the x86 assember for
|
|
||||||
; any of elf, a.out, BSDI,Win32, or Solaris
|
|
||||||
; eric <eay@cryptsoft.com>
|
|
||||||
;
|
|
||||||
TITLE cast-586.asm
|
|
||||||
.486
|
|
||||||
.model FLAT
|
|
||||||
_TEXT SEGMENT
|
|
||||||
PUBLIC _CAST_encrypt
|
|
||||||
EXTERN _CAST_S_table0:DWORD
|
|
||||||
EXTERN _CAST_S_table1:DWORD
|
|
||||||
EXTERN _CAST_S_table2:DWORD
|
|
||||||
EXTERN _CAST_S_table3:DWORD
|
|
||||||
|
|
||||||
_CAST_encrypt PROC NEAR
|
|
||||||
;
|
|
||||||
push ebp
|
|
||||||
push ebx
|
|
||||||
mov ebx, DWORD PTR 12[esp]
|
|
||||||
mov ebp, DWORD PTR 16[esp]
|
|
||||||
push esi
|
|
||||||
push edi
|
|
||||||
; Load the 2 words
|
|
||||||
mov edi, DWORD PTR [ebx]
|
|
||||||
mov esi, DWORD PTR 4[ebx]
|
|
||||||
; Get short key flag
|
|
||||||
mov eax, DWORD PTR 128[ebp]
|
|
||||||
push eax
|
|
||||||
xor eax, eax
|
|
||||||
; round 0
|
|
||||||
mov edx, DWORD PTR [ebp]
|
|
||||||
mov ecx, DWORD PTR 4[ebp]
|
|
||||||
add edx, esi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
add ecx, ebx
|
|
||||||
xor edi, ecx
|
|
||||||
; round 1
|
|
||||||
mov edx, DWORD PTR 8[ebp]
|
|
||||||
mov ecx, DWORD PTR 12[ebp]
|
|
||||||
xor edx, edi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
add ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
xor esi, ecx
|
|
||||||
; round 2
|
|
||||||
mov edx, DWORD PTR 16[ebp]
|
|
||||||
mov ecx, DWORD PTR 20[ebp]
|
|
||||||
sub edx, esi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
add ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
xor edi, ecx
|
|
||||||
; round 3
|
|
||||||
mov edx, DWORD PTR 24[ebp]
|
|
||||||
mov ecx, DWORD PTR 28[ebp]
|
|
||||||
add edx, edi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
add ecx, ebx
|
|
||||||
xor esi, ecx
|
|
||||||
; round 4
|
|
||||||
mov edx, DWORD PTR 32[ebp]
|
|
||||||
mov ecx, DWORD PTR 36[ebp]
|
|
||||||
xor edx, esi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
add ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
xor edi, ecx
|
|
||||||
; round 5
|
|
||||||
mov edx, DWORD PTR 40[ebp]
|
|
||||||
mov ecx, DWORD PTR 44[ebp]
|
|
||||||
sub edx, edi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
add ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
xor esi, ecx
|
|
||||||
; round 6
|
|
||||||
mov edx, DWORD PTR 48[ebp]
|
|
||||||
mov ecx, DWORD PTR 52[ebp]
|
|
||||||
add edx, esi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
add ecx, ebx
|
|
||||||
xor edi, ecx
|
|
||||||
; round 7
|
|
||||||
mov edx, DWORD PTR 56[ebp]
|
|
||||||
mov ecx, DWORD PTR 60[ebp]
|
|
||||||
xor edx, edi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
add ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
xor esi, ecx
|
|
||||||
; round 8
|
|
||||||
mov edx, DWORD PTR 64[ebp]
|
|
||||||
mov ecx, DWORD PTR 68[ebp]
|
|
||||||
sub edx, esi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
add ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
xor edi, ecx
|
|
||||||
; round 9
|
|
||||||
mov edx, DWORD PTR 72[ebp]
|
|
||||||
mov ecx, DWORD PTR 76[ebp]
|
|
||||||
add edx, edi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
add ecx, ebx
|
|
||||||
xor esi, ecx
|
|
||||||
; round 10
|
|
||||||
mov edx, DWORD PTR 80[ebp]
|
|
||||||
mov ecx, DWORD PTR 84[ebp]
|
|
||||||
xor edx, esi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
add ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
xor edi, ecx
|
|
||||||
; round 11
|
|
||||||
mov edx, DWORD PTR 88[ebp]
|
|
||||||
mov ecx, DWORD PTR 92[ebp]
|
|
||||||
sub edx, edi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
add ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
xor esi, ecx
|
|
||||||
; test short key flag
|
|
||||||
pop edx
|
|
||||||
or edx, edx
|
|
||||||
jnz $L000cast_enc_done
|
|
||||||
; round 12
|
|
||||||
mov edx, DWORD PTR 96[ebp]
|
|
||||||
mov ecx, DWORD PTR 100[ebp]
|
|
||||||
add edx, esi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
add ecx, ebx
|
|
||||||
xor edi, ecx
|
|
||||||
; round 13
|
|
||||||
mov edx, DWORD PTR 104[ebp]
|
|
||||||
mov ecx, DWORD PTR 108[ebp]
|
|
||||||
xor edx, edi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
add ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
xor esi, ecx
|
|
||||||
; round 14
|
|
||||||
mov edx, DWORD PTR 112[ebp]
|
|
||||||
mov ecx, DWORD PTR 116[ebp]
|
|
||||||
sub edx, esi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
add ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
xor edi, ecx
|
|
||||||
; round 15
|
|
||||||
mov edx, DWORD PTR 120[ebp]
|
|
||||||
mov ecx, DWORD PTR 124[ebp]
|
|
||||||
add edx, edi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
add ecx, ebx
|
|
||||||
xor esi, ecx
|
|
||||||
$L000cast_enc_done:
|
|
||||||
nop
|
|
||||||
mov eax, DWORD PTR 20[esp]
|
|
||||||
mov DWORD PTR 4[eax],edi
|
|
||||||
mov DWORD PTR [eax],esi
|
|
||||||
pop edi
|
|
||||||
pop esi
|
|
||||||
pop ebx
|
|
||||||
pop ebp
|
|
||||||
ret
|
|
||||||
_CAST_encrypt ENDP
|
|
||||||
_TEXT ENDS
|
|
||||||
_TEXT SEGMENT
|
|
||||||
PUBLIC _CAST_decrypt
|
|
||||||
EXTERN _CAST_S_table0:DWORD
|
|
||||||
EXTERN _CAST_S_table1:DWORD
|
|
||||||
EXTERN _CAST_S_table2:DWORD
|
|
||||||
EXTERN _CAST_S_table3:DWORD
|
|
||||||
|
|
||||||
_CAST_decrypt PROC NEAR
|
|
||||||
;
|
|
||||||
push ebp
|
|
||||||
push ebx
|
|
||||||
mov ebx, DWORD PTR 12[esp]
|
|
||||||
mov ebp, DWORD PTR 16[esp]
|
|
||||||
push esi
|
|
||||||
push edi
|
|
||||||
; Load the 2 words
|
|
||||||
mov edi, DWORD PTR [ebx]
|
|
||||||
mov esi, DWORD PTR 4[ebx]
|
|
||||||
; Get short key flag
|
|
||||||
mov eax, DWORD PTR 128[ebp]
|
|
||||||
or eax, eax
|
|
||||||
jnz $L001cast_dec_skip
|
|
||||||
xor eax, eax
|
|
||||||
; round 15
|
|
||||||
mov edx, DWORD PTR 120[ebp]
|
|
||||||
mov ecx, DWORD PTR 124[ebp]
|
|
||||||
add edx, esi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
add ecx, ebx
|
|
||||||
xor edi, ecx
|
|
||||||
; round 14
|
|
||||||
mov edx, DWORD PTR 112[ebp]
|
|
||||||
mov ecx, DWORD PTR 116[ebp]
|
|
||||||
sub edx, edi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
add ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
xor esi, ecx
|
|
||||||
; round 13
|
|
||||||
mov edx, DWORD PTR 104[ebp]
|
|
||||||
mov ecx, DWORD PTR 108[ebp]
|
|
||||||
xor edx, esi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
add ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
xor edi, ecx
|
|
||||||
; round 12
|
|
||||||
mov edx, DWORD PTR 96[ebp]
|
|
||||||
mov ecx, DWORD PTR 100[ebp]
|
|
||||||
add edx, edi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
add ecx, ebx
|
|
||||||
xor esi, ecx
|
|
||||||
$L001cast_dec_skip:
|
|
||||||
; round 11
|
|
||||||
mov edx, DWORD PTR 88[ebp]
|
|
||||||
mov ecx, DWORD PTR 92[ebp]
|
|
||||||
sub edx, esi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
add ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
xor edi, ecx
|
|
||||||
; round 10
|
|
||||||
mov edx, DWORD PTR 80[ebp]
|
|
||||||
mov ecx, DWORD PTR 84[ebp]
|
|
||||||
xor edx, edi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
add ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
xor esi, ecx
|
|
||||||
; round 9
|
|
||||||
mov edx, DWORD PTR 72[ebp]
|
|
||||||
mov ecx, DWORD PTR 76[ebp]
|
|
||||||
add edx, esi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
add ecx, ebx
|
|
||||||
xor edi, ecx
|
|
||||||
; round 8
|
|
||||||
mov edx, DWORD PTR 64[ebp]
|
|
||||||
mov ecx, DWORD PTR 68[ebp]
|
|
||||||
sub edx, edi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
add ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
xor esi, ecx
|
|
||||||
; round 7
|
|
||||||
mov edx, DWORD PTR 56[ebp]
|
|
||||||
mov ecx, DWORD PTR 60[ebp]
|
|
||||||
xor edx, esi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
add ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
xor edi, ecx
|
|
||||||
; round 6
|
|
||||||
mov edx, DWORD PTR 48[ebp]
|
|
||||||
mov ecx, DWORD PTR 52[ebp]
|
|
||||||
add edx, edi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
add ecx, ebx
|
|
||||||
xor esi, ecx
|
|
||||||
; round 5
|
|
||||||
mov edx, DWORD PTR 40[ebp]
|
|
||||||
mov ecx, DWORD PTR 44[ebp]
|
|
||||||
sub edx, esi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
add ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
xor edi, ecx
|
|
||||||
; round 4
|
|
||||||
mov edx, DWORD PTR 32[ebp]
|
|
||||||
mov ecx, DWORD PTR 36[ebp]
|
|
||||||
xor edx, edi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
add ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
xor esi, ecx
|
|
||||||
; round 3
|
|
||||||
mov edx, DWORD PTR 24[ebp]
|
|
||||||
mov ecx, DWORD PTR 28[ebp]
|
|
||||||
add edx, esi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
add ecx, ebx
|
|
||||||
xor edi, ecx
|
|
||||||
; round 2
|
|
||||||
mov edx, DWORD PTR 16[ebp]
|
|
||||||
mov ecx, DWORD PTR 20[ebp]
|
|
||||||
sub edx, edi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
add ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
xor esi, ecx
|
|
||||||
; round 1
|
|
||||||
mov edx, DWORD PTR 8[ebp]
|
|
||||||
mov ecx, DWORD PTR 12[ebp]
|
|
||||||
xor edx, esi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
add ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
xor edi, ecx
|
|
||||||
; round 0
|
|
||||||
mov edx, DWORD PTR [ebp]
|
|
||||||
mov ecx, DWORD PTR 4[ebp]
|
|
||||||
add edx, edi
|
|
||||||
rol edx, cl
|
|
||||||
mov ebx, edx
|
|
||||||
xor ecx, ecx
|
|
||||||
mov cl, dh
|
|
||||||
and ebx, 255
|
|
||||||
shr edx, 16
|
|
||||||
xor eax, eax
|
|
||||||
mov al, dh
|
|
||||||
and edx, 255
|
|
||||||
mov ecx, DWORD PTR _CAST_S_table0[ecx*4]
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table1[ebx*4]
|
|
||||||
xor ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table2[eax*4]
|
|
||||||
sub ecx, ebx
|
|
||||||
mov ebx, DWORD PTR _CAST_S_table3[edx*4]
|
|
||||||
add ecx, ebx
|
|
||||||
xor esi, ecx
|
|
||||||
nop
|
|
||||||
mov eax, DWORD PTR 20[esp]
|
|
||||||
mov DWORD PTR 4[eax],edi
|
|
||||||
mov DWORD PTR [eax],esi
|
|
||||||
pop edi
|
|
||||||
pop esi
|
|
||||||
pop ebx
|
|
||||||
pop ebp
|
|
||||||
ret
|
|
||||||
_CAST_decrypt ENDP
|
|
||||||
_TEXT ENDS
|
|
||||||
_TEXT SEGMENT
|
|
||||||
PUBLIC _CAST_cbc_encrypt
|
|
||||||
|
|
||||||
_CAST_cbc_encrypt PROC NEAR
|
|
||||||
;
|
|
||||||
push ebp
|
|
||||||
push ebx
|
|
||||||
push esi
|
|
||||||
push edi
|
|
||||||
mov ebp, DWORD PTR 28[esp]
|
|
||||||
; getting iv ptr from parameter 4
|
|
||||||
mov ebx, DWORD PTR 36[esp]
|
|
||||||
mov esi, DWORD PTR [ebx]
|
|
||||||
mov edi, DWORD PTR 4[ebx]
|
|
||||||
push edi
|
|
||||||
push esi
|
|
||||||
push edi
|
|
||||||
push esi
|
|
||||||
mov ebx, esp
|
|
||||||
mov esi, DWORD PTR 36[esp]
|
|
||||||
mov edi, DWORD PTR 40[esp]
|
|
||||||
; getting encrypt flag from parameter 5
|
|
||||||
mov ecx, DWORD PTR 56[esp]
|
|
||||||
; get and push parameter 3
|
|
||||||
mov eax, DWORD PTR 48[esp]
|
|
||||||
push eax
|
|
||||||
push ebx
|
|
||||||
cmp ecx, 0
|
|
||||||
jz $L002decrypt
|
|
||||||
and ebp, 4294967288
|
|
||||||
mov eax, DWORD PTR 8[esp]
|
|
||||||
mov ebx, DWORD PTR 12[esp]
|
|
||||||
jz $L003encrypt_finish
|
|
||||||
L004encrypt_loop:
|
|
||||||
mov ecx, DWORD PTR [esi]
|
|
||||||
mov edx, DWORD PTR 4[esi]
|
|
||||||
xor eax, ecx
|
|
||||||
xor ebx, edx
|
|
||||||
bswap eax
|
|
||||||
bswap ebx
|
|
||||||
mov DWORD PTR 8[esp],eax
|
|
||||||
mov DWORD PTR 12[esp],ebx
|
|
||||||
call _CAST_encrypt
|
|
||||||
mov eax, DWORD PTR 8[esp]
|
|
||||||
mov ebx, DWORD PTR 12[esp]
|
|
||||||
bswap eax
|
|
||||||
bswap ebx
|
|
||||||
mov DWORD PTR [edi],eax
|
|
||||||
mov DWORD PTR 4[edi],ebx
|
|
||||||
add esi, 8
|
|
||||||
add edi, 8
|
|
||||||
sub ebp, 8
|
|
||||||
jnz L004encrypt_loop
|
|
||||||
$L003encrypt_finish:
|
|
||||||
mov ebp, DWORD PTR 52[esp]
|
|
||||||
and ebp, 7
|
|
||||||
jz $L005finish
|
|
||||||
xor ecx, ecx
|
|
||||||
xor edx, edx
|
|
||||||
mov ebp, DWORD PTR $L006cbc_enc_jmp_table[ebp*4]
|
|
||||||
jmp ebp
|
|
||||||
L007ej7:
|
|
||||||
xor edx, edx
|
|
||||||
mov dh, BYTE PTR 6[esi]
|
|
||||||
shl edx, 8
|
|
||||||
L008ej6:
|
|
||||||
mov dh, BYTE PTR 5[esi]
|
|
||||||
L009ej5:
|
|
||||||
mov dl, BYTE PTR 4[esi]
|
|
||||||
L010ej4:
|
|
||||||
mov ecx, DWORD PTR [esi]
|
|
||||||
jmp $L011ejend
|
|
||||||
L012ej3:
|
|
||||||
mov ch, BYTE PTR 2[esi]
|
|
||||||
xor ecx, ecx
|
|
||||||
shl ecx, 8
|
|
||||||
L013ej2:
|
|
||||||
mov ch, BYTE PTR 1[esi]
|
|
||||||
L014ej1:
|
|
||||||
mov cl, BYTE PTR [esi]
|
|
||||||
$L011ejend:
|
|
||||||
xor eax, ecx
|
|
||||||
xor ebx, edx
|
|
||||||
bswap eax
|
|
||||||
bswap ebx
|
|
||||||
mov DWORD PTR 8[esp],eax
|
|
||||||
mov DWORD PTR 12[esp],ebx
|
|
||||||
call _CAST_encrypt
|
|
||||||
mov eax, DWORD PTR 8[esp]
|
|
||||||
mov ebx, DWORD PTR 12[esp]
|
|
||||||
bswap eax
|
|
||||||
bswap ebx
|
|
||||||
mov DWORD PTR [edi],eax
|
|
||||||
mov DWORD PTR 4[edi],ebx
|
|
||||||
jmp $L005finish
|
|
||||||
$L002decrypt:
|
|
||||||
and ebp, 4294967288
|
|
||||||
mov eax, DWORD PTR 16[esp]
|
|
||||||
mov ebx, DWORD PTR 20[esp]
|
|
||||||
jz $L015decrypt_finish
|
|
||||||
L016decrypt_loop:
|
|
||||||
mov eax, DWORD PTR [esi]
|
|
||||||
mov ebx, DWORD PTR 4[esi]
|
|
||||||
bswap eax
|
|
||||||
bswap ebx
|
|
||||||
mov DWORD PTR 8[esp],eax
|
|
||||||
mov DWORD PTR 12[esp],ebx
|
|
||||||
call _CAST_decrypt
|
|
||||||
mov eax, DWORD PTR 8[esp]
|
|
||||||
mov ebx, DWORD PTR 12[esp]
|
|
||||||
bswap eax
|
|
||||||
bswap ebx
|
|
||||||
mov ecx, DWORD PTR 16[esp]
|
|
||||||
mov edx, DWORD PTR 20[esp]
|
|
||||||
xor ecx, eax
|
|
||||||
xor edx, ebx
|
|
||||||
mov eax, DWORD PTR [esi]
|
|
||||||
mov ebx, DWORD PTR 4[esi]
|
|
||||||
mov DWORD PTR [edi],ecx
|
|
||||||
mov DWORD PTR 4[edi],edx
|
|
||||||
mov DWORD PTR 16[esp],eax
|
|
||||||
mov DWORD PTR 20[esp],ebx
|
|
||||||
add esi, 8
|
|
||||||
add edi, 8
|
|
||||||
sub ebp, 8
|
|
||||||
jnz L016decrypt_loop
|
|
||||||
$L015decrypt_finish:
|
|
||||||
mov ebp, DWORD PTR 52[esp]
|
|
||||||
and ebp, 7
|
|
||||||
jz $L005finish
|
|
||||||
mov eax, DWORD PTR [esi]
|
|
||||||
mov ebx, DWORD PTR 4[esi]
|
|
||||||
bswap eax
|
|
||||||
bswap ebx
|
|
||||||
mov DWORD PTR 8[esp],eax
|
|
||||||
mov DWORD PTR 12[esp],ebx
|
|
||||||
call _CAST_decrypt
|
|
||||||
mov eax, DWORD PTR 8[esp]
|
|
||||||
mov ebx, DWORD PTR 12[esp]
|
|
||||||
bswap eax
|
|
||||||
bswap ebx
|
|
||||||
mov ecx, DWORD PTR 16[esp]
|
|
||||||
mov edx, DWORD PTR 20[esp]
|
|
||||||
xor ecx, eax
|
|
||||||
xor edx, ebx
|
|
||||||
mov eax, DWORD PTR [esi]
|
|
||||||
mov ebx, DWORD PTR 4[esi]
|
|
||||||
L017dj7:
|
|
||||||
ror edx, 16
|
|
||||||
mov BYTE PTR 6[edi],dl
|
|
||||||
shr edx, 16
|
|
||||||
L018dj6:
|
|
||||||
mov BYTE PTR 5[edi],dh
|
|
||||||
L019dj5:
|
|
||||||
mov BYTE PTR 4[edi],dl
|
|
||||||
L020dj4:
|
|
||||||
mov DWORD PTR [edi],ecx
|
|
||||||
jmp $L021djend
|
|
||||||
L022dj3:
|
|
||||||
ror ecx, 16
|
|
||||||
mov BYTE PTR 2[edi],cl
|
|
||||||
shl ecx, 16
|
|
||||||
L023dj2:
|
|
||||||
mov BYTE PTR 1[esi],ch
|
|
||||||
L024dj1:
|
|
||||||
mov BYTE PTR [esi], cl
|
|
||||||
$L021djend:
|
|
||||||
jmp $L005finish
|
|
||||||
$L005finish:
|
|
||||||
mov ecx, DWORD PTR 60[esp]
|
|
||||||
add esp, 24
|
|
||||||
mov DWORD PTR [ecx],eax
|
|
||||||
mov DWORD PTR 4[ecx],ebx
|
|
||||||
pop edi
|
|
||||||
pop esi
|
|
||||||
pop ebx
|
|
||||||
pop ebp
|
|
||||||
ret
|
|
||||||
$L006cbc_enc_jmp_table:
|
|
||||||
DD 0
|
|
||||||
DD L014ej1
|
|
||||||
DD L013ej2
|
|
||||||
DD L012ej3
|
|
||||||
DD L010ej4
|
|
||||||
DD L009ej5
|
|
||||||
DD L008ej6
|
|
||||||
DD L007ej7
|
|
||||||
L025cbc_dec_jmp_table:
|
|
||||||
DD 0
|
|
||||||
DD L024dj1
|
|
||||||
DD L023dj2
|
|
||||||
DD L022dj3
|
|
||||||
DD L020dj4
|
|
||||||
DD L019dj5
|
|
||||||
DD L018dj6
|
|
||||||
DD L017dj7
|
|
||||||
_CAST_cbc_encrypt ENDP
|
|
||||||
_TEXT ENDS
|
|
||||||
END
|
|
File diff suppressed because it is too large
Load Diff
@ -1,929 +0,0 @@
|
|||||||
; Don't even think of reading this code
|
|
||||||
; It was automatically generated by crypt586.pl
|
|
||||||
; Which is a perl program used to generate the x86 assember for
|
|
||||||
; any of elf, a.out, BSDI,Win32, or Solaris
|
|
||||||
; eric <eay@cryptsoft.com>
|
|
||||||
;
|
|
||||||
TITLE crypt586.asm
|
|
||||||
.386
|
|
||||||
.model FLAT
|
|
||||||
_TEXT SEGMENT
|
|
||||||
PUBLIC _fcrypt_body
|
|
||||||
EXTRN _des_SPtrans:DWORD
|
|
||||||
_fcrypt_body PROC NEAR
|
|
||||||
push ebp
|
|
||||||
push ebx
|
|
||||||
push esi
|
|
||||||
push edi
|
|
||||||
;
|
|
||||||
; Load the 2 words
|
|
||||||
xor edi, edi
|
|
||||||
xor esi, esi
|
|
||||||
mov ebp, DWORD PTR 24[esp]
|
|
||||||
push 25
|
|
||||||
L000start:
|
|
||||||
;
|
|
||||||
; Round 0
|
|
||||||
mov eax, DWORD PTR 32[esp]
|
|
||||||
mov edx, esi
|
|
||||||
shr edx, 16
|
|
||||||
mov ecx, DWORD PTR 36[esp]
|
|
||||||
xor edx, esi
|
|
||||||
and eax, edx
|
|
||||||
and edx, ecx
|
|
||||||
mov ebx, eax
|
|
||||||
shl ebx, 16
|
|
||||||
mov ecx, edx
|
|
||||||
shl ecx, 16
|
|
||||||
xor eax, ebx
|
|
||||||
xor edx, ecx
|
|
||||||
mov ebx, DWORD PTR [ebp]
|
|
||||||
xor eax, ebx
|
|
||||||
mov ecx, DWORD PTR 4[ebp]
|
|
||||||
xor eax, esi
|
|
||||||
xor edx, esi
|
|
||||||
xor edx, ecx
|
|
||||||
and eax, 0fcfcfcfch
|
|
||||||
xor ebx, ebx
|
|
||||||
and edx, 0cfcfcfcfh
|
|
||||||
xor ecx, ecx
|
|
||||||
mov bl, al
|
|
||||||
mov cl, ah
|
|
||||||
ror edx, 4
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[ebx]
|
|
||||||
mov bl, dl
|
|
||||||
xor edi, ebp
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0200h+ecx]
|
|
||||||
xor edi, ebp
|
|
||||||
mov cl, dh
|
|
||||||
shr eax, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0100h+ebx]
|
|
||||||
xor edi, ebp
|
|
||||||
mov bl, ah
|
|
||||||
shr edx, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0300h+ecx]
|
|
||||||
xor edi, ebp
|
|
||||||
mov ebp, DWORD PTR 28[esp]
|
|
||||||
mov cl, dh
|
|
||||||
and eax, 0ffh
|
|
||||||
and edx, 0ffh
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0600h+ebx]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0700h+ecx]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0400h+eax]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0500h+edx]
|
|
||||||
xor edi, ebx
|
|
||||||
;
|
|
||||||
; Round 1
|
|
||||||
mov eax, DWORD PTR 32[esp]
|
|
||||||
mov edx, edi
|
|
||||||
shr edx, 16
|
|
||||||
mov ecx, DWORD PTR 36[esp]
|
|
||||||
xor edx, edi
|
|
||||||
and eax, edx
|
|
||||||
and edx, ecx
|
|
||||||
mov ebx, eax
|
|
||||||
shl ebx, 16
|
|
||||||
mov ecx, edx
|
|
||||||
shl ecx, 16
|
|
||||||
xor eax, ebx
|
|
||||||
xor edx, ecx
|
|
||||||
mov ebx, DWORD PTR 8[ebp]
|
|
||||||
xor eax, ebx
|
|
||||||
mov ecx, DWORD PTR 12[ebp]
|
|
||||||
xor eax, edi
|
|
||||||
xor edx, edi
|
|
||||||
xor edx, ecx
|
|
||||||
and eax, 0fcfcfcfch
|
|
||||||
xor ebx, ebx
|
|
||||||
and edx, 0cfcfcfcfh
|
|
||||||
xor ecx, ecx
|
|
||||||
mov bl, al
|
|
||||||
mov cl, ah
|
|
||||||
ror edx, 4
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[ebx]
|
|
||||||
mov bl, dl
|
|
||||||
xor esi, ebp
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0200h+ecx]
|
|
||||||
xor esi, ebp
|
|
||||||
mov cl, dh
|
|
||||||
shr eax, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0100h+ebx]
|
|
||||||
xor esi, ebp
|
|
||||||
mov bl, ah
|
|
||||||
shr edx, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0300h+ecx]
|
|
||||||
xor esi, ebp
|
|
||||||
mov ebp, DWORD PTR 28[esp]
|
|
||||||
mov cl, dh
|
|
||||||
and eax, 0ffh
|
|
||||||
and edx, 0ffh
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0600h+ebx]
|
|
||||||
xor esi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0700h+ecx]
|
|
||||||
xor esi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0400h+eax]
|
|
||||||
xor esi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0500h+edx]
|
|
||||||
xor esi, ebx
|
|
||||||
;
|
|
||||||
; Round 2
|
|
||||||
mov eax, DWORD PTR 32[esp]
|
|
||||||
mov edx, esi
|
|
||||||
shr edx, 16
|
|
||||||
mov ecx, DWORD PTR 36[esp]
|
|
||||||
xor edx, esi
|
|
||||||
and eax, edx
|
|
||||||
and edx, ecx
|
|
||||||
mov ebx, eax
|
|
||||||
shl ebx, 16
|
|
||||||
mov ecx, edx
|
|
||||||
shl ecx, 16
|
|
||||||
xor eax, ebx
|
|
||||||
xor edx, ecx
|
|
||||||
mov ebx, DWORD PTR 16[ebp]
|
|
||||||
xor eax, ebx
|
|
||||||
mov ecx, DWORD PTR 20[ebp]
|
|
||||||
xor eax, esi
|
|
||||||
xor edx, esi
|
|
||||||
xor edx, ecx
|
|
||||||
and eax, 0fcfcfcfch
|
|
||||||
xor ebx, ebx
|
|
||||||
and edx, 0cfcfcfcfh
|
|
||||||
xor ecx, ecx
|
|
||||||
mov bl, al
|
|
||||||
mov cl, ah
|
|
||||||
ror edx, 4
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[ebx]
|
|
||||||
mov bl, dl
|
|
||||||
xor edi, ebp
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0200h+ecx]
|
|
||||||
xor edi, ebp
|
|
||||||
mov cl, dh
|
|
||||||
shr eax, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0100h+ebx]
|
|
||||||
xor edi, ebp
|
|
||||||
mov bl, ah
|
|
||||||
shr edx, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0300h+ecx]
|
|
||||||
xor edi, ebp
|
|
||||||
mov ebp, DWORD PTR 28[esp]
|
|
||||||
mov cl, dh
|
|
||||||
and eax, 0ffh
|
|
||||||
and edx, 0ffh
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0600h+ebx]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0700h+ecx]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0400h+eax]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0500h+edx]
|
|
||||||
xor edi, ebx
|
|
||||||
;
|
|
||||||
; Round 3
|
|
||||||
mov eax, DWORD PTR 32[esp]
|
|
||||||
mov edx, edi
|
|
||||||
shr edx, 16
|
|
||||||
mov ecx, DWORD PTR 36[esp]
|
|
||||||
xor edx, edi
|
|
||||||
and eax, edx
|
|
||||||
and edx, ecx
|
|
||||||
mov ebx, eax
|
|
||||||
shl ebx, 16
|
|
||||||
mov ecx, edx
|
|
||||||
shl ecx, 16
|
|
||||||
xor eax, ebx
|
|
||||||
xor edx, ecx
|
|
||||||
mov ebx, DWORD PTR 24[ebp]
|
|
||||||
xor eax, ebx
|
|
||||||
mov ecx, DWORD PTR 28[ebp]
|
|
||||||
xor eax, edi
|
|
||||||
xor edx, edi
|
|
||||||
xor edx, ecx
|
|
||||||
and eax, 0fcfcfcfch
|
|
||||||
xor ebx, ebx
|
|
||||||
and edx, 0cfcfcfcfh
|
|
||||||
xor ecx, ecx
|
|
||||||
mov bl, al
|
|
||||||
mov cl, ah
|
|
||||||
ror edx, 4
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[ebx]
|
|
||||||
mov bl, dl
|
|
||||||
xor esi, ebp
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0200h+ecx]
|
|
||||||
xor esi, ebp
|
|
||||||
mov cl, dh
|
|
||||||
shr eax, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0100h+ebx]
|
|
||||||
xor esi, ebp
|
|
||||||
mov bl, ah
|
|
||||||
shr edx, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0300h+ecx]
|
|
||||||
xor esi, ebp
|
|
||||||
mov ebp, DWORD PTR 28[esp]
|
|
||||||
mov cl, dh
|
|
||||||
and eax, 0ffh
|
|
||||||
and edx, 0ffh
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0600h+ebx]
|
|
||||||
xor esi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0700h+ecx]
|
|
||||||
xor esi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0400h+eax]
|
|
||||||
xor esi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0500h+edx]
|
|
||||||
xor esi, ebx
|
|
||||||
;
|
|
||||||
; Round 4
|
|
||||||
mov eax, DWORD PTR 32[esp]
|
|
||||||
mov edx, esi
|
|
||||||
shr edx, 16
|
|
||||||
mov ecx, DWORD PTR 36[esp]
|
|
||||||
xor edx, esi
|
|
||||||
and eax, edx
|
|
||||||
and edx, ecx
|
|
||||||
mov ebx, eax
|
|
||||||
shl ebx, 16
|
|
||||||
mov ecx, edx
|
|
||||||
shl ecx, 16
|
|
||||||
xor eax, ebx
|
|
||||||
xor edx, ecx
|
|
||||||
mov ebx, DWORD PTR 32[ebp]
|
|
||||||
xor eax, ebx
|
|
||||||
mov ecx, DWORD PTR 36[ebp]
|
|
||||||
xor eax, esi
|
|
||||||
xor edx, esi
|
|
||||||
xor edx, ecx
|
|
||||||
and eax, 0fcfcfcfch
|
|
||||||
xor ebx, ebx
|
|
||||||
and edx, 0cfcfcfcfh
|
|
||||||
xor ecx, ecx
|
|
||||||
mov bl, al
|
|
||||||
mov cl, ah
|
|
||||||
ror edx, 4
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[ebx]
|
|
||||||
mov bl, dl
|
|
||||||
xor edi, ebp
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0200h+ecx]
|
|
||||||
xor edi, ebp
|
|
||||||
mov cl, dh
|
|
||||||
shr eax, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0100h+ebx]
|
|
||||||
xor edi, ebp
|
|
||||||
mov bl, ah
|
|
||||||
shr edx, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0300h+ecx]
|
|
||||||
xor edi, ebp
|
|
||||||
mov ebp, DWORD PTR 28[esp]
|
|
||||||
mov cl, dh
|
|
||||||
and eax, 0ffh
|
|
||||||
and edx, 0ffh
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0600h+ebx]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0700h+ecx]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0400h+eax]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0500h+edx]
|
|
||||||
xor edi, ebx
|
|
||||||
;
|
|
||||||
; Round 5
|
|
||||||
mov eax, DWORD PTR 32[esp]
|
|
||||||
mov edx, edi
|
|
||||||
shr edx, 16
|
|
||||||
mov ecx, DWORD PTR 36[esp]
|
|
||||||
xor edx, edi
|
|
||||||
and eax, edx
|
|
||||||
and edx, ecx
|
|
||||||
mov ebx, eax
|
|
||||||
shl ebx, 16
|
|
||||||
mov ecx, edx
|
|
||||||
shl ecx, 16
|
|
||||||
xor eax, ebx
|
|
||||||
xor edx, ecx
|
|
||||||
mov ebx, DWORD PTR 40[ebp]
|
|
||||||
xor eax, ebx
|
|
||||||
mov ecx, DWORD PTR 44[ebp]
|
|
||||||
xor eax, edi
|
|
||||||
xor edx, edi
|
|
||||||
xor edx, ecx
|
|
||||||
and eax, 0fcfcfcfch
|
|
||||||
xor ebx, ebx
|
|
||||||
and edx, 0cfcfcfcfh
|
|
||||||
xor ecx, ecx
|
|
||||||
mov bl, al
|
|
||||||
mov cl, ah
|
|
||||||
ror edx, 4
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[ebx]
|
|
||||||
mov bl, dl
|
|
||||||
xor esi, ebp
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0200h+ecx]
|
|
||||||
xor esi, ebp
|
|
||||||
mov cl, dh
|
|
||||||
shr eax, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0100h+ebx]
|
|
||||||
xor esi, ebp
|
|
||||||
mov bl, ah
|
|
||||||
shr edx, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0300h+ecx]
|
|
||||||
xor esi, ebp
|
|
||||||
mov ebp, DWORD PTR 28[esp]
|
|
||||||
mov cl, dh
|
|
||||||
and eax, 0ffh
|
|
||||||
and edx, 0ffh
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0600h+ebx]
|
|
||||||
xor esi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0700h+ecx]
|
|
||||||
xor esi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0400h+eax]
|
|
||||||
xor esi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0500h+edx]
|
|
||||||
xor esi, ebx
|
|
||||||
;
|
|
||||||
; Round 6
|
|
||||||
mov eax, DWORD PTR 32[esp]
|
|
||||||
mov edx, esi
|
|
||||||
shr edx, 16
|
|
||||||
mov ecx, DWORD PTR 36[esp]
|
|
||||||
xor edx, esi
|
|
||||||
and eax, edx
|
|
||||||
and edx, ecx
|
|
||||||
mov ebx, eax
|
|
||||||
shl ebx, 16
|
|
||||||
mov ecx, edx
|
|
||||||
shl ecx, 16
|
|
||||||
xor eax, ebx
|
|
||||||
xor edx, ecx
|
|
||||||
mov ebx, DWORD PTR 48[ebp]
|
|
||||||
xor eax, ebx
|
|
||||||
mov ecx, DWORD PTR 52[ebp]
|
|
||||||
xor eax, esi
|
|
||||||
xor edx, esi
|
|
||||||
xor edx, ecx
|
|
||||||
and eax, 0fcfcfcfch
|
|
||||||
xor ebx, ebx
|
|
||||||
and edx, 0cfcfcfcfh
|
|
||||||
xor ecx, ecx
|
|
||||||
mov bl, al
|
|
||||||
mov cl, ah
|
|
||||||
ror edx, 4
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[ebx]
|
|
||||||
mov bl, dl
|
|
||||||
xor edi, ebp
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0200h+ecx]
|
|
||||||
xor edi, ebp
|
|
||||||
mov cl, dh
|
|
||||||
shr eax, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0100h+ebx]
|
|
||||||
xor edi, ebp
|
|
||||||
mov bl, ah
|
|
||||||
shr edx, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0300h+ecx]
|
|
||||||
xor edi, ebp
|
|
||||||
mov ebp, DWORD PTR 28[esp]
|
|
||||||
mov cl, dh
|
|
||||||
and eax, 0ffh
|
|
||||||
and edx, 0ffh
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0600h+ebx]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0700h+ecx]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0400h+eax]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0500h+edx]
|
|
||||||
xor edi, ebx
|
|
||||||
;
|
|
||||||
; Round 7
|
|
||||||
mov eax, DWORD PTR 32[esp]
|
|
||||||
mov edx, edi
|
|
||||||
shr edx, 16
|
|
||||||
mov ecx, DWORD PTR 36[esp]
|
|
||||||
xor edx, edi
|
|
||||||
and eax, edx
|
|
||||||
and edx, ecx
|
|
||||||
mov ebx, eax
|
|
||||||
shl ebx, 16
|
|
||||||
mov ecx, edx
|
|
||||||
shl ecx, 16
|
|
||||||
xor eax, ebx
|
|
||||||
xor edx, ecx
|
|
||||||
mov ebx, DWORD PTR 56[ebp]
|
|
||||||
xor eax, ebx
|
|
||||||
mov ecx, DWORD PTR 60[ebp]
|
|
||||||
xor eax, edi
|
|
||||||
xor edx, edi
|
|
||||||
xor edx, ecx
|
|
||||||
and eax, 0fcfcfcfch
|
|
||||||
xor ebx, ebx
|
|
||||||
and edx, 0cfcfcfcfh
|
|
||||||
xor ecx, ecx
|
|
||||||
mov bl, al
|
|
||||||
mov cl, ah
|
|
||||||
ror edx, 4
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[ebx]
|
|
||||||
mov bl, dl
|
|
||||||
xor esi, ebp
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0200h+ecx]
|
|
||||||
xor esi, ebp
|
|
||||||
mov cl, dh
|
|
||||||
shr eax, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0100h+ebx]
|
|
||||||
xor esi, ebp
|
|
||||||
mov bl, ah
|
|
||||||
shr edx, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0300h+ecx]
|
|
||||||
xor esi, ebp
|
|
||||||
mov ebp, DWORD PTR 28[esp]
|
|
||||||
mov cl, dh
|
|
||||||
and eax, 0ffh
|
|
||||||
and edx, 0ffh
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0600h+ebx]
|
|
||||||
xor esi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0700h+ecx]
|
|
||||||
xor esi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0400h+eax]
|
|
||||||
xor esi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0500h+edx]
|
|
||||||
xor esi, ebx
|
|
||||||
;
|
|
||||||
; Round 8
|
|
||||||
mov eax, DWORD PTR 32[esp]
|
|
||||||
mov edx, esi
|
|
||||||
shr edx, 16
|
|
||||||
mov ecx, DWORD PTR 36[esp]
|
|
||||||
xor edx, esi
|
|
||||||
and eax, edx
|
|
||||||
and edx, ecx
|
|
||||||
mov ebx, eax
|
|
||||||
shl ebx, 16
|
|
||||||
mov ecx, edx
|
|
||||||
shl ecx, 16
|
|
||||||
xor eax, ebx
|
|
||||||
xor edx, ecx
|
|
||||||
mov ebx, DWORD PTR 64[ebp]
|
|
||||||
xor eax, ebx
|
|
||||||
mov ecx, DWORD PTR 68[ebp]
|
|
||||||
xor eax, esi
|
|
||||||
xor edx, esi
|
|
||||||
xor edx, ecx
|
|
||||||
and eax, 0fcfcfcfch
|
|
||||||
xor ebx, ebx
|
|
||||||
and edx, 0cfcfcfcfh
|
|
||||||
xor ecx, ecx
|
|
||||||
mov bl, al
|
|
||||||
mov cl, ah
|
|
||||||
ror edx, 4
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[ebx]
|
|
||||||
mov bl, dl
|
|
||||||
xor edi, ebp
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0200h+ecx]
|
|
||||||
xor edi, ebp
|
|
||||||
mov cl, dh
|
|
||||||
shr eax, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0100h+ebx]
|
|
||||||
xor edi, ebp
|
|
||||||
mov bl, ah
|
|
||||||
shr edx, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0300h+ecx]
|
|
||||||
xor edi, ebp
|
|
||||||
mov ebp, DWORD PTR 28[esp]
|
|
||||||
mov cl, dh
|
|
||||||
and eax, 0ffh
|
|
||||||
and edx, 0ffh
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0600h+ebx]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0700h+ecx]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0400h+eax]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0500h+edx]
|
|
||||||
xor edi, ebx
|
|
||||||
;
|
|
||||||
; Round 9
|
|
||||||
mov eax, DWORD PTR 32[esp]
|
|
||||||
mov edx, edi
|
|
||||||
shr edx, 16
|
|
||||||
mov ecx, DWORD PTR 36[esp]
|
|
||||||
xor edx, edi
|
|
||||||
and eax, edx
|
|
||||||
and edx, ecx
|
|
||||||
mov ebx, eax
|
|
||||||
shl ebx, 16
|
|
||||||
mov ecx, edx
|
|
||||||
shl ecx, 16
|
|
||||||
xor eax, ebx
|
|
||||||
xor edx, ecx
|
|
||||||
mov ebx, DWORD PTR 72[ebp]
|
|
||||||
xor eax, ebx
|
|
||||||
mov ecx, DWORD PTR 76[ebp]
|
|
||||||
xor eax, edi
|
|
||||||
xor edx, edi
|
|
||||||
xor edx, ecx
|
|
||||||
and eax, 0fcfcfcfch
|
|
||||||
xor ebx, ebx
|
|
||||||
and edx, 0cfcfcfcfh
|
|
||||||
xor ecx, ecx
|
|
||||||
mov bl, al
|
|
||||||
mov cl, ah
|
|
||||||
ror edx, 4
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[ebx]
|
|
||||||
mov bl, dl
|
|
||||||
xor esi, ebp
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0200h+ecx]
|
|
||||||
xor esi, ebp
|
|
||||||
mov cl, dh
|
|
||||||
shr eax, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0100h+ebx]
|
|
||||||
xor esi, ebp
|
|
||||||
mov bl, ah
|
|
||||||
shr edx, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0300h+ecx]
|
|
||||||
xor esi, ebp
|
|
||||||
mov ebp, DWORD PTR 28[esp]
|
|
||||||
mov cl, dh
|
|
||||||
and eax, 0ffh
|
|
||||||
and edx, 0ffh
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0600h+ebx]
|
|
||||||
xor esi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0700h+ecx]
|
|
||||||
xor esi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0400h+eax]
|
|
||||||
xor esi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0500h+edx]
|
|
||||||
xor esi, ebx
|
|
||||||
;
|
|
||||||
; Round 10
|
|
||||||
mov eax, DWORD PTR 32[esp]
|
|
||||||
mov edx, esi
|
|
||||||
shr edx, 16
|
|
||||||
mov ecx, DWORD PTR 36[esp]
|
|
||||||
xor edx, esi
|
|
||||||
and eax, edx
|
|
||||||
and edx, ecx
|
|
||||||
mov ebx, eax
|
|
||||||
shl ebx, 16
|
|
||||||
mov ecx, edx
|
|
||||||
shl ecx, 16
|
|
||||||
xor eax, ebx
|
|
||||||
xor edx, ecx
|
|
||||||
mov ebx, DWORD PTR 80[ebp]
|
|
||||||
xor eax, ebx
|
|
||||||
mov ecx, DWORD PTR 84[ebp]
|
|
||||||
xor eax, esi
|
|
||||||
xor edx, esi
|
|
||||||
xor edx, ecx
|
|
||||||
and eax, 0fcfcfcfch
|
|
||||||
xor ebx, ebx
|
|
||||||
and edx, 0cfcfcfcfh
|
|
||||||
xor ecx, ecx
|
|
||||||
mov bl, al
|
|
||||||
mov cl, ah
|
|
||||||
ror edx, 4
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[ebx]
|
|
||||||
mov bl, dl
|
|
||||||
xor edi, ebp
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0200h+ecx]
|
|
||||||
xor edi, ebp
|
|
||||||
mov cl, dh
|
|
||||||
shr eax, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0100h+ebx]
|
|
||||||
xor edi, ebp
|
|
||||||
mov bl, ah
|
|
||||||
shr edx, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0300h+ecx]
|
|
||||||
xor edi, ebp
|
|
||||||
mov ebp, DWORD PTR 28[esp]
|
|
||||||
mov cl, dh
|
|
||||||
and eax, 0ffh
|
|
||||||
and edx, 0ffh
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0600h+ebx]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0700h+ecx]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0400h+eax]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0500h+edx]
|
|
||||||
xor edi, ebx
|
|
||||||
;
|
|
||||||
; Round 11
|
|
||||||
mov eax, DWORD PTR 32[esp]
|
|
||||||
mov edx, edi
|
|
||||||
shr edx, 16
|
|
||||||
mov ecx, DWORD PTR 36[esp]
|
|
||||||
xor edx, edi
|
|
||||||
and eax, edx
|
|
||||||
and edx, ecx
|
|
||||||
mov ebx, eax
|
|
||||||
shl ebx, 16
|
|
||||||
mov ecx, edx
|
|
||||||
shl ecx, 16
|
|
||||||
xor eax, ebx
|
|
||||||
xor edx, ecx
|
|
||||||
mov ebx, DWORD PTR 88[ebp]
|
|
||||||
xor eax, ebx
|
|
||||||
mov ecx, DWORD PTR 92[ebp]
|
|
||||||
xor eax, edi
|
|
||||||
xor edx, edi
|
|
||||||
xor edx, ecx
|
|
||||||
and eax, 0fcfcfcfch
|
|
||||||
xor ebx, ebx
|
|
||||||
and edx, 0cfcfcfcfh
|
|
||||||
xor ecx, ecx
|
|
||||||
mov bl, al
|
|
||||||
mov cl, ah
|
|
||||||
ror edx, 4
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[ebx]
|
|
||||||
mov bl, dl
|
|
||||||
xor esi, ebp
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0200h+ecx]
|
|
||||||
xor esi, ebp
|
|
||||||
mov cl, dh
|
|
||||||
shr eax, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0100h+ebx]
|
|
||||||
xor esi, ebp
|
|
||||||
mov bl, ah
|
|
||||||
shr edx, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0300h+ecx]
|
|
||||||
xor esi, ebp
|
|
||||||
mov ebp, DWORD PTR 28[esp]
|
|
||||||
mov cl, dh
|
|
||||||
and eax, 0ffh
|
|
||||||
and edx, 0ffh
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0600h+ebx]
|
|
||||||
xor esi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0700h+ecx]
|
|
||||||
xor esi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0400h+eax]
|
|
||||||
xor esi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0500h+edx]
|
|
||||||
xor esi, ebx
|
|
||||||
;
|
|
||||||
; Round 12
|
|
||||||
mov eax, DWORD PTR 32[esp]
|
|
||||||
mov edx, esi
|
|
||||||
shr edx, 16
|
|
||||||
mov ecx, DWORD PTR 36[esp]
|
|
||||||
xor edx, esi
|
|
||||||
and eax, edx
|
|
||||||
and edx, ecx
|
|
||||||
mov ebx, eax
|
|
||||||
shl ebx, 16
|
|
||||||
mov ecx, edx
|
|
||||||
shl ecx, 16
|
|
||||||
xor eax, ebx
|
|
||||||
xor edx, ecx
|
|
||||||
mov ebx, DWORD PTR 96[ebp]
|
|
||||||
xor eax, ebx
|
|
||||||
mov ecx, DWORD PTR 100[ebp]
|
|
||||||
xor eax, esi
|
|
||||||
xor edx, esi
|
|
||||||
xor edx, ecx
|
|
||||||
and eax, 0fcfcfcfch
|
|
||||||
xor ebx, ebx
|
|
||||||
and edx, 0cfcfcfcfh
|
|
||||||
xor ecx, ecx
|
|
||||||
mov bl, al
|
|
||||||
mov cl, ah
|
|
||||||
ror edx, 4
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[ebx]
|
|
||||||
mov bl, dl
|
|
||||||
xor edi, ebp
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0200h+ecx]
|
|
||||||
xor edi, ebp
|
|
||||||
mov cl, dh
|
|
||||||
shr eax, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0100h+ebx]
|
|
||||||
xor edi, ebp
|
|
||||||
mov bl, ah
|
|
||||||
shr edx, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0300h+ecx]
|
|
||||||
xor edi, ebp
|
|
||||||
mov ebp, DWORD PTR 28[esp]
|
|
||||||
mov cl, dh
|
|
||||||
and eax, 0ffh
|
|
||||||
and edx, 0ffh
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0600h+ebx]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0700h+ecx]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0400h+eax]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0500h+edx]
|
|
||||||
xor edi, ebx
|
|
||||||
;
|
|
||||||
; Round 13
|
|
||||||
mov eax, DWORD PTR 32[esp]
|
|
||||||
mov edx, edi
|
|
||||||
shr edx, 16
|
|
||||||
mov ecx, DWORD PTR 36[esp]
|
|
||||||
xor edx, edi
|
|
||||||
and eax, edx
|
|
||||||
and edx, ecx
|
|
||||||
mov ebx, eax
|
|
||||||
shl ebx, 16
|
|
||||||
mov ecx, edx
|
|
||||||
shl ecx, 16
|
|
||||||
xor eax, ebx
|
|
||||||
xor edx, ecx
|
|
||||||
mov ebx, DWORD PTR 104[ebp]
|
|
||||||
xor eax, ebx
|
|
||||||
mov ecx, DWORD PTR 108[ebp]
|
|
||||||
xor eax, edi
|
|
||||||
xor edx, edi
|
|
||||||
xor edx, ecx
|
|
||||||
and eax, 0fcfcfcfch
|
|
||||||
xor ebx, ebx
|
|
||||||
and edx, 0cfcfcfcfh
|
|
||||||
xor ecx, ecx
|
|
||||||
mov bl, al
|
|
||||||
mov cl, ah
|
|
||||||
ror edx, 4
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[ebx]
|
|
||||||
mov bl, dl
|
|
||||||
xor esi, ebp
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0200h+ecx]
|
|
||||||
xor esi, ebp
|
|
||||||
mov cl, dh
|
|
||||||
shr eax, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0100h+ebx]
|
|
||||||
xor esi, ebp
|
|
||||||
mov bl, ah
|
|
||||||
shr edx, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0300h+ecx]
|
|
||||||
xor esi, ebp
|
|
||||||
mov ebp, DWORD PTR 28[esp]
|
|
||||||
mov cl, dh
|
|
||||||
and eax, 0ffh
|
|
||||||
and edx, 0ffh
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0600h+ebx]
|
|
||||||
xor esi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0700h+ecx]
|
|
||||||
xor esi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0400h+eax]
|
|
||||||
xor esi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0500h+edx]
|
|
||||||
xor esi, ebx
|
|
||||||
;
|
|
||||||
; Round 14
|
|
||||||
mov eax, DWORD PTR 32[esp]
|
|
||||||
mov edx, esi
|
|
||||||
shr edx, 16
|
|
||||||
mov ecx, DWORD PTR 36[esp]
|
|
||||||
xor edx, esi
|
|
||||||
and eax, edx
|
|
||||||
and edx, ecx
|
|
||||||
mov ebx, eax
|
|
||||||
shl ebx, 16
|
|
||||||
mov ecx, edx
|
|
||||||
shl ecx, 16
|
|
||||||
xor eax, ebx
|
|
||||||
xor edx, ecx
|
|
||||||
mov ebx, DWORD PTR 112[ebp]
|
|
||||||
xor eax, ebx
|
|
||||||
mov ecx, DWORD PTR 116[ebp]
|
|
||||||
xor eax, esi
|
|
||||||
xor edx, esi
|
|
||||||
xor edx, ecx
|
|
||||||
and eax, 0fcfcfcfch
|
|
||||||
xor ebx, ebx
|
|
||||||
and edx, 0cfcfcfcfh
|
|
||||||
xor ecx, ecx
|
|
||||||
mov bl, al
|
|
||||||
mov cl, ah
|
|
||||||
ror edx, 4
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[ebx]
|
|
||||||
mov bl, dl
|
|
||||||
xor edi, ebp
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0200h+ecx]
|
|
||||||
xor edi, ebp
|
|
||||||
mov cl, dh
|
|
||||||
shr eax, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0100h+ebx]
|
|
||||||
xor edi, ebp
|
|
||||||
mov bl, ah
|
|
||||||
shr edx, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0300h+ecx]
|
|
||||||
xor edi, ebp
|
|
||||||
mov ebp, DWORD PTR 28[esp]
|
|
||||||
mov cl, dh
|
|
||||||
and eax, 0ffh
|
|
||||||
and edx, 0ffh
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0600h+ebx]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0700h+ecx]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0400h+eax]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0500h+edx]
|
|
||||||
xor edi, ebx
|
|
||||||
;
|
|
||||||
; Round 15
|
|
||||||
mov eax, DWORD PTR 32[esp]
|
|
||||||
mov edx, edi
|
|
||||||
shr edx, 16
|
|
||||||
mov ecx, DWORD PTR 36[esp]
|
|
||||||
xor edx, edi
|
|
||||||
and eax, edx
|
|
||||||
and edx, ecx
|
|
||||||
mov ebx, eax
|
|
||||||
shl ebx, 16
|
|
||||||
mov ecx, edx
|
|
||||||
shl ecx, 16
|
|
||||||
xor eax, ebx
|
|
||||||
xor edx, ecx
|
|
||||||
mov ebx, DWORD PTR 120[ebp]
|
|
||||||
xor eax, ebx
|
|
||||||
mov ecx, DWORD PTR 124[ebp]
|
|
||||||
xor eax, edi
|
|
||||||
xor edx, edi
|
|
||||||
xor edx, ecx
|
|
||||||
and eax, 0fcfcfcfch
|
|
||||||
xor ebx, ebx
|
|
||||||
and edx, 0cfcfcfcfh
|
|
||||||
xor ecx, ecx
|
|
||||||
mov bl, al
|
|
||||||
mov cl, ah
|
|
||||||
ror edx, 4
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[ebx]
|
|
||||||
mov bl, dl
|
|
||||||
xor esi, ebp
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0200h+ecx]
|
|
||||||
xor esi, ebp
|
|
||||||
mov cl, dh
|
|
||||||
shr eax, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0100h+ebx]
|
|
||||||
xor esi, ebp
|
|
||||||
mov bl, ah
|
|
||||||
shr edx, 16
|
|
||||||
mov ebp, DWORD PTR _des_SPtrans[0300h+ecx]
|
|
||||||
xor esi, ebp
|
|
||||||
mov ebp, DWORD PTR 28[esp]
|
|
||||||
mov cl, dh
|
|
||||||
and eax, 0ffh
|
|
||||||
and edx, 0ffh
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0600h+ebx]
|
|
||||||
xor esi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0700h+ecx]
|
|
||||||
xor esi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0400h+eax]
|
|
||||||
xor esi, ebx
|
|
||||||
mov ebx, DWORD PTR _des_SPtrans[0500h+edx]
|
|
||||||
xor esi, ebx
|
|
||||||
mov ebx, DWORD PTR [esp]
|
|
||||||
mov eax, edi
|
|
||||||
dec ebx
|
|
||||||
mov edi, esi
|
|
||||||
mov esi, eax
|
|
||||||
mov DWORD PTR [esp],ebx
|
|
||||||
jnz L000start
|
|
||||||
;
|
|
||||||
; FP
|
|
||||||
mov edx, DWORD PTR 24[esp]
|
|
||||||
ror edi, 1
|
|
||||||
mov eax, esi
|
|
||||||
xor esi, edi
|
|
||||||
and esi, 0aaaaaaaah
|
|
||||||
xor eax, esi
|
|
||||||
xor edi, esi
|
|
||||||
;
|
|
||||||
rol eax, 23
|
|
||||||
mov esi, eax
|
|
||||||
xor eax, edi
|
|
||||||
and eax, 003fc03fch
|
|
||||||
xor esi, eax
|
|
||||||
xor edi, eax
|
|
||||||
;
|
|
||||||
rol esi, 10
|
|
||||||
mov eax, esi
|
|
||||||
xor esi, edi
|
|
||||||
and esi, 033333333h
|
|
||||||
xor eax, esi
|
|
||||||
xor edi, esi
|
|
||||||
;
|
|
||||||
rol edi, 18
|
|
||||||
mov esi, edi
|
|
||||||
xor edi, eax
|
|
||||||
and edi, 0fff0000fh
|
|
||||||
xor esi, edi
|
|
||||||
xor eax, edi
|
|
||||||
;
|
|
||||||
rol esi, 12
|
|
||||||
mov edi, esi
|
|
||||||
xor esi, eax
|
|
||||||
and esi, 0f0f0f0f0h
|
|
||||||
xor edi, esi
|
|
||||||
xor eax, esi
|
|
||||||
;
|
|
||||||
ror eax, 4
|
|
||||||
mov DWORD PTR [edx],eax
|
|
||||||
mov DWORD PTR 4[edx],edi
|
|
||||||
pop ecx
|
|
||||||
pop edi
|
|
||||||
pop esi
|
|
||||||
pop ebx
|
|
||||||
pop ebp
|
|
||||||
ret
|
|
||||||
_fcrypt_body ENDP
|
|
||||||
_TEXT ENDS
|
|
||||||
END
|
|
@ -1,687 +0,0 @@
|
|||||||
; Don't even think of reading this code
|
|
||||||
; It was automatically generated by md5-586.pl
|
|
||||||
; Which is a perl program used to generate the x86 assember for
|
|
||||||
; any of elf, a.out, BSDI,Win32, or Solaris
|
|
||||||
; eric <eay@cryptsoft.com>
|
|
||||||
;
|
|
||||||
TITLE md5-586.asm
|
|
||||||
.386
|
|
||||||
.model FLAT
|
|
||||||
_TEXT SEGMENT
|
|
||||||
PUBLIC _md5_block_asm_host_order
|
|
||||||
|
|
||||||
_md5_block_asm_host_order PROC NEAR
|
|
||||||
push esi
|
|
||||||
push edi
|
|
||||||
mov edi, DWORD PTR 12[esp]
|
|
||||||
mov esi, DWORD PTR 16[esp]
|
|
||||||
mov ecx, DWORD PTR 20[esp]
|
|
||||||
push ebp
|
|
||||||
shl ecx, 6
|
|
||||||
push ebx
|
|
||||||
add ecx, esi
|
|
||||||
sub ecx, 64
|
|
||||||
mov eax, DWORD PTR [edi]
|
|
||||||
push ecx
|
|
||||||
mov ebx, DWORD PTR 4[edi]
|
|
||||||
mov ecx, DWORD PTR 8[edi]
|
|
||||||
mov edx, DWORD PTR 12[edi]
|
|
||||||
L000start:
|
|
||||||
;
|
|
||||||
; R0 section
|
|
||||||
mov edi, ecx
|
|
||||||
mov ebp, DWORD PTR [esi]
|
|
||||||
; R0 0
|
|
||||||
xor edi, edx
|
|
||||||
and edi, ebx
|
|
||||||
lea eax, DWORD PTR 3614090360[ebp*1+eax]
|
|
||||||
xor edi, edx
|
|
||||||
add eax, edi
|
|
||||||
mov edi, ebx
|
|
||||||
rol eax, 7
|
|
||||||
mov ebp, DWORD PTR 4[esi]
|
|
||||||
add eax, ebx
|
|
||||||
; R0 1
|
|
||||||
xor edi, ecx
|
|
||||||
and edi, eax
|
|
||||||
lea edx, DWORD PTR 3905402710[ebp*1+edx]
|
|
||||||
xor edi, ecx
|
|
||||||
add edx, edi
|
|
||||||
mov edi, eax
|
|
||||||
rol edx, 12
|
|
||||||
mov ebp, DWORD PTR 8[esi]
|
|
||||||
add edx, eax
|
|
||||||
; R0 2
|
|
||||||
xor edi, ebx
|
|
||||||
and edi, edx
|
|
||||||
lea ecx, DWORD PTR 606105819[ebp*1+ecx]
|
|
||||||
xor edi, ebx
|
|
||||||
add ecx, edi
|
|
||||||
mov edi, edx
|
|
||||||
rol ecx, 17
|
|
||||||
mov ebp, DWORD PTR 12[esi]
|
|
||||||
add ecx, edx
|
|
||||||
; R0 3
|
|
||||||
xor edi, eax
|
|
||||||
and edi, ecx
|
|
||||||
lea ebx, DWORD PTR 3250441966[ebp*1+ebx]
|
|
||||||
xor edi, eax
|
|
||||||
add ebx, edi
|
|
||||||
mov edi, ecx
|
|
||||||
rol ebx, 22
|
|
||||||
mov ebp, DWORD PTR 16[esi]
|
|
||||||
add ebx, ecx
|
|
||||||
; R0 4
|
|
||||||
xor edi, edx
|
|
||||||
and edi, ebx
|
|
||||||
lea eax, DWORD PTR 4118548399[ebp*1+eax]
|
|
||||||
xor edi, edx
|
|
||||||
add eax, edi
|
|
||||||
mov edi, ebx
|
|
||||||
rol eax, 7
|
|
||||||
mov ebp, DWORD PTR 20[esi]
|
|
||||||
add eax, ebx
|
|
||||||
; R0 5
|
|
||||||
xor edi, ecx
|
|
||||||
and edi, eax
|
|
||||||
lea edx, DWORD PTR 1200080426[ebp*1+edx]
|
|
||||||
xor edi, ecx
|
|
||||||
add edx, edi
|
|
||||||
mov edi, eax
|
|
||||||
rol edx, 12
|
|
||||||
mov ebp, DWORD PTR 24[esi]
|
|
||||||
add edx, eax
|
|
||||||
; R0 6
|
|
||||||
xor edi, ebx
|
|
||||||
and edi, edx
|
|
||||||
lea ecx, DWORD PTR 2821735955[ebp*1+ecx]
|
|
||||||
xor edi, ebx
|
|
||||||
add ecx, edi
|
|
||||||
mov edi, edx
|
|
||||||
rol ecx, 17
|
|
||||||
mov ebp, DWORD PTR 28[esi]
|
|
||||||
add ecx, edx
|
|
||||||
; R0 7
|
|
||||||
xor edi, eax
|
|
||||||
and edi, ecx
|
|
||||||
lea ebx, DWORD PTR 4249261313[ebp*1+ebx]
|
|
||||||
xor edi, eax
|
|
||||||
add ebx, edi
|
|
||||||
mov edi, ecx
|
|
||||||
rol ebx, 22
|
|
||||||
mov ebp, DWORD PTR 32[esi]
|
|
||||||
add ebx, ecx
|
|
||||||
; R0 8
|
|
||||||
xor edi, edx
|
|
||||||
and edi, ebx
|
|
||||||
lea eax, DWORD PTR 1770035416[ebp*1+eax]
|
|
||||||
xor edi, edx
|
|
||||||
add eax, edi
|
|
||||||
mov edi, ebx
|
|
||||||
rol eax, 7
|
|
||||||
mov ebp, DWORD PTR 36[esi]
|
|
||||||
add eax, ebx
|
|
||||||
; R0 9
|
|
||||||
xor edi, ecx
|
|
||||||
and edi, eax
|
|
||||||
lea edx, DWORD PTR 2336552879[ebp*1+edx]
|
|
||||||
xor edi, ecx
|
|
||||||
add edx, edi
|
|
||||||
mov edi, eax
|
|
||||||
rol edx, 12
|
|
||||||
mov ebp, DWORD PTR 40[esi]
|
|
||||||
add edx, eax
|
|
||||||
; R0 10
|
|
||||||
xor edi, ebx
|
|
||||||
and edi, edx
|
|
||||||
lea ecx, DWORD PTR 4294925233[ebp*1+ecx]
|
|
||||||
xor edi, ebx
|
|
||||||
add ecx, edi
|
|
||||||
mov edi, edx
|
|
||||||
rol ecx, 17
|
|
||||||
mov ebp, DWORD PTR 44[esi]
|
|
||||||
add ecx, edx
|
|
||||||
; R0 11
|
|
||||||
xor edi, eax
|
|
||||||
and edi, ecx
|
|
||||||
lea ebx, DWORD PTR 2304563134[ebp*1+ebx]
|
|
||||||
xor edi, eax
|
|
||||||
add ebx, edi
|
|
||||||
mov edi, ecx
|
|
||||||
rol ebx, 22
|
|
||||||
mov ebp, DWORD PTR 48[esi]
|
|
||||||
add ebx, ecx
|
|
||||||
; R0 12
|
|
||||||
xor edi, edx
|
|
||||||
and edi, ebx
|
|
||||||
lea eax, DWORD PTR 1804603682[ebp*1+eax]
|
|
||||||
xor edi, edx
|
|
||||||
add eax, edi
|
|
||||||
mov edi, ebx
|
|
||||||
rol eax, 7
|
|
||||||
mov ebp, DWORD PTR 52[esi]
|
|
||||||
add eax, ebx
|
|
||||||
; R0 13
|
|
||||||
xor edi, ecx
|
|
||||||
and edi, eax
|
|
||||||
lea edx, DWORD PTR 4254626195[ebp*1+edx]
|
|
||||||
xor edi, ecx
|
|
||||||
add edx, edi
|
|
||||||
mov edi, eax
|
|
||||||
rol edx, 12
|
|
||||||
mov ebp, DWORD PTR 56[esi]
|
|
||||||
add edx, eax
|
|
||||||
; R0 14
|
|
||||||
xor edi, ebx
|
|
||||||
and edi, edx
|
|
||||||
lea ecx, DWORD PTR 2792965006[ebp*1+ecx]
|
|
||||||
xor edi, ebx
|
|
||||||
add ecx, edi
|
|
||||||
mov edi, edx
|
|
||||||
rol ecx, 17
|
|
||||||
mov ebp, DWORD PTR 60[esi]
|
|
||||||
add ecx, edx
|
|
||||||
; R0 15
|
|
||||||
xor edi, eax
|
|
||||||
and edi, ecx
|
|
||||||
lea ebx, DWORD PTR 1236535329[ebp*1+ebx]
|
|
||||||
xor edi, eax
|
|
||||||
add ebx, edi
|
|
||||||
mov edi, ecx
|
|
||||||
rol ebx, 22
|
|
||||||
mov ebp, DWORD PTR 4[esi]
|
|
||||||
add ebx, ecx
|
|
||||||
;
|
|
||||||
; R1 section
|
|
||||||
; R1 16
|
|
||||||
lea eax, DWORD PTR 4129170786[ebp*1+eax]
|
|
||||||
xor edi, ebx
|
|
||||||
and edi, edx
|
|
||||||
mov ebp, DWORD PTR 24[esi]
|
|
||||||
xor edi, ecx
|
|
||||||
add eax, edi
|
|
||||||
mov edi, ebx
|
|
||||||
rol eax, 5
|
|
||||||
add eax, ebx
|
|
||||||
; R1 17
|
|
||||||
lea edx, DWORD PTR 3225465664[ebp*1+edx]
|
|
||||||
xor edi, eax
|
|
||||||
and edi, ecx
|
|
||||||
mov ebp, DWORD PTR 44[esi]
|
|
||||||
xor edi, ebx
|
|
||||||
add edx, edi
|
|
||||||
mov edi, eax
|
|
||||||
rol edx, 9
|
|
||||||
add edx, eax
|
|
||||||
; R1 18
|
|
||||||
lea ecx, DWORD PTR 643717713[ebp*1+ecx]
|
|
||||||
xor edi, edx
|
|
||||||
and edi, ebx
|
|
||||||
mov ebp, DWORD PTR [esi]
|
|
||||||
xor edi, eax
|
|
||||||
add ecx, edi
|
|
||||||
mov edi, edx
|
|
||||||
rol ecx, 14
|
|
||||||
add ecx, edx
|
|
||||||
; R1 19
|
|
||||||
lea ebx, DWORD PTR 3921069994[ebp*1+ebx]
|
|
||||||
xor edi, ecx
|
|
||||||
and edi, eax
|
|
||||||
mov ebp, DWORD PTR 20[esi]
|
|
||||||
xor edi, edx
|
|
||||||
add ebx, edi
|
|
||||||
mov edi, ecx
|
|
||||||
rol ebx, 20
|
|
||||||
add ebx, ecx
|
|
||||||
; R1 20
|
|
||||||
lea eax, DWORD PTR 3593408605[ebp*1+eax]
|
|
||||||
xor edi, ebx
|
|
||||||
and edi, edx
|
|
||||||
mov ebp, DWORD PTR 40[esi]
|
|
||||||
xor edi, ecx
|
|
||||||
add eax, edi
|
|
||||||
mov edi, ebx
|
|
||||||
rol eax, 5
|
|
||||||
add eax, ebx
|
|
||||||
; R1 21
|
|
||||||
lea edx, DWORD PTR 38016083[ebp*1+edx]
|
|
||||||
xor edi, eax
|
|
||||||
and edi, ecx
|
|
||||||
mov ebp, DWORD PTR 60[esi]
|
|
||||||
xor edi, ebx
|
|
||||||
add edx, edi
|
|
||||||
mov edi, eax
|
|
||||||
rol edx, 9
|
|
||||||
add edx, eax
|
|
||||||
; R1 22
|
|
||||||
lea ecx, DWORD PTR 3634488961[ebp*1+ecx]
|
|
||||||
xor edi, edx
|
|
||||||
and edi, ebx
|
|
||||||
mov ebp, DWORD PTR 16[esi]
|
|
||||||
xor edi, eax
|
|
||||||
add ecx, edi
|
|
||||||
mov edi, edx
|
|
||||||
rol ecx, 14
|
|
||||||
add ecx, edx
|
|
||||||
; R1 23
|
|
||||||
lea ebx, DWORD PTR 3889429448[ebp*1+ebx]
|
|
||||||
xor edi, ecx
|
|
||||||
and edi, eax
|
|
||||||
mov ebp, DWORD PTR 36[esi]
|
|
||||||
xor edi, edx
|
|
||||||
add ebx, edi
|
|
||||||
mov edi, ecx
|
|
||||||
rol ebx, 20
|
|
||||||
add ebx, ecx
|
|
||||||
; R1 24
|
|
||||||
lea eax, DWORD PTR 568446438[ebp*1+eax]
|
|
||||||
xor edi, ebx
|
|
||||||
and edi, edx
|
|
||||||
mov ebp, DWORD PTR 56[esi]
|
|
||||||
xor edi, ecx
|
|
||||||
add eax, edi
|
|
||||||
mov edi, ebx
|
|
||||||
rol eax, 5
|
|
||||||
add eax, ebx
|
|
||||||
; R1 25
|
|
||||||
lea edx, DWORD PTR 3275163606[ebp*1+edx]
|
|
||||||
xor edi, eax
|
|
||||||
and edi, ecx
|
|
||||||
mov ebp, DWORD PTR 12[esi]
|
|
||||||
xor edi, ebx
|
|
||||||
add edx, edi
|
|
||||||
mov edi, eax
|
|
||||||
rol edx, 9
|
|
||||||
add edx, eax
|
|
||||||
; R1 26
|
|
||||||
lea ecx, DWORD PTR 4107603335[ebp*1+ecx]
|
|
||||||
xor edi, edx
|
|
||||||
and edi, ebx
|
|
||||||
mov ebp, DWORD PTR 32[esi]
|
|
||||||
xor edi, eax
|
|
||||||
add ecx, edi
|
|
||||||
mov edi, edx
|
|
||||||
rol ecx, 14
|
|
||||||
add ecx, edx
|
|
||||||
; R1 27
|
|
||||||
lea ebx, DWORD PTR 1163531501[ebp*1+ebx]
|
|
||||||
xor edi, ecx
|
|
||||||
and edi, eax
|
|
||||||
mov ebp, DWORD PTR 52[esi]
|
|
||||||
xor edi, edx
|
|
||||||
add ebx, edi
|
|
||||||
mov edi, ecx
|
|
||||||
rol ebx, 20
|
|
||||||
add ebx, ecx
|
|
||||||
; R1 28
|
|
||||||
lea eax, DWORD PTR 2850285829[ebp*1+eax]
|
|
||||||
xor edi, ebx
|
|
||||||
and edi, edx
|
|
||||||
mov ebp, DWORD PTR 8[esi]
|
|
||||||
xor edi, ecx
|
|
||||||
add eax, edi
|
|
||||||
mov edi, ebx
|
|
||||||
rol eax, 5
|
|
||||||
add eax, ebx
|
|
||||||
; R1 29
|
|
||||||
lea edx, DWORD PTR 4243563512[ebp*1+edx]
|
|
||||||
xor edi, eax
|
|
||||||
and edi, ecx
|
|
||||||
mov ebp, DWORD PTR 28[esi]
|
|
||||||
xor edi, ebx
|
|
||||||
add edx, edi
|
|
||||||
mov edi, eax
|
|
||||||
rol edx, 9
|
|
||||||
add edx, eax
|
|
||||||
; R1 30
|
|
||||||
lea ecx, DWORD PTR 1735328473[ebp*1+ecx]
|
|
||||||
xor edi, edx
|
|
||||||
and edi, ebx
|
|
||||||
mov ebp, DWORD PTR 48[esi]
|
|
||||||
xor edi, eax
|
|
||||||
add ecx, edi
|
|
||||||
mov edi, edx
|
|
||||||
rol ecx, 14
|
|
||||||
add ecx, edx
|
|
||||||
; R1 31
|
|
||||||
lea ebx, DWORD PTR 2368359562[ebp*1+ebx]
|
|
||||||
xor edi, ecx
|
|
||||||
and edi, eax
|
|
||||||
mov ebp, DWORD PTR 20[esi]
|
|
||||||
xor edi, edx
|
|
||||||
add ebx, edi
|
|
||||||
mov edi, ecx
|
|
||||||
rol ebx, 20
|
|
||||||
add ebx, ecx
|
|
||||||
;
|
|
||||||
; R2 section
|
|
||||||
; R2 32
|
|
||||||
xor edi, edx
|
|
||||||
xor edi, ebx
|
|
||||||
lea eax, DWORD PTR 4294588738[ebp*1+eax]
|
|
||||||
add eax, edi
|
|
||||||
rol eax, 4
|
|
||||||
mov ebp, DWORD PTR 32[esi]
|
|
||||||
mov edi, ebx
|
|
||||||
; R2 33
|
|
||||||
lea edx, DWORD PTR 2272392833[ebp*1+edx]
|
|
||||||
add eax, ebx
|
|
||||||
xor edi, ecx
|
|
||||||
xor edi, eax
|
|
||||||
mov ebp, DWORD PTR 44[esi]
|
|
||||||
add edx, edi
|
|
||||||
mov edi, eax
|
|
||||||
rol edx, 11
|
|
||||||
add edx, eax
|
|
||||||
; R2 34
|
|
||||||
xor edi, ebx
|
|
||||||
xor edi, edx
|
|
||||||
lea ecx, DWORD PTR 1839030562[ebp*1+ecx]
|
|
||||||
add ecx, edi
|
|
||||||
rol ecx, 16
|
|
||||||
mov ebp, DWORD PTR 56[esi]
|
|
||||||
mov edi, edx
|
|
||||||
; R2 35
|
|
||||||
lea ebx, DWORD PTR 4259657740[ebp*1+ebx]
|
|
||||||
add ecx, edx
|
|
||||||
xor edi, eax
|
|
||||||
xor edi, ecx
|
|
||||||
mov ebp, DWORD PTR 4[esi]
|
|
||||||
add ebx, edi
|
|
||||||
mov edi, ecx
|
|
||||||
rol ebx, 23
|
|
||||||
add ebx, ecx
|
|
||||||
; R2 36
|
|
||||||
xor edi, edx
|
|
||||||
xor edi, ebx
|
|
||||||
lea eax, DWORD PTR 2763975236[ebp*1+eax]
|
|
||||||
add eax, edi
|
|
||||||
rol eax, 4
|
|
||||||
mov ebp, DWORD PTR 16[esi]
|
|
||||||
mov edi, ebx
|
|
||||||
; R2 37
|
|
||||||
lea edx, DWORD PTR 1272893353[ebp*1+edx]
|
|
||||||
add eax, ebx
|
|
||||||
xor edi, ecx
|
|
||||||
xor edi, eax
|
|
||||||
mov ebp, DWORD PTR 28[esi]
|
|
||||||
add edx, edi
|
|
||||||
mov edi, eax
|
|
||||||
rol edx, 11
|
|
||||||
add edx, eax
|
|
||||||
; R2 38
|
|
||||||
xor edi, ebx
|
|
||||||
xor edi, edx
|
|
||||||
lea ecx, DWORD PTR 4139469664[ebp*1+ecx]
|
|
||||||
add ecx, edi
|
|
||||||
rol ecx, 16
|
|
||||||
mov ebp, DWORD PTR 40[esi]
|
|
||||||
mov edi, edx
|
|
||||||
; R2 39
|
|
||||||
lea ebx, DWORD PTR 3200236656[ebp*1+ebx]
|
|
||||||
add ecx, edx
|
|
||||||
xor edi, eax
|
|
||||||
xor edi, ecx
|
|
||||||
mov ebp, DWORD PTR 52[esi]
|
|
||||||
add ebx, edi
|
|
||||||
mov edi, ecx
|
|
||||||
rol ebx, 23
|
|
||||||
add ebx, ecx
|
|
||||||
; R2 40
|
|
||||||
xor edi, edx
|
|
||||||
xor edi, ebx
|
|
||||||
lea eax, DWORD PTR 681279174[ebp*1+eax]
|
|
||||||
add eax, edi
|
|
||||||
rol eax, 4
|
|
||||||
mov ebp, DWORD PTR [esi]
|
|
||||||
mov edi, ebx
|
|
||||||
; R2 41
|
|
||||||
lea edx, DWORD PTR 3936430074[ebp*1+edx]
|
|
||||||
add eax, ebx
|
|
||||||
xor edi, ecx
|
|
||||||
xor edi, eax
|
|
||||||
mov ebp, DWORD PTR 12[esi]
|
|
||||||
add edx, edi
|
|
||||||
mov edi, eax
|
|
||||||
rol edx, 11
|
|
||||||
add edx, eax
|
|
||||||
; R2 42
|
|
||||||
xor edi, ebx
|
|
||||||
xor edi, edx
|
|
||||||
lea ecx, DWORD PTR 3572445317[ebp*1+ecx]
|
|
||||||
add ecx, edi
|
|
||||||
rol ecx, 16
|
|
||||||
mov ebp, DWORD PTR 24[esi]
|
|
||||||
mov edi, edx
|
|
||||||
; R2 43
|
|
||||||
lea ebx, DWORD PTR 76029189[ebp*1+ebx]
|
|
||||||
add ecx, edx
|
|
||||||
xor edi, eax
|
|
||||||
xor edi, ecx
|
|
||||||
mov ebp, DWORD PTR 36[esi]
|
|
||||||
add ebx, edi
|
|
||||||
mov edi, ecx
|
|
||||||
rol ebx, 23
|
|
||||||
add ebx, ecx
|
|
||||||
; R2 44
|
|
||||||
xor edi, edx
|
|
||||||
xor edi, ebx
|
|
||||||
lea eax, DWORD PTR 3654602809[ebp*1+eax]
|
|
||||||
add eax, edi
|
|
||||||
rol eax, 4
|
|
||||||
mov ebp, DWORD PTR 48[esi]
|
|
||||||
mov edi, ebx
|
|
||||||
; R2 45
|
|
||||||
lea edx, DWORD PTR 3873151461[ebp*1+edx]
|
|
||||||
add eax, ebx
|
|
||||||
xor edi, ecx
|
|
||||||
xor edi, eax
|
|
||||||
mov ebp, DWORD PTR 60[esi]
|
|
||||||
add edx, edi
|
|
||||||
mov edi, eax
|
|
||||||
rol edx, 11
|
|
||||||
add edx, eax
|
|
||||||
; R2 46
|
|
||||||
xor edi, ebx
|
|
||||||
xor edi, edx
|
|
||||||
lea ecx, DWORD PTR 530742520[ebp*1+ecx]
|
|
||||||
add ecx, edi
|
|
||||||
rol ecx, 16
|
|
||||||
mov ebp, DWORD PTR 8[esi]
|
|
||||||
mov edi, edx
|
|
||||||
; R2 47
|
|
||||||
lea ebx, DWORD PTR 3299628645[ebp*1+ebx]
|
|
||||||
add ecx, edx
|
|
||||||
xor edi, eax
|
|
||||||
xor edi, ecx
|
|
||||||
mov ebp, DWORD PTR [esi]
|
|
||||||
add ebx, edi
|
|
||||||
mov edi, -1
|
|
||||||
rol ebx, 23
|
|
||||||
add ebx, ecx
|
|
||||||
;
|
|
||||||
; R3 section
|
|
||||||
; R3 48
|
|
||||||
xor edi, edx
|
|
||||||
or edi, ebx
|
|
||||||
lea eax, DWORD PTR 4096336452[ebp*1+eax]
|
|
||||||
xor edi, ecx
|
|
||||||
mov ebp, DWORD PTR 28[esi]
|
|
||||||
add eax, edi
|
|
||||||
mov edi, -1
|
|
||||||
rol eax, 6
|
|
||||||
xor edi, ecx
|
|
||||||
add eax, ebx
|
|
||||||
; R3 49
|
|
||||||
or edi, eax
|
|
||||||
lea edx, DWORD PTR 1126891415[ebp*1+edx]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebp, DWORD PTR 56[esi]
|
|
||||||
add edx, edi
|
|
||||||
mov edi, -1
|
|
||||||
rol edx, 10
|
|
||||||
xor edi, ebx
|
|
||||||
add edx, eax
|
|
||||||
; R3 50
|
|
||||||
or edi, edx
|
|
||||||
lea ecx, DWORD PTR 2878612391[ebp*1+ecx]
|
|
||||||
xor edi, eax
|
|
||||||
mov ebp, DWORD PTR 20[esi]
|
|
||||||
add ecx, edi
|
|
||||||
mov edi, -1
|
|
||||||
rol ecx, 15
|
|
||||||
xor edi, eax
|
|
||||||
add ecx, edx
|
|
||||||
; R3 51
|
|
||||||
or edi, ecx
|
|
||||||
lea ebx, DWORD PTR 4237533241[ebp*1+ebx]
|
|
||||||
xor edi, edx
|
|
||||||
mov ebp, DWORD PTR 48[esi]
|
|
||||||
add ebx, edi
|
|
||||||
mov edi, -1
|
|
||||||
rol ebx, 21
|
|
||||||
xor edi, edx
|
|
||||||
add ebx, ecx
|
|
||||||
; R3 52
|
|
||||||
or edi, ebx
|
|
||||||
lea eax, DWORD PTR 1700485571[ebp*1+eax]
|
|
||||||
xor edi, ecx
|
|
||||||
mov ebp, DWORD PTR 12[esi]
|
|
||||||
add eax, edi
|
|
||||||
mov edi, -1
|
|
||||||
rol eax, 6
|
|
||||||
xor edi, ecx
|
|
||||||
add eax, ebx
|
|
||||||
; R3 53
|
|
||||||
or edi, eax
|
|
||||||
lea edx, DWORD PTR 2399980690[ebp*1+edx]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebp, DWORD PTR 40[esi]
|
|
||||||
add edx, edi
|
|
||||||
mov edi, -1
|
|
||||||
rol edx, 10
|
|
||||||
xor edi, ebx
|
|
||||||
add edx, eax
|
|
||||||
; R3 54
|
|
||||||
or edi, edx
|
|
||||||
lea ecx, DWORD PTR 4293915773[ebp*1+ecx]
|
|
||||||
xor edi, eax
|
|
||||||
mov ebp, DWORD PTR 4[esi]
|
|
||||||
add ecx, edi
|
|
||||||
mov edi, -1
|
|
||||||
rol ecx, 15
|
|
||||||
xor edi, eax
|
|
||||||
add ecx, edx
|
|
||||||
; R3 55
|
|
||||||
or edi, ecx
|
|
||||||
lea ebx, DWORD PTR 2240044497[ebp*1+ebx]
|
|
||||||
xor edi, edx
|
|
||||||
mov ebp, DWORD PTR 32[esi]
|
|
||||||
add ebx, edi
|
|
||||||
mov edi, -1
|
|
||||||
rol ebx, 21
|
|
||||||
xor edi, edx
|
|
||||||
add ebx, ecx
|
|
||||||
; R3 56
|
|
||||||
or edi, ebx
|
|
||||||
lea eax, DWORD PTR 1873313359[ebp*1+eax]
|
|
||||||
xor edi, ecx
|
|
||||||
mov ebp, DWORD PTR 60[esi]
|
|
||||||
add eax, edi
|
|
||||||
mov edi, -1
|
|
||||||
rol eax, 6
|
|
||||||
xor edi, ecx
|
|
||||||
add eax, ebx
|
|
||||||
; R3 57
|
|
||||||
or edi, eax
|
|
||||||
lea edx, DWORD PTR 4264355552[ebp*1+edx]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebp, DWORD PTR 24[esi]
|
|
||||||
add edx, edi
|
|
||||||
mov edi, -1
|
|
||||||
rol edx, 10
|
|
||||||
xor edi, ebx
|
|
||||||
add edx, eax
|
|
||||||
; R3 58
|
|
||||||
or edi, edx
|
|
||||||
lea ecx, DWORD PTR 2734768916[ebp*1+ecx]
|
|
||||||
xor edi, eax
|
|
||||||
mov ebp, DWORD PTR 52[esi]
|
|
||||||
add ecx, edi
|
|
||||||
mov edi, -1
|
|
||||||
rol ecx, 15
|
|
||||||
xor edi, eax
|
|
||||||
add ecx, edx
|
|
||||||
; R3 59
|
|
||||||
or edi, ecx
|
|
||||||
lea ebx, DWORD PTR 1309151649[ebp*1+ebx]
|
|
||||||
xor edi, edx
|
|
||||||
mov ebp, DWORD PTR 16[esi]
|
|
||||||
add ebx, edi
|
|
||||||
mov edi, -1
|
|
||||||
rol ebx, 21
|
|
||||||
xor edi, edx
|
|
||||||
add ebx, ecx
|
|
||||||
; R3 60
|
|
||||||
or edi, ebx
|
|
||||||
lea eax, DWORD PTR 4149444226[ebp*1+eax]
|
|
||||||
xor edi, ecx
|
|
||||||
mov ebp, DWORD PTR 44[esi]
|
|
||||||
add eax, edi
|
|
||||||
mov edi, -1
|
|
||||||
rol eax, 6
|
|
||||||
xor edi, ecx
|
|
||||||
add eax, ebx
|
|
||||||
; R3 61
|
|
||||||
or edi, eax
|
|
||||||
lea edx, DWORD PTR 3174756917[ebp*1+edx]
|
|
||||||
xor edi, ebx
|
|
||||||
mov ebp, DWORD PTR 8[esi]
|
|
||||||
add edx, edi
|
|
||||||
mov edi, -1
|
|
||||||
rol edx, 10
|
|
||||||
xor edi, ebx
|
|
||||||
add edx, eax
|
|
||||||
; R3 62
|
|
||||||
or edi, edx
|
|
||||||
lea ecx, DWORD PTR 718787259[ebp*1+ecx]
|
|
||||||
xor edi, eax
|
|
||||||
mov ebp, DWORD PTR 36[esi]
|
|
||||||
add ecx, edi
|
|
||||||
mov edi, -1
|
|
||||||
rol ecx, 15
|
|
||||||
xor edi, eax
|
|
||||||
add ecx, edx
|
|
||||||
; R3 63
|
|
||||||
or edi, ecx
|
|
||||||
lea ebx, DWORD PTR 3951481745[ebp*1+ebx]
|
|
||||||
xor edi, edx
|
|
||||||
mov ebp, DWORD PTR 24[esp]
|
|
||||||
add ebx, edi
|
|
||||||
add esi, 64
|
|
||||||
rol ebx, 21
|
|
||||||
mov edi, DWORD PTR [ebp]
|
|
||||||
add ebx, ecx
|
|
||||||
add eax, edi
|
|
||||||
mov edi, DWORD PTR 4[ebp]
|
|
||||||
add ebx, edi
|
|
||||||
mov edi, DWORD PTR 8[ebp]
|
|
||||||
add ecx, edi
|
|
||||||
mov edi, DWORD PTR 12[ebp]
|
|
||||||
add edx, edi
|
|
||||||
mov DWORD PTR [ebp],eax
|
|
||||||
mov DWORD PTR 4[ebp],ebx
|
|
||||||
mov edi, DWORD PTR [esp]
|
|
||||||
mov DWORD PTR 8[ebp],ecx
|
|
||||||
mov DWORD PTR 12[ebp],edx
|
|
||||||
cmp edi, esi
|
|
||||||
jge L000start
|
|
||||||
pop eax
|
|
||||||
pop ebx
|
|
||||||
pop ebp
|
|
||||||
pop edi
|
|
||||||
pop esi
|
|
||||||
ret
|
|
||||||
_md5_block_asm_host_order ENDP
|
|
||||||
_TEXT ENDS
|
|
||||||
END
|
|
@ -1,314 +0,0 @@
|
|||||||
; Don't even think of reading this code
|
|
||||||
; It was automatically generated by rc4-586.pl
|
|
||||||
; Which is a perl program used to generate the x86 assember for
|
|
||||||
; any of elf, a.out, BSDI,Win32, or Solaris
|
|
||||||
; eric <eay@cryptsoft.com>
|
|
||||||
;
|
|
||||||
TITLE rc4-586.asm
|
|
||||||
.386
|
|
||||||
.model FLAT
|
|
||||||
_TEXT SEGMENT
|
|
||||||
PUBLIC _RC4
|
|
||||||
|
|
||||||
_RC4 PROC NEAR
|
|
||||||
;
|
|
||||||
push ebp
|
|
||||||
push ebx
|
|
||||||
mov ebp, DWORD PTR 12[esp]
|
|
||||||
mov ebx, DWORD PTR 16[esp]
|
|
||||||
push esi
|
|
||||||
push edi
|
|
||||||
mov ecx, DWORD PTR [ebp]
|
|
||||||
mov edx, DWORD PTR 4[ebp]
|
|
||||||
mov esi, DWORD PTR 28[esp]
|
|
||||||
inc ecx
|
|
||||||
sub esp, 12
|
|
||||||
add ebp, 8
|
|
||||||
and ecx, 255
|
|
||||||
lea ebx, DWORD PTR [esi+ebx-8]
|
|
||||||
mov edi, DWORD PTR 44[esp]
|
|
||||||
mov DWORD PTR 8[esp],ebx
|
|
||||||
mov eax, DWORD PTR [ecx*4+ebp]
|
|
||||||
cmp ebx, esi
|
|
||||||
jl $L000end
|
|
||||||
L001start:
|
|
||||||
add esi, 8
|
|
||||||
; Round 0
|
|
||||||
add edx, eax
|
|
||||||
and edx, 255
|
|
||||||
inc ecx
|
|
||||||
mov ebx, DWORD PTR [edx*4+ebp]
|
|
||||||
mov DWORD PTR [ecx*4+ebp-4],ebx
|
|
||||||
add ebx, eax
|
|
||||||
and ecx, 255
|
|
||||||
and ebx, 255
|
|
||||||
mov DWORD PTR [edx*4+ebp],eax
|
|
||||||
nop
|
|
||||||
mov ebx, DWORD PTR [ebx*4+ebp]
|
|
||||||
mov eax, DWORD PTR [ecx*4+ebp]
|
|
||||||
mov BYTE PTR [esp], bl
|
|
||||||
; Round 1
|
|
||||||
add edx, eax
|
|
||||||
and edx, 255
|
|
||||||
inc ecx
|
|
||||||
mov ebx, DWORD PTR [edx*4+ebp]
|
|
||||||
mov DWORD PTR [ecx*4+ebp-4],ebx
|
|
||||||
add ebx, eax
|
|
||||||
and ecx, 255
|
|
||||||
and ebx, 255
|
|
||||||
mov DWORD PTR [edx*4+ebp],eax
|
|
||||||
nop
|
|
||||||
mov ebx, DWORD PTR [ebx*4+ebp]
|
|
||||||
mov eax, DWORD PTR [ecx*4+ebp]
|
|
||||||
mov BYTE PTR 1[esp],bl
|
|
||||||
; Round 2
|
|
||||||
add edx, eax
|
|
||||||
and edx, 255
|
|
||||||
inc ecx
|
|
||||||
mov ebx, DWORD PTR [edx*4+ebp]
|
|
||||||
mov DWORD PTR [ecx*4+ebp-4],ebx
|
|
||||||
add ebx, eax
|
|
||||||
and ecx, 255
|
|
||||||
and ebx, 255
|
|
||||||
mov DWORD PTR [edx*4+ebp],eax
|
|
||||||
nop
|
|
||||||
mov ebx, DWORD PTR [ebx*4+ebp]
|
|
||||||
mov eax, DWORD PTR [ecx*4+ebp]
|
|
||||||
mov BYTE PTR 2[esp],bl
|
|
||||||
; Round 3
|
|
||||||
add edx, eax
|
|
||||||
and edx, 255
|
|
||||||
inc ecx
|
|
||||||
mov ebx, DWORD PTR [edx*4+ebp]
|
|
||||||
mov DWORD PTR [ecx*4+ebp-4],ebx
|
|
||||||
add ebx, eax
|
|
||||||
and ecx, 255
|
|
||||||
and ebx, 255
|
|
||||||
mov DWORD PTR [edx*4+ebp],eax
|
|
||||||
nop
|
|
||||||
mov ebx, DWORD PTR [ebx*4+ebp]
|
|
||||||
mov eax, DWORD PTR [ecx*4+ebp]
|
|
||||||
mov BYTE PTR 3[esp],bl
|
|
||||||
; Round 4
|
|
||||||
add edx, eax
|
|
||||||
and edx, 255
|
|
||||||
inc ecx
|
|
||||||
mov ebx, DWORD PTR [edx*4+ebp]
|
|
||||||
mov DWORD PTR [ecx*4+ebp-4],ebx
|
|
||||||
add ebx, eax
|
|
||||||
and ecx, 255
|
|
||||||
and ebx, 255
|
|
||||||
mov DWORD PTR [edx*4+ebp],eax
|
|
||||||
nop
|
|
||||||
mov ebx, DWORD PTR [ebx*4+ebp]
|
|
||||||
mov eax, DWORD PTR [ecx*4+ebp]
|
|
||||||
mov BYTE PTR 4[esp],bl
|
|
||||||
; Round 5
|
|
||||||
add edx, eax
|
|
||||||
and edx, 255
|
|
||||||
inc ecx
|
|
||||||
mov ebx, DWORD PTR [edx*4+ebp]
|
|
||||||
mov DWORD PTR [ecx*4+ebp-4],ebx
|
|
||||||
add ebx, eax
|
|
||||||
and ecx, 255
|
|
||||||
and ebx, 255
|
|
||||||
mov DWORD PTR [edx*4+ebp],eax
|
|
||||||
nop
|
|
||||||
mov ebx, DWORD PTR [ebx*4+ebp]
|
|
||||||
mov eax, DWORD PTR [ecx*4+ebp]
|
|
||||||
mov BYTE PTR 5[esp],bl
|
|
||||||
; Round 6
|
|
||||||
add edx, eax
|
|
||||||
and edx, 255
|
|
||||||
inc ecx
|
|
||||||
mov ebx, DWORD PTR [edx*4+ebp]
|
|
||||||
mov DWORD PTR [ecx*4+ebp-4],ebx
|
|
||||||
add ebx, eax
|
|
||||||
and ecx, 255
|
|
||||||
and ebx, 255
|
|
||||||
mov DWORD PTR [edx*4+ebp],eax
|
|
||||||
nop
|
|
||||||
mov ebx, DWORD PTR [ebx*4+ebp]
|
|
||||||
mov eax, DWORD PTR [ecx*4+ebp]
|
|
||||||
mov BYTE PTR 6[esp],bl
|
|
||||||
; Round 7
|
|
||||||
add edx, eax
|
|
||||||
and edx, 255
|
|
||||||
inc ecx
|
|
||||||
mov ebx, DWORD PTR [edx*4+ebp]
|
|
||||||
mov DWORD PTR [ecx*4+ebp-4],ebx
|
|
||||||
add ebx, eax
|
|
||||||
and ecx, 255
|
|
||||||
and ebx, 255
|
|
||||||
mov DWORD PTR [edx*4+ebp],eax
|
|
||||||
nop
|
|
||||||
mov ebx, DWORD PTR [ebx*4+ebp]
|
|
||||||
add edi, 8
|
|
||||||
mov BYTE PTR 7[esp],bl
|
|
||||||
; apply the cipher text
|
|
||||||
mov eax, DWORD PTR [esp]
|
|
||||||
mov ebx, DWORD PTR [esi-8]
|
|
||||||
xor eax, ebx
|
|
||||||
mov ebx, DWORD PTR [esi-4]
|
|
||||||
mov DWORD PTR [edi-8],eax
|
|
||||||
mov eax, DWORD PTR 4[esp]
|
|
||||||
xor eax, ebx
|
|
||||||
mov ebx, DWORD PTR 8[esp]
|
|
||||||
mov DWORD PTR [edi-4],eax
|
|
||||||
mov eax, DWORD PTR [ecx*4+ebp]
|
|
||||||
cmp esi, ebx
|
|
||||||
jle L001start
|
|
||||||
$L000end:
|
|
||||||
; Round 0
|
|
||||||
add ebx, 8
|
|
||||||
inc esi
|
|
||||||
cmp ebx, esi
|
|
||||||
jl $L002finished
|
|
||||||
mov DWORD PTR 8[esp],ebx
|
|
||||||
add edx, eax
|
|
||||||
and edx, 255
|
|
||||||
inc ecx
|
|
||||||
mov ebx, DWORD PTR [edx*4+ebp]
|
|
||||||
mov DWORD PTR [ecx*4+ebp-4],ebx
|
|
||||||
add ebx, eax
|
|
||||||
and ecx, 255
|
|
||||||
and ebx, 255
|
|
||||||
mov DWORD PTR [edx*4+ebp],eax
|
|
||||||
nop
|
|
||||||
mov ebx, DWORD PTR [ebx*4+ebp]
|
|
||||||
mov eax, DWORD PTR [ecx*4+ebp]
|
|
||||||
mov bh, BYTE PTR [esi-1]
|
|
||||||
xor bl, bh
|
|
||||||
mov BYTE PTR [edi], bl
|
|
||||||
; Round 1
|
|
||||||
mov ebx, DWORD PTR 8[esp]
|
|
||||||
cmp ebx, esi
|
|
||||||
jle $L002finished
|
|
||||||
inc esi
|
|
||||||
add edx, eax
|
|
||||||
and edx, 255
|
|
||||||
inc ecx
|
|
||||||
mov ebx, DWORD PTR [edx*4+ebp]
|
|
||||||
mov DWORD PTR [ecx*4+ebp-4],ebx
|
|
||||||
add ebx, eax
|
|
||||||
and ecx, 255
|
|
||||||
and ebx, 255
|
|
||||||
mov DWORD PTR [edx*4+ebp],eax
|
|
||||||
nop
|
|
||||||
mov ebx, DWORD PTR [ebx*4+ebp]
|
|
||||||
mov eax, DWORD PTR [ecx*4+ebp]
|
|
||||||
mov bh, BYTE PTR [esi-1]
|
|
||||||
xor bl, bh
|
|
||||||
mov BYTE PTR 1[edi],bl
|
|
||||||
; Round 2
|
|
||||||
mov ebx, DWORD PTR 8[esp]
|
|
||||||
cmp ebx, esi
|
|
||||||
jle $L002finished
|
|
||||||
inc esi
|
|
||||||
add edx, eax
|
|
||||||
and edx, 255
|
|
||||||
inc ecx
|
|
||||||
mov ebx, DWORD PTR [edx*4+ebp]
|
|
||||||
mov DWORD PTR [ecx*4+ebp-4],ebx
|
|
||||||
add ebx, eax
|
|
||||||
and ecx, 255
|
|
||||||
and ebx, 255
|
|
||||||
mov DWORD PTR [edx*4+ebp],eax
|
|
||||||
nop
|
|
||||||
mov ebx, DWORD PTR [ebx*4+ebp]
|
|
||||||
mov eax, DWORD PTR [ecx*4+ebp]
|
|
||||||
mov bh, BYTE PTR [esi-1]
|
|
||||||
xor bl, bh
|
|
||||||
mov BYTE PTR 2[edi],bl
|
|
||||||
; Round 3
|
|
||||||
mov ebx, DWORD PTR 8[esp]
|
|
||||||
cmp ebx, esi
|
|
||||||
jle $L002finished
|
|
||||||
inc esi
|
|
||||||
add edx, eax
|
|
||||||
and edx, 255
|
|
||||||
inc ecx
|
|
||||||
mov ebx, DWORD PTR [edx*4+ebp]
|
|
||||||
mov DWORD PTR [ecx*4+ebp-4],ebx
|
|
||||||
add ebx, eax
|
|
||||||
and ecx, 255
|
|
||||||
and ebx, 255
|
|
||||||
mov DWORD PTR [edx*4+ebp],eax
|
|
||||||
nop
|
|
||||||
mov ebx, DWORD PTR [ebx*4+ebp]
|
|
||||||
mov eax, DWORD PTR [ecx*4+ebp]
|
|
||||||
mov bh, BYTE PTR [esi-1]
|
|
||||||
xor bl, bh
|
|
||||||
mov BYTE PTR 3[edi],bl
|
|
||||||
; Round 4
|
|
||||||
mov ebx, DWORD PTR 8[esp]
|
|
||||||
cmp ebx, esi
|
|
||||||
jle $L002finished
|
|
||||||
inc esi
|
|
||||||
add edx, eax
|
|
||||||
and edx, 255
|
|
||||||
inc ecx
|
|
||||||
mov ebx, DWORD PTR [edx*4+ebp]
|
|
||||||
mov DWORD PTR [ecx*4+ebp-4],ebx
|
|
||||||
add ebx, eax
|
|
||||||
and ecx, 255
|
|
||||||
and ebx, 255
|
|
||||||
mov DWORD PTR [edx*4+ebp],eax
|
|
||||||
nop
|
|
||||||
mov ebx, DWORD PTR [ebx*4+ebp]
|
|
||||||
mov eax, DWORD PTR [ecx*4+ebp]
|
|
||||||
mov bh, BYTE PTR [esi-1]
|
|
||||||
xor bl, bh
|
|
||||||
mov BYTE PTR 4[edi],bl
|
|
||||||
; Round 5
|
|
||||||
mov ebx, DWORD PTR 8[esp]
|
|
||||||
cmp ebx, esi
|
|
||||||
jle $L002finished
|
|
||||||
inc esi
|
|
||||||
add edx, eax
|
|
||||||
and edx, 255
|
|
||||||
inc ecx
|
|
||||||
mov ebx, DWORD PTR [edx*4+ebp]
|
|
||||||
mov DWORD PTR [ecx*4+ebp-4],ebx
|
|
||||||
add ebx, eax
|
|
||||||
and ecx, 255
|
|
||||||
and ebx, 255
|
|
||||||
mov DWORD PTR [edx*4+ebp],eax
|
|
||||||
nop
|
|
||||||
mov ebx, DWORD PTR [ebx*4+ebp]
|
|
||||||
mov eax, DWORD PTR [ecx*4+ebp]
|
|
||||||
mov bh, BYTE PTR [esi-1]
|
|
||||||
xor bl, bh
|
|
||||||
mov BYTE PTR 5[edi],bl
|
|
||||||
; Round 6
|
|
||||||
mov ebx, DWORD PTR 8[esp]
|
|
||||||
cmp ebx, esi
|
|
||||||
jle $L002finished
|
|
||||||
inc esi
|
|
||||||
add edx, eax
|
|
||||||
and edx, 255
|
|
||||||
inc ecx
|
|
||||||
mov ebx, DWORD PTR [edx*4+ebp]
|
|
||||||
mov DWORD PTR [ecx*4+ebp-4],ebx
|
|
||||||
add ebx, eax
|
|
||||||
and ecx, 255
|
|
||||||
and ebx, 255
|
|
||||||
mov DWORD PTR [edx*4+ebp],eax
|
|
||||||
nop
|
|
||||||
mov ebx, DWORD PTR [ebx*4+ebp]
|
|
||||||
mov bh, BYTE PTR [esi-1]
|
|
||||||
xor bl, bh
|
|
||||||
mov BYTE PTR 6[edi],bl
|
|
||||||
$L002finished:
|
|
||||||
dec ecx
|
|
||||||
add esp, 12
|
|
||||||
mov DWORD PTR [ebp-4],edx
|
|
||||||
mov BYTE PTR [ebp-8],cl
|
|
||||||
pop edi
|
|
||||||
pop esi
|
|
||||||
pop ebx
|
|
||||||
pop ebp
|
|
||||||
ret
|
|
||||||
_RC4 ENDP
|
|
||||||
_TEXT ENDS
|
|
||||||
END
|
|
@ -1,574 +0,0 @@
|
|||||||
; Don't even think of reading this code
|
|
||||||
; It was automatically generated by rc5-586.pl
|
|
||||||
; Which is a perl program used to generate the x86 assember for
|
|
||||||
; any of elf, a.out, BSDI,Win32, or Solaris
|
|
||||||
; eric <eay@cryptsoft.com>
|
|
||||||
;
|
|
||||||
TITLE rc5-586.asm
|
|
||||||
.386
|
|
||||||
.model FLAT
|
|
||||||
_TEXT SEGMENT
|
|
||||||
PUBLIC _RC5_32_encrypt
|
|
||||||
|
|
||||||
_RC5_32_encrypt PROC NEAR
|
|
||||||
;
|
|
||||||
push ebp
|
|
||||||
push esi
|
|
||||||
push edi
|
|
||||||
mov edx, DWORD PTR 16[esp]
|
|
||||||
mov ebp, DWORD PTR 20[esp]
|
|
||||||
; Load the 2 words
|
|
||||||
mov edi, DWORD PTR [edx]
|
|
||||||
mov esi, DWORD PTR 4[edx]
|
|
||||||
push ebx
|
|
||||||
mov ebx, DWORD PTR [ebp]
|
|
||||||
add edi, DWORD PTR 4[ebp]
|
|
||||||
add esi, DWORD PTR 8[ebp]
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 12[ebp]
|
|
||||||
mov ecx, esi
|
|
||||||
rol edi, cl
|
|
||||||
add edi, eax
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 16[ebp]
|
|
||||||
mov ecx, edi
|
|
||||||
rol esi, cl
|
|
||||||
add esi, eax
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 20[ebp]
|
|
||||||
mov ecx, esi
|
|
||||||
rol edi, cl
|
|
||||||
add edi, eax
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 24[ebp]
|
|
||||||
mov ecx, edi
|
|
||||||
rol esi, cl
|
|
||||||
add esi, eax
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 28[ebp]
|
|
||||||
mov ecx, esi
|
|
||||||
rol edi, cl
|
|
||||||
add edi, eax
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 32[ebp]
|
|
||||||
mov ecx, edi
|
|
||||||
rol esi, cl
|
|
||||||
add esi, eax
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 36[ebp]
|
|
||||||
mov ecx, esi
|
|
||||||
rol edi, cl
|
|
||||||
add edi, eax
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 40[ebp]
|
|
||||||
mov ecx, edi
|
|
||||||
rol esi, cl
|
|
||||||
add esi, eax
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 44[ebp]
|
|
||||||
mov ecx, esi
|
|
||||||
rol edi, cl
|
|
||||||
add edi, eax
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 48[ebp]
|
|
||||||
mov ecx, edi
|
|
||||||
rol esi, cl
|
|
||||||
add esi, eax
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 52[ebp]
|
|
||||||
mov ecx, esi
|
|
||||||
rol edi, cl
|
|
||||||
add edi, eax
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 56[ebp]
|
|
||||||
mov ecx, edi
|
|
||||||
rol esi, cl
|
|
||||||
add esi, eax
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 60[ebp]
|
|
||||||
mov ecx, esi
|
|
||||||
rol edi, cl
|
|
||||||
add edi, eax
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 64[ebp]
|
|
||||||
mov ecx, edi
|
|
||||||
rol esi, cl
|
|
||||||
add esi, eax
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 68[ebp]
|
|
||||||
mov ecx, esi
|
|
||||||
rol edi, cl
|
|
||||||
add edi, eax
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 72[ebp]
|
|
||||||
mov ecx, edi
|
|
||||||
rol esi, cl
|
|
||||||
add esi, eax
|
|
||||||
cmp ebx, 8
|
|
||||||
je $L000rc5_exit
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 76[ebp]
|
|
||||||
mov ecx, esi
|
|
||||||
rol edi, cl
|
|
||||||
add edi, eax
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 80[ebp]
|
|
||||||
mov ecx, edi
|
|
||||||
rol esi, cl
|
|
||||||
add esi, eax
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 84[ebp]
|
|
||||||
mov ecx, esi
|
|
||||||
rol edi, cl
|
|
||||||
add edi, eax
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 88[ebp]
|
|
||||||
mov ecx, edi
|
|
||||||
rol esi, cl
|
|
||||||
add esi, eax
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 92[ebp]
|
|
||||||
mov ecx, esi
|
|
||||||
rol edi, cl
|
|
||||||
add edi, eax
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 96[ebp]
|
|
||||||
mov ecx, edi
|
|
||||||
rol esi, cl
|
|
||||||
add esi, eax
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 100[ebp]
|
|
||||||
mov ecx, esi
|
|
||||||
rol edi, cl
|
|
||||||
add edi, eax
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 104[ebp]
|
|
||||||
mov ecx, edi
|
|
||||||
rol esi, cl
|
|
||||||
add esi, eax
|
|
||||||
cmp ebx, 12
|
|
||||||
je $L000rc5_exit
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 108[ebp]
|
|
||||||
mov ecx, esi
|
|
||||||
rol edi, cl
|
|
||||||
add edi, eax
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 112[ebp]
|
|
||||||
mov ecx, edi
|
|
||||||
rol esi, cl
|
|
||||||
add esi, eax
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 116[ebp]
|
|
||||||
mov ecx, esi
|
|
||||||
rol edi, cl
|
|
||||||
add edi, eax
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 120[ebp]
|
|
||||||
mov ecx, edi
|
|
||||||
rol esi, cl
|
|
||||||
add esi, eax
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 124[ebp]
|
|
||||||
mov ecx, esi
|
|
||||||
rol edi, cl
|
|
||||||
add edi, eax
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 128[ebp]
|
|
||||||
mov ecx, edi
|
|
||||||
rol esi, cl
|
|
||||||
add esi, eax
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 132[ebp]
|
|
||||||
mov ecx, esi
|
|
||||||
rol edi, cl
|
|
||||||
add edi, eax
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 136[ebp]
|
|
||||||
mov ecx, edi
|
|
||||||
rol esi, cl
|
|
||||||
add esi, eax
|
|
||||||
$L000rc5_exit:
|
|
||||||
mov DWORD PTR [edx],edi
|
|
||||||
mov DWORD PTR 4[edx],esi
|
|
||||||
pop ebx
|
|
||||||
pop edi
|
|
||||||
pop esi
|
|
||||||
pop ebp
|
|
||||||
ret
|
|
||||||
_RC5_32_encrypt ENDP
|
|
||||||
_TEXT ENDS
|
|
||||||
_TEXT SEGMENT
|
|
||||||
PUBLIC _RC5_32_decrypt
|
|
||||||
|
|
||||||
_RC5_32_decrypt PROC NEAR
|
|
||||||
;
|
|
||||||
push ebp
|
|
||||||
push esi
|
|
||||||
push edi
|
|
||||||
mov edx, DWORD PTR 16[esp]
|
|
||||||
mov ebp, DWORD PTR 20[esp]
|
|
||||||
; Load the 2 words
|
|
||||||
mov edi, DWORD PTR [edx]
|
|
||||||
mov esi, DWORD PTR 4[edx]
|
|
||||||
push ebx
|
|
||||||
mov ebx, DWORD PTR [ebp]
|
|
||||||
cmp ebx, 12
|
|
||||||
je $L001rc5_dec_12
|
|
||||||
cmp ebx, 8
|
|
||||||
je $L002rc5_dec_8
|
|
||||||
mov eax, DWORD PTR 136[ebp]
|
|
||||||
sub esi, eax
|
|
||||||
mov ecx, edi
|
|
||||||
ror esi, cl
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 132[ebp]
|
|
||||||
sub edi, eax
|
|
||||||
mov ecx, esi
|
|
||||||
ror edi, cl
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 128[ebp]
|
|
||||||
sub esi, eax
|
|
||||||
mov ecx, edi
|
|
||||||
ror esi, cl
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 124[ebp]
|
|
||||||
sub edi, eax
|
|
||||||
mov ecx, esi
|
|
||||||
ror edi, cl
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 120[ebp]
|
|
||||||
sub esi, eax
|
|
||||||
mov ecx, edi
|
|
||||||
ror esi, cl
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 116[ebp]
|
|
||||||
sub edi, eax
|
|
||||||
mov ecx, esi
|
|
||||||
ror edi, cl
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 112[ebp]
|
|
||||||
sub esi, eax
|
|
||||||
mov ecx, edi
|
|
||||||
ror esi, cl
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 108[ebp]
|
|
||||||
sub edi, eax
|
|
||||||
mov ecx, esi
|
|
||||||
ror edi, cl
|
|
||||||
xor edi, esi
|
|
||||||
$L001rc5_dec_12:
|
|
||||||
mov eax, DWORD PTR 104[ebp]
|
|
||||||
sub esi, eax
|
|
||||||
mov ecx, edi
|
|
||||||
ror esi, cl
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 100[ebp]
|
|
||||||
sub edi, eax
|
|
||||||
mov ecx, esi
|
|
||||||
ror edi, cl
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 96[ebp]
|
|
||||||
sub esi, eax
|
|
||||||
mov ecx, edi
|
|
||||||
ror esi, cl
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 92[ebp]
|
|
||||||
sub edi, eax
|
|
||||||
mov ecx, esi
|
|
||||||
ror edi, cl
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 88[ebp]
|
|
||||||
sub esi, eax
|
|
||||||
mov ecx, edi
|
|
||||||
ror esi, cl
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 84[ebp]
|
|
||||||
sub edi, eax
|
|
||||||
mov ecx, esi
|
|
||||||
ror edi, cl
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 80[ebp]
|
|
||||||
sub esi, eax
|
|
||||||
mov ecx, edi
|
|
||||||
ror esi, cl
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 76[ebp]
|
|
||||||
sub edi, eax
|
|
||||||
mov ecx, esi
|
|
||||||
ror edi, cl
|
|
||||||
xor edi, esi
|
|
||||||
$L002rc5_dec_8:
|
|
||||||
mov eax, DWORD PTR 72[ebp]
|
|
||||||
sub esi, eax
|
|
||||||
mov ecx, edi
|
|
||||||
ror esi, cl
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 68[ebp]
|
|
||||||
sub edi, eax
|
|
||||||
mov ecx, esi
|
|
||||||
ror edi, cl
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 64[ebp]
|
|
||||||
sub esi, eax
|
|
||||||
mov ecx, edi
|
|
||||||
ror esi, cl
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 60[ebp]
|
|
||||||
sub edi, eax
|
|
||||||
mov ecx, esi
|
|
||||||
ror edi, cl
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 56[ebp]
|
|
||||||
sub esi, eax
|
|
||||||
mov ecx, edi
|
|
||||||
ror esi, cl
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 52[ebp]
|
|
||||||
sub edi, eax
|
|
||||||
mov ecx, esi
|
|
||||||
ror edi, cl
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 48[ebp]
|
|
||||||
sub esi, eax
|
|
||||||
mov ecx, edi
|
|
||||||
ror esi, cl
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 44[ebp]
|
|
||||||
sub edi, eax
|
|
||||||
mov ecx, esi
|
|
||||||
ror edi, cl
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 40[ebp]
|
|
||||||
sub esi, eax
|
|
||||||
mov ecx, edi
|
|
||||||
ror esi, cl
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 36[ebp]
|
|
||||||
sub edi, eax
|
|
||||||
mov ecx, esi
|
|
||||||
ror edi, cl
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 32[ebp]
|
|
||||||
sub esi, eax
|
|
||||||
mov ecx, edi
|
|
||||||
ror esi, cl
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 28[ebp]
|
|
||||||
sub edi, eax
|
|
||||||
mov ecx, esi
|
|
||||||
ror edi, cl
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 24[ebp]
|
|
||||||
sub esi, eax
|
|
||||||
mov ecx, edi
|
|
||||||
ror esi, cl
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 20[ebp]
|
|
||||||
sub edi, eax
|
|
||||||
mov ecx, esi
|
|
||||||
ror edi, cl
|
|
||||||
xor edi, esi
|
|
||||||
mov eax, DWORD PTR 16[ebp]
|
|
||||||
sub esi, eax
|
|
||||||
mov ecx, edi
|
|
||||||
ror esi, cl
|
|
||||||
xor esi, edi
|
|
||||||
mov eax, DWORD PTR 12[ebp]
|
|
||||||
sub edi, eax
|
|
||||||
mov ecx, esi
|
|
||||||
ror edi, cl
|
|
||||||
xor edi, esi
|
|
||||||
sub esi, DWORD PTR 8[ebp]
|
|
||||||
sub edi, DWORD PTR 4[ebp]
|
|
||||||
L003rc5_exit:
|
|
||||||
mov DWORD PTR [edx],edi
|
|
||||||
mov DWORD PTR 4[edx],esi
|
|
||||||
pop ebx
|
|
||||||
pop edi
|
|
||||||
pop esi
|
|
||||||
pop ebp
|
|
||||||
ret
|
|
||||||
_RC5_32_decrypt ENDP
|
|
||||||
_TEXT ENDS
|
|
||||||
_TEXT SEGMENT
|
|
||||||
PUBLIC _RC5_32_cbc_encrypt
|
|
||||||
|
|
||||||
_RC5_32_cbc_encrypt PROC NEAR
|
|
||||||
;
|
|
||||||
push ebp
|
|
||||||
push ebx
|
|
||||||
push esi
|
|
||||||
push edi
|
|
||||||
mov ebp, DWORD PTR 28[esp]
|
|
||||||
; getting iv ptr from parameter 4
|
|
||||||
mov ebx, DWORD PTR 36[esp]
|
|
||||||
mov esi, DWORD PTR [ebx]
|
|
||||||
mov edi, DWORD PTR 4[ebx]
|
|
||||||
push edi
|
|
||||||
push esi
|
|
||||||
push edi
|
|
||||||
push esi
|
|
||||||
mov ebx, esp
|
|
||||||
mov esi, DWORD PTR 36[esp]
|
|
||||||
mov edi, DWORD PTR 40[esp]
|
|
||||||
; getting encrypt flag from parameter 5
|
|
||||||
mov ecx, DWORD PTR 56[esp]
|
|
||||||
; get and push parameter 3
|
|
||||||
mov eax, DWORD PTR 48[esp]
|
|
||||||
push eax
|
|
||||||
push ebx
|
|
||||||
cmp ecx, 0
|
|
||||||
jz $L004decrypt
|
|
||||||
and ebp, 4294967288
|
|
||||||
mov eax, DWORD PTR 8[esp]
|
|
||||||
mov ebx, DWORD PTR 12[esp]
|
|
||||||
jz $L005encrypt_finish
|
|
||||||
L006encrypt_loop:
|
|
||||||
mov ecx, DWORD PTR [esi]
|
|
||||||
mov edx, DWORD PTR 4[esi]
|
|
||||||
xor eax, ecx
|
|
||||||
xor ebx, edx
|
|
||||||
mov DWORD PTR 8[esp],eax
|
|
||||||
mov DWORD PTR 12[esp],ebx
|
|
||||||
call _RC5_32_encrypt
|
|
||||||
mov eax, DWORD PTR 8[esp]
|
|
||||||
mov ebx, DWORD PTR 12[esp]
|
|
||||||
mov DWORD PTR [edi],eax
|
|
||||||
mov DWORD PTR 4[edi],ebx
|
|
||||||
add esi, 8
|
|
||||||
add edi, 8
|
|
||||||
sub ebp, 8
|
|
||||||
jnz L006encrypt_loop
|
|
||||||
$L005encrypt_finish:
|
|
||||||
mov ebp, DWORD PTR 52[esp]
|
|
||||||
and ebp, 7
|
|
||||||
jz $L007finish
|
|
||||||
xor ecx, ecx
|
|
||||||
xor edx, edx
|
|
||||||
mov ebp, DWORD PTR $L008cbc_enc_jmp_table[ebp*4]
|
|
||||||
jmp ebp
|
|
||||||
L009ej7:
|
|
||||||
mov dh, BYTE PTR 6[esi]
|
|
||||||
shl edx, 8
|
|
||||||
L010ej6:
|
|
||||||
mov dh, BYTE PTR 5[esi]
|
|
||||||
L011ej5:
|
|
||||||
mov dl, BYTE PTR 4[esi]
|
|
||||||
L012ej4:
|
|
||||||
mov ecx, DWORD PTR [esi]
|
|
||||||
jmp $L013ejend
|
|
||||||
L014ej3:
|
|
||||||
mov ch, BYTE PTR 2[esi]
|
|
||||||
shl ecx, 8
|
|
||||||
L015ej2:
|
|
||||||
mov ch, BYTE PTR 1[esi]
|
|
||||||
L016ej1:
|
|
||||||
mov cl, BYTE PTR [esi]
|
|
||||||
$L013ejend:
|
|
||||||
xor eax, ecx
|
|
||||||
xor ebx, edx
|
|
||||||
mov DWORD PTR 8[esp],eax
|
|
||||||
mov DWORD PTR 12[esp],ebx
|
|
||||||
call _RC5_32_encrypt
|
|
||||||
mov eax, DWORD PTR 8[esp]
|
|
||||||
mov ebx, DWORD PTR 12[esp]
|
|
||||||
mov DWORD PTR [edi],eax
|
|
||||||
mov DWORD PTR 4[edi],ebx
|
|
||||||
jmp $L007finish
|
|
||||||
$L004decrypt:
|
|
||||||
and ebp, 4294967288
|
|
||||||
mov eax, DWORD PTR 16[esp]
|
|
||||||
mov ebx, DWORD PTR 20[esp]
|
|
||||||
jz $L017decrypt_finish
|
|
||||||
L018decrypt_loop:
|
|
||||||
mov eax, DWORD PTR [esi]
|
|
||||||
mov ebx, DWORD PTR 4[esi]
|
|
||||||
mov DWORD PTR 8[esp],eax
|
|
||||||
mov DWORD PTR 12[esp],ebx
|
|
||||||
call _RC5_32_decrypt
|
|
||||||
mov eax, DWORD PTR 8[esp]
|
|
||||||
mov ebx, DWORD PTR 12[esp]
|
|
||||||
mov ecx, DWORD PTR 16[esp]
|
|
||||||
mov edx, DWORD PTR 20[esp]
|
|
||||||
xor ecx, eax
|
|
||||||
xor edx, ebx
|
|
||||||
mov eax, DWORD PTR [esi]
|
|
||||||
mov ebx, DWORD PTR 4[esi]
|
|
||||||
mov DWORD PTR [edi],ecx
|
|
||||||
mov DWORD PTR 4[edi],edx
|
|
||||||
mov DWORD PTR 16[esp],eax
|
|
||||||
mov DWORD PTR 20[esp],ebx
|
|
||||||
add esi, 8
|
|
||||||
add edi, 8
|
|
||||||
sub ebp, 8
|
|
||||||
jnz L018decrypt_loop
|
|
||||||
$L017decrypt_finish:
|
|
||||||
mov ebp, DWORD PTR 52[esp]
|
|
||||||
and ebp, 7
|
|
||||||
jz $L007finish
|
|
||||||
mov eax, DWORD PTR [esi]
|
|
||||||
mov ebx, DWORD PTR 4[esi]
|
|
||||||
mov DWORD PTR 8[esp],eax
|
|
||||||
mov DWORD PTR 12[esp],ebx
|
|
||||||
call _RC5_32_decrypt
|
|
||||||
mov eax, DWORD PTR 8[esp]
|
|
||||||
mov ebx, DWORD PTR 12[esp]
|
|
||||||
mov ecx, DWORD PTR 16[esp]
|
|
||||||
mov edx, DWORD PTR 20[esp]
|
|
||||||
xor ecx, eax
|
|
||||||
xor edx, ebx
|
|
||||||
mov eax, DWORD PTR [esi]
|
|
||||||
mov ebx, DWORD PTR 4[esi]
|
|
||||||
L019dj7:
|
|
||||||
ror edx, 16
|
|
||||||
mov BYTE PTR 6[edi],dl
|
|
||||||
shr edx, 16
|
|
||||||
L020dj6:
|
|
||||||
mov BYTE PTR 5[edi],dh
|
|
||||||
L021dj5:
|
|
||||||
mov BYTE PTR 4[edi],dl
|
|
||||||
L022dj4:
|
|
||||||
mov DWORD PTR [edi],ecx
|
|
||||||
jmp $L023djend
|
|
||||||
L024dj3:
|
|
||||||
ror ecx, 16
|
|
||||||
mov BYTE PTR 2[edi],cl
|
|
||||||
shl ecx, 16
|
|
||||||
L025dj2:
|
|
||||||
mov BYTE PTR 1[esi],ch
|
|
||||||
L026dj1:
|
|
||||||
mov BYTE PTR [esi], cl
|
|
||||||
$L023djend:
|
|
||||||
jmp $L007finish
|
|
||||||
$L007finish:
|
|
||||||
mov ecx, DWORD PTR 60[esp]
|
|
||||||
add esp, 24
|
|
||||||
mov DWORD PTR [ecx],eax
|
|
||||||
mov DWORD PTR 4[ecx],ebx
|
|
||||||
pop edi
|
|
||||||
pop esi
|
|
||||||
pop ebx
|
|
||||||
pop ebp
|
|
||||||
ret
|
|
||||||
$L008cbc_enc_jmp_table:
|
|
||||||
DD 0
|
|
||||||
DD L016ej1
|
|
||||||
DD L015ej2
|
|
||||||
DD L014ej3
|
|
||||||
DD L012ej4
|
|
||||||
DD L011ej5
|
|
||||||
DD L010ej6
|
|
||||||
DD L009ej7
|
|
||||||
L027cbc_dec_jmp_table:
|
|
||||||
DD 0
|
|
||||||
DD L026dj1
|
|
||||||
DD L025dj2
|
|
||||||
DD L024dj3
|
|
||||||
DD L022dj4
|
|
||||||
DD L021dj5
|
|
||||||
DD L020dj6
|
|
||||||
DD L019dj7
|
|
||||||
_RC5_32_cbc_encrypt ENDP
|
|
||||||
_TEXT ENDS
|
|
||||||
END
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user