Function at 0x40bc40
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15a8
call fcn.0040c780
mov ebx, edx
mov edi, ecx
mov esi, dword [esp + 0x15bc]
lea eax, [esp + 0x24]
push 0x84
push 0
push eax
call fcn.0040c8a0
add esp, 0xc
cmp dword [esp + 0x15c4], 0
je 0x40bcf8
test esi, esi
mov ecx, esi
jle 0x40c4ae
xor eax, eax
cmp ecx, 1
je 0x40bcc8
mov ecx, dword [esp + 0x15bc]
and ecx, 0x7ffffffe
lea eax, [ebx + ebx*8]
shl eax, 5
lea edx, [eax + edi]
add edx, 0x8f13
xor eax, eax
nop
nop
nop
nop
nop
nop
movzx esi, byte [edx + eax - 1]
inc dword [esp + esi*4 + 0x24]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x24]
add eax, 2
cmp ecx, eax
jne 0x40bcb0
mov ecx, dword [esp + 0x15bc]
test cl, 1
je 0x40c4ae
lea ecx, [ebx + ebx*8]
shl ecx, 5
add ecx, edi
movzx eax, byte [eax + ecx + 0x8f12]
mov ecx, dword [esp + 0x15bc]
inc dword [esp + eax*4 + 0x24]
jmp 0x40c4ae
lea eax, [ebx + ebx*8]
mov edx, eax
shl edx, 6
test esi, esi
mov dword [esp + 8], edi
mov dword [esp + 0x14], ebx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], edx
jle 0x40bdfd
cmp esi, 1
jne 0x40c62d
xor eax, eax
xor ebx, ebx
mov ecx, dword [esp + 0x15bc]
test cl, 1
je 0x40bd5b
mov ecx, dword [esp + 8]
mov edx, dword [esp + 0x18]
add ecx, edx
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x40bd5b
mov word [esp + ebx*4 + 0x4a8], cx
mov word [esp + ebx*4 + 0x4aa], ax
inc ebx
lea eax, [esp + 0x928]
push 0x800
push 0
push eax
call fcn.0040c8a0
add esp, 0xc
test ebx, ebx
sete byte [esp]
je 0x40be14
xor eax, eax
cmp ebx, 1
je 0x40bdcf
mov edx, ebx
and edx, 0xfffffffe
xor eax, eax
nop
nop
nop
nop
movzx ecx, word [esp + eax*4 + 0x4a8]
movzx esi, cl
inc dword [esp + esi*4 + 0x928]
shr ecx, 8
inc dword [esp + ecx*4 + 0xd28]
movzx ecx, word [esp + eax*4 + 0x4ac]
movzx esi, cl
inc dword [esp + esi*4 + 0x928]
shr ecx, 8
inc dword [esp + ecx*4 + 0xd28]
add eax, 2
cmp edx, eax
jne 0x40bd90
test bl, 1
je 0x40bdf0
movzx eax, word [esp + eax*4 + 0x4a8]
movzx ecx, al
inc dword [esp + ecx*4 + 0x928]
shr eax, 8
inc dword [esp + eax*4 + 0xd28]
mov eax, dword [esp + 0xd28]
mov dword [esp + 4], eax
jmp 0x40be22
lea eax, [esp + 0x928]
push 0x800
push 0
push eax
call fcn.0040c8a0
add esp, 0xc
xor ebx, ebx
mov byte [esp], 1
mov dword [esp + 4], 0
lea eax, [ebx - 1]
mov dword [esp + 0x10], eax
xor edx, edx
mov ecx, 3
mov dword [esp + ecx*4 + 0x9c], edx
add edx, dword [esp + ecx*4 + 0x91c]
mov dword [esp + ecx*4 + 0xa0], edx
add edx, dword [esp + ecx*4 + 0x920]
mov dword [esp + ecx*4 + 0xa4], edx
add edx, dword [esp + ecx*4 + 0x924]
mov dword [esp + ecx*4 + 0xa8], edx
add edx, dword [esp + ecx*4 + 0x928]
add ecx, 4
cmp ecx, 0x103
jne 0x40be30
cmp byte [esp], 0
jne 0x40bf11
cmp dword [esp + 0x10], 0
je 0x40c695
mov ecx, ebx
and ecx, 0xfffffffe
xor edx, edx
nop
movzx esi, byte [esp + edx*4 + 0x4a8]
mov edi, dword [esp + esi*4 + 0xa8]
lea ebp, [edi + 1]
mov dword [esp + esi*4 + 0xa8], ebp
mov esi, dword [esp + edx*4 + 0x4a8]
mov ebp, dword [esp + edx*4 + 0x4ac]
mov dword [esp + edi*4 + 0x1128], esi
movzx esi, byte [esp + edx*4 + 0x4ac]
mov edi, dword [esp + esi*4 + 0xa8]
lea eax, [edi + 1]
mov dword [esp + esi*4 + 0xa8], eax
mov dword [esp + edi*4 + 0x1128], ebp
add edx, 2
cmp ecx, edx
jne 0x40be90
test bl, 1
je 0x40bf11
movzx eax, byte [esp + edx*4 + 0x4a8]
mov ecx, dword [esp + eax*4 + 0xa8]
lea esi, [ecx + 1]
mov dword [esp + eax*4 + 0xa8], esi
mov eax, dword [esp + edx*4 + 0x4a8]
mov dword [esp + ecx*4 + 0x1128], eax
cmp dword [esp + 4], ebx
jne 0x40bf2b
lea edi, [esp + 0x1128]
test ebx, ebx
jne 0x40c039
jmp 0x40c368
xor eax, eax
mov ecx, 3
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov dword [esp + ecx*4 + 0x9c], eax
add eax, dword [esp + ecx*4 + 0xd1c]
mov dword [esp + ecx*4 + 0xa0], eax
add eax, dword [esp + ecx*4 + 0xd20]
mov dword [esp + ecx*4 + 0xa4], eax
add eax, dword [esp + ecx*4 + 0xd24]
mov dword [esp + ecx*4 + 0xa8], eax
add eax, dword [esp + ecx*4 + 0xd28]
add ecx, 4
cmp ecx, 0x103
jne 0x40bf40
cmp byte [esp], 0
jne 0x40c02a
cmp dword [esp + 0x10], 0
je 0x40c6a5
mov ecx, ebx
and ecx, 0xfffffffe
xor eax, eax
nop
movzx edx, word [esp + eax*4 + 0x1128]
movzx edx, dh
mov esi, dword [esp + edx*4 + 0xa8]
lea edi, [esi + 1]
mov dword [esp + edx*4 + 0xa8], edi
mov edx, dword [esp + eax*4 + 0x1128]
mov edi, dword [esp + eax*4 + 0x112c]
mov dword [esp + esi*4 + 0x4a8], edx
movzx edx, word [esp + eax*4 + 0x112c]
movzx edx, dh
mov esi, dword [esp + edx*4 + 0xa8]
lea ebp, [esi + 1]
mov dword [esp + edx*4 + 0xa8], ebp
mov dword [esp + esi*4 + 0x4a8], edi
add eax, 2
cmp ecx, eax
jne 0x40bfa0
test bl, 1
je 0x40c02a
movzx ecx, word [esp + eax*4 + 0x1128]
movzx ecx, ch
mov edx, dword [esp + ecx*4 + 0xa8]
lea esi, [edx + 1]
mov dword [esp + ecx*4 + 0xa8], esi
mov eax, dword [esp + eax*4 + 0x1128]
mov dword [esp + edx*4 + 0x4a8], eax
lea edi, [esp + 0x4a8]
test ebx, ebx
je 0x40c368
cmp ebx, 1
jne 0x40c048
mov word [edi], 1
jmp 0x40c25a
movzx eax, word [edi + 4]
add word [edi], ax
mov eax, ebx
xor eax, 1
mov ebp, ebx
and ebp, 0xfffffffe
add ebp, ebp
sub ebp, eax
cmp ebp, 2
jl 0x40c0eb
xor eax, eax
mov edx, 2
mov esi, 1
mov dword [esp + 0xc], ebp
jmp 0x40c096
movzx ebp, word [edi + eax*4]
add word [edi + esi*4], bp
mov word [edi + eax*4], si
inc eax
inc esi
mov ebp, dword [esp + 0xc]
cmp ebp, esi
je 0x40c0eb
movzx ecx, word [edi + eax*4]
cmp edx, ebx
jge 0x40c0a7
movzx ebp, word [edi + edx*4]
cmp cx, bp
jae 0x40c0c0
mov word [edi + esi*4], cx
mov word [edi + eax*4], si
inc eax
cmp edx, ebx
jge 0x40c080
jmp 0x40c0c9
inc edx
mov word [edi + esi*4], bp
cmp edx, ebx
jge 0x40c080
cmp eax, esi
jge 0x40c0e0
movzx ebp, word [edi + eax*4]
movzx ecx, word [edi + edx*4]
cmp bp, cx
jb 0x40c084
jmp 0x40c0e4
movzx ecx, word [edi + edx*4]
inc edx
add word [edi + esi*4], cx
jmp 0x40c08d
mov word [edi + ebx*4 - 8], 0
cmp ebx, 3
jl 0x40c171
lea edx, [ebx - 3]
mov esi, ebx
and esi, 3
xor esi, 2
mov eax, edx
je 0x40c121
mov eax, edx
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [edi + eax*4]
movzx ecx, word [edi + ecx*4]
inc ecx
mov word [edi + eax*4], cx
dec eax
dec esi
jne 0x40c110
cmp edx, 3
jb 0x40c171
inc eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [edi + eax*4 - 4]
movzx ecx, word [edi + ecx*4]
inc ecx
mov word [edi + eax*4 - 4], cx
movzx ecx, word [edi + eax*4 - 8]
movzx ecx, word [edi + ecx*4]
inc ecx
mov word [edi + eax*4 - 8], cx
movzx ecx, word [edi + eax*4 - 0xc]
movzx ecx, word [edi + ecx*4]
inc ecx
mov word [edi + eax*4 - 0xc], cx
movzx ecx, word [edi + eax*4 - 0x10]
movzx ecx, word [edi + ecx*4]
inc ecx
mov word [edi + eax*4 - 0x10], cx
add eax, 0xfffffffc
jne 0x40c130
lea edx, [ebx - 2]
mov esi, 1
xor eax, eax
mov dword [esp], edi
jmp 0x40c18c
lea esi, [ecx + ecx]
inc eax
test ecx, ecx
je 0x40c252
test edx, edx
mov dword [esp + 4], esi
js 0x40c1c0
lea ecx, [edx + 1]
xor esi, esi
nop
nop
nop
nop
nop
nop
nop
mov edi, ecx
mov ecx, dword [esp]
movzx ecx, word [ecx + edx*4]
cmp eax, ecx
jne 0x40c1d0
inc esi
dec edx
mov ecx, edi
cmp edi, esi
jne 0x40c1a0
mov edx, 0xffffffff
jmp 0x40c1d2
xor ecx, ecx
sub esi, ecx
jle 0x40c180
jmp 0x40c1dd
mov ecx, esi
mov edi, dword [esp]
mov esi, dword [esp + 4]
sub esi, ecx
jle 0x40c180
and esi, 3
je 0x40c20f
mov dword [esp + 0x20], ecx
mov dword [esp + 0xc], ebp
lea ecx, [edi + ebp*4]
xor ebp, ebp
nop
mov word [ecx], ax
inc ebp
add ecx, 0xfffffffc
cmp esi, ebp
jne 0x40c1f0
mov esi, dword [esp + 4]
sub esi, ebp
mov ecx, dword [esp + 0xc]
sub ecx, ebp
mov ebp, ecx
mov ecx, dword [esp + 0x20]
jmp 0x40c213
mov esi, dword [esp + 4]
mov edi, ecx
sub ecx, dword [esp + 4]
cmp ecx, 0xfffffffc
mov ecx, edi
mov edi, dword [esp]
ja 0x40c180
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [edi + ebp*4], ax
mov word [edi + ebp*4 - 4], ax
mov word [edi + ebp*4 - 8], ax
mov word [edi + ebp*4 - 0xc], ax
add ebp, 0xfffffffc
add esi, 0xfffffffc
cmp esi, ecx
jg 0x40c230
jmp 0x40c180
test ebx, ebx
jle 0x40c368
mov eax, ebx
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x10], 3
jb 0x40c29a
mov edx, ebx
and edx, 0xfffffffc
xor ecx, ecx
nop
movzx esi, word [edi + ecx*4]
inc dword [esp + esi*4 + 0x24]
movzx esi, word [edi + ecx*4 + 4]
inc dword [esp + esi*4 + 0x24]
movzx esi, word [edi + ecx*4 + 8]
inc dword [esp + esi*4 + 0x24]
movzx esi, word [edi + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x24]
add ecx, 4
cmp edx, ecx
jne 0x40c270
test eax, eax
je 0x40c2bd
lea ecx, [edi + ecx*4]
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ecx + edx*4]
inc dword [esp + esi*4 + 0x24]
inc edx
cmp eax, edx
jne 0x40c2b0
cmp ebx, 2
jl 0x40c368
mov ecx, dword [esp + 0x15c0]
cmp ecx, 0x20
jge 0x40c334
mov eax, ecx
mov ecx, dword [esp + ecx*4 + 0x24]
mov ebp, eax
test al, 1
je 0x40c2f0
inc eax
mov edx, dword [esp + ebp*4 + 0x28]
mov esi, edx
and esi, ecx
xor edx, ecx
lea ecx, [edx + esi*2]
mov dword [esp + ebp*4 + 0x24], ecx
cmp ebp, 0x1f
je 0x40c32a
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov edx, dword [esp + eax*4 + 0x28]
mov esi, edx
and esi, ecx
xor edx, ecx
lea ecx, [edx + esi*2]
mov dword [esp + ebp*4 + 0x24], ecx
mov edx, dword [esp + eax*4 + 0x2c]
add eax, 2
mov esi, edx
and esi, ecx
xor edx, ecx
lea ecx, [edx + esi*2]
mov dword [esp + ebp*4 + 0x24], ecx
cmp eax, 0x20
jne 0x40c300
test ebp, ebp
mov ecx, ebp
jle 0x40c6b5
lea edx, [ecx + 1]
xor ecx, ecx
xor eax, eax
nop
nop
nop
nop
nop
mov esi, dword [esp + edx*4 + 0x20]
shl esi, cl
add eax, esi
dec edx
inc ecx
cmp edx, 1
ja 0x40c340
mov edx, 1
mov ecx, dword [esp + 0x15c0]
shl edx, cl
mov dword [esp], edx
cmp eax, edx
jne 0x40c6c1
mov ebp, dword [esp + 0x1c]
shl ebp, 5
mov esi, dword [esp + 8]
lea eax, [esi + ebp]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.0040c8a0
add esp, 0xc
mov eax, dword [esp + 0x18]
add eax, esi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.0040c8a0
add esp, 0xc
cmp dword [esp + 0x15c0], 0
jle 0x40c49f
mov edx, ebp
mov eax, dword [esp + 0x15c0]
lea ebp, [eax + 1]
cmp ebp, 3
jge 0x40c3ca
mov ebp, 2
add edi, 0xfffffffe
mov ecx, 1
add edx, dword [esp + 8]
mov dword [esp], edi
mov dword [esp + 0xc], ebp
jmp 0x40c3e9
inc ecx
cmp ecx, ebp
je 0x40c49f
mov eax, dword [esp + ecx*4 + 0x24]
test eax, eax
jle 0x40c3e0
mov esi, eax
and esi, 3
je 0x40c450
mov dword [esp + 4], eax
lea ebp, [edi + ebx*4]
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov edi, edx
movzx edx, word [ebp]
mov byte [edx + edi + 0x8f12], cl
mov edx, edi
inc eax
add ebp, 0xfffffffc
cmp esi, eax
jne 0x40c410
sub ebx, eax
mov edi, dword [esp + 4]
mov esi, edi
sub esi, eax
mov eax, edi
mov edi, dword [esp]
mov ebp, dword [esp + 0xc]
cmp eax, 4
jb 0x40c3e0
jmp 0x40c457
mov esi, eax
cmp eax, 4
jb 0x40c3e0
dec esi
nop
nop
nop
nop
nop
nop
nop
nop
movzx eax, word [edi + ebx*4]
mov byte [eax + edx + 0x8f12], cl
movzx eax, word [edi + ebx*4 - 4]
mov byte [eax + edx + 0x8f12], cl
movzx eax, word [edi + ebx*4 - 8]
mov byte [eax + edx + 0x8f12], cl
movzx eax, word [edi + ebx*4 - 0xc]
add ebx, 0xfffffffc
mov byte [eax + edx + 0x8f12], cl
add esi, 0xfffffffc
cmp esi, 0xfffffffe
jb 0x40c460
jmp 0x40c3e0
mov ecx, dword [esp + 0x15bc]
mov edi, dword [esp + 8]
mov ebx, dword [esp + 0x14]
mov dword [esp + 0x92c], 0
mov eax, dword [esp + 0x15c0]
cmp eax, 2
jl 0x40c557
lea ecx, [eax - 1]
cmp eax, 2
jne 0x40c4da
xor edx, edx
mov eax, 2
jmp 0x40c52e
mov dword [esp + 0x14], ebx
mov dword [esp + 8], edi
mov ebx, ecx
and ebx, 0xfffffffe
xor edx, edx
xor eax, eax
nop
nop
nop
nop
nop
mov edi, dword [esp + eax*4 + 0x28]
mov esi, dword [esp + eax*4 + 0x2c]
mov ebp, edi
and ebp, edx
xor edi, edx
add edi, edi
lea edx, [edi + ebp*4]
mov dword [esp + eax*4 + 0x930], edx
mov edi, esi
and edi, edx
xor esi, edx
add esi, esi
lea edx, [esi + edi*4]
mov dword [esp + eax*4 + 0x934], edx
add eax, 2
cmp ebx, eax
jne 0x40c4f0
add eax, 2
mov edi, dword [esp + 8]
mov ebx, dword [esp + 0x14]
test cl, 1
mov ecx, dword [esp + 0x15bc]
je 0x40c557
mov ecx, dword [esp + eax*4 + 0x20]
mov esi, ecx
and esi, edx
xor ecx, edx
add ecx, ecx
lea ecx, [ecx + esi*4]
mov dword [esp + eax*4 + 0x928], ecx
mov ecx, dword [esp + 0x15bc]
test ecx, ecx
jle 0x40c622
xor eax, eax
lea esi, [ebx + ebx*8]
mov edx, esi
shl edx, 5
add edx, edi
shl esi, 6
add esi, edi
mov dword [esp], esi
jmp 0x40c59b
mov ecx, dword [esp]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15bc]
inc eax
cmp eax, ecx
je 0x40c622
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x40c592
mov ecx, dword [esp + ebx*4 + 0x928]
lea edi, [ecx + 1]
mov dword [esp + ebx*4 + 0x928], edi
xor edi, edi
cmp bl, 4
jb 0x40c5ff
mov ebp, ebx
and ebp, 0xfffffffc
xor edi, edi
nop
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 0x40c5d0
and ebx, 3
je 0x40c580
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 0x40c610
jmp 0x40c580
add esp, 0x15a8
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, esi
and ecx, 0x7ffffffe
add edx, edi
add edx, 0x8194
xor eax, eax
xor ebx, ebx
jmp 0x40c65b
add eax, 2
cmp ecx, eax
je 0x40bd25
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x40c676
mov word [esp + ebx*4 + 0x4a8], si
mov word [esp + ebx*4 + 0x4aa], ax
inc ebx
movzx esi, word [edx + eax*2]
test si, si
je 0x40c650
mov word [esp + ebx*4 + 0x4a8], si
lea esi, [eax + 1]
mov word [esp + ebx*4 + 0x4aa], si
inc ebx
jmp 0x40c650
xor edx, edx
test bl, 1
jne 0x40beea
jmp 0x40bf11
xor eax, eax
test bl, 1
jne 0x40c000
jmp 0x40c02a
mov eax, 1
shl eax, cl
mov dword [esp], eax
xor eax, eax
mov ecx, dword [esp + 0x15c0]
add ecx, ecx
jmp 0x40c6ef
dec ebp
mov dword [esp + esi*2 + 0x24], ebp
and esi, 2
xor edx, 1
lea edx, [esp + edx*4]
add edx, 0x24
add dword [edx + esi*4], 2
dec eax
cmp eax, dword [esp]
je 0x40c368
mov edx, dword [esp + 0x15c0]
dec dword [esp + edx*4 + 0x24]
mov esi, ecx
nop
nop
nop
nop
cmp edx, 2
jl 0x40c6e5
dec edx
mov ebp, dword [esp + esi*2 + 0x20]
add esi, 0xfffffffe
test ebp, ebp
je 0x40c700
jmp 0x40c6d0