上传用户:hbtcygglw
上传日期:2007-01-07
资源大小:281k
文件大小:5k
- .386p
- extrn _ntohl@4: near
- extrn _htonl@4: near
- extrn _memset : near
- extrn _rand : near
- ; Segment type: Pure code
- _text segment para public 'CODE' use32
- assume cs:_text
- assume es:nothing, ss:nothing, ds:_text, fs:nothing, gs:nothing
- TeaEncrypt proc near
- var_10 = dword ptr -10h
- var_C = dword ptr -0Ch
- var_8 = dword ptr -8
- var_4 = dword ptr -4
- arg_0 = dword ptr 8
- arg_4 = dword ptr 0Ch
- arg_8 = dword ptr 10h
- push ebp
- mov ebp, esp
- sub esp, 10h
- push ebx
- push esi
- mov esi, [ebp+arg_0]
- push edi
- push dword ptr [esi]
- call _ntohl@4
- push dword ptr [esi+4]
- mov edi, eax
- call _ntohl@4
- mov ebx, eax
- mov eax, [ebp+arg_4]
- lea ecx, [ebp+var_10]
- lea esi, [ebp+var_10]
- sub eax, ecx
- mov [ebp+arg_0], 4
- mov [ebp+arg_4], eax
- jmp short loc_0_43D04D
- loc_0_43D04A:
- mov eax, [ebp+arg_4]
- loc_0_43D04D:
- push dword ptr [eax+esi]
- call _ntohl@4
- mov [esi], eax
- add esi, 4
- dec [ebp+arg_0]
- jnz short loc_0_43D04A
- push 10h
- xor eax, eax
- pop ecx
- loc_0_43D064:
- mov edx, ebx
- mov esi, ebx
- shr edx, 5
- add edx, [ebp+var_C]
- sub eax, 61C88647h
- shl esi, 4
- add esi, [ebp+var_10]
- xor edx, esi
- lea esi, [eax+ebx]
- xor edx, esi
- add edi, edx
- mov edx, edi
- mov esi, edi
- shr edx, 5
- add edx, [ebp+var_4]
- shl esi, 4
- add esi, [ebp+var_8]
- xor edx, esi
- lea esi, [eax+edi]
- xor edx, esi
- add ebx, edx
- dec ecx
- jnz short loc_0_43D064
- push edi
- call _htonl@4
- mov esi, [ebp+arg_8]
- push ebx
- mov [esi], eax
- call _htonl@4
- mov [esi+4], eax
- pop edi
- pop esi
- pop ebx
- leave
- retn
- TeaEncrypt endp
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- public _SymmetryEncrypt
- _SymmetryEncrypt proc near
- var_14 = byte ptr -14h
- var_D = byte ptr -0Dh
- var_C = byte ptr -0Ch
- var_4 = dword ptr -4
- arg_0 = dword ptr 8
- arg_4 = dword ptr 0Ch
- arg_8 = dword ptr 10h
- arg_C = dword ptr 14h
- arg_10 = dword ptr 18h
- push ebp
- mov ebp, esp
- sub esp, 14h
- mov eax, [ebp+arg_4]
- push ebx
- push esi
- push edi
- push 8
- add eax, 0Ah
- pop ebx
- cdq
- mov ecx, ebx
- idiv ecx
- test edx, edx
- mov [ebp+var_4], edx
- jz short loc_0_43D182
- mov eax, ebx
- sub eax, edx
- mov [ebp+var_4], eax
- loc_0_43D182:
- call _rand
- mov ecx, eax
- mov eax, [ebp+var_4]
- and cl, 0F8h
- push 1
- or cl, al
- pop edi
- mov [ebp+var_C], cl
- mov ecx, eax
- dec eax
- test ecx, ecx
- jz short loc_0_43D1AE
- lea esi, [eax+1]
- loc_0_43D1A1:
- call _rand
- mov [ebp+edi+var_C], al
- inc edi
- dec esi
- jnz short loc_0_43D1A1
- loc_0_43D1AE:
- push ebx
- lea eax, [ebp+var_14]
- push 0
- push eax
- call _memset
- mov esi, [ebp+arg_10]
- lea eax, [ebp+var_14]
- add esp, 0Ch
- mov [ebp+var_4], eax
- and dword ptr [esi], 0
- mov [ebp+arg_10], 1
- loc_0_43D1D0:
- cmp edi, ebx
- jge short loc_0_43D1E3
- call _rand
- mov [ebp+edi+var_C], al
- inc edi
- inc [ebp+arg_10]
- cmp edi, ebx
- loc_0_43D1E3:
- jnz short loc_0_43D21C
- mov ecx, [ebp+var_4]
- lea eax, [ebp+var_C]
- xor edi, edi
- sub ecx, eax
- loc_0_43D1EF:
- lea eax, [ebp+edi+var_C]
- mov dl, [ecx+eax]
- xor [eax], dl
- inc edi
- cmp edi, ebx
- jl short loc_0_43D1EF
- push [ebp+arg_C]
- lea eax, [ebp+var_C]
- push [ebp+arg_8]
- push eax
- call TeaEncrypt
- mov eax, [ebp+arg_C]
- add [esi], ebx
- add esp, 0Ch
- xor edi, edi
- add [ebp+arg_C], ebx
- mov [ebp+var_4], eax
- loc_0_43D21C:
- cmp [ebp+arg_10], 2
- jle short loc_0_43D1D0
- loc_0_43D222:
- cmp [ebp+arg_4], 0
- jz short loc_0_43D279
- cmp edi, ebx
- jge short loc_0_43D23E
- mov eax, [ebp+arg_0]
- inc edi
- inc [ebp+arg_0]
- dec [ebp+arg_4]
- mov al, [eax]
- cmp edi, ebx
- mov [ebp+edi+var_D], al
- loc_0_43D23E:
- jnz short loc_0_43D222
- mov ecx, [ebp+var_4]
- lea eax, [ebp+var_C]
- xor edi, edi
- sub ecx, eax
- loc_0_43D24A:
- lea eax, [ebp+edi+var_C]
- mov dl, [ecx+eax]
- xor [eax], dl
- inc edi
- cmp edi, ebx
- jl short loc_0_43D24A
- push [ebp+arg_C]
- lea eax, [ebp+var_C]
- push [ebp+arg_8]
- push eax
- call TeaEncrypt
- mov eax, [ebp+arg_C]
- add [esi], ebx
- add esp, 0Ch
- xor edi, edi
- add [ebp+arg_C], ebx
- mov [ebp+var_4], eax
- jmp short loc_0_43D222
- loc_0_43D279:
- mov [ebp+arg_10], 1
- loc_0_43D280:
- cmp edi, ebx
- jge short loc_0_43D28F
- and [ebp+edi+var_C], 0
- inc edi
- inc [ebp+arg_10]
- cmp edi, ebx
- loc_0_43D28F:
- jnz short loc_0_43D2C8
- mov ecx, [ebp+var_4]
- lea eax, [ebp+var_C]
- xor edi, edi
- sub ecx, eax
- loc_0_43D29B:
- lea eax, [ebp+edi+var_C]
- mov dl, [ecx+eax]
- xor [eax], dl
- inc edi
- cmp edi, ebx
- jl short loc_0_43D29B
- push [ebp+arg_C]
- lea eax, [ebp+var_C]
- push [ebp+arg_8]
- push eax
- call TeaEncrypt
- mov eax, [ebp+arg_C]
- add [esi], ebx
- add esp, 0Ch
- xor edi, edi
- add [ebp+arg_C], ebx
- mov [ebp+var_4], eax
- loc_0_43D2C8:
- cmp [ebp+arg_10], 7
- jle short loc_0_43D280
- pop edi
- pop esi
- pop ebx
- leave
- retn
- _SymmetryEncrypt endp
- _text ends
- end