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

Disassembly:
sub esp, 0x1d4
mov eax, dword [0x451a14]
xor eax, esp
mov dword [esp + 0x1d0], eax
mov eax, dword [esp + 0x1e0]
mov ecx, dword [esp + 0x1f4]
mov edx, dword [esp + 0x1f0]
push ebx
mov ebx, dword [esp + 0x1e0]
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x1ec]
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x1f0]
mov dword [esp + 0xc], ecx
mov ecx, dword [esp + 0x1fc]
mov dword [esp + 4], eax
mov dword [esp + 8], edx
mov dword [esp + 0x10], ecx
push ebp
mov ebp, dword [esp + 0x1e0]
push esi
push edi
cmp ebx, 0x40
jbe 0x40c5d2
lea eax, [esp + 0xf8]
push eax
call fcn.00421f30
push ebx
push ebp
lea eax, [esp + 0x100]
push eax
call fcn.00421f80
lea eax, [esp + 0x1a0]
push eax
lea eax, [esp + 0xfc]
push eax
call fcn.00421e10
mov eax, dword [esp + 0x10]
lea ebp, [esp + 0x1a0]
mov edx, dword [esp + 0x14]
mov ebx, 0x20
mov ecx, 0x40
test eax, eax
je 0x40c5ef
cmp byte [edx], 0
je 0x40c5ef
mov ecx, 0x1a
lea edi, [esp + 0x28]
mov esi, eax
rep movsd dword es:[edi], dword [esi]
jmp 0x40c663
xor edx, edx
test ebx, ebx
je 0x40c61a
mov esi, ebp
lea eax, [esp + 0x160]
sub esi, eax
lea ecx, [esp + 0x160]
add ecx, edx
inc edx
mov al, byte [esi + ecx]
xor al, 0x36
mov byte [ecx], al
cmp edx, ebx
jb 0x40c600
mov ecx, 0x40
cmp ebx, 0x40
jae 0x40c63d
sub ecx, ebx
lea edi, [esp + 0x160]
mov edx, ecx
add edi, ebx
shr ecx, 2
mov eax, 0x36363636
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
lea eax, [esp + 0x28]
push eax
call fcn.00421f30
push 0x40
lea eax, [esp + 0x164]
push eax
lea eax, [esp + 0x30]
push eax
call fcn.00421f80
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
test eax, eax
je 0x40c67c
cmp byte [edx], 0
jne 0x40c67c
mov ecx, 0x1a
lea esi, [esp + 0x28]
mov edi, eax
rep movsd dword es:[edi], dword [esi]
mov byte [edx], 1
push dword [esp + 0x1f4]
lea eax, [esp + 0x2c]
push dword [esp + 0x24]
push eax
call fcn.00421f80
lea eax, [esp + 0x1c0]
push eax
lea eax, [esp + 0x2c]
push eax
call fcn.00421e10
mov eax, dword [esp + 0x18]
test eax, eax
je 0x40c6c6
mov edx, dword [esp + 0x1c]
cmp byte [edx], 0
je 0x40c6c6
mov ecx, 0x1a
lea edi, [esp + 0x90]
mov esi, eax
rep movsd dword es:[edi], dword [esi]
jmp 0x40c73e
xor edx, edx
test ebx, ebx
je 0x40c6ea
lea eax, [esp + 0x160]
sub ebp, eax
lea ecx, [esp + 0x160]
add ecx, edx
inc edx
mov al, byte [ecx + ebp]
xor al, 0x5c
mov byte [ecx], al
cmp edx, ebx
jb 0x40c6d5
cmp ebx, 0x40
jae 0x40c712
mov ecx, 0x40
lea edi, [esp + 0x160]
sub ecx, ebx
add edi, ebx
mov edx, ecx
mov eax, 0x5c5c5c5c
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
lea eax, [esp + 0x90]
push eax
call fcn.00421f30
push 0x40
lea eax, [esp + 0x164]
push eax
lea eax, [esp + 0x98]
push eax
call fcn.00421f80
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
test eax, eax
je 0x40c75a
cmp byte [edx], 0
jne 0x40c75a
mov ecx, 0x1a
lea esi, [esp + 0x90]
mov edi, eax
rep movsd dword es:[edi], dword [esi]
mov byte [edx], 1
push 0x20
lea eax, [esp + 0x1c4]
push eax
lea eax, [esp + 0x98]
push eax
call fcn.00421f80
push dword [esp + 0x24]
lea eax, [esp + 0x94]
push eax
call fcn.00421e10
mov ecx, dword [esp + 0x1e0]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0042f943
add esp, 0x1d4
ret 0x24