Function at 0x4087b0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
mov dword [ebp - 4], ecx
mov dword [ebp - 0x10], 0
mov dword [ebp - 8], 2
mov eax, dword [ebp - 4]
cmp dword [eax + 0x70], 3
jg 0x4087dd
mov ecx, dword [ebp - 4]
call fcn.00408ba0
jmp 0x408b8f
mov ecx, dword [ebp - 4]
cmp dword [ecx + 0x64], 0
je 0x408b31
mov edx, dword [ebp - 4]
mov eax, dword [edx + 0x50]
shl eax, 5
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x58]
mov ecx, dword [ebp - 4]
mov ecx, dword [ecx + 0x34]
movzx edx, byte [ecx + edx + 2]
xor eax, edx
and eax, 0x1fff
mov ecx, dword [ebp - 4]
mov dword [ecx + 0x50], eax
mov edx, dword [ebp - 4]
mov eax, dword [edx + 0x38]
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x50]
movzx eax, word [eax + edx*2 + 0x10000]
mov dword [ebp - 0xc], eax
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x58]
and edx, 0x7fff
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x38]
mov ax, word [ebp - 0xc]
mov word [ecx + edx*2], ax
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x38]
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x50]
mov eax, dword [ebp - 4]
mov ax, word [eax + 0x58]
mov word [edx + ecx*2 + 0x10000], ax
mov ecx, dword [ebp - 4]
mov edx, dword [ebp - 8]
mov dword [ecx + 0x54], edx
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x5c]
mov dword [ebp - 0x24], ecx
mov dword [ebp - 8], 2
cmp dword [ebp - 0xc], 0
je 0x4088e0
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 4]
mov ecx, dword [edx + 0x54]
cmp ecx, dword [eax + 0x6c]
jae 0x4088e0
mov edx, dword [ebp - 4]
mov eax, dword [edx + 0x58]
sub eax, dword [ebp - 0xc]
cmp eax, 0x7efa
ja 0x4088e0
mov ecx, dword [ebp - 0xc]
push ecx
mov ecx, dword [ebp - 4]
call fcn.00409210
mov dword [ebp - 8], eax
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 8]
cmp eax, dword [edx + 0x64]
jbe 0x4088bd
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x64]
mov dword [ebp - 8], edx
cmp dword [ebp - 8], 3
jne 0x4088e0
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 4]
mov edx, dword [eax + 0x58]
sub edx, dword [ecx + 0x5c]
cmp edx, 0x1000
jbe 0x4088e0
mov eax, dword [ebp - 8]
sub eax, 1
mov dword [ebp - 8], eax
mov ecx, dword [ebp - 4]
cmp dword [ecx + 0x54], 3
jb 0x408a56
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 8]
cmp eax, dword [edx + 0x54]
ja 0x408a56
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x54]
sub edx, 3
push edx
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x58]
sub ecx, 1
sub ecx, dword [ebp - 0x24]
push ecx
mov ecx, dword [ebp - 4]
call fcn.0040c2e0
mov dword [ebp - 0x28], eax
mov edx, dword [ebp - 4]
mov eax, dword [edx + 0x54]
sub eax, 1
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x64]
sub edx, eax
mov eax, dword [ebp - 4]
mov dword [eax + 0x64], edx
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x54]
sub edx, 2
mov eax, dword [ebp - 4]
mov dword [eax + 0x54], edx
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x58]
add edx, 1
mov eax, dword [ebp - 4]
mov dword [eax + 0x58], edx
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x50]
shl edx, 5
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x58]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x34]
movzx ecx, byte [eax + ecx + 2]
xor edx, ecx
and edx, 0x1fff
mov eax, dword [ebp - 4]
mov dword [eax + 0x50], edx
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x38]
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x50]
movzx edx, word [edx + ecx*2 + 0x10000]
mov dword [ebp - 0xc], edx
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x58]
and ecx, 0x7fff
mov edx, dword [ebp - 4]
mov eax, dword [edx + 0x38]
mov dx, word [ebp - 0xc]
mov word [eax + ecx*2], dx
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x38]
mov edx, dword [ebp - 4]
mov eax, dword [edx + 0x50]
mov edx, dword [ebp - 4]
mov dx, word [edx + 0x58]
mov word [ecx + eax*2 + 0x10000], dx
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x54]
sub ecx, 1
mov dword [ebp - 0x14], ecx
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0x14]
mov dword [edx + 0x54], eax
cmp dword [ebp - 0x14], 0
jne 0x408944
mov dword [ebp - 0x10], 0
mov dword [ebp - 8], 2
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x58]
add edx, 1
mov eax, dword [ebp - 4]
mov dword [eax + 0x58], edx
cmp dword [ebp - 0x28], 0
je 0x408a51
mov ecx, dword [ebp - 4]
cmp dword [ecx + 0x4c], 0
jl 0x408a23
mov edx, dword [ebp - 4]
mov eax, dword [edx + 0x34]
mov ecx, dword [ebp - 4]
add eax, dword [ecx + 0x4c]
mov dword [ebp - 0x18], eax
jmp 0x408a2a
mov dword [ebp - 0x18], 0
push 0
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 4]
mov ecx, dword [edx + 0x58]
sub ecx, dword [eax + 0x4c]
push ecx
mov edx, dword [ebp - 0x18]
push edx
mov ecx, dword [ebp - 4]
call fcn.0040c590
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x58]
mov dword [eax + 0x4c], edx
jmp 0x408b0d
cmp dword [ebp - 0x10], 0
je 0x408ae8
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x58]
mov edx, dword [ebp - 4]
mov eax, dword [edx + 0x34]
movzx ecx, byte [eax + ecx - 1]
push ecx
push 0
mov ecx, dword [ebp - 4]
call fcn.0040c2e0
test eax, eax
je 0x408ac8
mov edx, dword [ebp - 4]
cmp dword [edx + 0x4c], 0
jl 0x408a9a
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x34]
mov edx, dword [ebp - 4]
add ecx, dword [edx + 0x4c]
mov dword [ebp - 0x1c], ecx
jmp 0x408aa1
mov dword [ebp - 0x1c], 0
push 0
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 4]
mov edx, dword [eax + 0x58]
sub edx, dword [ecx + 0x4c]
push edx
mov eax, dword [ebp - 0x1c]
push eax
mov ecx, dword [ebp - 4]
call fcn.0040c590
mov ecx, dword [ebp - 4]
mov edx, dword [ebp - 4]
mov eax, dword [edx + 0x58]
mov dword [ecx + 0x4c], eax
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x58]
add edx, 1
mov eax, dword [ebp - 4]
mov dword [eax + 0x58], edx
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x64]
sub edx, 1
mov eax, dword [ebp - 4]
mov dword [eax + 0x64], edx
jmp 0x408b0d
mov dword [ebp - 0x10], 1
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x58]
add edx, 1
mov eax, dword [ebp - 4]
mov dword [eax + 0x58], edx
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x64]
sub edx, 1
mov eax, dword [ebp - 4]
mov dword [eax + 0x64], edx
mov ecx, dword [ebp - 4]
cmp dword [ecx + 0x64], 0x106
jae 0x408b2c
mov edx, dword [ebp - 4]
cmp dword [edx + 0x60], 0
jne 0x408b2c
mov ecx, dword [ebp - 4]
call fcn.00408eb0
jmp 0x408b0d
jmp 0x4087dd
cmp dword [ebp - 0x10], 0
je 0x408b53
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x58]
mov edx, dword [ebp - 4]
mov eax, dword [edx + 0x34]
movzx ecx, byte [eax + ecx - 1]
push ecx
push 0
mov ecx, dword [ebp - 4]
call fcn.0040c2e0
mov edx, dword [ebp - 4]
cmp dword [edx + 0x4c], 0
jl 0x408b6d
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x34]
mov edx, dword [ebp - 4]
add ecx, dword [edx + 0x4c]
mov dword [ebp - 0x20], ecx
jmp 0x408b74
mov dword [ebp - 0x20], 0
push 1
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 4]
mov edx, dword [eax + 0x58]
sub edx, dword [ecx + 0x4c]
push edx
mov eax, dword [ebp - 0x20]
push eax
mov ecx, dword [ebp - 4]
call fcn.0040c590
mov esp, ebp
pop ebp
ret