Function at 0x10156758
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x28
mov eax, dword [ecx + 8]
mov edi, ecx
mov ecx, dword [ecx + 0xc]
mov dword [ebp - 0x24], edx
mov ebx, 4
mov esi, 0x10
mov dword [ebp - 0x14], edi
mov dword [ebp - 0x30], eax
mov eax, dword [eax + 0x38]
mov dword [ebp - 0x28], ecx
movsx eax, word [eax + ecx*2]
mov ecx, dword [ebp + 0x20]
lea ecx, [eax + ecx*8]
mov eax, ecx
sar eax, 1
cmp dword [ebp + 0x24], 0
setne dl
cmp dword [ebp + 0x10], 2
sete dh
and dh, dl
cmovne ebx, esi
mov esi, dword [ebp + 0x10]
movzx edx, dh
sub eax, ebx
lea esi, [esi + esi]
sub esi, edx
mov edx, dword [ebp + 0x14]
dec esi
imul eax, esi
mov ebx, dword [edx]
add eax, ebx
sub ebx, ecx
mov ecx, dword [edi]
cdq
add ebx, 0xffffffe0
mov dword [ebp - 0x1c], ecx
mov ecx, dword [edi + 0x10]
mov dword [ebp - 0x10], ecx
mov ecx, dword [edi + 0x1c]
mov edi, dword [edi + 0x24]
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x2c], edi
idiv esi
mov edx, 0x40
cmp ebx, eax
cmovg ebx, eax
cmp ebx, 0x41
cmovl edx, ebx
xor esi, esi
inc esi
cmp edx, 4
mov eax, esi
jl 0x10156811
mov eax, edx
shr edx, 3
mov ecx, 0xe
and eax, 7
sub ecx, edx
movsx eax, word [eax + eax + 0x101c5d6c]
sar eax, cl
inc eax
and eax, 0xfffffffe
mov ecx, dword [ebp + 0x24]
mov edx, dword [ebp - 0x10]
test ecx, ecx
cmove esi, eax
cmp dword [ebp - 0x28], edx
cmovl esi, eax
cmp dword [ebp - 0x1c], 0
je 0x10156845
mov eax, dword [ebp - 0x14]
push dword [eax + 0x2c]
push dword [ebp + 0x10]
push ecx
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.1015786b
add esp, 0x14
mov dword [ebp - 0x10], eax
jmp 0x1015684c
mov dword [ebp - 0x10], 0
mov edi, dword [ebp - 0x18]
mov ebx, dword [ebp + 0x28]
push edi
call fcn.10153994
add esp, 4
cmp esi, 1
mov dword [ebp - 0x34], eax
jne 0x101568d0
cmp dword [ebp + 0x24], 0
je 0x10156937
xor esi, esi
cmp dword [ebp - 0x1c], 0
mov ebx, 0
je 0x10156e9a
xor ebx, ebx
cmp dword [ebp - 0x10], 0x2001
jl 0x10156e80
mov ecx, dword [ebp - 0x14]
xor eax, eax
cmp dword [ecx + 0x34], 0
sete cl
jne 0x10156e80
mov edx, dword [ebp + 0x10]
test edx, edx
jle 0x10156e7d
mov al, cl
mov ecx, edx
movaps xmm0, xmmword [0x10187140]
mov edx, dword [ebp + 0xc]
movss xmm1, dword [edx]
xorps xmm1, xmm0
movss dword [edx], xmm1
add edx, 4
dec ecx
jne 0x101568b8
mov ebx, eax
jmp 0x10156e80
cmp dword [ebp - 0x1c], 0
mov edx, dword [ebp + 0x24]
je 0x10156aaa
test edx, edx
je 0x1015693f
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax + 0x30]
test ecx, ecx
je 0x10156a99
mov ebx, dword [ebp - 0x10]
mov edx, 0x7fff
mov eax, 0xffff8001
cmp ebx, 0x2000
cmovg eax, edx
imul ebx, esi
cdq
idiv esi
add ebx, eax
xor edx, edx
mov eax, ebx
sar eax, 0xe
test ebx, ebx
mov ebx, dword [ebp + 0x28]
cmovns edx, eax
lea eax, [esi - 1]
cmp esi, edx
cmovle edx, eax
shr ecx, 0x1f
xor ecx, 1
add ecx, edx
mov edx, dword [ebp + 0x24]
mov dword [ebp - 0x10], ecx
jmp 0x10156aaa
mov esi, dword [ebp - 0x10]
jmp 0x10156d2e
mov ecx, dword [ebp - 0x10]
imul ecx, esi
lea eax, [ecx + 0x2000]
mov dword [ebp - 0x10], eax
sar eax, 0xe
cmp eax, esi
mov dword [ebp - 0x20], eax
jge 0x10156b45
cmp ecx, 0x2000
jl 0x10156b45
mov ecx, dword [ebp - 0x14]
mov ecx, dword [ecx + 0x38]
test ecx, ecx
je 0x10156b45
mov eax, dword [ebp - 0x10]
xor edx, edx
and eax, 0xffffc000
div esi
mov edx, 0x40000000
movsx ecx, ax
shl eax, 0x10
mov edi, eax
sub edx, eax
sar edi, 0xd
imul edi, ecx
mov ecx, 0x7fff
add edi, 0x8000
sar edi, 0x10
imul eax, edi, 0xfffffd8e
sub ecx, edi
add eax, 0x4000
sar eax, 0xf
add eax, 0x2055
imul eax, edi
lea eax, [eax + eax + 0x8000]
and eax, 0xffff0000
add eax, 0xe21d0000
sar eax, 0x10
imul eax, edi
mov edi, ebx
mov ebx, 0x7fff
add eax, 0x4000
shr eax, 0xf
add eax, ecx
mov ecx, edx
sar edx, 0xd
sar ecx, 0x10
shl eax, 0x10
imul edx, ecx
add eax, 0x10000
add edx, 0x8000
sar eax, 0x10
sar edx, 0x10
imul ecx, edx, 0xfffffd8e
sub ebx, edx
add ecx, 0x4000
sar ecx, 0xf
add ecx, 0x2055
imul ecx, edx
lea ecx, [ecx + ecx + 0x8000]
and ecx, 0xffff0000
add ecx, 0xe21d0000
sar ecx, 0x10
imul ecx, edx
mov edx, dword [ebp + 0x10]
add ecx, 0x4000
shr ecx, 0xf
add ecx, ebx
shl ecx, 0x10
shl edx, 7
add ecx, 0x10000
add edx, 0xffffff80
sar ecx, 0x10
movsx ebx, dx
push eax
push ecx
call fcn.1015442e
mov edx, dword [ebp + 0x24]
add esp, 8
mov ecx, dword [ebp + 0x14]
cwde
mov dword [ebp - 0x10], esi
imul eax, ebx
mov ebx, edi
add eax, 0x4000
sar eax, 0xf
mov ecx, dword [ecx]
cmp eax, ecx
jg 0x10156b4b
neg ecx
cmp eax, ecx
mov eax, dword [ebp - 0x20]
mov ecx, 0
cmovl eax, ecx
jmp 0x10156b48
mov eax, dword [ebp - 0x10]
imul eax, esi
add eax, 0x2000
sar eax, 0xe
mov dword [ebp - 0x10], eax
mov eax, dword [ebp + 0x10]
cmp eax, 3
jl 0x10156b4b
test edx, edx
je 0x10156b4b
mov ebx, esi
shr ebx, 0x1f
add ebx, esi
sar ebx, 1
cmp dword [ebp - 0x1c], 0
lea edx, [ebx + 1]
lea ecx, [edx + edx*2]
lea eax, [ecx + ebx]
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x14], eax
je 0x10156afa
mov edx, dword [ebp - 0x10]
sub ecx, ebx
add ecx, edx
cmp edx, ebx
lea eax, [edx + edx*2 + 3]
cmovg eax, ecx
jg 0x10156bb0
lea ecx, [edx + edx*2]
jmp 0x10156bb9
push eax
push edi
mov edi, edx
call fcn.10151f2f
add esp, 8
mov edx, 0x55555556
mov ecx, eax
add edi, edi
imul edx
mov dword [ebp - 0x10], edi
mov edi, ecx
mov eax, edx
sub edi, dword [ebp - 0x10]
shr eax, 0x1f
add eax, edx
mov edx, dword [ebp - 0x20]
cmp ecx, edx
mov ecx, edx
cmovl edi, eax
sub ecx, ebx
add ecx, edi
cmp edi, ebx
lea eax, [edi + edi*2 + 3]
cmovg eax, ecx
jg 0x10156cbd
lea edx, [edi + edi*2]
jmp 0x10156cc3
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x10], eax
cmp dword [ebp + 0x1c], 1
jg 0x10156b92
test edx, edx
jne 0x10156b92
mov edi, esi
sar edi, 1
lea ebx, [edi + 1]
mov eax, ebx
imul eax, ebx
cmp dword [ebp - 0x1c], 0
mov dword [ebp - 0x14], eax
je 0x10156bbf
mov ebx, dword [ebp - 0x10]
lea edx, [esi + 1]
sub edx, ebx
lea ecx, [ebx + 1]
cmp ebx, edi
mov eax, edx
cmovle eax, ecx
jg 0x10156c12
imul ecx, ebx
mov edi, dword [ebp - 0x18]
mov ebx, dword [ebp - 0x14]
sar ecx, 1
jmp 0x10156c26
cmp dword [ebp - 0x1c], 0
lea eax, [esi + 1]
je 0x10156bff
push eax
push dword [ebp - 0x10]
mov edi, dword [ebp - 0x18]
push edi
call fcn.1015c5ae
add esp, 0xc
jmp 0x10156c34
mov ecx, dword [ebp - 0x20]
not ebx
add ecx, ebx
add ecx, edx
mov edx, dword [ebp - 0x14]
push edx
jmp 0x10156c29
push eax
push dword [ebp - 0x18]
call fcn.10151f2f
add esp, 8
imul ebx, edi
sar ebx, 1
cmp eax, ebx
jge 0x10156cd8
lea eax, [eax*8 + 1]
push eax
call fcn.1015c7e0
add esp, 4
mov edi, eax
mov ecx, dword [ebp - 0x14]
dec edi
shr edi, 1
lea ebx, [edi + 1]
mov eax, ebx
imul eax, edi
shr eax, 1
jmp 0x10156d0d
push eax
push dword [ebp - 0x18]
call fcn.10152046
add esp, 8
mov edi, eax
jmp 0x10156d20
lea ecx, [esi + 2]
mov edi, dword [ebp - 0x18]
sub ecx, ebx
mov ebx, dword [ebp - 0x14]
imul edx, ecx
sar edx, 1
mov ecx, ebx
sub ecx, edx
add eax, ecx
push ebx
push eax
push ecx
push edi
call fcn.1015c4d4
add esp, 0x10
mov ecx, dword [ebp - 0x10]
xor edx, edx
shl ecx, 0xe
mov eax, ecx
div esi
cmp dword [ebp + 0x24], 0
mov ebx, eax
je 0x10156cb6
cmp dword [ebp - 0x1c], 0
je 0x10156cb6
cmp esi, ecx
jbe 0x10156c73
mov ecx, dword [ebp - 0x30]
mov edx, dword [ebp + 8]
push dword [ebp + 0x10]
push dword [ebp - 0x28]
push dword [ebp - 0x2c]
push dword [ebp + 0xc]
call fcn.10156f2f
add esp, 0x10
xor esi, esi
jmp 0x10156ed9
mov ecx, dword [ebp + 0x10]
test ecx, ecx
jle 0x10156cb6
movss xmm0, dword [0x101872cc]
mov edx, dword [ebp + 0xc]
mov esi, dword [ebp + 8]
xor eax, eax
movss xmm1, dword [esi + eax*4]
movss xmm2, dword [edx + eax*4]
mulss xmm1, xmm0
mulss xmm2, xmm0
movaps xmm3, xmm1
addss xmm3, xmm2
subss xmm2, xmm1
movss dword [esi + eax*4], xmm3
movss dword [edx + eax*4], xmm2
inc eax
cmp ecx, eax
jne 0x10156c8a
mov esi, ebx
mov ebx, dword [ebp + 0x28]
jmp 0x10156d2e
not ebx
add edx, ebx
add edx, edi
mov ebx, dword [ebp + 0x28]
push dword [ebp - 0x14]
push eax
push edx
push dword [ebp - 0x18]
call fcn.10151f8a
add esp, 0x10
jmp 0x10156d20
mov ecx, dword [ebp - 0x14]
lea ebx, [esi + 1]
lea edi, [esi + esi + 2]
sub ecx, eax
lea eax, [ecx*8 - 7]
push eax
call fcn.1015c7e0
add esp, 4
sub edi, eax
mov edx, dword [ebp - 0x14]
lea ecx, [esi + 2]
shr edi, 1
sub ebx, edi
sub ecx, edi
imul ecx, ebx
sar ecx, 1
mov eax, edx
sub eax, ecx
mov ecx, edx
add ebx, eax
push ecx
push ebx
push eax
push dword [ebp - 0x18]
call fcn.10151f8a
add esp, 0x10
mov ebx, dword [ebp + 0x28]
shl edi, 0xe
xor edx, edx
mov eax, edi
div esi
mov edi, dword [ebp - 0x18]
mov esi, eax
push edi
call fcn.10153994
add esp, 4
mov edi, eax
mov eax, dword [ebp + 0x14]
sub edi, dword [ebp - 0x34]
sub dword [eax], edi
cmp esi, 0x4000
je 0x10156e55
test esi, esi
je 0x10156eef
mov eax, esi
mov edx, 0x40000000
movsx ecx, si
mov dword [ebp - 0x10], esi
shl eax, 0x10
sub edx, eax
sar eax, 0xd
imul eax, ecx
mov ecx, 0x7fff
add eax, 0x8000
sar eax, 0x10
imul esi, eax, 0xfffffd8e
sub ecx, eax
add esi, 0x4000
sar esi, 0xf
add esi, 0x2055
imul esi, eax
lea esi, [esi + esi + 0x8000]
and esi, 0xffff0000
add esi, 0xe21d0000
sar esi, 0x10
imul esi, eax
mov eax, 0x7fff
add esi, 0x4000
shr esi, 0xf
add esi, ecx
mov ecx, edx
sar edx, 0xd
sar ecx, 0x10
shl esi, 0x10
imul edx, ecx
add esi, 0x10000
add edx, 0x8000
sar esi, 0x10
sar edx, 0x10
imul ecx, edx, 0xfffffd8e
sub eax, edx
add ecx, 0x4000
sar ecx, 0xf
add ecx, 0x2055
imul ecx, edx
lea ebx, [ecx + ecx + 0x8000]
and ebx, 0xffff0000
add ebx, 0xe21d0000
sar ebx, 0x10
imul ebx, edx
add ebx, 0x4000
shr ebx, 0xf
add ebx, eax
mov eax, dword [ebp + 0x10]
shl ebx, 0x10
add ebx, 0x10000
sar ebx, 0x10
shl eax, 7
add eax, 0xffffff80
cwde
mov dword [ebp - 0x1c], eax
push esi
push ebx
call fcn.1015442e
add esp, 8
movsx ecx, ax
xor eax, eax
imul ecx, dword [ebp - 0x1c]
add ecx, 0x4000
sar ecx, 0xf
jmp 0x10156f10
mov ecx, dword [ebp + 0x18]
xor eax, eax
xor esi, esi
dec eax
shl eax, cl
not eax
shl eax, cl
mov ecx, 0x4000
and dword [ebx], eax
mov ebx, 0x7fff
xor eax, eax
mov dword [ebp - 0x10], 0x4000
jmp 0x10156f10
xor ebx, ebx
inc ebx
mov ecx, dword [ebp - 0x30]
mov edx, dword [ebp + 8]
push dword [ebp + 0x10]
push dword [ebp - 0x28]
push dword [ebp - 0x2c]
push dword [ebp + 0xc]
call fcn.10156f2f
add esp, 0x10
mov eax, dword [ebp + 0x14]
cmp dword [eax], 0x11
jl 0x10156ece
mov eax, dword [ebp - 0x14]
cmp dword [eax + 0x20], 0x11
jl 0x10156ece
cmp dword [ebp - 0x1c], 0
je 0x10156ec1
push 2
push ebx
push edi
call fcn.1015c54d
add esp, 0xc
mov esi, ebx
jmp 0x10156ece
push 2
push edi
call fcn.10151fc1
add esp, 8
mov esi, eax
mov ecx, dword [ebp - 0x14]
xor eax, eax
cmp dword [ecx + 0x34], eax
cmovne esi, eax
mov ebx, dword [ebp + 0x28]
push edi
call fcn.10153994
add esp, 4
mov edi, eax
mov eax, dword [ebp + 0x14]
sub edi, dword [ebp - 0x34]
sub dword [eax], edi
mov ecx, dword [ebp + 0x18]
xor edx, edx
mov eax, esi
mov esi, 0x7fff
dec edx
shl edx, cl
mov ecx, 0xffffc000
not edx
and dword [ebx], edx
mov dword [ebp - 0x10], 0
xor ebx, ebx
mov edx, dword [ebp - 0x24]
mov dword [edx], eax
mov dword [edx + 4], esi
mov dword [edx + 8], ebx
mov dword [edx + 0xc], ecx
mov ecx, dword [ebp - 0x10]
mov dword [edx + 0x10], ecx
mov dword [edx + 0x14], edi
add esp, 0x28
pop esi
pop edi
pop ebx
pop ebp
ret