加解密都错了
这是我改的32加密 解密不知道怎么弄
.版本 2
.子程序 TEA加密, 字节集, 公开
.参数 明文, 字节集
.参数 密钥, 字节集, , 密钥为16字节,如果提供大于16字节将忽略后面的字节
.局部变量 outLen, 整数型, , , ebp-04h
.局部变量 outData, 字节集, , , ebp-08h
.如果真 (取字节集长度 (密钥) ≥ 16)
' oi_symmetry_encrypt2_len:
' mov eax, dword [ebp+0x08]
' mov eax, dword [eax]
' test eax, eax
' je e
' add eax, 8
' mov edx, [eax-4]
' add edx, 0x0A
' mov ecx, edx
' and ecx, 0x80000007
' jns label1
' dec ecx
' or ecx, 0xFFFFFFF8
' inc ecx
' label1:
' mov eax, 0x00000008
' sub eax, ecx
' test ecx, ecx
' cmove eax, ecx
' add eax, edx
' mov [ebp-4], eax
' e:
置入代码 ({ 139, 69, 8, 139, 0, 133, 192, 116, 41, 131, 192, 8, 139, 80, 252, 131, 194, 10, 137, 209, 129, 225, 7, 0, 0, 128, 121, 5, 73, 131, 201, 248, 65, 184, 8, 0, 0, 0, 41, 200, 133, 201, 15, 68, 193, 1, 208, 137, 69, 252 })
.如果真 (outLen ≠ 0)
outData = 取空白字节集 (outLen)
' *** 缩略程序块 ***
' mov edx, dword [ebp-08h]
' add edx, 8
' push edx
' lea eax, [ebp-04h]
' push eax
' push edx
' mov eax, dword [ebp+0Ch]
' mov eax, dword [eax]
' add eax, 8
' push eax
' mov eax, dword [ebp+0x08]
' mov eax, dword [eax]
' add eax, 8
' push dword [eax-4]
' push eax
' call oi_symmetry_encrypt2
' pop eax
' mov ecx, [ebp-04h]
' mov [eax-4], ecx
' jmp e
' oi_symmetry_encrypt2:
' push ebp
' mov ebp, esp
' mov eax, dword [ebp+0x0C]
' sub esp, 0x14
' add eax, 0x0A
' push ebx
' push esi
' push edi
' and eax, 0x80000007
' jns label1
' dec eax
' or eax, 0xFFFFFFF8
' inc eax
' label1:
' mov ebx, 0x00000008
' sub ebx, eax
' test eax, eax
' cmove ebx, eax
' rdtsc
' and al, 0xF8
' mov esi, 0x00000001
' or al, bl
' mov byte [ebp-0x0C], al
' test ebx, ebx
' je label3
' nop
' label2:
' rdtsc
' mov byte [ebp+esi-0x0C], al
' inc esi
' sub ebx, 0x01
' jne label2
' label3:
' mov eax, dword [ebp+0x18]
' lea ebx, dword [ebp-0x14]
' mov edi, dword [ebp+0x14]
' xorps xmm0, xmm0
' movq qword [ebp-0x14], xmm0
' mov dword [eax], 0x00000000
' mov eax, 0x00000001
' mov dword [ebp-0x04], eax
' nop dword [eax+eax+0x00]
' label4:
' cmp esi, 0x08
' jnl label5
' rdtsc
' mov byte [ebp+esi-0x0C], al
' inc esi
' mov eax, dword [ebp-0x04]
' inc eax
' cmp esi, 0x08
' mov dword [ebp-0x04], eax
' label5:
' jne label6
' movzx eax, byte [ebx]
' xor byte [ebp-0x0C], al
' movzx eax, byte [ebx+0x01]
' xor byte [ebp-0x0B], al
' movzx eax, byte [ebx+0x02]
' xor byte [ebp-0x0A], al
' movzx eax, byte [ebx+0x03]
' xor byte [ebp-0x09], al
' movzx eax, byte [ebx+0x04]
' xor byte [ebp-0x08], al
' movzx eax, byte [ebx+0x05]
' xor byte [ebp-0x07], al
' movzx eax, byte [ebx+0x06]
' xor byte [ebp-0x06], al
' movzx eax, byte [ebx+0x07]
' xor byte [ebp-0x05], al
' lea eax, dword [ebp-0x0C]
' push edi
' push dword [ebp+0x10]
' push eax
' call TeaEncryptECB
' mov eax, dword [ebp-0x14]
' xor esi, esi
' xor byte [edi], al
' mov ebx, edi
' xor byte [edi+0x01], ah
' movzx eax, byte [ebp-0x12]
' xor byte [edi+0x02], al
' movzx eax, byte [ebp-0x11]
' xor byte [edi+0x03], al
' mov eax, dword [ebp-0x10]
' xor byte [edi+0x04], al
' xor byte [edi+0x05], ah
' movzx eax, byte [ebp-0x0E]
' xor byte [edi+0x06], al
' movzx eax, byte [ebp-0x0D]
' mov edx, dword [ebp-0x08]
' xor byte [edi+0x07], al
' mov eax, dword [ebp-0x0C]
' mov dword [ebp-0x10], edx
' mov edx, dword [ebp+0x18]
' mov dword [ebp-0x14], eax
' mov eax, dword [ebp-0x04]
' add dword [edx], 0x08
' add edi, 0x08
' label6:
' cmp eax, 0x02
' jng label4
' mov ecx, dword [ebp+0x0C]
' test ecx, ecx
' je label10
' label7:
' cmp esi, 0x08
' jnl label8
' mov edx, dword [ebp+0x08]
' dec ecx
' mov dword [ebp+0x0C], ecx
' mov al, byte [edx]
' inc edx
' mov byte [ebp+esi-0x0C], al
' inc esi
' mov dword [ebp+0x08], edx
' cmp esi, 0x08
' label8:
' jne label9
' movzx eax, byte [ebx]
' xor byte [ebp-0x0C], al
' movzx eax, byte [ebx+0x01]
' xor byte [ebp-0x0B], al
' movzx eax, byte [ebx+0x02]
' xor byte [ebp-0x0A], al
' movzx eax, byte [ebx+0x03]
' xor byte [ebp-0x09], al
' movzx eax, byte [ebx+0x04]
' xor byte [ebp-0x08], al
' movzx eax, byte [ebx+0x05]
' xor byte [ebp-0x07], al
' movzx eax, byte [ebx+0x06]
' xor byte [ebp-0x06], al
' movzx eax, byte [ebx+0x07]
' xor byte [ebp-0x05], al
' lea eax, dword [ebp-0x0C]
' push edi
' push dword [ebp+0x10]
' push eax
' call TeaEncryptECB
' mov eax, dword [ebp-0x14]
' xor esi, esi
' xor byte [edi], al
' mov ebx, edi
' xor byte [edi+0x01], ah
' movzx eax, byte [ebp-0x12]
' xor byte [edi+0x02], al
' movzx eax, byte [ebp-0x11]
' xor byte [edi+0x03], al
' mov eax, dword [ebp-0x10]
' xor byte [edi+0x04], al
' xor byte [edi+0x05], ah
' movzx eax, byte [ebp-0x0E]
' xor byte [edi+0x06], al
' movzx eax, byte [ebp-0x0D]
' xor byte [edi+0x07], al
' mov eax, dword [ebp-0x0C]
' mov ecx, dword [ebp+0x0C]
' mov dword [ebp-0x14], eax
' mov eax, dword [ebp-0x08]
' mov dword [ebp-0x10], eax
' mov eax, dword [ebp+0x18]
' add dword [eax], 0x08
' add edi, 0x08
' label9:
' test ecx, ecx
' jne label7
' label10:
' mov eax, 0x00000001
' add edi, 0x02
' mov dword [ebp+0x0C], eax
' label11:
' cmp esi, 0x08
' jnl label12
' mov byte [ebp+esi-0x0C], 0x00
' inc eax
' inc esi
' mov dword [ebp+0x0C], eax
' cmp esi, 0x08
' label12:
' jne label13
' movzx eax, byte [ebx]
' xor byte [ebp-0x0C], al
' movzx eax, byte [ebx+0x01]
' xor byte [ebp-0x0B], al
' movzx eax, byte [ebx+0x02]
' xor byte [ebp-0x0A], al
' movzx eax, byte [ebx+0x03]
' xor byte [ebp-0x09], al
' movzx eax, byte [ebx+0x04]
' xor byte [ebp-0x08], al
' movzx eax, byte [ebx+0x05]
' xor byte [ebp-0x07], al
' movzx eax, byte [ebx+0x06]
' xor byte [ebp-0x06], al
' movzx eax, byte [ebx+0x07]
' lea ebx, dword [edi-0x02]
' xor byte [ebp-0x05], al
' lea eax, dword [ebp-0x0C]
' push ebx
' push dword [ebp+0x10]
' push eax
' call TeaEncryptECB
' mov eax, dword [ebp-0x14]
' xor esi, esi
' xor byte [ebx], al
' xor byte [edi-0x01], ah
' movzx eax, byte [ebp-0x12]
' xor byte [edi], al
' movzx eax, byte [ebp-0x11]
' xor byte [edi+0x01], al
' mov eax, dword [ebp-0x10]
' xor byte [edi+0x02], al
' xor byte [edi+0x03], ah
' movzx eax, byte [ebp-0x0E]
' xor byte [edi+0x04], al
' movzx eax, byte [ebp-0x0D]
' xor byte [edi+0x05], al
' mov eax, dword [ebp-0x0C]
' mov dword [ebp-0x14], eax
' mov eax, dword [ebp-0x08]
' mov dword [ebp-0x10], eax
' mov eax, dword [ebp+0x18]
' add dword [eax], 0x08
' add edi, 0x08
' mov eax, dword [ebp+0x0C]
' label13:
' cmp eax, 0x07
' jng label11
' pop edi
' pop esi
' pop ebx
' mov esp, ebp
' pop ebp
' retn 0x0014
' TeaEncryptECB:
' push ebp
' mov ebp, esp
' sub esp, 0x10
' push ebx
' push esi
' mov esi, dword [ebp+0x08]
' push edi
' mov eax, dword [esi]
' bswap eax
' mov dword [ebp+0x08], eax
' mov ebx, dword [esi+0x04]
' bswap ebx
' mov edi, dword [ebp+0x0C]
' xor esi, esi
' a:
' mov eax, dword [edi+esi*4]
' bswap eax
' mov dword [ebp+esi*4-0x10], eax
' inc esi
' cmp esi, 0x04
' jl a
' mov edi, dword [ebp+0x08]
' xor edx, edx
' lea esi, dword [edx+0x10]
' b:
' mov ecx, ebx
' lea edx, dword [edx-0x61C88647]
' shr ecx, 0x05
' mov eax, ebx
' add ecx, dword [ebp-0x0C]
' shl eax, 0x04
' add eax, dword [ebp-0x10]
' xor ecx, eax
' lea eax, dword [edx+ebx]
' xor ecx, eax
' add edi, ecx
' mov ecx, edi
' mov eax, edi
' shr ecx, 0x05
' add ecx, dword [ebp-0x04]
' shl eax, 0x04
' add eax, dword [ebp-0x08]
' xor ecx, eax
' lea eax, dword [edx+edi]
' xor ecx, eax
' add ebx, ecx
' sub esi, 0x01
' jne b
' bswap edi
' mov esi, dword [ebp+0x10]
' mov dword [esi], edi
' bswap ebx
' pop edi
' mov dword [esi+0x04], ebx
' pop esi
' pop ebx
' mov esp, ebp
' pop ebp
' retn 0x000C
' e:
' 置入代码 ({ 139, 85, 248, 131, 194, 8, 82, 141, 69, 252, 80, 82, 139, 69, 12, 139, 0, 131, 192, 8, 80, 139, 69, 8, 139, 0, 131, 192, 8, 255, 112, 252, 80, 232, 12, 0, 0, 0, 88, 139, 77, 252, 137, 72, 252, 233, 35, 3, 0, 0, 85, 137, 229, 139, 69, 12, 131, 236, 20, 131, 192, 10, 83, 86, 87, 37, 7, 0, 0, 128, 121, 5, 72, 131, 200, 248, 64, 187, 8, 0, 0, 0, 41, 195, 133, 192, 15, 68, 216, 15, 49, 36, 248, 190, 1, 0, 0, 0, 8, 216, 136, 69, 244, 133, 219, 116, 13, 144, 15, 49, 136, 68, 53, 244, 70, 131, 235, 1, 117, 244, 139, 69, 24, 141, 93, 236, 139, 125, 20, 15, 87, 192, 102, 15, 214, 69, 236, 199, 0, 0, 0, 0, 0, 184, 1, 0, 0, 0, 137, 69, 252, 15, 31, 4, 0, 131, 254, 8, 125, 17, 15, 49, 136, 68, 53, 244, 70, 139, 69, 252, 64, 131, 254, 8, 137, 69, 252, 15, 133, 141, 0, 0, 0, 15, 182, 3, 48, 69, 244, 15, 182, 67, 1, 48, 69, 245, 15, 182, 67, 2, 48, 69, 246, 15, 182, 67, 3, 48, 69, 247, 15, 182, 67, 4, 48, 69, 248, 15, 182, 67, 5, 48, 69, 249, 15, 182, 67, 6, 48, 69, 250, 15, 182, 67, 7, 48, 69, 251, 141, 69, 244, 87, 255, 117, 16, 80, 232, 212, 1, 0, 0, 139, 69, 236, 49, 246, 48, 7, 137, 251, 48, 103, 1, 15, 182, 69, 238, 48, 71, 2, 15, 182, 69, 239, 48, 71, 3, 139, 69, 240, 48, 71, 4, 48, 103, 5, 15, 182, 69, 242, 48, 71, 6, 15, 182, 69, 243, 139, 85, 248, 48, 71, 7, 139, 69, 244, 137, 85, 240, 139, 85, 24, 137, 69, 236, 139, 69, 252, 131, 2, 8, 131, 199, 8, 131, 248, 2, 15, 142, 78, 255, 255, 255, 139, 77, 12, 133, 201, 15, 132, 181, 0, 0, 0, 131, 254, 8, 125, 21, 139, 85, 8, 73, 137, 77, 12, 138, 2, 66, 136, 68, 53, 244, 70, 137, 85, 8, 131, 254, 8, 15, 133, 141, 0, 0, 0, 15, 182, 3, 48, 69, 244, 15, 182, 67, 1, 48, 69, 245, 15, 182, 67, 2, 48, 69, 246, 15, 182, 67, 3, 48, 69, 247, 15, 182, 67, 4, 48, 69, 248, 15, 182, 67, 5, 48, 69, 249, 15, 182, 67, 6, 48, 69, 250, 15, 182, 67, 7, 48, 69, 251, 141, 69, 244, 87, 255, 117, 16, 80, 232, 19, 1, 0, 0, 139, 69, 236, 49, 246, 48, 7, 137, 251, 48, 103, 1, 15, 182, 69, 238, 48, 71, 2, 15, 182, 69, 239, 48, 71, 3, 139, 69, 240, 48, 71, 4, 48, 103, 5, 15, 182, 69, 242, 48, 71, 6, 15, 182, 69, 243, 48, 71, 7, 139, 69, 244, 139, 77, 12, 137, 69, 236, 139, 69, 248, 137, 69, 240, 139, 69, 24, 131, 0, 8, 131, 199, 8, 133, 201, 15, 133, 75, 255, 255, 255, 184, 1, 0, 0, 0, 131, 199, 2, 137, 69, 12, 131, 254, 8, 125, 13, 198, 68, 53, 244, 0, 64, 70, 137, 69, 12, 131, 254, 8, 15, 133, 141, 0, 0, 0, 15, 182, 3, 48, 69, 244, 15, 182, 67, 1, 48, 69, 245, 15, 182, 67, 2, 48, 69, 246, 15, 182, 67, 3, 48, 69, 247, 15, 182, 67, 4, 48, 69, 248, 15, 182, 67, 5, 48, 69, 249, 15, 182, 67, 6, 48, 69, 250, 15, 182, 67, 7, 141, 95, 254, 48, 69, 251, 141, 69, 244, 83, 255, 117, 16, 80, 232, 88, 0, 0, 0, 139, 69, 236, 49, 246, 48, 3, 48, 103, 255, 15, 182, 69, 238, 48, 7, 15, 182, 69, 239, 48, 71, 1, 139, 69, 240, 48, 71, 2, 48, 103, 3, 15, 182, 69, 242, 48, 71, 4, 15, 182, 69, 243, 48, 71, 5, 139, 69, 244, 137, 69, 236, 139, 69, 248, 137, 69, 240, 139, 69, 24, 131, 0, 8, 131, 199, 8, 139, 69, 12, 131, 248, 7, 15, 142, 82, 255, 255, 255, 95, 94, 91, 137, 236, 93, 194, 20, 0, 85, 137, 229, 131, 236, 16, 83, 86, 139, 117, 8, 87, 139, 6, 15, 200, 137, 69, 8, 139, 94, 4, 15, 203, 139, 125, 12, 49, 246, 139, 4, 183, 15, 200, 137, 68, 181, 240, 70, 131, 254, 4, 124, 241, 139, 125, 8, 49, 210, 141, 114, 16, 137, 217, 141, 146, 185, 121, 55, 158, 193, 233, 5, 137, 216, 3, 77, 244, 193, 224, 4, 3, 69, 240, 49, 193, 141, 4, 26, 49, 193, 1, 207, 137, 249, 137, 248, 193, 233, 5, 3, 77, 252, 193, 224, 4, 3, 69, 248, 49, 193, 141, 4, 58, 49, 193, 1, 203, 131, 238, 1, 117, 195, 15, 207, 139, 117, 16, 137, 62, 15, 203, 95, 137, 94, 4, 94, 91, 137, 236, 93, 194, 12, 0 }) ' 16轮
置入代码 ({ 139, 85, 248, 131, 194, 8, 82, 141, 69, 252, 80, 82, 139, 69, 12, 139, 0, 131, 192, 8, 80, 139, 69, 8, 139, 0, 131, 192, 8, 255, 112, 252, 80, 232, 12, 0, 0, 0, 88, 139, 77, 252, 137, 72, 252, 233, 35, 3, 0, 0, 85, 137, 229, 139, 69, 12, 131, 236, 20, 131, 192, 10, 83, 86, 87, 37, 7, 0, 0, 128, 121, 5, 72, 131, 200, 248, 64, 187, 8, 0, 0, 0, 41, 195, 133, 192, 15, 68, 216, 15, 49, 36, 248, 190, 1, 0, 0, 0, 8, 216, 136, 69, 244, 133, 219, 116, 13, 144, 15, 49, 136, 68, 53, 244, 70, 131, 235, 1, 117, 244, 139, 69, 24, 141, 93, 236, 139, 125, 20, 15, 87, 192, 102, 15, 214, 69, 236, 199, 0, 0, 0, 0, 0, 184, 1, 0, 0, 0, 137, 69, 252, 15, 31, 4, 0, 131, 254, 8, 125, 17, 15, 49, 136, 68, 53, 244, 70, 139, 69, 252, 64, 131, 254, 8, 137, 69, 252, 15, 133, 141, 0, 0, 0, 15, 182, 3, 48, 69, 244, 15, 182, 67, 1, 48, 69, 245, 15, 182, 67, 2, 48, 69, 246, 15, 182, 67, 3, 48, 69, 247, 15, 182, 67, 4, 48, 69, 248, 15, 182, 67, 5, 48, 69, 249, 15, 182, 67, 6, 48, 69, 250, 15, 182, 67, 7, 48, 69, 251, 141, 69, 244, 87, 255, 117, 16, 80, 232, 212, 1, 0, 0, 139, 69, 236, 49, 246, 48, 7, 137, 251, 48, 103, 1, 15, 182, 69, 238, 48, 71, 2, 15, 182, 69, 239, 48, 71, 3, 139, 69, 240, 48, 71, 4, 48, 103, 5, 15, 182, 69, 242, 48, 71, 6, 15, 182, 69, 243, 139, 85, 248, 48, 71, 7, 139, 69, 244, 137, 85, 240, 139, 85, 24, 137, 69, 236, 139, 69, 252, 131, 2, 8, 131, 199, 8, 131, 248, 2, 15, 142, 78, 255, 255, 255, 139, 77, 12, 133, 201, 15, 132, 181, 0, 0, 0, 131, 254, 8, 125, 21, 139, 85, 8, 73, 137, 77, 12, 138, 2, 66, 136, 68, 53, 244, 70, 137, 85, 8, 131, 254, 8, 15, 133, 141, 0, 0, 0, 15, 182, 3, 48, 69, 244, 15, 182, 67, 1, 48, 69, 245, 15, 182, 67, 2, 48, 69, 246, 15, 182, 67, 3, 48, 69, 247, 15, 182, 67, 4, 48, 69, 248, 15, 182, 67, 5, 48, 69, 249, 15, 182, 67, 6, 48, 69, 250, 15, 182, 67, 7, 48, 69, 251, 141, 69, 244, 87, 255, 117, 16, 80, 232, 19, 1, 0, 0, 139, 69, 236, 49, 246, 48, 7, 137, 251, 48, 103, 1, 15, 182, 69, 238, 48, 71, 2, 15, 182, 69, 239, 48, 71, 3, 139, 69, 240, 48, 71, 4, 48, 103, 5, 15, 182, 69, 242, 48, 71, 6, 15, 182, 69, 243, 48, 71, 7, 139, 69, 244, 139, 77, 12, 137, 69, 236, 139, 69, 248, 137, 69, 240, 139, 69, 24, 131, 0, 8, 131, 199, 8, 133, 201, 15, 133, 75, 255, 255, 255, 184, 1, 0, 0, 0, 131, 199, 2, 137, 69, 12, 131, 254, 8, 125, 13, 198, 68, 53, 244, 0, 64, 70, 137, 69, 12, 131, 254, 8, 15, 133, 141, 0, 0, 0, 15, 182, 3, 48, 69, 244, 15, 182, 67, 1, 48, 69, 245, 15, 182, 67, 2, 48, 69, 246, 15, 182, 67, 3, 48, 69, 247, 15, 182, 67, 4, 48, 69, 248, 15, 182, 67, 5, 48, 69, 249, 15, 182, 67, 6, 48, 69, 250, 15, 182, 67, 7, 141, 95, 254, 48, 69, 251, 141, 69, 244, 83, 255, 117, 16, 80, 232, 88, 0, 0, 0, 139, 69, 236, 49, 246, 48, 3, 48, 103, 255, 15, 182, 69, 238, 48, 7, 15, 182, 69, 239, 48, 71, 1, 139, 69, 240, 48, 71, 2, 48, 103, 3, 15, 182, 69, 242, 48, 71, 4, 15, 182, 69, 243, 48, 71, 5, 139, 69, 244, 137, 69, 236, 139, 69, 248, 137, 69, 240, 139, 69, 24, 131, 0, 8, 131, 199, 8, 139, 69, 12, 131, 248, 7, 15, 142, 82, 255, 255, 255, 95, 94, 91, 137, 236, 93, 194, 20, 0, 85, 137, 229, 131, 236, 16, 83, 86, 139, 117, 8, 87, 139, 6, 15, 200, 137, 69, 8, 139, 94, 4, 15, 203, 139, 125, 12, 49, 246, 139, 4, 183, 15, 200, 137, 68, 181, 240, 70, 131, 254, 4, 124, 241, 139, 125, 8, 49, 210, 141, 114, 32, 137, 217, 141, 146, 71, 145, 232, 87, 193, 233, 5, 137, 216, 3, 77, 244, 193, 224, 4, 3, 69, 240, 49, 193, 141, 4, 26, 49, 193, 1, 207, 137, 249, 137, 248, 193, 233, 5, 3, 77, 252, 193, 224, 4, 3, 69, 248, 49, 193, 141, 4, 58, 49, 193, 1, 203, 131, 238, 1, 117, 195, 15, 207, 139, 117, 16, 137, 62, 15, 203, 95, 137, 94, 4, 94, 91, 137, 236, 93, 194, 12, 0 }) ' 32轮
.如果真结束
.如果真结束
返回 (outData)
|