Function at 0x40bf10
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b0
call fcn.0040c950
mov edi, edx
mov dword [esp + 0xc], ecx
mov ebx, dword [esp + 0x15c8]
mov esi, dword [esp + 0x15c4]
lea eax, [esp + 0x2c]
push 0x84
push 0
push eax
call fcn.0040ca70
add esp, 0xc
cmp dword [esp + 0x15cc], 0
mov dword [esp + 0x1c], edi
je 0x40c01b
test esi, esi
jle 0x40c76f
xor eax, eax
cmp dword [esp + 0x15c4], 1
je 0x40bfd6
mov ecx, dword [esp + 0x15c4]
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x1c]
lea eax, [eax + eax*8]
shl eax, 5
mov edx, dword [esp + 0xc]
add edx, eax
add edx, 0x8f13
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, byte [edx + eax - 1]
mov edi, dword [esp + esi*4 + 0x2c]
mov ebx, edi
and ebx, 1
xor edi, 1
lea edi, [edi + ebx*2]
mov dword [esp + esi*4 + 0x2c], edi
movzx esi, byte [edx + eax]
mov edi, dword [esp + esi*4 + 0x2c]
mov ebx, edi
and ebx, 1
xor edi, 1
lea edi, [edi + ebx*2]
mov dword [esp + esi*4 + 0x2c], edi
add eax, 2
cmp ecx, eax
jne 0x40bfa0
mov ecx, dword [esp + 0x15c4]
test cl, 1
mov ebx, dword [esp + 0x15c8]
je 0x40c76f
mov ecx, dword [esp + 0x1c]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, dword [esp + 0xc]
movzx eax, byte [eax + ecx + 0x8f12]
mov ecx, dword [esp + eax*4 + 0x2c]
mov edx, ecx
and edx, 1
xor ecx, 1
lea ecx, [ecx + edx*2]
mov dword [esp + eax*4 + 0x2c], ecx
jmp 0x40c76f
lea eax, [edi + edi*8]
mov dword [esp + 0x14], eax
mov ebp, eax
shl ebp, 6
test esi, esi
jle 0x40c109
cmp esi, 1
jne 0x40c329
xor eax, eax
xor ebx, ebx
mov ecx, dword [esp + 0x15c4]
test cl, 1
je 0x40c06e
mov ecx, dword [esp + 0xc]
add ecx, ebp
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x40c06e
mov word [esp + ebx*4 + 0xb0], cx
mov word [esp + ebx*4 + 0xb2], ax
inc ebx
lea eax, [esp + 0x530]
push 0x800
push 0
push eax
call fcn.0040ca70
add esp, 0xc
test ebx, ebx
sete byte [esp + 7]
je 0x40c120
xor eax, eax
cmp ebx, 1
je 0x40c0df
mov ecx, ebx
and ecx, 0xfffffffe
xor eax, eax
movzx edx, word [esp + eax*4 + 0xb0]
movzx esi, dl
inc dword [esp + esi*4 + 0x530]
shr edx, 8
inc dword [esp + edx*4 + 0x930]
movzx edx, word [esp + eax*4 + 0xb4]
movzx esi, dl
inc dword [esp + esi*4 + 0x530]
shr edx, 8
inc dword [esp + edx*4 + 0x930]
add eax, 2
cmp ecx, eax
jne 0x40c0a0
test bl, 1
je 0x40c100
movzx eax, word [esp + eax*4 + 0xb0]
movzx ecx, al
inc dword [esp + ecx*4 + 0x530]
shr eax, 8
inc dword [esp + eax*4 + 0x930]
mov eax, dword [esp + 0x930]
jmp 0x40c129
lea eax, [esp + 0x530]
push 0x800
push 0
push eax
call fcn.0040ca70
add esp, 0xc
xor ebx, ebx
mov byte [esp + 7], 1
xor eax, eax
mov dword [esp + 0x24], ebp
xor ecx, ecx
cmp eax, ebx
setne cl
inc ecx
mov dword [esp + 0x28], ecx
lea eax, [ebx - 1]
mov dword [esp + 0x20], eax
mov dword [esp], ebx
mov edx, ebx
and edx, 0xfffffffe
lea eax, [esp + 0xb0]
mov dword [esp + 0x18], eax
lea eax, [esp + 0x1130]
xor ecx, ecx
xor esi, esi
mov dword [esp + 8], edx
jmp 0x40c184
mov esi, dword [esp + 0x10]
inc esi
add ecx, 8
mov eax, edi
cmp esi, dword [esp + 0x28]
je 0x40c26e
mov edi, dword [esp + 0x18]
mov dword [esp + 0x18], eax
mov dword [esp + 0x10], esi
mov eax, esi
shl eax, 0xa
add eax, esp
add eax, 0x530
xor ebp, ebp
xor edx, edx
mov dword [esp + edx*4 + 0xd30], ebp
add ebp, dword [eax + edx*4]
mov ebx, edx
and ebx, 1
xor edx, 1
lea edx, [edx + ebx*2]
cmp edx, 0x100
jb 0x40c1a0
cmp byte [esp + 7], 0
jne 0x40c170
cmp dword [esp + 0x20], 0
je 0x40c239
xor eax, eax
mov esi, dword [esp + 0x18]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [edi + eax*4]
shr edx, cl
movzx edx, dl
mov ebx, dword [esp + edx*4 + 0xd30]
lea ebp, [ebx + 1]
mov dword [esp + edx*4 + 0xd30], ebp
mov edx, dword [edi + eax*4]
mov dword [esi + ebx*4], edx
movzx edx, word [edi + eax*4 + 4]
shr edx, cl
movzx edx, dl
mov ebx, dword [esp + edx*4 + 0xd30]
lea ebp, [ebx + 1]
mov dword [esp + edx*4 + 0xd30], ebp
mov edx, dword [edi + eax*4 + 4]
mov dword [esi + ebx*4], edx
mov edx, dword [esp + 8]
add eax, 2
cmp edx, eax
jne 0x40c1e0
test byte [esp], 1
je 0x40c170
jmp 0x40c245
xor eax, eax
test byte [esp], 1
je 0x40c170
movzx edx, word [edi + eax*4]
shr edx, cl
movzx edx, dl
mov ebx, dword [esp + edx*4 + 0xd30]
lea ebp, [ebx + 1]
mov dword [esp + edx*4 + 0xd30], ebp
mov eax, dword [edi + eax*4]
mov esi, dword [esp + 0x18]
mov dword [esi + ebx*4], eax
jmp 0x40c170
cmp dword [esp], 0
mov ebp, dword [esp + 0x14]
mov esi, dword [esp + 0x18]
je 0x40c668
mov edx, dword [esp]
cmp edx, 1
jne 0x40c292
mov word [esi], 1
jmp 0x40c51c
movzx eax, word [esi + 4]
add word [esi], ax
cmp edx, 3
jl 0x40c395
mov eax, 2
mov ecx, 2
sub ecx, edx
xor edx, edx
mov edi, 1
jmp 0x40c2db
movzx ebx, word [esi + eax*4]
inc eax
add word [esi + edi*4], bx
mov ebp, dword [esp + 0x14]
lea ebx, [ecx + edi]
inc ebx
inc edi
cmp ebx, 1
je 0x40c3a4
movzx ebx, word [esi + edx*4]
cmp eax, dword [esp]
jge 0x40c2ed
movzx ebp, word [esi + eax*4]
cmp bx, bp
jae 0x40c310
mov word [esi + edi*4], bx
mov word [esi + edx*4], di
inc edx
cmp eax, dword [esp]
jge 0x40c31a
cmp edx, edi
jge 0x40c2c0
movzx ebp, word [esi + edx*4]
movzx ebx, word [esi + eax*4]
cmp bp, bx
jae 0x40c2c4
jmp 0x40c31e
inc eax
mov word [esi + edi*4], bp
cmp eax, dword [esp]
jl 0x40c2fb
movzx ebp, word [esi + edx*4]
add word [esi + edi*4], bp
mov word [esi + edx*4], di
inc edx
jmp 0x40c2c9
mov ecx, esi
and ecx, 0x7ffffffe
mov eax, dword [esp + 0xc]
lea edx, [eax + ebp]
add edx, 0x8194
xor eax, eax
xor ebx, ebx
jmp 0x40c35b
add eax, 2
cmp ecx, eax
je 0x40c03c
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x40c376
mov word [esp + ebx*4 + 0xb0], si
mov word [esp + ebx*4 + 0xb2], ax
inc ebx
movzx esi, word [edx + eax*2]
test si, si
je 0x40c350
mov word [esp + ebx*4 + 0xb0], si
lea esi, [eax + 1]
mov word [esp + ebx*4 + 0xb2], si
inc ebx
jmp 0x40c350
lea ecx, [edx - 2]
mov word [esi + edx*4 - 8], 0
jmp 0x40c421
mov ebx, dword [esp]
mov word [esi + ebx*4 - 8], 0
lea edx, [ebx - 3]
mov ecx, ebx
and ecx, 3
xor ecx, 2
mov eax, edx
je 0x40c3d1
mov eax, edx
nop
movzx edi, word [esi + eax*4]
movzx edi, word [esi + edi*4]
inc edi
mov word [esi + eax*4], di
dec eax
dec ecx
jne 0x40c3c0
lea ecx, [ebx - 2]
cmp edx, 3
jb 0x40c421
inc eax
nop
nop
nop
nop
nop
nop
movzx edx, word [esi + eax*4 - 4]
movzx edx, word [esi + edx*4]
inc edx
mov word [esi + eax*4 - 4], dx
movzx edx, word [esi + eax*4 - 8]
movzx edx, word [esi + edx*4]
inc edx
mov word [esi + eax*4 - 8], dx
movzx edx, word [esi + eax*4 - 0xc]
movzx edx, word [esi + edx*4]
inc edx
mov word [esi + eax*4 - 0xc], dx
movzx edx, word [esi + eax*4 - 0x10]
movzx edx, word [esi + edx*4]
inc edx
mov word [esi + eax*4 - 0x10], dx
add eax, 0xfffffffc
jne 0x40c3e0
mov edi, 1
xor edx, edx
mov eax, dword [esp + 0x20]
jmp 0x40c440
mov ebx, dword [esp + 8]
lea edi, [ebx + ebx]
inc edx
test ebx, ebx
je 0x40c512
test ecx, ecx
mov dword [esp + 0x10], edi
js 0x40c480
lea edi, [ecx + 1]
mov dword [esp + 8], edi
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ebx, word [esi + ecx*4]
cmp edx, ebx
jne 0x40c490
inc edi
dec ecx
cmp dword [esp + 8], edi
jne 0x40c460
mov ecx, 0xffffffff
mov ebx, dword [esp + 8]
jmp 0x40c492
xor ebx, ebx
jmp 0x40c496
mov ebx, edi
mov edi, dword [esp + 0x10]
mov dword [esp + 8], ebx
sub edi, ebx
jle 0x40c430
and edi, 3
je 0x40c4ca
lea ebp, [esi + eax*4]
xor ebx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
mov word [ebp], dx
inc ebx
add ebp, 0xfffffffc
cmp edi, ebx
jne 0x40c4b0
mov edi, dword [esp + 0x10]
sub edi, ebx
sub eax, ebx
mov ebp, dword [esp + 0x14]
jmp 0x40c4ce
mov edi, dword [esp + 0x10]
mov ebx, dword [esp + 8]
sub ebx, dword [esp + 0x10]
cmp ebx, 0xfffffffc
mov ebx, dword [esp + 8]
ja 0x40c434
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [esi + eax*4], dx
mov word [esi + eax*4 - 4], dx
mov word [esi + eax*4 - 8], dx
mov word [esi + eax*4 - 0xc], dx
add eax, 0xfffffffc
add edi, 0xfffffffc
cmp edi, ebx
jg 0x40c4f0
jmp 0x40c434
cmp dword [esp], 0
jle 0x40c668
mov eax, dword [esp]
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x20], 3
jb 0x40c56a
mov edx, dword [esp]
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edi, word [esi + ecx*4]
inc dword [esp + edi*4 + 0x2c]
movzx edi, word [esi + ecx*4 + 4]
inc dword [esp + edi*4 + 0x2c]
movzx edi, word [esi + ecx*4 + 8]
inc dword [esp + edi*4 + 0x2c]
movzx edi, word [esi + ecx*4 + 0xc]
inc dword [esp + edi*4 + 0x2c]
add ecx, 4
cmp edx, ecx
jne 0x40c540
test eax, eax
je 0x40c58d
lea ecx, [esi + ecx*4]
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edi, word [ecx + edx*4]
inc dword [esp + edi*4 + 0x2c]
inc edx
cmp eax, edx
jne 0x40c580
cmp dword [esp], 2
jl 0x40c668
mov ecx, dword [esp + 0x15c8]
cmp ecx, 0x20
jge 0x40c610
mov eax, dword [esp + ecx*4 + 0x2c]
mov edx, ecx
neg edx
mov edi, ecx
and edx, 3
je 0x40c5cc
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + edi*4 + 0x30]
inc edi
mov dword [esp + ecx*4 + 0x2c], eax
dec edx
jne 0x40c5c0
lea edx, [ecx - 0x1d]
cmp edx, 3
jb 0x40c608
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + edi*4 + 0x30]
mov dword [esp + ecx*4 + 0x2c], eax
add eax, dword [esp + edi*4 + 0x34]
mov dword [esp + ecx*4 + 0x2c], eax
add eax, dword [esp + edi*4 + 0x38]
mov dword [esp + ecx*4 + 0x2c], eax
add eax, dword [esp + edi*4 + 0x3c]
add edi, 4
mov dword [esp + ecx*4 + 0x2c], eax
cmp edi, 0x20
jne 0x40c5e0
test ecx, ecx
jle 0x40c8ad
mov edx, ecx
not edx
mov edi, ecx
xor ebx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
mov eax, dword [esp + edi*4 + 0x2c]
mov dword [esp + 8], eax
mov ebp, edi
mov eax, dword [esp + 0x15c8]
xor ebp, eax
mov ecx, edx
and ecx, eax
add ecx, ecx
sub ecx, ebp
mov eax, dword [esp + 8]
shl eax, cl
add ebx, eax
lea ecx, [edi - 1]
inc edx
cmp edi, 1
mov edi, ecx
ja 0x40c620
mov edx, 1
mov ecx, dword [esp + 0x15c8]
shl edx, cl
cmp ebx, edx
mov ebp, dword [esp + 0x14]
jne 0x40c8d3
shl ebp, 5
mov edi, dword [esp + 0xc]
lea eax, [edi + ebp]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.0040ca70
add esp, 0xc
mov eax, dword [esp + 0x24]
add eax, edi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.0040ca70
add esp, 0xc
mov ebx, dword [esp + 0x15c8]
test ebx, ebx
jle 0x40c76f
add esi, 0xfffffffe
mov eax, 1
add ebp, dword [esp + 0xc]
jmp 0x40c6d3
mov edi, dword [esp]
mov dword [esp], edi
lea ecx, [eax + 1]
cmp eax, ebx
mov eax, ecx
je 0x40c76f
mov ecx, dword [esp + eax*4 + 0x2c]
test ecx, ecx
jle 0x40c6c0
mov edx, ecx
and edx, 3
je 0x40c720
mov dword [esp + 8], ecx
mov ecx, dword [esp]
lea ebx, [esi + ecx*4]
xor edi, edi
nop
nop
mov ecx, ebp
movzx ebp, word [ebx]
mov byte [ebp + ecx + 0x8f12], al
mov ebp, ecx
inc edi
add ebx, 0xfffffffc
cmp edx, edi
jne 0x40c6f0
sub dword [esp], edi
mov ecx, dword [esp + 8]
mov edx, ecx
sub edx, edi
mov ebx, dword [esp + 0x15c8]
jmp 0x40c722
mov edx, ecx
cmp ecx, 4
mov edi, dword [esp]
jb 0x40c6c3
dec edx
nop
nop
nop
nop
nop
movzx ecx, word [esi + edi*4]
mov byte [ecx + ebp + 0x8f12], al
movzx ecx, word [esi + edi*4 - 4]
mov byte [ecx + ebp + 0x8f12], al
movzx ecx, word [esi + edi*4 - 8]
mov byte [ecx + ebp + 0x8f12], al
movzx ecx, word [esi + edi*4 - 0xc]
add edi, 0xfffffffc
mov byte [ecx + ebp + 0x8f12], al
add edx, 0xfffffffc
cmp edx, 0xfffffffe
jb 0x40c730
jmp 0x40c6c3
mov dword [esp + 0x534], 0
cmp ebx, 2
jl 0x40c7d3
inc ebx
xor eax, eax
cmp ebx, 4
jge 0x40c78c
mov ebx, 3
mov ecx, 2
jl 0x40c7c1
mov edx, ebx
and edx, 0x7ffffffe
xor eax, eax
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x28]
add eax, eax
mov dword [esp + ecx*4 + 0x530], eax
add eax, dword [esp + ecx*4 + 0x2c]
add eax, eax
mov dword [esp + ecx*4 + 0x534], eax
add ecx, 2
cmp edx, ecx
jne 0x40c7a0
test bl, 1
je 0x40c7d3
add eax, dword [esp + ecx*4 + 0x28]
add eax, eax
mov dword [esp + ecx*4 + 0x530], eax
cmp dword [esp + 0x15c4], 0
jle 0x40c8a2
xor eax, eax
mov ecx, dword [esp + 0x1c]
lea esi, [ecx + ecx*8]
mov edx, esi
shl edx, 5
mov ecx, dword [esp + 0xc]
add edx, ecx
shl esi, 6
add esi, ecx
mov dword [esp + 8], esi
jmp 0x40c824
mov ecx, dword [esp + 8]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, eax
and ecx, 1
xor eax, 1
lea eax, [eax + ecx*2]
cmp eax, dword [esp + 0x15c4]
jge 0x40c8a2
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x40c80c
mov ecx, dword [esp + ebx*4 + 0x530]
lea edi, [ecx + 1]
mov dword [esp + ebx*4 + 0x530], edi
xor edi, edi
cmp bl, 4
jb 0x40c87f
mov ebp, ebx
and ebp, 0xfffffffc
xor edi, edi
nop
mov esi, ecx
and esi, 1
shl esi, 2
lea esi, [esi + edi*8]
mov edi, ecx
and edi, 2
or edi, esi
mov esi, ecx
shr esi, 2
and esi, 1
or esi, edi
mov edi, ecx
shr edi, 3
and edi, 1
lea edi, [edi + esi*2]
shr ecx, 4
add ebp, 0xfffffffc
jne 0x40c850
and ebx, 3
je 0x40c800
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, ecx
and esi, 1
lea edi, [esi + edi*2]
shr ecx, 1
dec ebx
jne 0x40c890
jmp 0x40c800
add esp, 0x15b0
pop esi
pop edi
pop ebx
pop ebp
ret
mov edx, 1
shl edx, cl
xor ebx, ebx
jmp 0x40c8d3
dec edi
mov dword [esp + ecx*4 + 0x2c], edi
add dword [esp + ecx*4 + 0x30], 2
dec ebx
cmp ebx, edx
je 0x40c668
mov ecx, dword [esp + 0x15c8]
dec dword [esp + ecx*4 + 0x2c]
nop
nop
cmp ecx, 2
jl 0x40c8ca
mov edi, dword [esp + ecx*4 + 0x28]
dec ecx
test edi, edi
je 0x40c8e0
jmp 0x40c8c0