Function at 0x40d8e0
Capabilities:
Authenticate hmac
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x5c
push ebx
push edi
mov edi, ecx
mov dword [ebp - 4], edx
mov dword [ebp - 0x10], edi
test edi, edi
je 0x40dac1
mov eax, dword [edi]
test eax, eax
je 0x40dac1
mov ebx, dword [edi + 8]
test ebx, ebx
je 0x40dac1
push esi
mov esi, dword [ebp + 8]
cmp esi, dword [eax + 0xc]
jbe 0x40d972
push dword [edi + 4]
mov eax, dword [eax + 0x10]
call eax
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x40daa6
mov eax, dword [edi]
push esi
push dword [ebp - 4]
push dword [edi + 4]
mov eax, dword [eax + 0x14]
call eax
mov ebx, eax
add esp, 0xc
test ebx, ebx
jne 0x40daa6
mov eax, dword [edi]
lea ecx, [ebp - 0x5c]
push ecx
push dword [edi + 4]
mov eax, dword [eax + 0x18]
call eax
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x40daa6
mov eax, dword [edi]
lea ecx, [ebp - 0x5c]
mov ebx, dword [edi + 8]
mov dword [ebp - 4], ecx
mov esi, dword [eax + 8]
mov dword [ebp + 8], esi
mov eax, dword [eax + 0xc]
push eax
push 0x36
push ebx
lea ecx, [eax + ebx]
mov dword [ebp - 8], ecx
call sub.ntdll.dll_memset
mov eax, dword [edi]
push dword [eax + 0xc]
push 0x5c
push dword [ebp - 8]
call sub.ntdll.dll_memset
xor ecx, ecx
add esp, 0x18
mov dword [ebp - 0xc], ecx
test esi, esi
je 0x40da7a
cmp esi, 0x10
jb 0x40da45
mov edx, dword [ebp - 8]
mov dword [ebp - 0xc], ecx
lea eax, [edx - 1]
add eax, esi
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 4]
lea edi, [eax - 1]
add edi, esi
mov dword [ebp - 0x18], edi
cmp edx, edi
mov edi, dword [ebp - 0x10]
ja 0x40d9d1
cmp dword [ebp - 0x14], eax
jae 0x40da48
lea ecx, [ebx - 1]
add ecx, esi
mov dword [ebp - 0x1c], ecx
cmp edx, ecx
mov ecx, 0
ja 0x40d9e7
cmp dword [ebp - 0x14], ebx
jae 0x40da48
cmp ebx, dword [ebp - 0x18]
ja 0x40d9f1
cmp dword [ebp - 0x1c], eax
jae 0x40da48
mov edi, dword [ebp - 4]
mov eax, esi
sub edi, ebx
and eax, 0xfffffff0
mov dword [ebp - 0x1c], edi
mov edi, edx
mov edx, dword [ebp - 0x1c]
sub edi, ebx
mov dword [ebp - 0x18], edi
mov edi, dword [ebp - 0x10]
mov esi, dword [ebp - 0x18]
mov dword [ebp - 0x14], eax
mov eax, ebx
movups xmm2, xmmword [edx + eax]
add ecx, 0x10
lea eax, [eax + 0x10]
movups xmm0, xmmword [eax - 0x10]
movaps xmm1, xmm2
pxor xmm1, xmm0
movups xmm0, xmmword [esi + eax - 0x10]
movups xmmword [eax - 0x10], xmm1
pxor xmm0, xmm2
movups xmmword [esi + eax - 0x10], xmm0
cmp ecx, dword [ebp - 0x14]
jb 0x40da13
mov esi, dword [ebp + 8]
mov dword [ebp - 0xc], ecx
mov eax, dword [ebp - 4]
cmp ecx, esi
jae 0x40da7a
mov edx, ebx
add ecx, eax
sub edx, eax
mov dword [ebp - 0x1c], edx
mov edx, dword [ebp - 8]
mov edi, dword [ebp - 0x1c]
sub edx, eax
sub esi, dword [ebp - 0xc]
movzx eax, byte [ecx]
lea ecx, [ecx + 1]
xor byte [edi + ecx - 1], al
movzx eax, byte [ecx - 1]
xor byte [edx + ecx - 1], al
sub esi, 1
jne 0x40da60
mov edi, dword [ebp - 0x10]
mov eax, dword [edi]
push dword [edi + 4]
mov eax, dword [eax + 0x10]
call eax
add esp, 4
mov dword [ebp - 0x1c], eax
test eax, eax
jne 0x40daa3
mov eax, dword [edi]
push dword [eax + 0xc]
mov eax, dword [eax + 0x14]
push ebx
push dword [edi + 4]
call eax
add esp, 0xc
mov ebx, eax
jmp 0x40daa6
mov ebx, dword [ebp - 0x1c]
push 0x40
lea eax, [ebp - 0x5c]
push 0
push eax
mov eax, dword [sub.ntdll.dll_memset]
call eax
add esp, 0xc
mov eax, ebx
pop esi
pop edi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
mov eax, 0xffffaf00
pop ebx
mov esp, ebp
pop ebp
ret