Function at 0x407767
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
mov eax, dword [edi + 0x38]
mov ecx, dword [eax + 0x2c314]
mov esi, dword [eax + 0x2c310]
mov ebx, dword [eax + 0x2c30c]
mov dword [ebp + 8], ecx
mov ecx, dword [edi + 0x18]
mov dword [ebp - 4], ecx
add ecx, eax
movzx edx, byte [ecx + 1]
movzx ecx, byte [ecx]
shl ecx, 5
xor edx, ecx
mov dword [ebp - 0xc], eax
mov dword [ebp - 8], esi
mov dword [ebp - 0x14], edx
jmp 0x407e3a
mov edx, dword [edi + 0x1c]
sub edx, ecx
cmp edx, 3
jle 0x40783b
movzx ecx, byte [eax + ecx + 2]
mov edx, dword [ebp - 0x14]
shl edx, 5
xor ecx, edx
mov dword [ebp - 0x14], ecx
and ecx, 0x1fff
lea ecx, [eax + ecx*2 + 0x2030a]
movzx edx, word [ecx]
mov dword [ebp - 0x18], edx
mov edx, dword [ebp - 4]
mov word [ecx], dx
mov ecx, edx
mov edx, dword [ebp - 0x18]
and ecx, 0x7fff
add eax, 0x10106
test edx, edx
mov word [eax + ecx*2], dx
je 0x40782c
push dword [ebp + 0x18]
mov esi, dword [ebp - 0xc]
push dword [ebp + 0xc]
lea ecx, [ebp - 0x1c]
push ecx
mov ecx, dword [ebp - 4]
push eax
call fcn.004075a2
mov edx, dword [ebp - 4]
mov ecx, dword [edi + 0x1c]
lea esi, [eax + edx]
cmp esi, ecx
mov esi, dword [ebp - 8]
mov dword [ebp - 0x10], eax
jle 0x407833
sub ecx, edx
mov dword [ebp - 0x10], ecx
jmp 0x407830
and dword [ebp - 0x10], 0
mov eax, dword [ebp - 0x10]
cmp eax, 3
jge 0x4078a8
mov eax, dword [ebp - 0xc]
inc dword [edi + 0x14]
mov ecx, dword [ebp - 4]
movzx ecx, byte [ecx + eax]
mov edx, dword [edi + 0x38]
lea ecx, [edx + ecx*2 + 0x2f2d8]
inc word [ecx]
mov ecx, dword [ebp - 4]
movzx ecx, byte [ecx + eax]
mov edx, dword [edi + 0x38]
movzx edx, word [edx + ecx*2 + 0x2f098]
mov ecx, esi
shl edx, cl
mov ecx, dword [ebp - 4]
movzx ecx, byte [ecx + eax]
or ebx, edx
mov edx, dword [edi + 0x38]
movzx ecx, byte [edx + ecx + 0x2ef78]
add esi, ecx
cmp esi, 0x10
mov dword [ebp - 8], esi
jl 0x4078a0
mov ecx, dword [ebp + 8]
mov byte [ecx], bl
mov edx, ebx
inc ecx
shr edx, 8
mov byte [ecx], dl
inc ecx
shr ebx, 0x10
sub esi, 0x10
mov dword [ebp + 8], ecx
mov dword [ebp - 8], esi
inc dword [ebp - 4]
jmp 0x407dea
inc dword [ebp - 4]
cmp eax, dword [ebp + 0x10]
jg 0x407c3e
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebp - 4]
movzx eax, byte [ecx + eax + 2]
mov edx, dword [ebp - 0x14]
shl edx, 5
xor eax, edx
mov dword [ebp - 0x14], eax
and eax, 0x1fff
lea eax, [ecx + eax*2 + 0x2030a]
movzx edx, word [eax]
mov dword [ebp - 0x18], edx
mov edx, dword [ebp - 4]
mov word [eax], dx
mov eax, edx
mov edx, dword [ebp - 0x18]
and eax, 0x7fff
add ecx, 0x10106
test edx, edx
mov word [ecx + eax*2], dx
je 0x407937
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp + 0x14]
mov eax, dword [ebp + 0xc]
jl 0x407908
sar eax, 2
push dword [ebp + 0x18]
mov esi, dword [ebp - 0xc]
push eax
lea eax, [ebp - 0x20]
push eax
push ecx
mov ecx, dword [ebp - 4]
call fcn.004075a2
mov ecx, dword [ebp - 4]
mov esi, dword [ebp - 8]
mov edx, eax
mov eax, dword [edi + 0x1c]
mov dword [ebp - 0x18], edx
add edx, ecx
cmp edx, eax
jle 0x40793b
sub eax, ecx
mov dword [ebp - 0x18], eax
jmp 0x40793b
and dword [ebp - 0x18], 0
mov eax, dword [ebp - 0x18]
cmp eax, dword [ebp - 0x10]
jle 0x407af1
inc dword [edi + 0x14]
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 0xc]
mov edx, dword [edi + 0x38]
lea ecx, [eax + ecx - 1]
movzx eax, byte [ecx]
lea eax, [edx + eax*2 + 0x2f2d8]
inc word [eax]
movzx eax, byte [ecx]
mov ecx, dword [edi + 0x38]
movzx edx, word [ecx + eax*2 + 0x2f098]
mov ecx, esi
shl edx, cl
mov ecx, dword [edi + 0x38]
movzx eax, byte [ecx + eax + 0x2ef78]
add esi, eax
or ebx, edx
cmp esi, 0x10
jl 0x4079a1
mov eax, dword [ebp + 8]
mov byte [eax], bl
mov ecx, ebx
inc eax
shr ecx, 8
mov byte [eax], cl
inc eax
shr ebx, 0x10
mov dword [ebp + 8], eax
sub esi, 0x10
mov eax, dword [ebp - 0x20]
mov ecx, 0x100
cmp eax, ecx
jb 0x4079b2
shr eax, 7
add eax, ecx
movzx ecx, byte [eax + 0x68cd8180]
mov eax, dword [ebp - 0x18]
movzx edx, byte [eax + 0x68cd805d]
movzx eax, byte [ecx + 0x68cd1114]
mov dword [ebp - 0x24], eax
movzx eax, byte [edx + 0x68cd10f4]
inc dword [edi + 0x14]
mov dword [ebp - 0x10], eax
mov eax, dword [edi + 0x38]
lea eax, [eax + edx*2 + 0x2f4da]
inc word [eax]
mov eax, dword [edi + 0x38]
lea eax, [eax + ecx*2 + 0x2fab8]
inc word [eax]
mov eax, dword [edi + 0x38]
movzx eax, word [eax + edx*2 + 0x2f29a]
mov dword [ebp - 8], ecx
mov ecx, esi
shl eax, cl
or ebx, eax
mov eax, dword [edi + 0x38]
movzx eax, byte [eax + edx + 0x2f079]
add esi, eax
cmp esi, 0x10
mov eax, dword [ebp + 8]
jl 0x407a31
mov byte [eax], bl
mov ecx, ebx
inc eax
shr ecx, 8
mov byte [eax], cl
inc eax
shr ebx, 0x10
mov dword [ebp + 8], eax
sub esi, 0x10
mov ecx, dword [ebp - 0x10]
test ecx, ecx
jle 0x407a68
xor edx, edx
inc edx
shl edx, cl
mov ecx, dword [ebp - 0x18]
add ecx, 0xfffffffd
dec edx
and edx, ecx
mov ecx, esi
add esi, dword [ebp - 0x10]
shl edx, cl
or ebx, edx
cmp esi, 0x10
jl 0x407a68
mov byte [eax], bl
mov ecx, ebx
inc eax
shr ecx, 8
mov byte [eax], cl
inc eax
shr ebx, 0x10
mov dword [ebp + 8], eax
sub esi, 0x10
mov ecx, dword [edi + 0x38]
mov edx, dword [ebp - 8]
movzx edx, word [ecx + edx*2 + 0x2c638]
mov ecx, esi
shl edx, cl
mov ecx, dword [edi + 0x38]
or ebx, edx
mov edx, dword [ebp - 8]
movzx ecx, byte [ecx + edx + 0x2c618]
add esi, ecx
cmp esi, 0x10
mov dword [ebp - 8], esi
jl 0x407aab
mov byte [eax], bl
mov ecx, ebx
inc eax
shr ecx, 8
mov byte [eax], cl
inc eax
shr ebx, 0x10
sub esi, 0x10
mov dword [ebp + 8], eax
mov dword [ebp - 8], esi
mov ecx, dword [ebp - 0x24]
test ecx, ecx
jle 0x407ae3
xor edx, edx
inc edx
shl edx, cl
mov ecx, esi
add esi, dword [ebp - 0x24]
dec edx
and edx, dword [ebp - 0x20]
mov dword [ebp - 8], esi
shl edx, cl
or ebx, edx
cmp esi, 0x10
jl 0x407ae3
mov byte [eax], bl
mov ecx, ebx
inc eax
shr ecx, 8
mov byte [eax], cl
inc eax
shr ebx, 0x10
sub esi, 0x10
mov dword [ebp + 8], eax
mov dword [ebp - 8], esi
mov eax, dword [ebp - 0x18]
inc dword [ebp - 4]
mov dword [ebp - 0x10], eax
jmp 0x407d82
mov eax, dword [ebp - 0x1c]
mov ecx, 0x100
cmp eax, ecx
jb 0x407b02
shr eax, 7
add eax, ecx
movzx edx, byte [eax + 0x68cd8180]
movzx ecx, byte [edx + 0x68cd1114]
mov eax, dword [ebp - 0x10]
movzx eax, byte [eax + 0x68cd805d]
mov dword [ebp - 0x28], ecx
movzx ecx, byte [eax + 0x68cd10f4]
inc dword [edi + 0x14]
mov dword [ebp - 0x24], ecx
mov ecx, dword [edi + 0x38]
lea ecx, [ecx + eax*2 + 0x2f4da]
inc word [ecx]
mov ecx, dword [edi + 0x38]
lea ecx, [ecx + edx*2 + 0x2fab8]
inc word [ecx]
mov ecx, dword [edi + 0x38]
mov dword [ebp - 0x18], edx
movzx edx, word [ecx + eax*2 + 0x2f29a]
mov ecx, esi
shl edx, cl
mov ecx, dword [edi + 0x38]
movzx eax, byte [ecx + eax + 0x2f079]
add esi, eax
mov eax, dword [ebp + 8]
or ebx, edx
cmp esi, 0x10
jl 0x407b81
mov byte [eax], bl
mov ecx, ebx
inc eax
shr ecx, 8
mov byte [eax], cl
inc eax
shr ebx, 0x10
mov dword [ebp + 8], eax
sub esi, 0x10
mov ecx, dword [ebp - 0x24]
test ecx, ecx
jle 0x407bb8
xor edx, edx
inc edx
shl edx, cl
mov ecx, dword [ebp - 0x10]
add ecx, 0xfffffffd
dec edx
and edx, ecx
mov ecx, esi
add esi, dword [ebp - 0x24]
shl edx, cl
or ebx, edx
cmp esi, 0x10
jl 0x407bb8
mov byte [eax], bl
mov ecx, ebx
inc eax
shr ecx, 8
mov byte [eax], cl
inc eax
shr ebx, 0x10
mov dword [ebp + 8], eax
sub esi, 0x10
mov ecx, dword [edi + 0x38]
mov edx, dword [ebp - 0x18]
movzx edx, word [ecx + edx*2 + 0x2c638]
mov ecx, esi
shl edx, cl
mov ecx, dword [edi + 0x38]
or ebx, edx
mov edx, dword [ebp - 0x18]
movzx ecx, byte [ecx + edx + 0x2c618]
add esi, ecx
cmp esi, 0x10
mov dword [ebp - 8], esi
jl 0x407bfb
mov byte [eax], bl
mov ecx, ebx
inc eax
shr ecx, 8
mov byte [eax], cl
inc eax
shr ebx, 0x10
sub esi, 0x10
mov dword [ebp + 8], eax
mov dword [ebp - 8], esi
mov ecx, dword [ebp - 0x28]
test ecx, ecx
jle 0x407c33
xor edx, edx
inc edx
shl edx, cl
mov ecx, esi
add esi, dword [ebp - 0x28]
dec edx
and edx, dword [ebp - 0x1c]
mov dword [ebp - 8], esi
shl edx, cl
or ebx, edx
cmp esi, 0x10
jl 0x407c33
mov byte [eax], bl
mov ecx, ebx
inc eax
shr ecx, 8
mov byte [eax], cl
inc eax
shr ebx, 0x10
sub esi, 0x10
mov dword [ebp + 8], eax
mov dword [ebp - 8], esi
dec dword [ebp - 0x10]
inc dword [ebp - 4]
jmp 0x407d82
mov ecx, dword [ebp - 0x1c]
mov edx, 0x100
cmp ecx, edx
jb 0x407c4f
shr ecx, 7
add ecx, edx
movzx edx, byte [eax + 0x68cd805d]
movzx ecx, byte [ecx + 0x68cd8180]
movzx eax, byte [ecx + 0x68cd1114]
mov dword [ebp - 0x18], eax
movzx eax, byte [edx + 0x68cd10f4]
inc dword [edi + 0x14]
mov dword [ebp - 0x28], eax
mov eax, dword [edi + 0x38]
lea eax, [eax + edx*2 + 0x2f4da]
inc word [eax]
mov eax, dword [edi + 0x38]
lea eax, [eax + ecx*2 + 0x2fab8]
inc word [eax]
mov eax, dword [edi + 0x38]
movzx eax, word [eax + edx*2 + 0x2f29a]
mov dword [ebp - 0x24], ecx
mov ecx, esi
shl eax, cl
or ebx, eax
mov eax, dword [edi + 0x38]
movzx eax, byte [eax + edx + 0x2f079]
add esi, eax
cmp esi, 0x10
mov eax, dword [ebp + 8]
jl 0x407ccb
mov byte [eax], bl
mov ecx, ebx
inc eax
shr ecx, 8
mov byte [eax], cl
inc eax
shr ebx, 0x10
mov dword [ebp + 8], eax
sub esi, 0x10
mov ecx, dword [ebp - 0x28]
test ecx, ecx
jle 0x407d02
xor edx, edx
inc edx
shl edx, cl
mov ecx, dword [ebp - 0x10]
add ecx, 0xfffffffd
dec edx
and edx, ecx
mov ecx, esi
add esi, dword [ebp - 0x28]
shl edx, cl
or ebx, edx
cmp esi, 0x10
jl 0x407d02
mov byte [eax], bl
mov ecx, ebx
inc eax
shr ecx, 8
mov byte [eax], cl
inc eax
shr ebx, 0x10
mov dword [ebp + 8], eax
sub esi, 0x10
mov ecx, dword [edi + 0x38]
mov edx, dword [ebp - 0x24]
movzx edx, word [ecx + edx*2 + 0x2c638]
mov ecx, esi
shl edx, cl
mov ecx, dword [edi + 0x38]
or ebx, edx
mov edx, dword [ebp - 0x24]
movzx ecx, byte [ecx + edx + 0x2c618]
add esi, ecx
cmp esi, 0x10
mov dword [ebp - 8], esi
jl 0x407d45
mov byte [eax], bl
mov ecx, ebx
inc eax
shr ecx, 8
mov byte [eax], cl
inc eax
shr ebx, 0x10
sub esi, 0x10
mov dword [ebp + 8], eax
mov dword [ebp - 8], esi
cmp dword [ebp - 0x18], 0
jle 0x407d82
mov ecx, dword [ebp - 0x18]
xor eax, eax
inc eax
shl eax, cl
mov ecx, esi
add esi, dword [ebp - 0x18]
dec eax
and eax, dword [ebp - 0x1c]
mov dword [ebp - 8], esi
shl eax, cl
or ebx, eax
cmp esi, 0x10
jl 0x407d82
mov eax, dword [ebp + 8]
mov byte [eax], bl
mov ecx, ebx
inc eax
shr ecx, 8
mov byte [eax], cl
inc eax
shr ebx, 0x10
sub esi, 0x10
mov dword [ebp + 8], eax
mov dword [ebp - 8], esi
mov edx, dword [edi + 0x1c]
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x10]
sub edx, ecx
cmp edx, eax
jg 0x407d9a
lea eax, [ecx + eax - 1]
mov dword [ebp - 4], eax
jmp 0x407de7
dec eax
test eax, eax
jle 0x407de7
mov dword [ebp - 0x28], eax
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0xc]
movzx eax, byte [eax + edx + 2]
mov ecx, dword [ebp - 0x14]
shl ecx, 5
xor eax, ecx
mov ecx, dword [ebp - 0xc]
mov dword [ebp - 0x14], eax
and eax, 0x1fff
lea eax, [ecx + eax*2 + 0x2030a]
movzx ecx, word [eax]
mov word [eax], dx
mov eax, dword [ebp - 0xc]
and edx, 0x7fff
add eax, 0x10106
inc dword [ebp - 4]
dec dword [ebp - 0x28]
mov word [eax + edx*2], cx
jne 0x407da2
mov eax, dword [ebp - 0xc]
cmp dword [edi + 0x14], 0xfff2
jae 0x407dfe
lea ecx, [eax + 0x2c302]
cmp dword [ebp + 8], ecx
jb 0x407e3a
mov eax, dword [ebp + 8]
mov byte [eax], bl
inc eax
mov ecx, ebx
shr ecx, 8
mov byte [eax], cl
inc eax
push edi
mov dword [ebp + 8], eax
call fcn.0040a47c
cmp dword [edi], 0
mov eax, dword [ebp - 0xc]
jne 0x407e46
mov ecx, dword [eax + 0x2c314]
mov ebx, dword [eax + 0x2c30c]
mov eax, dword [eax + 0x2c310]
mov dword [ebp - 8], eax
mov esi, eax
mov eax, dword [ebp - 0xc]
mov dword [ebp + 8], ecx
mov ecx, dword [ebp - 4]
cmp ecx, dword [edi + 0x1c]
jl 0x4077ad
mov ecx, dword [ebp + 8]
mov dword [eax + 0x2c314], ecx
mov dword [eax + 0x2c30c], ebx
mov dword [eax + 0x2c310], esi
mov eax, dword [ebp - 4]
cmp eax, 0x10000
mov dword [edi + 0x18], eax
jne 0x407e6e
push edi
call fcn.00407630
pop edi
pop esi
pop ebx
leave
ret 0x14