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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x264
push ebx
mov ebx, dword [ebp + 0xc]
push esi
cmp ebx, 0x40
push edi
jbe 0x51caeb
lea eax, [ebp - 0x1c8]
push eax
call fcn.00511bb0
mov ecx, dword [ebp + 8]
push ebx
lea edx, [ebp - 0x1c8]
push ecx
push edx
call fcn.00511bf0
lea eax, [ebp - 0x44]
lea ecx, [ebp - 0x1c8]
push eax
push ecx
call fcn.00511cc0
add esp, 0x18
mov ebx, 0x14
jmp 0x51cb0d
mov esi, dword [ebp + 8]
lea edx, [ebp - 0x44]
cmp edx, esi
je 0x51cb08
mov ecx, ebx
lea edi, [ebp - 0x44]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
cmp ebx, 0x40
jae 0x51cb28
mov ecx, 0x40
xor eax, eax
sub ecx, ebx
lea edi, [ebp + ebx - 0x44]
mov edx, ecx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
xor ecx, ecx
mov al, byte [ebp + ecx - 0x44]
mov dl, al
xor al, 0x5c
xor dl, 0x36
mov byte [ebp + ecx - 0x208], al
mov byte [ebp + ecx - 0x264], dl
inc ecx
cmp ecx, 0x40
jb 0x51cb2a
lea eax, [ebp - 0x1c8]
push eax
call fcn.00511bb0
lea ecx, [ebp - 0x264]
push 0x40
lea edx, [ebp - 0x1c8]
push ecx
push edx
call fcn.00511bf0
lea eax, [ebp - 0x16c]
push eax
call fcn.00511bb0
lea ecx, [ebp - 0x208]
push 0x40
lea edx, [ebp - 0x16c]
push ecx
push edx
call fcn.00511bf0
mov eax, dword [ebp + 0x20]
mov ebx, 1
add esp, 0x20
lea ecx, [eax + 0x13]
mov eax, 0xcccccccd
mul ecx
shr edx, 4
cmp edx, ebx
mov dword [ebp - 4], edx
jb 0x51cdf2
mov dword [ebp + 0xc], 0x14
mov edx, ebx
mov eax, ebx
mov ecx, ebx
lea edi, [ebp - 0x30]
shr edx, 0x18
shr eax, 0x10
shr ecx, 8
mov byte [ebp + 8], dl
mov byte [ebp + 9], al
mov byte [ebp + 0xa], cl
lea edx, [ebp - 8]
mov ecx, 0xa
xor eax, eax
mov byte [ebp + 0xb], bl
push edx
rep stosd dword es:[edi], eax
push 0x2a0
mov byte [ebp - 0x30], 0x80
call fcn.0051ce00
mov eax, dword [ebp + 0x14]
mov ecx, 0x2e
lea esi, [ebp - 0x1c8]
lea edi, [ebp - 0xfc]
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [ebp + 0x10]
push eax
lea edx, [ebp - 0xfc]
push ecx
push edx
call fcn.00511bf0
lea eax, [ebp + 8]
push 4
lea ecx, [ebp - 0xfc]
push eax
push ecx
call fcn.00511bf0
lea edx, [ebp - 0x44]
lea eax, [ebp - 0xfc]
push edx
push eax
call fcn.00511cc0
lea ecx, [ebp - 0x44]
push 0x14
lea edx, [ebp - 0xa0]
push ecx
push edx
call fcn.00511bf0
lea eax, [ebp - 0x44]
lea ecx, [ebp - 0xa0]
push eax
push ecx
call fcn.00511cc0
mov eax, dword [ebp + 0x18]
add esp, 0x3c
mov ecx, 0x17
lea esi, [ebp - 0xa0]
lea edi, [ebp - 0x224]
cmp eax, 1
rep movsd dword es:[edi], dword [esi]
jbe 0x51cd96
lea esi, [eax - 1]
mov edx, dword [ebp - 0x1c8]
mov ecx, dword [ebp - 0x1c0]
mov eax, dword [ebp - 0x1c4]
mov dword [ebp - 0xfc], edx
mov edx, dword [ebp - 0x1bc]
mov dword [ebp - 0xf4], ecx
mov dword [ebp - 0xf0], edx
lea ecx, [ebp - 0x44]
mov dword [ebp - 0xf8], eax
mov eax, dword [ebp - 0x1b8]
lea edx, [ebp - 0xfc]
push ecx
push edx
mov dword [ebp - 0xec], eax
call fcn.0050fc50
mov ecx, dword [ebp - 0xfc]
lea eax, [ebp - 0x44]
push eax
push ecx
call fcn.0051ce00
mov eax, dword [ebp - 0xf8]
lea edx, [ebp - 0x40]
push edx
push eax
call fcn.0051ce00
mov edx, dword [ebp - 0xf4]
lea ecx, [ebp - 0x3c]
push ecx
push edx
call fcn.0051ce00
mov ecx, dword [ebp - 0xf0]
lea eax, [ebp - 0x38]
push eax
push ecx
call fcn.0051ce00
mov eax, dword [ebp - 0xec]
lea edx, [ebp - 0x34]
push edx
push eax
call fcn.0051ce00
mov ecx, dword [ebp - 0x16c]
mov eax, dword [ebp - 0x164]
mov edx, dword [ebp - 0x168]
mov dword [ebp - 0xa0], ecx
mov ecx, dword [ebp - 0x160]
mov dword [ebp - 0x98], eax
mov dword [ebp - 0x94], ecx
lea eax, [ebp - 0x44]
mov dword [ebp - 0x9c], edx
mov edx, dword [ebp - 0x15c]
lea ecx, [ebp - 0xa0]
push eax
push ecx
mov dword [ebp - 0x90], edx
call fcn.0050fc50
lea edx, [ebp - 0x44]
lea eax, [ebp - 0xa0]
push edx
push eax
call fcn.0051ce30
add esp, 0x40
lea ecx, [ebp - 0xa0]
lea edx, [ebp - 0x224]
push ecx
push edx
call fcn.0051cee0
add esp, 8
dec esi
jne 0x51cc7e
lea eax, [ebp - 0x110]
lea ecx, [ebp - 0x224]
push eax
push ecx
call fcn.0051ce30
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp + 0x20]
add edx, 0xffffffec
add esp, 8
sub eax, edx
cmp eax, 0x14
jb 0x51cdc1
mov eax, 0x14
mov ecx, eax
mov eax, dword [ebp + 0x1c]
lea esi, [ebp - 0x110]
lea edi, [edx + eax]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov eax, dword [ebp - 4]
mov ecx, edx
and ecx, 3
inc ebx
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp + 0xc]
add ecx, 0x14
cmp ebx, eax
mov dword [ebp + 0xc], ecx
jbe 0x51cbb5
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret