Function at 0x408010
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push esi
xor esi, esi
mov dword [ebp - 0x18], edx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], esi
mov dword [ebp - 0x10], esi
cmp dword [ecx + 0xa4], esi
je 0x408037
mov eax, 0xffffbf80
pop esi
mov esp, ebp
pop ebp
ret
mov ecx, dword [ecx + 4]
push ebx
mov ebx, dword [ebp + 0x10]
mov dword [ebp - 0x14], ecx
push edi
lea edi, [ecx - 3]
test ebx, ebx
je 0x408098
mov ecx, ebx
call fcn.0040a0c0
mov edx, eax
test edx, edx
je 0x40806f
mov eax, 0x789970
cmp dword [0x789970], esi
je 0x40806f
cmp dword [eax + 0x10], ebx
je 0x40807b
add eax, 0x14
cmp dword [eax], esi
jne 0x408063
pop edi
pop ebx
mov eax, 0xffffbf80
pop esi
mov esp, ebp
pop ebp
ret
mov ecx, dword [eax]
mov esi, dword [eax + 4]
mov eax, 0xfffffff6
sub eax, esi
mov dword [ebp - 0x10], ecx
mov ecx, dword [ebp - 0x14]
add edi, eax
movzx eax, byte [edx + 8]
mov dword [ebp - 8], esi
jmp 0x40809b
mov eax, dword [ebp + 0x14]
sub edi, eax
mov dword [ebp - 4], eax
cmp edi, 8
jb 0x40806f
cmp edi, ecx
ja 0x40806f
mov esi, dword [ebp + 0x1c]
push edi
push 0xff
mov word [esi], 0x100
add esi, 2
push esi
call fcn.0050c5b0
add esi, edi
add esp, 0xc
mov byte [esi], 0
inc esi
test ebx, ebx
jne 0x4080de
push dword [ebp - 4]
push dword [ebp + 0x18]
push esi
call fcn.0050c59e
add esp, 0xc
jmp 0x40812c
mov ebx, dword [ebp - 8]
mov byte [esi], 0x30
push ebx
push dword [ebp - 0x10]
lea eax, [ebx + 8]
add al, byte [ebp - 4]
mov byte [esi + 1], al
lea eax, [ebx + 4]
mov byte [esi + 2], 0x30
mov byte [esi + 3], al
mov byte [esi + 4], 6
mov byte [esi + 5], bl
add esi, 6
push esi
call fcn.0050c59e
mov eax, dword [ebp - 4]
add esi, ebx
push eax
push dword [ebp + 0x18]
mov word [esi], 5
mov byte [esi + 2], 4
mov byte [esi + 3], al
add esi, 4
push esi
call fcn.0050c59e
add esp, 0x18
mov esi, dword [ebp - 0xc]
mov edi, dword [0x5317f4]
push dword [esi + 4]
push 1
call edi
mov ebx, eax
add esp, 8
mov dword [ebp - 0x10], ebx
test ebx, ebx
je 0x408163
push dword [esi + 4]
push 1
call edi
add esp, 8
mov dword [ebp - 8], eax
push ebx
test eax, eax
jne 0x40816f
call dword [0x5317f8]
add esp, 4
pop edi
pop ebx
mov eax, 0xfffffff0
pop esi
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp + 0x1c]
mov ecx, esi
mov edx, dword [ebp - 0x18]
push edi
push dword [ebp + 8]
call fcn.00407090
add esp, 0xc
mov dword [ebp - 4], eax
test eax, eax
jne 0x408299
push dword [ebp - 8]
mov edx, ebx
mov ecx, esi
call fcn.00406e60
add esp, 4
mov dword [ebp - 4], eax
test eax, eax
jne 0x408299
mov edx, dword [esi + 4]
xor bl, bl
test edx, edx
je 0x408279
cmp edx, 0x20
jb 0x408258
mov ebx, dword [ebp - 8]
mov ecx, edx
mov esi, ebx
and ecx, 0xffffffe0
sub esi, edi
mov dword [ebp - 0x18], ecx
add ebx, 0x10
mov dword [ebp - 0x14], esi
mov esi, dword [ebp - 0xc]
xorps xmm3, xmm3
mov dword [ebp - 0x1c], ebx
mov ecx, edi
mov ebx, dword [ebp - 0x18]
movaps xmm2, xmm3
mov edi, dword [ebp - 0x14]
mov edx, dword [ebp - 0x1c]
nop word [eax + eax]
movups xmm0, xmmword [ecx]
lea ecx, [ecx + 0x20]
movups xmm1, xmmword [edi + ecx - 0x20]
pxor xmm1, xmm0
movups xmm0, xmmword [ecx - 0x10]
por xmm3, xmm1
movups xmm1, xmmword [edx + eax]
add eax, 0x20
pxor xmm1, xmm0
por xmm2, xmm1
cmp eax, ebx
jb 0x4081f0
mov edx, dword [esi + 4]
por xmm2, xmm3
mov edi, dword [ebp + 0x1c]
movaps xmm0, xmm2
psrldq xmm0, 8
por xmm2, xmm0
movaps xmm0, xmm2
psrldq xmm0, 4
por xmm2, xmm0
movaps xmm0, xmm2
psrldq xmm0, 2
por xmm2, xmm0
movaps xmm0, xmm2
psrldq xmm0, 1
por xmm2, xmm0
movd ebx, xmm2
cmp eax, edx
jae 0x408279
mov esi, dword [ebp - 8]
lea ecx, [eax + edi]
sub esi, edi
sub edx, eax
mov al, byte [ecx + esi]
lea ecx, [ecx + 1]
xor al, byte [ecx - 1]
or bl, al
sub edx, 1
jne 0x408266
mov esi, dword [ebp - 0xc]
mov byte [ebp + 0x1f], bl
cmp byte [ebp + 0x1f], 0
mov ebx, dword [ebp - 0x10]
je 0x40828c
mov edi, 0xffffbd00
jmp 0x40829c
push dword [esi + 4]
push ebx
push edi
call fcn.0050c59e
add esp, 0xc
mov edi, dword [ebp - 4]
mov esi, dword [0x5317f8]
push ebx
call esi
push dword [ebp - 8]
call esi
add esp, 8
mov eax, edi
pop edi
pop ebx
pop esi
mov esp, ebp
pop ebp
ret