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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40c
push ebx
mov ebx, dword [ebp + 0xc]
push esi
cmp ebx, 0x40
push edi
jbe 0x51cf7b
lea eax, [ebp - 0x324]
push eax
call fcn.00515f30
mov ecx, dword [ebp + 8]
push ebx
lea edx, [ebp - 0x324]
push ecx
push edx
call fcn.00515fb0
lea eax, [ebp - 0x44]
lea ecx, [ebp - 0x324]
push eax
push ecx
call fcn.00516060
add esp, 0x18
mov ebx, 0x20
jmp 0x51cf9d
mov esi, dword [ebp + 8]
lea edx, [ebp - 0x44]
cmp edx, esi
je 0x51cf98
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 0x51cfb8
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 eax, eax
mov cl, byte [ebp + eax - 0x44]
mov dl, cl
xor cl, 0x5c
xor dl, 0x36
mov byte [ebp + eax - 0x364], cl
mov byte [ebp + eax - 0x1d4], dl
inc eax
cmp eax, 0x40
jb 0x51cfba
lea eax, [ebp - 0x324]
push eax
call fcn.00515f30
lea ecx, [ebp - 0x1d4]
push 0x40
lea edx, [ebp - 0x324]
push ecx
push edx
call fcn.00515fb0
lea eax, [ebp - 0x27c]
push eax
call fcn.00515f30
lea ecx, [ebp - 0x364]
push 0x40
lea edx, [ebp - 0x27c]
push ecx
push edx
call fcn.00515fb0
mov eax, dword [ebp + 0x20]
mov ebx, 1
add eax, 0x1f
add esp, 0x20
shr eax, 5
cmp eax, ebx
mov dword [ebp - 4], eax
jb 0x51d2a1
mov dword [ebp + 0xc], 0
mov ecx, ebx
mov eax, ebx
shr ecx, 0x18
mov edx, ebx
mov byte [ebp + 8], cl
shr eax, 8
shr edx, 0x10
mov byte [ebp + 0xa], al
mov ecx, 7
xor eax, eax
lea edi, [ebp - 0x24]
mov byte [ebp + 9], dl
mov byte [ebp + 0xb], bl
rep stosd dword es:[edi], eax
lea ecx, [ebp - 8]
mov byte [ebp - 0x24], 0x80
push ecx
push 0x300
call fcn.0051ce00
mov edx, dword [ebp + 0x14]
mov eax, dword [ebp + 0x10]
mov ecx, 0x54
lea esi, [ebp - 0x324]
lea edi, [ebp - 0x194]
push edx
rep movsd dword es:[edi], dword [esi]
lea ecx, [ebp - 0x194]
push eax
push ecx
call fcn.00515fb0
lea edx, [ebp + 8]
push 4
lea eax, [ebp - 0x194]
push edx
push eax
call fcn.00515fb0
lea ecx, [ebp - 0x44]
lea edx, [ebp - 0x194]
push ecx
push edx
call fcn.00516060
lea eax, [ebp - 0x44]
push 0x20
lea ecx, [ebp - 0xec]
push eax
push ecx
call fcn.00515fb0
lea edx, [ebp - 0x44]
lea eax, [ebp - 0xec]
push edx
push eax
call fcn.00516060
mov eax, dword [ebp + 0x18]
add esp, 0x3c
mov ecx, 0x2a
lea esi, [ebp - 0xec]
lea edi, [ebp - 0x40c]
cmp eax, 1
rep movsd dword es:[edi], dword [esi]
jbe 0x51d24b
lea esi, [eax - 1]
mov ecx, dword [ebp - 0x29c]
mov eax, dword [ebp - 0x294]
mov edx, dword [ebp - 0x298]
mov dword [ebp - 0x10c], ecx
mov ecx, dword [ebp - 0x290]
mov dword [ebp - 0x104], eax
mov eax, dword [ebp - 0x288]
mov dword [ebp - 0x100], ecx
mov ecx, dword [ebp - 0x284]
mov dword [ebp - 0x108], edx
mov edx, dword [ebp - 0x28c]
mov dword [ebp - 0xf8], eax
mov dword [ebp - 0xf4], ecx
lea eax, [ebp - 0x44]
mov dword [ebp - 0xfc], edx
mov edx, dword [ebp - 0x280]
lea ecx, [ebp - 0x194]
push eax
push ecx
mov dword [ebp - 0xf0], edx
call fcn.00511d90
mov eax, dword [ebp - 0x10c]
lea edx, [ebp - 0x44]
push edx
push eax
call fcn.0051ce00
mov edx, dword [ebp - 0x108]
lea ecx, [ebp - 0x40]
push ecx
push edx
call fcn.0051ce00
mov ecx, dword [ebp - 0x104]
lea eax, [ebp - 0x3c]
push eax
push ecx
call fcn.0051ce00
mov eax, dword [ebp - 0x100]
lea edx, [ebp - 0x38]
push edx
push eax
call fcn.0051ce00
mov edx, dword [ebp - 0xfc]
lea ecx, [ebp - 0x34]
push ecx
push edx
call fcn.0051ce00
mov ecx, dword [ebp - 0xf8]
lea eax, [ebp - 0x30]
push eax
push ecx
call fcn.0051ce00
mov eax, dword [ebp - 0xf4]
lea edx, [ebp - 0x2c]
push edx
push eax
call fcn.0051ce00
mov edx, dword [ebp - 0xf0]
add esp, 0x40
lea ecx, [ebp - 0x28]
push ecx
push edx
call fcn.0051ce00
lea eax, [ebp - 0x27c]
lea ecx, [ebp - 0xec]
push eax
push ecx
call fcn.0051d3d0
lea edx, [ebp - 0x44]
lea eax, [ebp - 0xec]
push edx
push eax
call fcn.00511d90
lea ecx, [ebp - 0x44]
lea edx, [ebp - 0xec]
push ecx
push edx
call fcn.0051d2b0
lea eax, [ebp - 0xec]
lea ecx, [ebp - 0x40c]
push eax
push ecx
call fcn.0051d440
add esp, 0x28
dec esi
jne 0x51d108
lea edx, [ebp - 0x1b4]
lea eax, [ebp - 0x40c]
push edx
push eax
call fcn.0051d2b0
mov eax, dword [ebp + 0x20]
mov edx, dword [ebp + 0xc]
sub eax, edx
add esp, 8
cmp eax, 0x20
jb 0x51d273
mov eax, 0x20
mov ecx, eax
mov eax, dword [ebp + 0x1c]
lea esi, [ebp - 0x1b4]
lea edi, [edx + eax]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov eax, dword [ebp - 4]
and ecx, 3
inc ebx
add edx, 0x20
cmp ebx, eax
rep movsb byte es:[edi], byte [esi]
mov dword [ebp + 0xc], edx
jbe 0x51d03f
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret