Function at 0x40bf50
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b0
call fcn.0040c960
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.0040cb90
add esp, 0xc
cmp dword [esp + 0x15cc], 0
mov dword [esp + 0x1c], edi
je 0x40c01e
test esi, esi
mov ecx, esi
jle 0x40c756
xor eax, eax
cmp ecx, 1
je 0x40bfe8
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
movzx esi, byte [edx + eax - 1]
inc dword [esp + esi*4 + 0x2c]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x2c]
add eax, 2
cmp ecx, eax
jne 0x40bfd0
mov ecx, dword [esp + 0x15c4]
test cl, 1
je 0x40c756
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 + 0x15c4]
inc dword [esp + eax*4 + 0x2c]
jmp 0x40c756
lea eax, [edi + edi*8]
mov dword [esp + 0x18], eax
mov ebp, eax
shl ebp, 6
test esi, esi
jle 0x40c119
cmp esi, 1
jne 0x40c339
xor eax, eax
xor ebx, ebx
mov ecx, dword [esp + 0x15c4]
test cl, 1
je 0x40c071
mov ecx, dword [esp + 0xc]
add ecx, ebp
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x40c071
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.0040cb90
add esp, 0xc
test ebx, ebx
sete byte [esp + 7]
je 0x40c130
xor eax, eax
cmp ebx, 1
je 0x40c0ef
mov ecx, ebx
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
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 0x40c0b0
test bl, 1
je 0x40c110
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 0x40c139
lea eax, [esp + 0x530]
push 0x800
push 0
push eax
call fcn.0040cb90
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 + 0x14], eax
lea eax, [esp + 0x1130]
xor ecx, ecx
xor esi, esi
mov dword [esp + 8], edx
jmp 0x40c194
add ecx, 8
mov esi, dword [esp + 0x10]
inc esi
mov eax, edi
cmp esi, dword [esp + 0x28]
je 0x40c27e
mov edi, dword [esp + 0x14]
mov dword [esp + 0x14], 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
xor ebx, 1
and edx, 1
lea edx, [ebx + edx*2]
cmp edx, 0x100
jb 0x40c1b0
cmp byte [esp + 7], 0
jne 0x40c180
cmp dword [esp + 0x20], 0
je 0x40c249
xor eax, eax
mov esi, dword [esp + 0x14]
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 0x40c1f0
test byte [esp], 1
je 0x40c180
jmp 0x40c255
xor eax, eax
test byte [esp], 1
je 0x40c180
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 + 0x14]
mov dword [esi + ebx*4], eax
jmp 0x40c180
cmp dword [esp], 0
mov ebx, dword [esp + 0x15c8]
mov ebp, dword [esp + 0x18]
mov esi, dword [esp + 0x14]
je 0x40c642
mov edx, dword [esp]
cmp edx, 1
jne 0x40c2a9
mov word [esi], 1
jmp 0x40c525
movzx eax, word [esi + 4]
add word [esi], ax
cmp edx, 3
jl 0x40c3a5
mov eax, 2
mov ecx, 2
sub ecx, edx
xor edx, edx
mov edi, 1
jmp 0x40c2eb
movzx ebx, word [esi + eax*4]
inc eax
add word [esi + edi*4], bx
mov ebp, dword [esp + 0x18]
lea ebx, [ecx + edi]
inc ebx
inc edi
cmp ebx, 1
je 0x40c3b4
movzx ebx, word [esi + edx*4]
cmp eax, dword [esp]
jge 0x40c2fd
movzx ebp, word [esi + eax*4]
cmp bx, bp
jae 0x40c320
mov word [esi + edi*4], bx
mov word [esi + edx*4], di
inc edx
cmp eax, dword [esp]
jge 0x40c32a
cmp edx, edi
jge 0x40c2d0
movzx ebp, word [esi + edx*4]
movzx ebx, word [esi + eax*4]
cmp bp, bx
jae 0x40c2d4
jmp 0x40c32e
inc eax
mov word [esi + edi*4], bp
cmp eax, dword [esp]
jl 0x40c30b
movzx ebp, word [esi + edx*4]
add word [esi + edi*4], bp
mov word [esi + edx*4], di
inc edx
jmp 0x40c2d9
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 0x40c36b
add eax, 2
cmp ecx, eax
je 0x40c03f
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x40c386
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 0x40c360
mov word [esp + ebx*4 + 0xb0], si
lea esi, [eax + 1]
mov word [esp + ebx*4 + 0xb2], si
inc ebx
jmp 0x40c360
lea ecx, [edx - 2]
mov word [esi + edx*4 - 8], 0
jmp 0x40c431
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 0x40c3e1
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 0x40c3d0
lea ecx, [ebx - 2]
cmp edx, 3
jb 0x40c431
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 0x40c3f0
mov edi, 1
xor edx, edx
mov eax, dword [esp + 0x20]
jmp 0x40c450
mov ebx, dword [esp + 8]
lea edi, [ebx + ebx]
inc edx
test ebx, ebx
je 0x40c514
test ecx, ecx
mov dword [esp + 0x10], edi
js 0x40c490
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 0x40c4a0
dec ecx
inc edi
cmp dword [esp + 8], edi
jne 0x40c470
mov ecx, 0xffffffff
mov ebx, dword [esp + 8]
jmp 0x40c4a2
xor ebx, ebx
jmp 0x40c4a6
mov ebx, edi
mov edi, dword [esp + 0x10]
mov dword [esp + 8], ebx
sub edi, ebx
jle 0x40c440
and edi, 3
je 0x40c4da
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 0x40c4c0
mov edi, dword [esp + 0x10]
sub edi, ebx
sub eax, ebx
mov ebp, dword [esp + 0x18]
jmp 0x40c4de
mov edi, dword [esp + 0x10]
mov ebx, dword [esp + 8]
sub ebx, dword [esp + 0x10]
cmp ebx, 0xfffffffc
ja 0x40c440
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, dword [esp + 8]
jg 0x40c4f0
jmp 0x40c440
cmp dword [esp], 0
mov ebx, dword [esp + 0x15c8]
jle 0x40c642
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
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 0x40c642
cmp ebx, 0x20
jge 0x40c5fc
mov eax, dword [esp + ebx*4 + 0x2c]
mov edx, ebx
neg edx
mov ecx, ebx
and edx, 3
je 0x40c5bc
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x30]
inc ecx
mov dword [esp + ebx*4 + 0x2c], eax
dec edx
jne 0x40c5b0
lea edx, [ebx - 0x1d]
cmp edx, 3
jb 0x40c5f8
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x30]
mov dword [esp + ebx*4 + 0x2c], eax
add eax, dword [esp + ecx*4 + 0x34]
mov dword [esp + ebx*4 + 0x2c], eax
add eax, dword [esp + ecx*4 + 0x38]
mov dword [esp + ebx*4 + 0x2c], eax
add eax, dword [esp + ecx*4 + 0x3c]
add ecx, 4
mov dword [esp + ebx*4 + 0x2c], eax
cmp ecx, 0x20
jne 0x40c5d0
test ebx, ebx
jle 0x40c632
lea edx, [ebx + 1]
xor ecx, ecx
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov edi, dword [esp + edx*4 + 0x28]
shl edi, cl
add eax, edi
dec edx
inc ecx
cmp edx, 1
ja 0x40c610
mov edx, 1
mov ecx, ebx
shl edx, cl
cmp eax, edx
jne 0x40c89d
jmp 0x40c642
mov edx, 1
mov ecx, ebx
shl edx, cl
xor eax, eax
jmp 0x40c89d
shl ebp, 5
mov edi, dword [esp + 0xc]
lea eax, [edi + ebp]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.0040cb90
add esp, 0xc
mov eax, dword [esp + 0x24]
add eax, edi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.0040cb90
add esp, 0xc
test ebx, ebx
jle 0x40c74f
add esi, 0xfffffffe
mov eax, 1
add ebp, dword [esp + 0xc]
jmp 0x40c6b3
mov edi, dword [esp]
mov dword [esp], edi
lea ecx, [eax + 1]
cmp eax, ebx
mov eax, ecx
je 0x40c74f
mov ecx, dword [esp + eax*4 + 0x2c]
test ecx, ecx
jle 0x40c6a0
mov edx, ecx
and edx, 3
je 0x40c700
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 0x40c6d0
sub dword [esp], edi
mov ecx, dword [esp + 8]
mov edx, ecx
sub edx, edi
mov ebx, dword [esp + 0x15c8]
jmp 0x40c702
mov edx, ecx
cmp ecx, 4
mov edi, dword [esp]
jb 0x40c6a3
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 0x40c710
jmp 0x40c6a3
mov ecx, dword [esp + 0x15c4]
mov dword [esp + 0x534], 0
cmp ebx, 2
jl 0x40c7bd
lea ecx, [ebx - 1]
cmp ebx, 2
jne 0x40c777
xor eax, eax
mov edx, 2
jmp 0x40c7a4
mov ebx, ecx
and ebx, 0xfffffffe
xor eax, eax
xor edx, edx
add eax, dword [esp + edx*4 + 0x30]
add eax, eax
mov dword [esp + edx*4 + 0x538], eax
add eax, dword [esp + edx*4 + 0x34]
add eax, eax
mov dword [esp + edx*4 + 0x53c], eax
add edx, 2
cmp ebx, edx
jne 0x40c780
add edx, 2
test cl, 1
mov ecx, dword [esp + 0x15c4]
je 0x40c7bd
add eax, dword [esp + edx*4 + 0x28]
add eax, eax
mov dword [esp + edx*4 + 0x530], eax
test ecx, ecx
jle 0x40c892
xor eax, eax
mov edx, dword [esp + 0x1c]
lea esi, [edx + edx*8]
mov edi, esi
shl edi, 5
mov edx, dword [esp + 0xc]
add edi, edx
mov dword [esp + 8], edi
shl esi, 6
add esi, edx
mov dword [esp], esi
jmp 0x40c80b
mov ecx, dword [esp]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15c4]
inc eax
cmp eax, ecx
je 0x40c892
mov edx, dword [esp + 8]
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x40c802
mov edx, dword [esp + ebx*4 + 0x530]
lea ecx, [edx + 1]
mov dword [esp + ebx*4 + 0x530], ecx
xor edi, edi
cmp bl, 4
jb 0x40c86f
mov ebp, ebx
and ebp, 0xfffffffc
xor edi, edi
nop
nop
nop
nop
nop
nop
mov ecx, edx
shr ecx, 2
mov esi, edx
and esi, 1
shl esi, 2
lea esi, [esi + edi*8]
mov edi, edx
and edi, 2
or edi, esi
mov esi, edx
shr esi, 3
and ecx, 1
or ecx, edi
shr edx, 4
and esi, 1
lea edi, [esi + ecx*2]
add ebp, 0xfffffffc
jne 0x40c840
and ebx, 3
je 0x40c7f0
mov ecx, edx
nop
nop
nop
nop
nop
nop
shr ecx, 1
and edx, 1
lea edi, [edx + edi*2]
mov edx, ecx
dec ebx
jne 0x40c880
jmp 0x40c7f0
add esp, 0x15b0
pop esi
pop edi
pop ebx
pop ebp
ret
dec dword [esp + ebx*4 + 0x2c]
mov ecx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x40c8c8
mov edi, dword [esp + ecx*4 + 0x28]
dec ecx
test edi, edi
je 0x40c8b0
dec edi
mov dword [esp + ecx*4 + 0x2c], edi
add dword [esp + ecx*4 + 0x30], 2
dec eax
cmp eax, edx
jne 0x40c89d
jmp 0x40c642