Function at 0x4086a0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x6c
mov edi, dword [esp + 0x80]
mov ebx, dword [esp + 0x80]
mov esi, dword [esp + 0x80]
mov ecx, dword [edi + 0x10]
mov ebp, dword [edi + 0x1c]
mov ebx, dword [ebx + 0x14]
mov esi, dword [esi + 0x18]
mov edx, ecx
mov eax, ecx
sar edx, 0x1f
idiv ebp
mov dword [esp + 0x20], ebx
mov ebx, dword [edi + 0x20]
mov dword [esp + 0x38], ebp
mov dword [esp + 0x24], esi
test ebx, ebx
mov dword [esp + 0x3c], ebx
mov ebp, edx
mov dword [esp + 0x18], eax
mov dword [esp + 0x40], edx
mov dword [esp + 0x44], eax
je 0x4089e7
mov ecx, dword [edi + 0x24]
mov dword [esp + 0x48], ecx
mov eax, dword [esp + 0x94]
test eax, eax
jle 0x408b31
mov ebp, dword [esp + 0x80]
mov ebx, dword [esp + 0x80]
mov eax, dword [esp + 0x38]
mov edi, dword [esp + 0x84]
mov ebp, dword [ebp + 4]
mov esi, dword [ebx + 0x28]
mov edx, eax
sar edx, 0x1f
mov dword [esp + 0x4c], ebp
mov ebp, dword [ebx + 8]
mov dword [esp + 0x58], esi
mov dword [esp + 0x34], edi
mov dword [esp + 0x28], 0
lea ebx, [ebp + ebp]
mov dword [esp + 0x50], eax
mov dword [esp + 0x54], edx
mov dword [esp + 0x5c], ebx
nop
lea esi, [esi]
mov eax, dword [esp + 0x20]
and eax, dword [esp + 0x58]
mov ebx, dword [esp + 0x20]
movzx ecx, byte [esp + 0x48]
imul eax, ebp
mov esi, dword [esp + 0x4c]
sar ebx, cl
test ebx, ebx
lea edi, [esi + eax*2]
mov dword [esp + 0x18], ebx
js 0x408998
mov eax, ebx
add eax, ebp
cmp dword [esp + 0x90], eax
jl 0x408855
mov ebx, dword [esp + 0x80]
mov eax, dword [ebx + 0x2c]
test eax, eax
jne 0x4088e0
mov ecx, dword [esp + 0x18]
xor ebx, ebx
xor eax, eax
mov edx, dword [esp + 0x88]
test ebp, ebp
lea esi, [edx + ecx*2]
jle 0x4089e0
movsx edx, word [esi + eax*2]
movsx ecx, word [edi + eax*2]
add eax, 1
imul edx, ecx
add ebx, edx
cmp eax, ebp
jne 0x4087c6
add ebx, 0x4000
mov eax, ebx
sar eax, 0xf
lea edx, [eax + 0x8000]
cmp edx, 0xffff
jbe 0x4087fc
sar ebx, 0x1f
mov eax, ebx
xor ax, 0x7fff
mov ebx, dword [esp + 0x34]
mov edx, dword [esp + 0x40]
add dword [esp + 0x24], edx
mov word [ebx], ax
mov eax, dword [esp + 0x44]
mov ebx, dword [esp + 0x24]
add dword [esp + 0x20], eax
cmp dword [esp + 0x38], ebx
jg 0x40882c
mov esi, dword [esp + 0x38]
add dword [esp + 0x20], 1
sub ebx, esi
mov dword [esp + 0x24], ebx
add dword [esp + 0x28], 1
mov edi, dword [esp + 0x3c]
cmp dword [esp + 0x28], edi
je 0x408970
mov ebx, dword [esp + 0x94]
add dword [esp + 0x34], 2
cmp dword [esp + 0x28], ebx
jne 0x408760
mov ebx, dword [esp + 0x20]
xor eax, eax
movzx ecx, byte [esp + 0x48]
mov esi, dword [esp + 0x20]
mov edx, dword [esp + 0x8c]
test ebx, ebx
cmovns eax, dword [esp + 0x20]
sar eax, cl
test esi, esi
mov dword [edx], eax
js 0x408888
mov ebx, dword [esp + 0x80]
mov ebx, dword [ebx + 0x28]
and dword [esp + 0x20], ebx
mov edx, dword [esp + 0x3c]
mov ecx, dword [esp + 0x98]
mov eax, dword [esp + 0x3c]
sub eax, dword [esp + 0x28]
test edx, edx
cmove eax, dword [esp + 0x3c]
test ecx, ecx
mov dword [esp + 0x3c], eax
je 0x4088d3
mov esi, dword [esp + 0x80]
mov ebx, eax
mov eax, dword [esp + 0x44]
mov edi, dword [esp + 0x24]
mov ebp, dword [esp + 0x20]
imul eax, dword [esi + 0x1c]
add eax, dword [esp + 0x40]
mov dword [esi + 0x18], edi
mov dword [esi + 0x14], ebp
mov dword [esi + 0x10], eax
mov dword [esi + 0x20], ebx
mov eax, dword [esp + 0x28]
add esp, 0x6c
pop ebx
pop esi
pop edi
pop ebp
ret
xor esi, esi
xor ecx, ecx
xor ebx, ebx
test ebp, ebp
jle 0x408949
mov ebx, dword [esp + 0x18]
xor ecx, ecx
xor eax, eax
mov edx, dword [esp + 0x88]
mov dword [esp + 0x1c], ebp
lea ebx, [edx + ebx*2]
mov dword [esp + 0x18], ebx
mov ebx, dword [esp + 0x5c]
add ebx, edi
mov dword [esp + 0x30], ebx
nop
mov ebp, dword [esp + 0x18]
movsx ebx, word [edi + eax*2]
movsx edx, word [ebp + eax*2]
mov ebp, dword [esp + 0x30]
imul ebx, edx
add esi, ebx
movsx ebx, word [ebp + eax*2]
add eax, 1
imul edx, ebx
add ecx, edx
cmp eax, dword [esp + 0x1c]
jne 0x408910
mov eax, dword [esp + 0x24]
sub ecx, esi
mov ebp, dword [esp + 0x1c]
imul ecx
mov ecx, eax
mov ebx, edx
mov eax, dword [esp + 0x50]
mov edx, dword [esp + 0x54]
mov dword [esp + 4], ebx
mov dword [esp], ecx
mov dword [esp + 8], eax
mov dword [esp + 0xc], edx
call fcn.00567bf0
lea ebx, [esi + eax]
jmp 0x4087da
mov ebx, dword [esp + 0x80]
mov dword [esp + 0x3c], 0
mov eax, dword [ebx + 0xc]
mov edx, eax
sar edx, 0x1f
idiv dword [esp + 0x38]
mov dword [esp + 0x40], edx
mov dword [esp + 0x44], eax
jmp 0x40883f
test ebp, ebp
jle 0x4089e0
xor ebx, ebx
xor ecx, ecx
mov eax, dword [esp + 0x18]
add eax, ecx
mov esi, eax
sar esi, 0x1f
xor eax, esi
sub eax, esi
mov esi, dword [esp + 0x88]
mov edx, eax
sar edx, 0x1f
idiv dword [esp + 0x90]
movsx eax, word [esi + edx*2]
movsx edx, word [edi + ecx*2]
add ecx, 1
imul eax, edx
add ebx, eax
cmp ecx, ebp
jne 0x4089a0
jmp 0x4087da
xor eax, eax
jmp 0x4087fc
cmp dword [edi + 8], 1
nop
lea esi, [esi]
je 0x4089fe
mov ecx, dword [edi + 0x24]
mov dword [esp + 0x48], ecx
jmp 0x408701
mov ebx, dword [edi + 0x24]
test ebx, ebx
mov dword [esp + 0x48], ebx
jne 0x408701
mov eax, dword [esp + 0x38]
mov esi, ecx
sar esi, 0x1f
mov dword [esp + 4], ecx
mov dword [esp], 0
mov edx, eax
sar edx, 0x1f
mov dword [esp + 8], eax
mov dword [esp + 0xc], edx
mov dword [esp + 0x28], ecx
mov dword [esp + 0x2c], esi
call fcn.00567bf0
mov ecx, dword [esp + 0x28]
mov ebx, dword [esp + 0x2c]
mov dword [esp + 8], ecx
mov dword [esp + 0xc], ebx
mov esi, eax
mov eax, dword [esp + 0x90]
mov edi, edx
sub eax, 1
sub eax, dword [esp + 0x20]
imul dword [esp + 0x38]
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.00567bf0
mov ecx, eax
mov eax, dword [esp + 0x94]
mov ebx, edx
mov dword [esp + 0x28], ecx
mov edx, eax
sar edx, 0x1f
cmp ebx, edx
mov dword [esp + 0x50], eax
mov dword [esp + 0x54], edx
jge 0x408b10
mov eax, dword [esp + 0x28]
test eax, eax
jle 0x408b3e
mov eax, dword [esp + 0x20]
xor ecx, ecx
xor edx, edx
mov dword [esp + 0x50], esi
mov esi, dword [esp + 0x88]
mov dword [esp + 0x54], edi
mov edi, dword [esp + 0x84]
mov dword [esp + 0x1c], ebp
mov ebx, eax
movzx ebp, word [esi + ebx*2]
add ecx, dword [esp + 0x50]
adc ebx, dword [esp + 0x54]
mov word [edi + edx*2], bp
add edx, 1
cmp dword [esp + 0x28], edx
jg 0x408ac1
mov ebp, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
imul ebp, dword [esp + 0x28]
imul eax, dword [esp + 0x28]
add ebp, dword [esp + 0x24]
mov ecx, dword [esp + 0x20]
mov edx, ebp
sar edx, 0x1f
add ecx, eax
mov eax, ebp
idiv dword [esp + 0x38]
add eax, ecx
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], edx
jmp 0x408855
jg 0x408b21
mov ebx, dword [esp + 0x94]
cmp ecx, ebx
jbe 0x408a91
mov ebx, dword [esp + 0x94]
mov dword [esp + 0x28], ebx
jmp 0x408a91
mov dword [esp + 0x28], 0
jmp 0x408855
xor eax, eax
xor ebp, ebp
mov dword [esp + 0x28], 0
jmp 0x408aec