Function at 0x587ad9
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
mov eax, dword [edi + 0x40]
mov dword [ebp - 0x14], eax
add eax, 0x930c
cmp dword [eax], 0
jne 0x587b01
push edi
mov dword [eax], 1
call fcn.005878bd
mov eax, dword [edi + 0x30]
mov ecx, dword [ebp - 0x14]
mov esi, dword [edi + 0x20]
mov ebx, dword [edi + 0x2c]
mov dword [ebp - 4], eax
mov eax, dword [edi + 0x18]
add ecx, eax
movzx edx, byte [ecx]
movzx ecx, byte [ecx + 1]
shl edx, 4
xor edx, ecx
cmp eax, dword [edi + 0x1c]
mov dword [ebp - 8], eax
mov dword [ebp - 0x10], edx
jge 0x588070
jmp 0x587b35
mov edx, dword [ebp - 0x10]
cmp esi, dword [edi + 0x28]
jae 0x588070
mov ecx, dword [edi + 0x1c]
sub ecx, eax
cmp ecx, 3
jle 0x587bc7
mov edi, dword [ebp - 0x14]
movzx ecx, byte [edi + eax + 2]
shl edx, 4
xor ecx, edx
mov dword [ebp - 0x10], ecx
and ecx, 0x7ff
lea ecx, reloc.MSVCRT.dll___dllonexit
movzx edx, word [ecx]
mov word [ecx], ax
mov ecx, eax
and ecx, 0x1fff
test edx, edx
mov dword [ebp - 0x18], ecx
lea ecx, reloc.MSVCRT.dll___dllonexit
mov edi, dword [ebp - 0x18]
mov word [ecx + edi*2], dx
je 0x587c0e
push dword [ebp + 0x18]
lea edi, [ebp - 0x1c]
push dword [ebp + 0xc]
push edi
mov edi, dword [ebp - 0x14]
push ecx
mov ecx, eax
call fcn.00587969
mov edx, dword [ebp - 8]
mov ecx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x1c]
lea edi, [ecx + edx]
cmp edi, eax
mov dword [ebp - 0xc], ecx
jle 0x587bbc
sub eax, edx
mov dword [ebp - 0xc], eax
mov ecx, eax
mov eax, dword [ebp - 8]
cmp ecx, 3
jge 0x587c17
mov edi, dword [ebp + 8]
mov ecx, dword [ebp - 0x14]
movzx ecx, byte [eax + ecx]
mov ecx, dword [ecx*4 + reloc.MSVCRT.dll___dllonexit]
mov edx, ecx
mov dword [ebp - 0x18], ecx
mov ecx, dword [ebp - 4]
shr edx, 5
shl edx, cl
mov ecx, dword [ebp - 0x18]
and ecx, 0x1f
add dword [ebp - 4], ecx
or ebx, edx
cmp dword [ebp - 4], 0x10
jl 0x587c05
sub dword [ebp - 4], 0x10
mov byte [esi], bl
mov ecx, ebx
inc esi
shr ecx, 8
mov byte [esi], cl
inc esi
shr ebx, 0x10
inc eax
mov dword [ebp - 8], eax
jmp 0x588067
and dword [ebp - 0xc], 0
mov ecx, dword [ebp - 0xc]
jmp 0x587bbf
inc eax
cmp ecx, dword [ebp + 0x10]
mov dword [ebp - 8], eax
jg 0x587f04
mov edi, dword [ebp - 0x14]
movzx ecx, byte [edi + eax + 2]
mov edx, dword [ebp - 0x10]
shl edx, 4
xor ecx, edx
mov dword [ebp - 0x10], ecx
and ecx, 0x7ff
lea ecx, reloc.MSVCRT.dll___dllonexit
movzx edx, word [ecx]
mov word [ecx], ax
mov ecx, eax
and ecx, 0x1fff
add edi, 0x4106
test edx, edx
mov word [edi + ecx*2], dx
je 0x587d0c
mov ecx, dword [ebp - 0xc]
cmp ecx, dword [ebp + 0x14]
mov ecx, dword [ebp + 0xc]
jl 0x587c72
sar ecx, 2
push dword [ebp + 0x18]
push ecx
lea ecx, [ebp - 0x20]
push ecx
push edi
mov edi, dword [ebp - 0x14]
mov ecx, eax
call fcn.00587969
mov ecx, dword [ebp - 8]
mov edx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x1c]
mov dword [ebp - 0x18], edx
add edx, ecx
cmp edx, eax
jle 0x587c9e
sub eax, ecx
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 0xc]
cmp dword [ebp - 0x18], ecx
jle 0x587dff
mov ecx, dword [ebp - 0x14]
movzx ecx, byte [eax + ecx - 1]
mov edx, dword [ecx*4 + reloc.MSVCRT.dll___dllonexit]
mov ecx, dword [ebp - 4]
mov edi, edx
shr edi, 5
shl edi, cl
and edx, 0x1f
add dword [ebp - 4], edx
push 0x10
pop edx
or ebx, edi
cmp dword [ebp - 4], edx
jl 0x587ce7
sub dword [ebp - 4], edx
mov byte [esi], bl
mov ecx, ebx
inc esi
shr ecx, 8
mov byte [esi], cl
inc esi
shr ebx, 0x10
mov ecx, dword [ebp - 0x18]
mov edi, dword [ecx*4 + reloc.MSVCRT.dll___dllonexit]
mov ecx, edi
and ecx, 0x1f
mov dword [ebp - 0xc], ecx
cmp ecx, edx
mov ecx, dword [ebp - 4]
jg 0x587d12
shr edi, 5
shl edi, cl
or ebx, edi
add ecx, dword [ebp - 0xc]
jmp 0x587d51
and dword [ebp - 0x18], 0
jmp 0x587ca1
mov edx, edi
shr edx, 5
and edx, 0xffff
shl edx, cl
push 0x10
or ebx, edx
pop edx
add dword [ebp - 4], edx
cmp dword [ebp - 4], edx
jl 0x587d3d
sub dword [ebp - 4], edx
mov byte [esi], bl
mov ecx, ebx
inc esi
shr ecx, 8
mov byte [esi], cl
inc esi
shr ebx, 0x10
mov ecx, dword [ebp - 4]
shr edi, 0x15
shl edi, cl
mov ecx, dword [ebp - 0xc]
or ebx, edi
mov edi, dword [ebp - 4]
lea ecx, [edi + ecx - 0x10]
cmp ecx, edx
mov dword [ebp - 4], ecx
jl 0x587d69
sub dword [ebp - 4], edx
mov ecx, ebx
mov byte [esi], bl
shr ecx, 8
inc esi
mov byte [esi], cl
inc esi
shr ebx, 0x10
mov ecx, dword [ebp - 0x20]
mov edi, 0x100
cmp ecx, edi
jb 0x587d7a
shr ecx, 7
add ecx, edi
movzx ecx, byte [ecx + 0x68cd8180]
mov ecx, dword [ecx*4 + reloc.MSVCRT.dll___dllonexit]
mov edi, ecx
mov dword [ebp - 0xc], ecx
mov ecx, dword [ebp - 4]
shr edi, 8
shl edi, cl
mov ecx, dword [ebp - 0xc]
and ecx, 0xf
add dword [ebp - 4], ecx
or ebx, edi
cmp dword [ebp - 4], edx
jl 0x587db6
sub dword [ebp - 4], edx
mov byte [esi], bl
mov ecx, ebx
inc esi
shr ecx, 8
mov byte [esi], cl
inc esi
shr ebx, 0x10
mov ecx, dword [ebp - 0xc]
shr ecx, 4
and ecx, 0xf
mov dword [ebp - 0xc], ecx
je 0x587df0
mov edi, dword [ecx*4 + reloc.MSVCRT.dll___dllonexit]
and edi, dword [ebp - 0x20]
mov ecx, dword [ebp - 4]
shl edi, cl
add ecx, dword [ebp - 0xc]
mov dword [ebp - 4], ecx
or ebx, edi
cmp ecx, edx
jl 0x587df0
sub dword [ebp - 4], edx
mov byte [esi], bl
mov ecx, ebx
inc esi
shr ecx, 8
mov byte [esi], cl
inc esi
shr ebx, 0x10
mov ecx, dword [ebp - 0x18]
inc eax
mov dword [ebp - 8], eax
mov dword [ebp - 0xc], ecx
jmp 0x587ffd
mov edi, dword [ecx*4 + reloc.MSVCRT.dll___dllonexit]
mov ecx, dword [ebp - 4]
mov edx, edi
and edx, 0x1f
cmp edx, 0x10
mov dword [ebp - 0x18], edx
jg 0x587e26
add dword [ebp - 4], edx
shr edi, 5
shl edi, cl
or ebx, edi
cmp dword [ebp - 4], 0x10
jmp 0x587e65
mov edx, edi
shr edx, 5
and edx, 0xffff
shl edx, cl
mov ecx, dword [ebp - 4]
add ecx, 0x10
or ebx, edx
cmp ecx, 0x10
jl 0x587e51
mov byte [esi], bl
mov edx, ebx
inc esi
shr edx, 8
mov byte [esi], dl
inc esi
sub ecx, 0x10
shr ebx, 0x10
mov edx, dword [ebp - 0x18]
shr edi, 0x15
shl edi, cl
lea ecx, [ecx + edx - 0x10]
mov dword [ebp - 4], ecx
or ebx, edi
cmp ecx, 0x10
jl 0x587e79
sub dword [ebp - 4], 0x10
mov ecx, ebx
mov byte [esi], bl
shr ecx, 8
inc esi
mov byte [esi], cl
inc esi
shr ebx, 0x10
mov ecx, dword [ebp - 0x1c]
mov edx, 0x100
cmp ecx, edx
jb 0x587e8a
shr ecx, 7
add ecx, edx
movzx ecx, byte [ecx + 0x68cd8180]
mov edi, dword [ecx*4 + reloc.MSVCRT.dll___dllonexit]
mov ecx, dword [ebp - 4]
mov edx, edi
shr edx, 8
shl edx, cl
mov ecx, edi
and ecx, 0xf
add dword [ebp - 4], ecx
or ebx, edx
cmp dword [ebp - 4], 0x10
jl 0x587ec4
sub dword [ebp - 4], 0x10
mov byte [esi], bl
mov ecx, ebx
inc esi
shr ecx, 8
mov byte [esi], cl
inc esi
shr ebx, 0x10
shr edi, 4
and edi, 0xf
je 0x587ef8
mov edx, dword [edi*4 + reloc.MSVCRT.dll___dllonexit]
and edx, dword [ebp - 0x1c]
mov ecx, dword [ebp - 4]
add dword [ebp - 4], edi
shl edx, cl
or ebx, edx
cmp dword [ebp - 4], 0x10
jl 0x587ef8
sub dword [ebp - 4], 0x10
mov byte [esi], bl
mov ecx, ebx
inc esi
shr ecx, 8
mov byte [esi], cl
inc esi
shr ebx, 0x10
dec dword [ebp - 0xc]
inc eax
mov dword [ebp - 8], eax
jmp 0x587ffd
mov edi, dword [ecx*4 + reloc.MSVCRT.dll___dllonexit]
mov ecx, dword [ebp - 4]
mov edx, edi
and edx, 0x1f
cmp edx, 0x10
mov dword [ebp - 0x18], edx
jg 0x587f2b
add dword [ebp - 4], edx
shr edi, 5
shl edi, cl
or ebx, edi
cmp dword [ebp - 4], 0x10
jmp 0x587f6a
mov edx, edi
shr edx, 5
and edx, 0xffff
shl edx, cl
mov ecx, dword [ebp - 4]
add ecx, 0x10
or ebx, edx
cmp ecx, 0x10
jl 0x587f56
mov byte [esi], bl
mov edx, ebx
inc esi
shr edx, 8
mov byte [esi], dl
inc esi
sub ecx, 0x10
shr ebx, 0x10
mov edx, dword [ebp - 0x18]
shr edi, 0x15
shl edi, cl
lea ecx, [ecx + edx - 0x10]
mov dword [ebp - 4], ecx
or ebx, edi
cmp ecx, 0x10
jl 0x587f7e
sub dword [ebp - 4], 0x10
mov ecx, ebx
mov byte [esi], bl
shr ecx, 8
inc esi
mov byte [esi], cl
inc esi
shr ebx, 0x10
mov ecx, dword [ebp - 0x1c]
mov edx, 0x100
cmp ecx, edx
jb 0x587f8f
shr ecx, 7
add ecx, edx
movzx ecx, byte [ecx + 0x68cd8180]
mov edi, dword [ecx*4 + reloc.MSVCRT.dll___dllonexit]
mov ecx, dword [ebp - 4]
mov edx, edi
shr edx, 8
shl edx, cl
mov ecx, edi
and ecx, 0xf
add dword [ebp - 4], ecx
or ebx, edx
cmp dword [ebp - 4], 0x10
jl 0x587fc9
sub dword [ebp - 4], 0x10
mov byte [esi], bl
mov ecx, ebx
inc esi
shr ecx, 8
mov byte [esi], cl
inc esi
shr ebx, 0x10
shr edi, 4
and edi, 0xf
je 0x587ffd
mov edx, dword [edi*4 + reloc.MSVCRT.dll___dllonexit]
and edx, dword [ebp - 0x1c]
mov ecx, dword [ebp - 4]
add dword [ebp - 4], edi
shl edx, cl
or ebx, edx
cmp dword [ebp - 4], 0x10
jl 0x587ffd
sub dword [ebp - 4], 0x10
mov byte [esi], bl
mov ecx, ebx
inc esi
shr ecx, 8
mov byte [esi], cl
inc esi
shr ebx, 0x10
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x1c]
mov ecx, dword [ebp - 0xc]
sub edx, eax
cmp edx, ecx
jg 0x588015
lea eax, [eax + ecx - 1]
mov dword [ebp - 8], eax
jmp 0x588064
dec ecx
test ecx, ecx
jle 0x588064
mov dword [ebp - 0x18], ecx
mov edx, dword [ebp - 0x14]
movzx ecx, byte [edx + eax + 2]
mov edi, dword [ebp - 0x10]
shl edi, 4
xor ecx, edi
mov dword [ebp - 0x10], ecx
and ecx, 0x7ff
lea ecx, reloc.MSVCRT.dll___dllonexit
movzx edi, word [ecx]
mov word [ecx], ax
mov ecx, eax
and ecx, 0x1fff
mov dword [ebp - 0xc], ecx
lea ecx, reloc.MSVCRT.dll___dllonexit
mov edx, dword [ebp - 0xc]
inc eax
dec dword [ebp - 0x18]
mov word [ecx + edx*2], di
jne 0x58801d
mov dword [ebp - 8], eax
mov edi, dword [ebp + 8]
cmp eax, dword [edi + 0x1c]
jl 0x587b32
mov ecx, dword [ebp - 4]
mov dword [edi + 0x30], ecx
mov ecx, eax
sub ecx, dword [edi + 0x1c]
mov dword [edi + 0x18], eax
neg ecx
sbb ecx, ecx
and ecx, 2
cmp eax, 0x4000
mov dword [edi + 0x2c], ebx
mov dword [edi + 0x20], esi
mov dword [edi], ecx
jne 0x58809b
mov ebx, edi
call fcn.005878ff
pop edi
pop esi
pop ebx
leave
ret 0x14