Function at 0x40c150
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15ac
call fcn.0040cb30
mov edi, edx
mov dword [esp + 0x10], ecx
mov ebx, dword [esp + 0x15c4]
mov esi, dword [esp + 0x15c0]
lea eax, [esp + 0x28]
push 0x84
push 0
push eax
call fcn.0040cc50
add esp, 0xc
cmp dword [esp + 0x15c8], 0
mov dword [esp + 0x1c], edi
je 0x40c21e
test esi, esi
mov ecx, esi
jle 0x40c946
xor eax, eax
cmp ecx, 1
je 0x40c1e8
mov ecx, dword [esp + 0x15c0]
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x1c]
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 + 0x28]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x28]
add eax, 2
cmp ecx, eax
jne 0x40c1d0
mov ecx, dword [esp + 0x15c0]
test cl, 1
je 0x40c946
mov ecx, dword [esp + 0x1c]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, dword [esp + 0x10]
movzx eax, byte [eax + ecx + 0x8f12]
mov ecx, dword [esp + 0x15c0]
inc dword [esp + eax*4 + 0x28]
jmp 0x40c946
lea ebp, [edi + edi*8]
mov eax, ebp
shl eax, 6
mov dword [esp + 0x18], eax
test esi, esi
jle 0x40c2f1
cmp esi, 1
jne 0x40c316
xor eax, eax
xor ebx, ebx
mov ecx, dword [esp + 0x15c0]
test cl, 1
je 0x40c279
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x18]
add ecx, edx
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x40c279
mov edx, ebx
mov word [esp + ebx*4 + 0x4ac], cx
mov word [esp + ebx*4 + 0x4ae], ax
inc edx
mov ebx, edx
lea eax, [esp + 0x92c]
push 0x800
push 0
push eax
call fcn.0040cc50
add esp, 0xc
mov eax, ebx
test ebx, ebx
sete byte [esp + 7]
je 0x40c385
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [esp + eax*4 + 0x4ac]
movzx edx, cl
mov esi, dword [esp + edx*4 + 0x92c]
mov edi, esi
and edi, 1
xor esi, 1
lea esi, [esi + edi*2]
mov dword [esp + edx*4 + 0x92c], esi
shr ecx, 8
inc dword [esp + ecx*4 + 0xd2c]
inc eax
cmp ebx, eax
jne 0x40c2b0
mov edx, ebx
mov eax, dword [esp + 0xd2c]
jmp 0x40c38e
lea eax, [esp + 0x92c]
push 0x800
push 0
push eax
call fcn.0040cc50
add esp, 0xc
xor edx, edx
mov byte [esp + 7], 1
xor eax, eax
jmp 0x40c395
mov ecx, esi
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x18]
add edx, eax
add edx, 0x8194
xor eax, eax
xor ebx, ebx
jmp 0x40c34b
add eax, 2
cmp ecx, eax
je 0x40c23f
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x40c366
mov word [esp + ebx*4 + 0x4ac], si
mov word [esp + ebx*4 + 0x4ae], ax
inc ebx
movzx esi, word [edx + eax*2]
test si, si
je 0x40c340
mov word [esp + ebx*4 + 0x4ac], si
lea esi, [eax + 1]
mov word [esp + ebx*4 + 0x4ae], si
inc ebx
jmp 0x40c340
xor edx, edx
mov byte [esp + 7], 1
xor eax, eax
mov ebx, dword [esp + 0x15c4]
xor ecx, ecx
cmp eax, edx
setne cl
inc ecx
mov dword [esp + 0x24], ecx
mov dword [esp], edx
and edx, 0xfffffffe
mov dword [esp + 0xc], edx
lea edi, [esp + 0x4ac]
lea eax, [esp + 0x112c]
xor ecx, ecx
lea esi, [esp + 0x92c]
xor edx, edx
mov dword [esp + 0x20], ebp
jmp 0x40c3ec
inc eax
add ecx, 8
add esi, 0x400
mov edx, eax
mov eax, edi
cmp edx, dword [esp + 0x24]
mov edi, dword [esp + 8]
je 0x40c4fd
mov dword [esp + 0x14], edx
mov dword [esp + 8], eax
mov edx, 3
xor eax, eax
nop
nop
nop
nop
nop
mov dword [esp + edx*4 + 0xa0], eax
add eax, dword [esi + edx*4 - 0xc]
mov dword [esp + edx*4 + 0xa4], eax
add eax, dword [esi + edx*4 - 8]
mov dword [esp + edx*4 + 0xa8], eax
add eax, dword [esi + edx*4 - 4]
mov dword [esp + edx*4 + 0xac], eax
add eax, dword [esi + edx*4]
add edx, 4
cmp edx, 0x103
jne 0x40c400
cmp byte [esp + 7], 0
mov eax, dword [esp + 0x14]
jne 0x40c3d0
xor edx, edx
cmp dword [esp], 1
mov ebp, edi
je 0x40c4aa
xor edx, edx
nop
nop
nop
movzx eax, word [ebp + edx*4]
shr eax, cl
movzx eax, al
mov edi, ebp
mov ebp, dword [esp + eax*4 + 0xac]
lea ebx, [ebp + 1]
mov dword [esp + eax*4 + 0xac], ebx
mov eax, dword [edi + edx*4]
mov ebx, dword [esp + 8]
mov dword [ebx + ebp*4], eax
movzx eax, word [edi + edx*4 + 4]
shr eax, cl
movzx eax, al
mov ebx, dword [esp + eax*4 + 0xac]
lea ebp, [ebx + 1]
mov dword [esp + eax*4 + 0xac], ebp
mov ebp, edi
mov eax, dword [edi + edx*4 + 4]
mov edi, dword [esp + 8]
mov dword [edi + ebx*4], eax
mov edi, dword [esp + 0xc]
add edx, 2
cmp edi, edx
jne 0x40c450
test byte [esp], 1
mov ebx, dword [esp + 0x15c4]
mov edi, ebp
mov ebp, dword [esp + 0x20]
mov eax, dword [esp + 0x14]
je 0x40c3d0
movzx eax, word [edi + edx*4]
shr eax, cl
movzx eax, al
mov ebx, dword [esp + eax*4 + 0xac]
lea ebp, [ebx + 1]
mov dword [esp + eax*4 + 0xac], ebp
mov ebp, dword [esp + 0x20]
mov eax, dword [edi + edx*4]
mov edx, dword [esp + 8]
mov dword [edx + ebx*4], eax
mov eax, dword [esp + 0x14]
mov ebx, dword [esp + 0x15c4]
jmp 0x40c3d0
cmp dword [esp], 0
je 0x40c83a
mov ecx, dword [esp]
cmp ecx, 1
jne 0x40c519
mov word [edi], 1
jmp 0x40c73c
movzx eax, word [edi + 4]
add word [edi], ax
cmp ecx, 3
jl 0x40c5b9
mov eax, 2
mov edx, 2
sub edx, ecx
mov dword [esp + 0xc], edx
xor edx, edx
mov esi, 1
jmp 0x40c566
movzx ebx, word [edi + eax*4]
inc eax
add word [edi + esi*4], bx
mov ecx, dword [esp + 0xc]
add ecx, esi
inc ecx
inc esi
cmp ecx, 1
je 0x40c5c5
movzx ecx, word [edi + edx*4]
cmp eax, dword [esp]
jge 0x40c578
movzx ebx, word [edi + eax*4]
cmp cx, bx
jae 0x40c5a0
mov word [edi + esi*4], cx
mov word [edi + edx*4], si
inc edx
cmp eax, dword [esp]
jge 0x40c5aa
cmp edx, esi
jge 0x40c550
movzx ecx, word [edi + edx*4]
movzx ebx, word [edi + eax*4]
cmp cx, bx
jae 0x40c554
jmp 0x40c5ae
inc eax
mov word [edi + esi*4], bx
cmp eax, dword [esp]
jl 0x40c586
movzx ecx, word [edi + edx*4]
add word [edi + esi*4], cx
mov word [edi + edx*4], si
inc edx
jmp 0x40c559
lea eax, [ecx - 2]
mov word [edi + ecx*4 - 8], 0
jmp 0x40c644
mov eax, dword [esp]
mov word [edi + eax*4 - 8], 0
lea edx, [eax - 3]
and eax, 3
xor eax, 2
mov ecx, edx
je 0x40c5f1
mov ecx, edx
nop
nop
movzx esi, word [edi + ecx*4]
movzx esi, word [edi + esi*4]
inc esi
mov word [edi + ecx*4], si
dec ecx
dec eax
jne 0x40c5e0
mov eax, dword [esp]
add eax, 0xfffffffe
cmp edx, 3
jb 0x40c641
inc ecx
nop
nop
nop
movzx edx, word [edi + ecx*4 - 4]
movzx edx, word [edi + edx*4]
inc edx
mov word [edi + ecx*4 - 4], dx
movzx edx, word [edi + ecx*4 - 8]
movzx edx, word [edi + edx*4]
inc edx
mov word [edi + ecx*4 - 8], dx
movzx edx, word [edi + ecx*4 - 0xc]
movzx edx, word [edi + edx*4]
inc edx
mov word [edi + ecx*4 - 0xc], dx
movzx edx, word [edi + ecx*4 - 0x10]
movzx edx, word [edi + edx*4]
inc edx
mov word [edi + ecx*4 - 0x10], dx
add ecx, 0xfffffffc
jne 0x40c600
mov ecx, dword [esp]
dec ecx
mov dword [esp + 0xc], 1
xor edx, edx
jmp 0x40c67d
mov ebx, esi
mov esi, edi
lea edi, [ebx + ebx]
mov dword [esp + 0xc], edi
inc edx
test ebx, ebx
mov edi, esi
mov ebx, dword [esp + 0x15c4]
je 0x40c732
test eax, eax
js 0x40c6b0
lea esi, [eax + 1]
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov ebx, esi
mov esi, dword [esp + 8]
movzx esi, word [esi + eax*4]
cmp edx, esi
jne 0x40c6c0
inc edi
dec eax
mov esi, ebx
cmp ebx, edi
jne 0x40c690
mov eax, 0xffffffff
jmp 0x40c6c2
xor esi, esi
jmp 0x40c6c6
mov esi, edi
mov edi, dword [esp + 8]
mov ebx, dword [esp + 0xc]
sub ebx, esi
jle 0x40c660
and ebx, 3
je 0x40c6f9
mov dword [esp + 0x14], esi
lea edi, [edi + ecx*4]
xor esi, esi
nop
nop
nop
nop
mov word [edi], dx
inc esi
add edi, 0xfffffffc
cmp ebx, esi
jne 0x40c6e0
mov edi, dword [esp + 0xc]
sub edi, esi
sub ecx, esi
mov esi, dword [esp + 0x14]
jmp 0x40c6fd
mov edi, dword [esp + 0xc]
mov ebx, esi
sub esi, dword [esp + 0xc]
cmp esi, 0xfffffffc
mov esi, dword [esp + 8]
ja 0x40c664
mov word [esi + ecx*4], dx
mov word [esi + ecx*4 - 4], dx
mov word [esi + ecx*4 - 8], dx
mov word [esi + ecx*4 - 0xc], dx
add edi, 0xfffffffc
add ecx, 0xfffffffc
cmp edi, ebx
jg 0x40c710
jmp 0x40c664
cmp dword [esp], 0
jle 0x40c83a
xor eax, eax
mov edx, dword [esp]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [edi + eax*4]
inc dword [esp + ecx*4 + 0x28]
mov ecx, eax
and ecx, 1
xor eax, 1
lea eax, [eax + ecx*2]
cmp eax, edx
jl 0x40c750
cmp edx, 2
jl 0x40c83a
cmp ebx, 0x20
jge 0x40c7e0
mov eax, dword [esp + ebx*4 + 0x28]
mov edx, ebx
neg edx
mov ecx, ebx
and edx, 3
je 0x40c79c
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x2c]
inc ecx
mov dword [esp + ebx*4 + 0x28], eax
dec edx
jne 0x40c790
lea edx, [ebx - 0x1d]
cmp edx, 3
jb 0x40c7d8
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x2c]
mov dword [esp + ebx*4 + 0x28], eax
add eax, dword [esp + ecx*4 + 0x30]
mov dword [esp + ebx*4 + 0x28], eax
add eax, dword [esp + ecx*4 + 0x34]
mov dword [esp + ebx*4 + 0x28], eax
add eax, dword [esp + ecx*4 + 0x38]
add ecx, 4
mov dword [esp + ebx*4 + 0x28], eax
cmp ecx, 0x20
jne 0x40c7b0
test ebx, ebx
jle 0x40ca8d
mov edx, ebx
not edx
xor eax, eax
mov esi, ebx
nop
nop
nop
nop
nop
nop
nop
nop
mov dword [esp + 0xc], eax
mov edi, dword [esp + esi*4 + 0x28]
mov ebx, esi
mov eax, dword [esp + 0x15c4]
xor ebx, eax
mov ecx, edx
and ecx, eax
mov eax, dword [esp + 0xc]
add ecx, ecx
sub ecx, ebx
shl edi, cl
add eax, edi
lea ecx, [esi - 1]
inc edx
cmp esi, 1
mov esi, ecx
ja 0x40c7f0
mov edx, 1
mov ecx, dword [esp + 0x15c4]
shl edx, cl
cmp eax, edx
mov ebx, ecx
mov edi, dword [esp + 8]
jne 0x40cab3
shl ebp, 5
mov esi, dword [esp + 0x10]
lea eax, [esi + ebp]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.0040cc50
add esp, 0xc
mov eax, dword [esp + 0x18]
add eax, esi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.0040cc50
add esp, 0xc
test ebx, ebx
jle 0x40c93f
add edi, 0xfffffffe
mov eax, 1
add ebp, dword [esp + 0x10]
mov dword [esp + 8], edi
jmp 0x40c8a3
mov esi, dword [esp]
mov dword [esp], esi
lea ecx, [eax + 1]
cmp eax, ebx
mov eax, ecx
je 0x40c93f
mov ecx, dword [esp + eax*4 + 0x28]
test ecx, ecx
jle 0x40c890
mov edx, ecx
and edx, 3
je 0x40c8f0
mov esi, dword [esp]
lea edi, [edi + esi*4]
xor esi, esi
nop
nop
nop
nop
nop
nop
movzx ebx, word [edi]
mov byte [ebx + ebp + 0x8f12], al
inc esi
add edi, 0xfffffffc
cmp edx, esi
jne 0x40c8c0
sub dword [esp], esi
mov edx, ecx
sub edx, esi
mov ebx, dword [esp + 0x15c4]
mov edi, dword [esp + 8]
jmp 0x40c8f2
mov edx, ecx
cmp ecx, 4
mov esi, dword [esp]
jb 0x40c893
dec edx
nop
nop
nop
nop
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 0x40c900
jmp 0x40c893
mov ecx, dword [esp + 0x15c0]
mov dword [esp + 0x930], 0
cmp ebx, 2
jl 0x40c9ad
lea ecx, [ebx - 1]
cmp ebx, 2
jne 0x40c967
xor eax, eax
mov edx, 2
jmp 0x40c994
mov ebx, ecx
and ebx, 0xfffffffe
xor eax, eax
xor edx, edx
add eax, dword [esp + edx*4 + 0x2c]
add eax, eax
mov dword [esp + edx*4 + 0x934], eax
add eax, dword [esp + edx*4 + 0x30]
add eax, eax
mov dword [esp + edx*4 + 0x938], eax
add edx, 2
cmp ebx, edx
jne 0x40c970
add edx, 2
test cl, 1
mov ecx, dword [esp + 0x15c0]
je 0x40c9ad
add eax, dword [esp + edx*4 + 0x24]
add eax, eax
mov dword [esp + edx*4 + 0x92c], eax
test ecx, ecx
jle 0x40ca82
xor eax, eax
mov edx, dword [esp + 0x1c]
lea edi, [edx + edx*8]
mov edx, edi
shl edx, 5
mov esi, dword [esp + 0x10]
add edx, esi
shl edi, 6
add edi, esi
mov dword [esp + 8], edi
jmp 0x40c9fc
mov ecx, dword [esp + 8]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15c0]
inc eax
cmp eax, ecx
je 0x40ca82
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x40c9f3
mov ecx, dword [esp + ebx*4 + 0x92c]
lea edi, [ecx + 1]
mov dword [esp + ebx*4 + 0x92c], edi
xor edi, edi
cmp bl, 4
jb 0x40ca5f
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 0x40ca30
and ebx, 3
je 0x40c9e0
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 0x40ca70
jmp 0x40c9e0
add esp, 0x15ac
pop esi
pop edi
pop ebx
pop ebp
ret
mov edx, 1
mov ecx, ebx
shl edx, cl
xor eax, eax
jmp 0x40cab3
dec esi
mov dword [esp + ecx*4 + 0x28], esi
add dword [esp + ecx*4 + 0x2c], 2
dec eax
cmp eax, edx
je 0x40c83a
dec dword [esp + ebx*4 + 0x28]
mov ecx, ebx
nop
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x40caaa
mov esi, dword [esp + ecx*4 + 0x24]
dec ecx
test esi, esi
je 0x40cac0
jmp 0x40caa0