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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x7ec
push ebx
mov ebx, dword [ebp + 0xc]
push esi
cmp ebx, 0x80
push edi
jbe 0x51d541
lea eax, [ebp - 0x5a4]
push eax
call fcn.0051c2b0
mov ecx, dword [ebp + 8]
push ebx
lea edx, [ebp - 0x5a4]
push ecx
push edx
call fcn.0051c390
lea eax, [ebp - 0x84]
lea ecx, [ebp - 0x5a4]
push eax
push ecx
call fcn.0051c450
add esp, 0x18
mov ebx, 0x40
jmp 0x51d56c
mov esi, dword [ebp + 8]
lea edx, [ebp - 0x84]
cmp edx, esi
je 0x51d564
mov ecx, ebx
lea edi, [ebp - 0x84]
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, 0x80
jae 0x51d58a
mov ecx, 0x80
xor eax, eax
sub ecx, ebx
lea edi, [ebp + ebx - 0x84]
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 - 0x84]
mov dl, cl
xor cl, 0x5c
xor dl, 0x36
mov byte [ebp + eax - 0x6a4], cl
mov byte [ebp + eax - 0x624], dl
inc eax
cmp eax, 0x80
jb 0x51d58c
lea eax, [ebp - 0x5a4]
push eax
call fcn.0051c2b0
lea ecx, [ebp - 0x624]
push 0x80
lea edx, [ebp - 0x5a4]
push ecx
push edx
call fcn.0051c390
lea eax, [ebp - 0x45c]
push eax
call fcn.0051c2b0
lea ecx, [ebp - 0x6a4]
push 0x80
lea edx, [ebp - 0x45c]
push ecx
push edx
call fcn.0051c390
mov eax, dword [ebp + 0x20]
mov ebx, 1
add eax, 0x3f
add esp, 0x20
shr eax, 6
cmp eax, ebx
mov dword [ebp - 4], eax
jb 0x51d92b
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, 0xf
xor eax, eax
lea edi, [ebp - 0x44]
mov byte [ebp + 9], dl
mov byte [ebp + 0xb], bl
rep stosd dword es:[edi], eax
lea ecx, [ebp - 8]
mov byte [ebp - 0x44], 0x80
push ecx
push 0x600
call fcn.0051ce00
mov edx, dword [ebp + 0x14]
mov eax, dword [ebp + 0x10]
mov ecx, 0xa4
lea esi, [ebp - 0x5a4]
lea edi, [ebp - 0x314]
push edx
rep movsd dword es:[edi], dword [esi]
lea ecx, [ebp - 0x314]
push eax
push ecx
call fcn.0051c390
lea edx, [ebp + 8]
push 4
lea eax, [ebp - 0x314]
push edx
push eax
call fcn.0051c390
lea ecx, [ebp - 0x84]
lea edx, [ebp - 0x314]
push ecx
push edx
call fcn.0051c450
lea eax, [ebp - 0x84]
push 0x40
lea ecx, [ebp - 0x1cc]
push eax
push ecx
call fcn.0051c390
lea edx, [ebp - 0x84]
lea eax, [ebp - 0x1cc]
push edx
push eax
call fcn.0051c450
mov eax, dword [ebp + 0x18]
add esp, 0x3c
mov ecx, 0x52
lea esi, [ebp - 0x1cc]
lea edi, [ebp - 0x7ec]
cmp eax, 1
rep movsd dword es:[edi], dword [esi]
jbe 0x51d8d5
lea esi, [eax - 1]
mov edx, dword [ebp - 0x498]
mov eax, dword [ebp - 0x494]
mov ecx, dword [ebp - 0x49c]
mov dword [ebp - 0x208], edx
mov edx, dword [ebp - 0x48c]
mov dword [ebp - 0x204], eax
mov eax, dword [ebp - 0x488]
mov dword [ebp - 0x20c], ecx
mov ecx, dword [ebp - 0x490]
mov dword [ebp - 0x1fc], edx
mov edx, dword [ebp - 0x480]
mov dword [ebp - 0x1f8], eax
mov eax, dword [ebp - 0x47c]
mov dword [ebp - 0x200], ecx
mov ecx, dword [ebp - 0x484]
mov dword [ebp - 0x1f0], edx
mov edx, dword [ebp - 0x474]
mov dword [ebp - 0x1ec], eax
mov eax, dword [ebp - 0x470]
mov dword [ebp - 0x1f4], ecx
mov ecx, dword [ebp - 0x478]
mov dword [ebp - 0x1e4], edx
mov edx, dword [ebp - 0x468]
mov dword [ebp - 0x1e0], eax
mov eax, dword [ebp - 0x464]
mov dword [ebp - 0x1e8], ecx
mov ecx, dword [ebp - 0x46c]
mov dword [ebp - 0x1d8], edx
mov dword [ebp - 0x1d4], eax
lea edx, [ebp - 0x84]
mov dword [ebp - 0x1dc], ecx
mov ecx, dword [ebp - 0x460]
lea eax, [ebp - 0x314]
push edx
push eax
mov dword [ebp - 0x1d0], ecx
call fcn.00516250
mov edx, dword [ebp - 0x208]
mov eax, dword [ebp - 0x20c]
lea ecx, [ebp - 0x84]
push ecx
push edx
push eax
call fcn.0051d940
mov edx, dword [ebp - 0x200]
mov eax, dword [ebp - 0x204]
lea ecx, [ebp - 0x7c]
push ecx
push edx
push eax
call fcn.0051d940
mov edx, dword [ebp - 0x1f8]
mov eax, dword [ebp - 0x1fc]
lea ecx, [ebp - 0x74]
push ecx
push edx
push eax
call fcn.0051d940
mov edx, dword [ebp - 0x1f0]
mov eax, dword [ebp - 0x1f4]
lea ecx, [ebp - 0x6c]
push ecx
push edx
push eax
call fcn.0051d940
mov edx, dword [ebp - 0x1e8]
mov eax, dword [ebp - 0x1ec]
lea ecx, [ebp - 0x64]
push ecx
push edx
push eax
call fcn.0051d940
mov edx, dword [ebp - 0x1e0]
mov eax, dword [ebp - 0x1e4]
add esp, 0x44
lea ecx, [ebp - 0x5c]
push ecx
push edx
push eax
call fcn.0051d940
lea ecx, [ebp - 0x54]
mov edx, dword [ebp - 0x1d8]
mov eax, dword [ebp - 0x1dc]
push ecx
push edx
push eax
call fcn.0051d940
mov edx, dword [ebp - 0x1d0]
mov eax, dword [ebp - 0x1d4]
lea ecx, [ebp - 0x4c]
push ecx
push edx
push eax
call fcn.0051d940
lea ecx, [ebp - 0x45c]
lea edx, [ebp - 0x1cc]
push ecx
push edx
call fcn.0051db60
lea eax, [ebp - 0x84]
lea ecx, [ebp - 0x1cc]
push eax
push ecx
call fcn.00516250
lea edx, [ebp - 0x84]
lea eax, [ebp - 0x1cc]
push edx
push eax
call fcn.0051d990
lea ecx, [ebp - 0x1cc]
lea edx, [ebp - 0x7ec]
push ecx
push edx
call fcn.0051dc30
add esp, 0x44
dec esi
jne 0x51d6ee
lea eax, [ebp - 0x5e4]
lea ecx, [ebp - 0x7ec]
push eax
push ecx
call fcn.0051d990
mov eax, dword [ebp + 0x20]
mov edx, dword [ebp + 0xc]
sub eax, edx
add esp, 8
cmp eax, 0x40
jb 0x51d8fd
mov eax, 0x40
mov ecx, eax
mov eax, dword [ebp + 0x1c]
lea esi, [ebp - 0x5e4]
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, 0x40
cmp ebx, eax
rep movsb byte es:[edi], byte [esi]
mov dword [ebp + 0xc], edx
jbe 0x51d61c
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret