Function at 0x40bfd0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b0
call fcn.0040ca30
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.0040cb50
add esp, 0xc
cmp dword [esp + 0x15cc], 0
mov dword [esp + 0x18], edi
je 0x40c0a7
test esi, esi
jle 0x40c83f
xor eax, eax
cmp dword [esp + 0x15c4], 1
je 0x40c078
mov ecx, dword [esp + 0x15c4]
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x18]
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]
inc dword [esp + esi*4 + 0x2c]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x2c]
add eax, 2
cmp ecx, eax
jne 0x40c060
mov ecx, dword [esp + 0x15c4]
test cl, 1
je 0x40c83f
mov ecx, dword [esp + 0x18]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, dword [esp + 0xc]
movzx eax, byte [eax + ecx + 0x8f12]
inc dword [esp + eax*4 + 0x2c]
jmp 0x40c83f
lea eax, [edi + edi*8]
mov dword [esp + 0x20], eax
mov ebp, eax
shl ebp, 6
test esi, esi
jle 0x40c1ab
cmp esi, 1
jne 0x40c3d6
xor eax, eax
xor edi, edi
mov ecx, dword [esp + 0x15c4]
test cl, 1
je 0x40c108
mov ecx, dword [esp + 0xc]
add ecx, ebp
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x40c108
mov edx, edi
mov word [esp + edi*4 + 0xb0], cx
mov ecx, edi
mov word [esp + edi*4 + 0xb2], ax
mov eax, edi
and eax, 1
xor ecx, 1
lea edi, [ecx + eax*2]
lea eax, [esp + 0x530]
push 0x800
push 0
push eax
call fcn.0040cb50
add esp, 0xc
test edi, edi
sete byte [esp + 3]
je 0x40c1c2
mov ecx, edi
xor eax, eax
cmp edi, 1
je 0x40c17f
mov ecx, edi
and ecx, 0xfffffffe
xor eax, eax
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 0x40c140
mov edx, edi
test dl, 1
je 0x40c1a2
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 0x40c1cb
lea eax, [esp + 0x530]
push 0x800
push 0
push eax
call fcn.0040cb50
add esp, 0xc
xor edx, edx
mov byte [esp + 3], 1
xor eax, eax
mov dword [esp + 0x24], ebp
xor ecx, ecx
cmp eax, edx
setne cl
inc ecx
mov dword [esp + 0x28], ecx
lea eax, [edx - 1]
mov dword [esp + 0x1c], eax
mov dword [esp + 4], edx
and edx, 0xfffffffe
lea eax, [esp + 0xb0]
mov dword [esp + 0x14], eax
lea eax, [esp + 0x1130]
xor ecx, ecx
xor edi, edi
mov dword [esp + 8], edx
jmp 0x40c224
mov edi, dword [esp + 0x10]
inc edi
add ecx, 8
mov eax, esi
cmp edi, dword [esp + 0x28]
je 0x40c310
mov esi, dword [esp + 0x14]
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], edi
mov eax, edi
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 0x40c240
cmp byte [esp + 3], 0
jne 0x40c210
cmp dword [esp + 0x1c], 0
je 0x40c2da
xor eax, eax
mov edi, dword [esp + 0x14]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [esi + 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 [esi + eax*4]
mov dword [edi + ebx*4], edx
movzx edx, word [esi + 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 [esi + eax*4 + 4]
mov dword [edi + ebx*4], edx
mov edx, dword [esp + 8]
add eax, 2
cmp edx, eax
jne 0x40c280
test byte [esp + 4], 1
je 0x40c210
jmp 0x40c2e7
xor eax, eax
test byte [esp + 4], 1
je 0x40c210
movzx edx, word [esi + 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 [esi + eax*4]
mov edi, dword [esp + 0x14]
mov dword [edi + ebx*4], eax
jmp 0x40c210
cmp dword [esp + 4], 0
mov ebx, dword [esp + 0x15c8]
mov ebp, dword [esp + 0x20]
mov edi, dword [esp + 0x14]
je 0x40c712
mov edx, dword [esp + 4]
cmp edx, 1
jne 0x40c33d
mov word [edi], 1
jmp 0x40c5f4
movzx eax, word [edi + 4]
add word [edi], ax
cmp edx, 3
jl 0x40c45d
mov eax, 2
mov ecx, 2
sub ecx, edx
xor edx, edx
mov esi, 1
jmp 0x40c383
inc eax
add word [edi + esi*4], bx
lea ebx, [ecx + esi]
inc ebx
inc esi
cmp ebx, 1
je 0x40c469
cmp eax, dword [esp + 4]
jge 0x40c3b0
movzx ebp, word [edi + eax*4]
movzx ebx, word [edi + edx*4]
cmp bx, bp
jb 0x40c3b4
inc eax
mov word [edi + esi*4], bp
cmp eax, dword [esp + 4]
jl 0x40c3c3
movzx ebp, word [edi + edx*4]
add word [edi + esi*4], bp
mov word [edi + edx*4], si
inc edx
jmp 0x40c375
movzx ebx, word [edi + edx*4]
mov word [edi + esi*4], bx
mov word [edi + edx*4], si
inc edx
cmp eax, dword [esp + 4]
jge 0x40c3a1
movzx ebx, word [edi + eax*4]
cmp edx, esi
jge 0x40c370
movzx ebp, word [edi + edx*4]
cmp bp, bx
jae 0x40c370
jmp 0x40c3a5
mov ecx, esi
and ecx, 0x7ffffffe
mov eax, dword [esp + 0xc]
lea edx, [eax + ebp]
add edx, 0x8194
xor eax, eax
xor edi, edi
jmp 0x40c40b
add eax, 2
cmp ecx, eax
je 0x40c0c8
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x40c430
mov word [esp + edi*4 + 0xb0], si
mov esi, edi
mov word [esp + edi*4 + 0xb2], ax
and edi, 1
xor esi, 1
lea edi, [esi + edi*2]
movzx esi, word [edx + eax*2]
test si, si
je 0x40c400
mov ebx, edi
mov word [esp + edi*4 + 0xb0], si
mov esi, edi
lea edi, [eax + 1]
mov word [esp + ebx*4 + 0xb2], di
mov edi, ebx
and edi, 1
xor esi, 1
lea edi, [esi + edi*2]
jmp 0x40c400
lea ecx, [edx - 2]
mov word [edi + edx*4 - 8], 0
jmp 0x40c4e8
mov ebx, dword [esp + 4]
mov word [edi + ebx*4 - 8], 0
lea edx, [ebx - 3]
mov eax, edx
test bl, 1
je 0x40c49a
movzx eax, word [edi + ebx*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 + ebx*4 - 0xc], ax
lea eax, [ebx - 4]
lea ecx, [ebx - 2]
test edx, edx
je 0x40c4e8
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [edi + eax*4]
movzx edx, word [edi + edx*4]
mov esi, edx
and esi, 1
xor edx, 1
lea edx, [edx + esi*2]
mov word [edi + eax*4], dx
movzx edx, word [edi + eax*4 - 4]
movzx edx, word [edi + edx*4]
mov esi, edx
and esi, 1
xor edx, 1
lea edx, [edx + esi*2]
mov word [edi + eax*4 - 4], dx
add eax, 0xfffffffe
cmp eax, 0xffffffff
jne 0x40c4b0
mov dword [esp + 8], 1
xor edx, edx
mov eax, dword [esp + 0x1c]
jmp 0x40c52c
mov ebp, esi
and ebp, 0x7ffffffd
mov ebx, esi
and ebx, 2
or esi, 2
imul esi, ebx
xor ebx, 2
imul ebx, ebp
add esi, ebx
inc edx
mov dword [esp + 8], esi
test esi, esi
mov ebp, dword [esp + 0x20]
jle 0x40c5e2
test ecx, ecx
js 0x40c560
lea esi, [ecx + 1]
xor ebx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov ebp, esi
movzx esi, word [edi + ecx*4]
cmp edx, esi
jne 0x40c570
dec ecx
inc ebx
mov esi, ebp
cmp ebp, ebx
jne 0x40c540
mov ecx, 0xffffffff
jmp 0x40c572
xor esi, esi
jmp 0x40c572
mov esi, ebx
mov ebp, dword [esp + 8]
mov ebx, ebp
sub ebx, esi
jle 0x40c500
and ebx, 3
je 0x40c5a9
mov dword [esp + 0x10], esi
lea esi, [edi + eax*4]
xor ebp, ebp
nop
nop
nop
nop
nop
nop
mov word [esi], dx
inc ebp
add esi, 0xfffffffc
cmp ebx, ebp
jne 0x40c590
mov ebx, dword [esp + 8]
sub ebx, ebp
sub eax, ebp
mov esi, dword [esp + 0x10]
jmp 0x40c5af
mov ebx, ebp
mov dword [esp + 8], ebp
mov ebp, esi
sub esi, dword [esp + 8]
cmp esi, 0xfffffffc
mov esi, ebp
ja 0x40c500
mov word [edi + eax*4], dx
mov word [edi + eax*4 - 4], dx
mov word [edi + eax*4 - 8], dx
mov word [edi + eax*4 - 0xc], dx
add eax, 0xfffffffc
add ebx, 0xfffffffc
cmp ebx, esi
jg 0x40c5c0
jmp 0x40c500
cmp dword [esp + 4], 0
mov ebx, dword [esp + 0x15c8]
jle 0x40c712
mov eax, dword [esp + 4]
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x1c], 3
jb 0x40c63a
mov edx, dword [esp + 4]
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
nop
movzx esi, word [edi + ecx*4]
inc dword [esp + esi*4 + 0x2c]
movzx esi, word [edi + ecx*4 + 4]
inc dword [esp + esi*4 + 0x2c]
movzx esi, word [edi + ecx*4 + 8]
inc dword [esp + esi*4 + 0x2c]
movzx esi, word [edi + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x2c]
add ecx, 4
cmp edx, ecx
jne 0x40c610
test eax, eax
je 0x40c65d
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 + 0x2c]
inc edx
cmp eax, edx
jne 0x40c650
cmp dword [esp + 4], 2
jl 0x40c712
lea eax, [ebx + 1]
cmp eax, 0x21
jge 0x40c6cc
mov ecx, dword [esp + ebx*4 + 0x2c]
mov edx, ebx
neg edx
and edx, 3
je 0x40c68c
nop
nop
nop
add ecx, dword [esp + eax*4 + 0x2c]
mov dword [esp + ebx*4 + 0x2c], ecx
inc eax
dec edx
jne 0x40c680
lea edx, [ebx - 0x1d]
cmp edx, 3
jb 0x40c6c8
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add ecx, dword [esp + eax*4 + 0x2c]
mov dword [esp + ebx*4 + 0x2c], ecx
add ecx, dword [esp + eax*4 + 0x30]
mov dword [esp + ebx*4 + 0x2c], ecx
add ecx, dword [esp + eax*4 + 0x34]
mov dword [esp + ebx*4 + 0x2c], ecx
add ecx, dword [esp + eax*4 + 0x38]
mov dword [esp + ebx*4 + 0x2c], ecx
add eax, 4
cmp eax, 0x21
jne 0x40c6a0
test ebx, ebx
jle 0x40c702
lea edx, [ebx + 1]
xor ecx, ecx
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, dword [esp + edx*4 + 0x28]
shl esi, cl
add eax, esi
dec edx
inc ecx
cmp edx, 1
ja 0x40c6e0
mov edx, 1
mov ecx, ebx
shl edx, cl
cmp eax, edx
jne 0x40c98d
jmp 0x40c712
mov edx, 1
mov ecx, ebx
shl edx, cl
xor eax, eax
jmp 0x40c98d
shl ebp, 5
mov esi, dword [esp + 0xc]
lea eax, [esi + ebp]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.0040cb50
add esp, 0xc
mov eax, dword [esp + 0x24]
add eax, esi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.0040cb50
add esp, 0xc
test ebx, ebx
mov edx, dword [esp + 4]
jle 0x40c83f
lea eax, [ebx + 1]
mov dword [esp + 0x10], eax
cmp eax, 3
jge 0x40c76c
mov dword [esp + 0x10], 2
add edi, 0xfffffffe
mov ecx, 1
add ebp, dword [esp + 0xc]
jmp 0x40c78b
inc ecx
cmp ecx, dword [esp + 0x10]
je 0x40c83f
mov eax, dword [esp + ecx*4 + 0x2c]
test eax, eax
jle 0x40c780
mov esi, eax
and esi, 3
je 0x40c7f0
mov dword [esp + 8], eax
mov eax, edx
mov edx, ebp
mov dword [esp + 4], eax
lea ebp, [edi + eax*4]
xor ebx, ebx
nop
nop
nop
nop
nop
movzx eax, word [ebp]
mov byte [eax + edx + 0x8f12], cl
inc ebx
add ebp, 0xfffffffc
cmp esi, ebx
jne 0x40c7b0
mov eax, dword [esp + 4]
sub eax, ebx
mov esi, dword [esp + 8]
sub esi, ebx
mov ebx, dword [esp + 0x15c8]
mov ebp, edx
mov edx, eax
mov eax, dword [esp + 8]
cmp eax, 4
jb 0x40c780
jmp 0x40c7f7
mov esi, eax
cmp eax, 4
jb 0x40c780
dec esi
nop
nop
nop
nop
nop
nop
nop
nop
movzx eax, word [edi + edx*4]
mov byte [eax + ebp + 0x8f12], cl
movzx eax, word [edi + edx*4 - 4]
mov byte [eax + ebp + 0x8f12], cl
movzx eax, word [edi + edx*4 - 8]
mov byte [eax + ebp + 0x8f12], cl
movzx eax, word [edi + edx*4 - 0xc]
add edx, 0xfffffffc
mov byte [eax + ebp + 0x8f12], cl
add esi, 0xfffffffc
cmp esi, 0xfffffffe
jb 0x40c800
jmp 0x40c780
mov dword [esp + 0x534], 0
cmp ebx, 2
jl 0x40c8a3
inc ebx
xor eax, eax
cmp ebx, 4
jge 0x40c85c
mov ebx, 3
mov ecx, 2
jl 0x40c891
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 0x40c870
test bl, 1
je 0x40c8a3
add eax, dword [esp + ecx*4 + 0x28]
add eax, eax
mov dword [esp + ecx*4 + 0x530], eax
mov ecx, dword [esp + 0x15c4]
test ecx, ecx
jle 0x40c982
xor eax, eax
mov edx, dword [esp + 0x18]
lea edi, [edx + edx*8]
mov edx, edi
shl edx, 5
mov esi, dword [esp + 0xc]
add edx, esi
shl edi, 6
add edi, esi
mov dword [esp + 8], edi
jmp 0x40c8fc
mov ecx, dword [esp + 8]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15c4]
inc eax
cmp eax, ecx
je 0x40c982
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x40c8f3
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 0x40c95f
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 0x40c930
and ebx, 3
je 0x40c8e0
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 0x40c970
jmp 0x40c8e0
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 0x40c9b8
mov esi, dword [esp + ecx*4 + 0x28]
dec ecx
test esi, esi
je 0x40c9a0
dec esi
mov dword [esp + ecx*4 + 0x2c], esi
add dword [esp + ecx*4 + 0x30], 2
dec eax
cmp eax, edx
jne 0x40c98d
jmp 0x40c712