Function at 0x40bfe0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b4
call fcn.0040c9d0
mov edi, edx
mov dword [esp + 0x10], ecx
mov ebx, dword [esp + 0x15cc]
mov esi, dword [esp + 0x15c8]
lea eax, [esp + 0x30]
push 0x84
push 0
push eax
call fcn.0040caf0
add esp, 0xc
cmp dword [esp + 0x15d0], 0
mov dword [esp + 0x14], edi
je 0x40c0ae
test esi, esi
mov ecx, esi
jle 0x40c82a
xor eax, eax
cmp ecx, 1
je 0x40c078
mov ecx, dword [esp + 0x15c8]
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x14]
lea eax, [eax + eax*8]
shl eax, 5
mov edx, dword [esp + 0x10]
add edx, eax
add edx, 0x8f13
xor eax, eax
nop
nop
movzx esi, byte [edx + eax - 1]
inc dword [esp + esi*4 + 0x30]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x30]
add eax, 2
cmp ecx, eax
jne 0x40c060
mov ecx, dword [esp + 0x15c8]
test cl, 1
mov edi, dword [esp + 0x14]
je 0x40c82a
lea ecx, [edi + edi*8]
shl ecx, 5
add ecx, dword [esp + 0x10]
movzx eax, byte [eax + ecx + 0x8f12]
mov ecx, dword [esp + 0x15c8]
inc dword [esp + eax*4 + 0x30]
jmp 0x40c82a
lea ebp, [edi + edi*8]
mov ecx, ebp
shl ecx, 6
test esi, esi
mov dword [esp + 0x24], ecx
jle 0x40c1bb
mov eax, dword [esp + 0x10]
add eax, ecx
add eax, 0x8192
xor ecx, ecx
xor edi, edi
jmp 0x40c0f4
mov edx, ecx
and edx, 1
xor ecx, 1
lea ecx, [ecx + edx*2]
cmp ecx, dword [esp + 0x15c8]
jge 0x40c110
movzx edx, word [eax + ecx*2]
test dx, dx
je 0x40c0e0
mov word [esp + edi*4 + 0xcb4], dx
mov word [esp + edi*4 + 0xcb6], cx
inc edi
jmp 0x40c0e0
lea eax, [esp + 0x4b4]
push 0x800
push 0
push eax
call fcn.0040caf0
add esp, 0xc
test edi, edi
sete byte [esp + 0xf]
je 0x40c1d2
mov ecx, edi
xor eax, eax
cmp edi, 1
je 0x40c18f
mov ecx, edi
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [esp + eax*4 + 0xcb4]
movzx esi, dl
inc dword [esp + esi*4 + 0x4b4]
shr edx, 8
inc dword [esp + edx*4 + 0x8b4]
movzx edx, word [esp + eax*4 + 0xcb8]
movzx esi, dl
inc dword [esp + esi*4 + 0x4b4]
shr edx, 8
inc dword [esp + edx*4 + 0x8b4]
add eax, 2
cmp ecx, eax
jne 0x40c150
mov edx, edi
test dl, 1
je 0x40c1b2
movzx eax, word [esp + eax*4 + 0xcb4]
movzx ecx, al
inc dword [esp + ecx*4 + 0x4b4]
shr eax, 8
inc dword [esp + eax*4 + 0x8b4]
mov eax, dword [esp + 0x8b4]
jmp 0x40c1db
lea eax, [esp + 0x4b4]
push 0x800
push 0
push eax
call fcn.0040caf0
add esp, 0xc
xor edx, edx
mov byte [esp + 0xf], 1
xor eax, eax
xor ecx, ecx
cmp eax, edx
setne cl
inc ecx
mov dword [esp + 0x28], ecx
lea eax, [edx - 1]
mov dword [esp + 0x18], eax
mov dword [esp + 8], edx
and edx, 0xfffffffe
lea eax, [esp + 0xcb4]
mov dword [esp], eax
lea eax, [esp + 0x1134]
xor ecx, ecx
lea esi, [esp + 0x4b4]
xor edi, edi
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x2c], edx
jmp 0x40c238
inc edi
add ecx, 8
add esi, 0x400
mov eax, dword [esp + 4]
cmp edi, dword [esp + 0x28]
je 0x40c353
mov dword [esp + 0x20], edi
mov edx, dword [esp]
mov dword [esp + 4], edx
mov dword [esp], eax
mov eax, 3
xor edx, edx
nop
nop
nop
mov dword [esp + eax*4 + 0xa8], edx
add edx, dword [esi + eax*4 - 0xc]
mov dword [esp + eax*4 + 0xac], edx
add edx, dword [esi + eax*4 - 8]
mov dword [esp + eax*4 + 0xb0], edx
add edx, dword [esi + eax*4 - 4]
mov dword [esp + eax*4 + 0xb4], edx
add edx, dword [esi + eax*4]
add eax, 4
cmp eax, 0x103
jne 0x40c250
cmp byte [esp + 0xf], 0
mov edi, dword [esp + 0x20]
jne 0x40c220
cmp dword [esp + 0x18], 0
je 0x40c2fc
xor eax, eax
mov edi, dword [esp]
mov ebp, dword [esp + 4]
movzx edx, word [ebp + eax*4]
shr edx, cl
movzx edx, dl
mov ebx, dword [esp + edx*4 + 0xb4]
lea ebp, [ebx + 1]
mov dword [esp + edx*4 + 0xb4], ebp
mov edx, dword [esp + 4]
mov edx, dword [edx + eax*4]
mov dword [edi + ebx*4], edx
mov edx, dword [esp + 4]
movzx edx, word [edx + eax*4 + 4]
shr edx, cl
movzx edx, dl
mov ebx, dword [esp + edx*4 + 0xb4]
lea ebp, [ebx + 1]
mov dword [esp + edx*4 + 0xb4], ebp
mov ebp, dword [esp + 4]
mov edx, dword [ebp + eax*4 + 4]
mov dword [edi + ebx*4], edx
mov edx, dword [esp + 0x2c]
add eax, 2
cmp edx, eax
jne 0x40c2a0
jmp 0x40c2fe
xor eax, eax
test byte [esp + 8], 1
mov ebx, dword [esp + 0x15cc]
mov ebp, dword [esp + 0x1c]
mov edi, dword [esp + 0x20]
je 0x40c220
mov edx, dword [esp + 4]
movzx edx, word [edx + eax*4]
shr edx, cl
movzx edx, dl
mov ebx, dword [esp + edx*4 + 0xb4]
lea ebp, [ebx + 1]
mov dword [esp + edx*4 + 0xb4], ebp
mov ebp, dword [esp + 0x1c]
mov edx, dword [esp + 4]
mov eax, dword [edx + eax*4]
mov edx, dword [esp]
mov dword [edx + ebx*4], eax
mov ebx, dword [esp + 0x15cc]
jmp 0x40c220
cmp dword [esp + 8], 0
je 0x40c70d
mov edx, dword [esp + 8]
cmp edx, 1
jne 0x40c374
mov eax, dword [esp]
mov word [eax], 1
jmp 0x40c5b4
mov esi, dword [esp]
movzx eax, word [esi + 4]
add word [esi], ax
cmp edx, 3
jl 0x40c41d
mov eax, 2
mov ecx, 2
sub ecx, edx
mov dword [esp + 4], ecx
xor edx, edx
mov esi, 1
jmp 0x40c3b9
mov ebx, dword [esp]
movzx edi, word [ebx + eax*4]
inc eax
add word [ebx + esi*4], di
mov ecx, dword [esp + 4]
add ecx, esi
inc ecx
inc esi
cmp ecx, 1
je 0x40c42c
mov ebx, dword [esp]
movzx ecx, word [ebx + edx*4]
cmp eax, dword [esp + 8]
jge 0x40c3cf
movzx edi, word [ebx + eax*4]
cmp cx, di
jae 0x40c400
mov word [ebx + esi*4], cx
mov word [ebx + edx*4], si
inc edx
cmp eax, dword [esp + 8]
jge 0x40c40b
cmp edx, esi
jge 0x40c3a0
mov ebx, dword [esp]
movzx ecx, word [ebx + edx*4]
movzx edi, word [ebx + eax*4]
cmp cx, di
jae 0x40c3a7
jmp 0x40c412
inc eax
mov word [ebx + esi*4], di
cmp eax, dword [esp + 8]
jl 0x40c3de
mov ebx, dword [esp]
movzx ecx, word [ebx + edx*4]
add word [ebx + esi*4], cx
mov word [ebx + edx*4], si
inc edx
jmp 0x40c3ac
lea ecx, [edx - 2]
mov word [esi + edx*4 - 8], 0
jmp 0x40c4b9
mov edx, dword [esp + 8]
mov eax, dword [esp]
mov word [eax + edx*4 - 8], 0
lea esi, [edx - 3]
mov eax, esi
test dl, 1
je 0x40c463
mov edi, dword [esp]
movzx eax, word [edi + edx*4 - 0xc]
movzx eax, word [edi + eax*4]
mov ecx, eax
and ecx, 1
xor eax, 1
lea eax, [eax + ecx*2]
mov word [edi + edx*4 - 0xc], ax
lea eax, [edx - 4]
lea ecx, [edx - 2]
test esi, esi
je 0x40c4b6
mov esi, dword [esp]
nop
nop
nop
movzx edx, word [esi + eax*4]
movzx edx, word [esi + edx*4]
mov esi, edx
and esi, 1
xor edx, 1
lea edx, [edx + esi*2]
mov esi, dword [esp]
mov word [esi + eax*4], dx
mov edx, dword [esp]
movzx edx, word [edx + eax*4 - 4]
mov esi, dword [esp]
movzx edx, word [esi + edx*4]
mov esi, edx
and esi, 1
xor edx, 1
lea edx, [edx + esi*2]
mov esi, dword [esp]
mov word [esi + eax*4 - 4], dx
add eax, 0xfffffffe
cmp eax, 0xffffffff
jne 0x40c470
jmp 0x40c4b9
mov esi, dword [esp]
mov edi, 1
xor eax, eax
mov edx, dword [esp + 0x18]
jmp 0x40c4dc
inc eax
lea edi, [ebx + ebx]
test ebx, ebx
jle 0x40c5a2
test ecx, ecx
mov dword [esp + 4], edi
js 0x40c510
lea ebx, [ecx + 1]
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [esi + ecx*4]
cmp eax, esi
jne 0x40c520
inc edi
dec ecx
cmp ebx, edi
mov esi, dword [esp]
jne 0x40c4f0
mov ecx, 0xffffffff
jmp 0x40c525
xor ebx, ebx
sub edi, ebx
jle 0x40c4d0
jmp 0x40c52d
mov ebx, edi
mov esi, dword [esp]
mov edi, dword [esp + 4]
sub edi, ebx
jle 0x40c4d0
and edi, 3
je 0x40c557
mov ebp, edi
lea edi, [esi + edx*4]
xor esi, esi
nop
nop
nop
nop
nop
nop
nop
mov word [edi], ax
inc esi
add edi, 0xfffffffc
cmp ebp, esi
jne 0x40c540
mov ebp, dword [esp + 4]
mov edi, ebp
sub edi, esi
sub edx, esi
jmp 0x40c55d
mov ebp, dword [esp + 4]
mov edi, ebp
mov esi, ebx
sub esi, ebp
cmp esi, 0xfffffffc
mov esi, dword [esp]
mov ebp, dword [esp + 0x1c]
ja 0x40c4d0
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [esi + edx*4], ax
mov word [esi + edx*4 - 4], ax
mov word [esi + edx*4 - 8], ax
mov word [esi + edx*4 - 0xc], ax
add edx, 0xfffffffc
add edi, 0xfffffffc
cmp edi, ebx
jg 0x40c580
jmp 0x40c4d0
cmp dword [esp + 8], 0
mov ebx, dword [esp + 0x15cc]
jle 0x40c70d
mov eax, dword [esp + 8]
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x18], 3
mov edi, dword [esp]
jb 0x40c5fa
mov edx, dword [esp + 8]
and edx, 0xfffffffc
xor ecx, ecx
movzx esi, word [edi + ecx*4]
inc dword [esp + esi*4 + 0x30]
movzx esi, word [edi + ecx*4 + 4]
inc dword [esp + esi*4 + 0x30]
movzx esi, word [edi + ecx*4 + 8]
inc dword [esp + esi*4 + 0x30]
movzx esi, word [edi + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x30]
add ecx, 4
cmp edx, ecx
jne 0x40c5d0
test eax, eax
je 0x40c61d
mov edx, dword [esp]
lea ecx, [edx + ecx*4]
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ecx + edx*4]
inc dword [esp + esi*4 + 0x30]
inc edx
cmp eax, edx
jne 0x40c610
cmp dword [esp + 8], 2
jl 0x40c70d
cmp ebx, 0x1f
jg 0x40c68e
mov ecx, dword [esp + ebx*4 + 0x30]
test bl, 1
jne 0x40c63a
mov eax, ebx
jmp 0x40c64e
lea eax, [ebx + 1]
mov edx, dword [esp + ebx*4 + 0x34]
mov esi, edx
and esi, ecx
xor edx, ecx
lea ecx, [edx + esi*2]
mov dword [esp + ebx*4 + 0x30], ecx
cmp ebx, 0x1f
je 0x40c68a
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov edx, dword [esp + eax*4 + 0x34]
mov esi, edx
and esi, ecx
xor edx, ecx
lea ecx, [edx + esi*2]
mov dword [esp + ebx*4 + 0x30], ecx
mov edx, dword [esp + eax*4 + 0x38]
add eax, 2
mov esi, edx
and esi, ecx
xor edx, ecx
lea ecx, [edx + esi*2]
mov dword [esp + ebx*4 + 0x30], ecx
cmp eax, 0x20
jne 0x40c660
test ebx, ebx
jle 0x40c6d1
mov edx, ebx
not edx
xor eax, eax
mov esi, edx
mov edi, ebx
nop
nop
nop
nop
nop
nop
nop
nop
mov ecx, esi
and ecx, ebx
mov ebx, edi
and ebx, edx
sub ecx, ebx
mov ebx, dword [esp + edi*4 + 0x30]
shl ebx, cl
add eax, ebx
mov ebx, dword [esp + 0x15cc]
inc esi
cmp edi, 1
lea edi, [edi - 1]
ja 0x40c6a0
mov edx, 1
mov ecx, ebx
shl edx, cl
cmp eax, edx
jne 0x40c6dc
jmp 0x40c70d
mov edx, 1
mov ecx, ebx
shl edx, cl
xor eax, eax
dec dword [esp + ebx*4 + 0x30]
mov ecx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x40c708
mov esi, dword [esp + ecx*4 + 0x2c]
dec ecx
test esi, esi
je 0x40c6f0
dec esi
mov dword [esp + ecx*4 + 0x30], esi
add dword [esp + ecx*4 + 0x34], 2
dec eax
cmp eax, edx
jne 0x40c6dc
shl ebp, 5
mov esi, dword [esp + 0x10]
lea eax, [esi + ebp]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.0040caf0
add esp, 0xc
mov eax, dword [esp + 0x24]
add eax, esi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.0040caf0
add esp, 0xc
test ebx, ebx
mov edi, dword [esp]
jle 0x40c81f
add edi, 0xfffffffe
mov eax, 1
add ebp, dword [esp + 0x10]
mov dword [esp], edi
jmp 0x40c785
mov esi, dword [esp + 8]
mov dword [esp + 8], esi
lea ecx, [eax + 1]
cmp eax, ebx
mov eax, ecx
je 0x40c81f
mov ecx, dword [esp + eax*4 + 0x30]
test ecx, ecx
jle 0x40c770
mov edx, ecx
and edx, 3
je 0x40c7d0
mov esi, dword [esp + 8]
mov edi, dword [esp]
lea edi, [edi + esi*4]
xor esi, esi
movzx ebx, word [edi]
mov byte [ebx + ebp + 0x8f12], al
inc esi
add edi, 0xfffffffc
cmp edx, esi
jne 0x40c7a0
sub dword [esp + 8], esi
mov edx, ecx
sub edx, esi
mov ebx, dword [esp + 0x15cc]
jmp 0x40c7d2
mov edx, ecx
cmp ecx, 4
mov esi, dword [esp + 8]
mov edi, dword [esp]
jb 0x40c774
dec edx
nop
movzx ecx, word [edi + esi*4]
mov byte [ecx + ebp + 0x8f12], al
movzx ecx, word [edi + esi*4 - 4]
mov byte [ecx + ebp + 0x8f12], al
movzx ecx, word [edi + esi*4 - 8]
mov byte [ecx + ebp + 0x8f12], al
movzx ecx, word [edi + esi*4 - 0xc]
add esi, 0xfffffffc
mov byte [ecx + ebp + 0x8f12], al
add edx, 0xfffffffc
cmp edx, 0xfffffffe
jb 0x40c7e0
jmp 0x40c774
mov ecx, dword [esp + 0x15c8]
mov edi, dword [esp + 0x14]
mov dword [esp + 0x4b8], 0
cmp ebx, 2
jl 0x40c89d
lea ecx, [ebx - 1]
cmp ebx, 2
jne 0x40c84b
xor eax, eax
mov edx, 2
jmp 0x40c884
mov ebx, ecx
and ebx, 0xfffffffe
xor eax, eax
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + edx*4 + 0x34]
add eax, eax
mov dword [esp + edx*4 + 0x4bc], eax
add eax, dword [esp + edx*4 + 0x38]
add eax, eax
mov dword [esp + edx*4 + 0x4c0], eax
add edx, 2
cmp ebx, edx
jne 0x40c860
add edx, 2
test cl, 1
mov ecx, dword [esp + 0x15c8]
je 0x40c89d
add eax, dword [esp + edx*4 + 0x2c]
add eax, eax
mov dword [esp + edx*4 + 0x4b4], eax
test ecx, ecx
jle 0x40c962
xor eax, eax
lea edi, [edi + edi*8]
mov edx, edi
shl edx, 5
mov esi, dword [esp + 0x10]
add edx, esi
shl edi, 6
add edi, esi
mov dword [esp + 4], edi
jmp 0x40c8dc
mov ecx, dword [esp + 4]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15c8]
inc eax
cmp eax, ecx
je 0x40c962
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x40c8d3
mov ecx, dword [esp + ebx*4 + 0x4b4]
lea edi, [ecx + 1]
mov dword [esp + ebx*4 + 0x4b4], edi
xor edi, edi
cmp bl, 4
jb 0x40c93f
mov ebp, ebx
and ebp, 0xfffffffc
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
nop
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 0x40c910
and ebx, 3
je 0x40c8c0
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 0x40c950
jmp 0x40c8c0
add esp, 0x15b4
pop esi
pop edi
pop ebx
pop ebp
ret