Function at 0x4087f2
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
push esi
push edi
mov ebx, edx
mov edi, ecx
mov ecx, dword [ebp + 0xc]
xor edx, edx
xor esi, esi
mov dword [ebp - 4], edx
mov dword [ebp - 8], esi
test ecx, ecx
je 0x408812
mov byte [ecx], dl
test edi, edi
je 0x408a2b
mov edi, dword [edi + 0x7c]
mov dword [ebp - 0xc], edi
test edi, edi
je 0x408a2b
cmp dword [edi], edx
jne 0x408833
push 0xffffffffffffff9c
jmp 0x408a2d
mov eax, dword [ebp + 8]
test eax, eax
je 0x408a2e
mov ecx, dword [edi + 0x5c]
mov dword [edi + 0x10], ebx
mov dword [edi + 0x14], eax
cmp eax, ecx
jbe 0x408850
mov dword [edi + 0x14], ecx
mov eax, ecx
test eax, eax
je 0x408a27
lea eax, [edi + 4]
mov dword [ebp - 0x14], eax
cmp dword [edi + 8], 0
jne 0x408913
mov eax, dword [edi + 0x58]
test eax, eax
je 0x408910
mov edx, dword [edi + 0x68]
mov esi, 0x4000
mov ecx, dword [edi + 0x60]
cmp eax, esi
push 0
cmovb esi, eax
add edx, dword [edi + 0x3c]
call fcn.00407e26
pop ecx
test eax, eax
jne 0x408a14
push dword [edi + 0x60]
mov ecx, dword [edi]
mov edx, esi
push 1
call fcn.00407e91
pop ecx
pop ecx
cmp eax, 1
jne 0x408a14
add dword [edi + 0x3c], esi
sub dword [edi + 0x58], esi
cmp byte [edi + 0x6c], 0
mov ecx, dword [edi]
mov dword [ebp - 0x1c], ecx
mov dword [edi + 4], ecx
mov dword [edi + 8], esi
je 0x408910
and dword [ebp - 0x18], 0
test esi, esi
je 0x408910
lea eax, [edi + 0x70]
mov edi, dword [ebp - 0x18]
mov dword [ebp - 0x10], eax
mov eax, dword [eax + 8]
and eax, 0xfffd
or eax, 2
mov ebx, eax
xor ebx, 1
imul ebx, eax
shr ebx, 8
xor bl, byte [edi + ecx]
mov ecx, dword [ebp - 0x10]
mov dl, bl
call fcn.00407769
mov ecx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x10]
mov byte [edi + ecx], bl
inc edi
cmp edi, esi
jb 0x4088d7
mov edi, dword [ebp - 0xc]
mov eax, dword [ebp - 0x14]
jmp 0x408913
lea eax, [edi + 4]
mov esi, dword [edi + 0x7c]
mov ecx, dword [edi + 8]
cmp esi, ecx
mov edx, ecx
cmovbe edx, esi
test edx, edx
je 0x408949
mov eax, dword [eax]
sub ecx, edx
add eax, edx
mov bl, byte [eax - 1]
sub dword [edi + 0x5c], edx
sub esi, edx
mov dword [edi + 8], ecx
mov dword [edi + 4], eax
mov dword [edi + 0x7c], esi
jne 0x408949
cmp bl, byte [edi + 0x80]
jne 0x408a19
cmp dword [edi + 0x64], 0
jne 0x4089b4
mov ebx, dword [edi + 0x14]
cmp ebx, ecx
cmovae ebx, ecx
xor edx, edx
test ebx, ebx
je 0x40896e
mov eax, dword [edi + 4]
mov ecx, dword [edi + 0x10]
mov al, byte [edx + eax]
mov byte [edx + ecx], al
inc edx
cmp edx, ebx
jb 0x40895d
mov esi, dword [edi + 0x10]
mov edx, esi
mov ecx, dword [edi + 0x50]
push ebx
call fcn.0040767f
sub dword [edi + 0x5c], ebx
sub dword [edi + 8], ebx
sub dword [edi + 0x14], ebx
add dword [edi + 0x18], ebx
mov edx, dword [ebp - 4]
mov dword [edi + 0x50], eax
lea eax, [esi + ebx]
mov esi, dword [ebp - 8]
mov dword [edi + 0x10], eax
add esi, ebx
lea eax, [edi + 4]
mov dword [ebp - 8], esi
add dword [eax], ebx
cmp dword [edi + 0x5c], 0
pop ecx
jne 0x408a02
mov ecx, dword [ebp + 0xc]
test ecx, ecx
je 0x408a02
mov byte [ecx], 1
jmp 0x408a02
mov esi, dword [edi + 0x18]
mov ecx, dword [ebp - 0x14]
mov edi, dword [edi + 0x10]
call fcn.00407a1c
mov ebx, dword [ebp - 0xc]
mov edx, edi
mov edi, dword [ebp - 0xc]
mov dword [ebp - 4], eax
mov ebx, dword [ebx + 0x18]
mov ecx, dword [edi + 0x50]
sub ebx, esi
push ebx
call fcn.0040767f
mov esi, dword [ebp - 8]
mov edx, dword [ebp - 4]
add esi, ebx
mov dword [edi + 0x50], eax
mov eax, dword [edi + 0x5c]
sub eax, ebx
mov dword [ebp - 8], esi
mov dword [edi + 0x5c], eax
pop ecx
cmp edx, 1
je 0x408a1d
test eax, eax
je 0x408a1d
test edx, edx
jne 0x408a10
lea eax, [edi + 4]
cmp dword [edi + 0x14], 0
ja 0x40885e
test edx, edx
je 0x408a27
mov eax, edx
jmp 0x408a2e
or eax, 0xffffffff
jmp 0x408a2e
push 0xffffffffffffff96
jmp 0x408a2d
mov ecx, dword [ebp + 0xc]
test ecx, ecx
je 0x408a27
mov byte [ecx], 1
mov eax, esi
jmp 0x408a2e
push 0xffffffffffffff9a
pop eax
pop edi
pop esi
pop ebx
leave
ret