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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x410
mov eax, dword [ebp + 8]
push ebx
push esi
sub eax, 0
push edi
je 0x51e043
mov ebx, dword [ebp + 0x10]
dec eax
je 0x51defe
cmp ebx, 0x80
jbe 0x51dde4
lea eax, [ebp - 0x390]
push eax
call fcn.0051c2b0
mov ecx, dword [ebp + 0xc]
push ebx
lea edx, [ebp - 0x390]
push ecx
push edx
call fcn.0051c390
lea eax, [ebp - 0x100]
lea ecx, [ebp - 0x390]
push eax
push ecx
call fcn.0051c450
add esp, 0x18
mov ebx, 0x40
jmp 0x51de0f
mov esi, dword [ebp + 0xc]
lea edx, [ebp - 0x100]
cmp edx, esi
je 0x51de07
mov ecx, ebx
lea edi, [ebp - 0x100]
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 0x51de2d
mov ecx, 0x80
xor eax, eax
sub ecx, ebx
lea edi, [ebp + ebx - 0x100]
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 - 0x100]
mov dl, cl
xor cl, 0x5c
xor dl, 0x36
mov byte [ebp + eax - 0x80], cl
mov byte [ebp + eax - 0x410], dl
inc eax
cmp eax, 0x80
jb 0x51de2f
lea eax, [ebp - 0x390]
push eax
call fcn.0051c2b0
lea ecx, [ebp - 0x410]
push 0x80
lea edx, [ebp - 0x390]
push ecx
push edx
call fcn.0051c390
lea eax, [ebp - 0x248]
push eax
call fcn.0051c2b0
lea ecx, [ebp - 0x80]
push 0x80
lea edx, [ebp - 0x248]
push ecx
push edx
call fcn.0051c390
mov eax, dword [ebp + 0x18]
mov ecx, dword [ebp + 0x14]
push eax
lea edx, [ebp - 0x390]
push ecx
push edx
call fcn.0051c390
mov eax, dword [ebp + 0x1c]
add esp, 0x2c
test eax, eax
je 0x51dec8
mov ecx, dword [ebp + 0x20]
lea edx, [ebp - 0x390]
push ecx
push eax
push edx
call fcn.0051c390
add esp, 0xc
mov esi, dword [ebp + 0x24]
lea eax, [ebp - 0x390]
push esi
push eax
call fcn.0051c450
push 0x40
lea ecx, [ebp - 0x248]
push esi
push ecx
call fcn.0051c390
lea edx, [ebp - 0x248]
push esi
push edx
call fcn.0051c450
add esp, 0x1c
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp ebx, 0x40
jbe 0x51df3a
lea eax, [ebp - 0x250]
push eax
call fcn.00515f30
mov ecx, dword [ebp + 0xc]
push ebx
lea edx, [ebp - 0x250]
push ecx
push edx
call fcn.00515fb0
lea eax, [ebp - 0x40]
lea ecx, [ebp - 0x250]
push eax
push ecx
call fcn.00516060
add esp, 0x18
mov ebx, 0x20
jmp 0x51df5c
mov esi, dword [ebp + 0xc]
lea edx, [ebp - 0x40]
cmp edx, esi
je 0x51df57
mov ecx, ebx
lea edi, [ebp - 0x40]
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 0x51df77
mov ecx, 0x40
xor eax, eax
sub ecx, ebx
lea edi, [ebp + ebx - 0x40]
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 - 0x40]
mov dl, cl
xor cl, 0x5c
xor dl, 0x36
mov byte [ebp + eax - 0xc0], cl
mov byte [ebp + eax - 0x3d0], dl
inc eax
cmp eax, 0x40
jb 0x51df79
lea eax, [ebp - 0x250]
push eax
call fcn.00515f30
lea ecx, [ebp - 0x3d0]
push 0x40
lea edx, [ebp - 0x250]
push ecx
push edx
call fcn.00515fb0
lea eax, [ebp - 0x1a8]
push eax
call fcn.00515f30
lea ecx, [ebp - 0xc0]
push 0x40
lea edx, [ebp - 0x1a8]
push ecx
push edx
call fcn.00515fb0
mov eax, dword [ebp + 0x18]
mov ecx, dword [ebp + 0x14]
push eax
lea edx, [ebp - 0x250]
push ecx
push edx
call fcn.00515fb0
mov eax, dword [ebp + 0x1c]
add esp, 0x2c
test eax, eax
je 0x51e00d
mov ecx, dword [ebp + 0x20]
lea edx, [ebp - 0x250]
push ecx
push eax
push edx
call fcn.00515fb0
add esp, 0xc
mov esi, dword [ebp + 0x24]
lea eax, [ebp - 0x250]
push esi
push eax
call fcn.00516060
push 0x20
lea ecx, [ebp - 0x1a8]
push esi
push ecx
call fcn.00515fb0
lea edx, [ebp - 0x1a8]
push esi
push edx
call fcn.00516060
add esp, 0x1c
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp + 0x10]
cmp ebx, 0x40
jbe 0x51e082
lea eax, [ebp - 0x1b8]
push eax
call fcn.00511bb0
mov ecx, dword [ebp + 0xc]
push ebx
lea edx, [ebp - 0x1b8]
push ecx
push edx
call fcn.00511bf0
lea eax, [ebp - 0x40]
lea ecx, [ebp - 0x1b8]
push eax
push ecx
call fcn.00511cc0
add esp, 0x18
mov ebx, 0x14
jmp 0x51e0a4
mov esi, dword [ebp + 0xc]
lea edx, [ebp - 0x40]
cmp edx, esi
je 0x51e09f
mov ecx, ebx
lea edi, [ebp - 0x40]
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 0x51e0bf
mov ecx, 0x40
xor eax, eax
sub ecx, ebx
lea edi, [ebp + ebx - 0x40]
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 - 0x40]
mov dl, cl
xor cl, 0x5c
xor dl, 0x36
mov byte [ebp + eax - 0x3d0], cl
mov byte [ebp + eax - 0xc0], dl
inc eax
cmp eax, 0x40
jb 0x51e0c1
lea eax, [ebp - 0x1b8]
push eax
call fcn.00511bb0
lea ecx, [ebp - 0xc0]
push 0x40
lea edx, [ebp - 0x1b8]
push ecx
push edx
call fcn.00511bf0
lea eax, [ebp - 0x15c]
push eax
call fcn.00511bb0
lea ecx, [ebp - 0x3d0]
push 0x40
lea edx, [ebp - 0x15c]
push ecx
push edx
call fcn.00511bf0
mov eax, dword [ebp + 0x18]
mov ecx, dword [ebp + 0x14]
push eax
lea edx, [ebp - 0x1b8]
push ecx
push edx
call fcn.00511bf0
mov eax, dword [ebp + 0x1c]
add esp, 0x2c
test eax, eax
je 0x51e155
mov ecx, dword [ebp + 0x20]
lea edx, [ebp - 0x1b8]
push ecx
push eax
push edx
call fcn.00511bf0
add esp, 0xc
mov esi, dword [ebp + 0x24]
lea eax, [ebp - 0x1b8]
push esi
push eax
call fcn.00511cc0
push 0x14
lea ecx, [ebp - 0x15c]
push esi
push ecx
call fcn.00511bf0
lea edx, [ebp - 0x15c]
push esi
push edx
call fcn.00511cc0
add esp, 0x1c
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret