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

Disassembly:
sub esp, 0x1d8
mov eax, dword [0x448780]
xor eax, esp
mov dword [esp + 0x1d4], eax
mov eax, dword [esp + 0x1e4]
mov edx, dword [esp + 0x1f4]
push ebx
mov ebx, dword [esp + 0x1e4]
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x1f0]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x1fc]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x200]
mov dword [esp + 4], edx
mov dword [esp + 0x10], eax
push ebp
push esi
mov esi, dword [esp + 0x1e8]
mov dword [esp + 0x14], esi
push edi
mov edi, dword [esp + 0x200]
mov dword [esp + 0x20], edi
cmp ebx, 0x40
jbe 0x40871a
lea eax, [esp + 0xfc]
push eax
call fcn.00415b6e
push ebx
push esi
lea eax, [esp + 0x104]
push eax
call fcn.00415bb4
lea eax, [esp + 0x1a4]
push eax
lea eax, [esp + 0x100]
push eax
call fcn.00415a43
mov edx, dword [esp + 0x10]
lea esi, [esp + 0x1a4]
push 0x20
mov dword [esp + 0x1c], esi
pop ebx
xor ebp, ebp
test edi, edi
je 0x408736
cmp byte [edx], 0
je 0x408736
mov esi, edi
lea edi, [esp + 0x2c]
push 0x1a
pop ecx
rep movsd dword es:[edi], dword [esi]
mov edi, dword [esp + 0x20]
jmp 0x40879f
mov edx, ebp
test ebx, ebx
je 0x40875a
lea eax, [esp + 0x164]
sub esi, eax
lea ecx, [esp + 0x164]
add ecx, edx
mov al, byte [esi + ecx]
xor al, 0x36
inc edx
mov byte [ecx], al
cmp edx, ebx
jb 0x408745
cmp ebx, 0x40
jae 0x408779
push 0x40
pop eax
sub eax, ebx
lea ecx, [esp + 0x164]
push eax
add ecx, ebx
push 0x36
push ecx
call fcn.00426e70
add esp, 0xc
lea eax, [esp + 0x2c]
push eax
call fcn.00415b6e
push 0x40
lea eax, [esp + 0x168]
push eax
lea eax, [esp + 0x34]
push eax
call fcn.00415bb4
test edi, edi
je 0x4087b0
mov edx, dword [esp + 0x10]
cmp byte [edx], 0
jne 0x4087b0
push 0x1a
pop ecx
lea esi, [esp + 0x2c]
rep movsd dword es:[edi], dword [esi]
mov byte [edx], 1
push dword [esp + 0x1f8]
lea eax, [esp + 0x30]
push dword [esp + 0x28]
push eax
call fcn.00415bb4
lea eax, [esp + 0x1c4]
push eax
lea eax, [esp + 0x30]
push eax
call fcn.00415a43
mov edi, dword [esp + 0x14]
test edi, edi
je 0x4087fc
mov eax, dword [esp + 0x1c]
cmp byte [eax], 0
je 0x4087fc
mov esi, edi
lea edi, [esp + 0x94]
push 0x1a
pop ecx
rep movsd dword es:[edi], dword [esi]
mov edi, dword [esp + 0x14]
jmp 0x40886d
test ebx, ebx
je 0x408822
mov edx, dword [esp + 0x18]
lea eax, [esp + 0x164]
sub edx, eax
lea ecx, [esp + 0x164]
add ecx, ebp
mov al, byte [edx + ecx]
xor al, 0x5c
inc ebp
mov byte [ecx], al
cmp ebp, ebx
jb 0x40880d
cmp ebx, 0x40
jae 0x408841
push 0x40
pop eax
sub eax, ebx
lea ecx, [esp + 0x164]
push eax
add ecx, ebx
push 0x5c
push ecx
call fcn.00426e70
add esp, 0xc
lea eax, [esp + 0x94]
push eax
call fcn.00415b6e
push 0x40
lea eax, [esp + 0x168]
push eax
lea eax, [esp + 0x9c]
push eax
call fcn.00415bb4
test edi, edi
je 0x408881
mov eax, dword [esp + 0x1c]
cmp byte [eax], 0
jne 0x408881
push 0x1a
pop ecx
lea esi, [esp + 0x94]
rep movsd dword es:[edi], dword [esi]
mov byte [eax], 1
push 0x20
lea eax, [esp + 0x1c8]
push eax
lea eax, [esp + 0x9c]
push eax
call fcn.00415bb4
push dword [esp + 0x28]
lea eax, [esp + 0x98]
push eax
call fcn.00415a43
mov ecx, dword [esp + 0x1e4]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004253d4
add esp, 0x1d8
ret 0x24