Function at 0x40be40
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15ac
call fcn.0040c810
mov edi, edx
mov dword [esp + 0xc], ecx
mov ebx, dword [esp + 0x15c4]
mov esi, dword [esp + 0x15c0]
lea eax, [esp + 0x28]
push 0x84
push 0
push eax
call fcn.0040c930
add esp, 0xc
cmp dword [esp + 0x15c8], 0
mov dword [esp + 0x1c], edi
je 0x40bf07
test esi, esi
jle 0x40c624
xor eax, eax
cmp esi, 1
je 0x40bed8
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 + 0xc]
add edx, eax
add edx, 0x8f13
xor eax, eax
nop
nop
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 0x40bec0
mov ecx, dword [esp + 0x15c0]
test cl, 1
je 0x40c624
mov ecx, dword [esp + 0x1c]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, dword [esp + 0xc]
movzx eax, byte [eax + ecx + 0x8f12]
inc dword [esp + eax*4 + 0x28]
jmp 0x40c624
lea eax, [edi + edi*8]
mov dword [esp + 0x20], eax
shl eax, 6
mov dword [esp + 0x18], eax
test esi, esi
jle 0x40c009
cmp esi, 1
jne 0x40c1fd
xor eax, eax
xor ebx, ebx
mov ecx, dword [esp + 0x15c0]
test cl, 1
je 0x40bf60
mov ecx, dword [esp + 0xc]
mov edx, dword [esp + 0x18]
add ecx, edx
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x40bf60
mov word [esp + ebx*4 + 0xac], cx
mov word [esp + ebx*4 + 0xae], ax
inc ebx
lea eax, [esp + 0x52c]
push 0x800
push 0
push eax
call fcn.0040c930
add esp, 0xc
test ebx, ebx
sete byte [esp + 7]
je 0x40c020
xor eax, eax
cmp ebx, 1
je 0x40bfdf
mov ecx, ebx
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [esp + eax*4 + 0xac]
movzx esi, dl
inc dword [esp + esi*4 + 0x52c]
shr edx, 8
inc dword [esp + edx*4 + 0x92c]
movzx edx, word [esp + eax*4 + 0xb0]
movzx esi, dl
inc dword [esp + esi*4 + 0x52c]
shr edx, 8
inc dword [esp + edx*4 + 0x92c]
add eax, 2
cmp ecx, eax
jne 0x40bfa0
test bl, 1
je 0x40c000
movzx eax, word [esp + eax*4 + 0xac]
movzx ecx, al
inc dword [esp + ecx*4 + 0x52c]
shr eax, 8
inc dword [esp + eax*4 + 0x92c]
mov eax, dword [esp + 0x92c]
jmp 0x40c029
lea eax, [esp + 0x52c]
push 0x800
push 0
push eax
call fcn.0040c930
add esp, 0xc
xor ebx, ebx
mov byte [esp + 7], 1
xor eax, eax
xor ecx, ecx
cmp eax, ebx
setne cl
inc ecx
mov dword [esp + 0x24], ecx
lea ebp, [esp + 0xac]
lea edx, [esp + 0x112c]
xor ecx, ecx
lea esi, [esp + 0x52c]
xor eax, eax
mov dword [esp], ebx
jmp 0x40c07c
mov eax, dword [esp + 0x10]
inc eax
add ecx, 8
add esi, 0x400
mov edx, ebp
cmp eax, dword [esp + 0x24]
mov ebp, edi
je 0x40c121
mov dword [esp + 0x10], eax
mov dword [esp + 8], edx
mov edx, 3
xor edi, edi
nop
nop
nop
nop
nop
mov dword [esp + edx*4 + 0xd20], edi
add edi, dword [esi + edx*4 - 0xc]
mov dword [esp + edx*4 + 0xd24], edi
add edi, dword [esi + edx*4 - 8]
mov dword [esp + edx*4 + 0xd28], edi
add edi, dword [esi + edx*4 - 4]
mov dword [esp + edx*4 + 0xd2c], edi
add edi, dword [esi + edx*4]
add edx, 4
cmp edx, 0x103
jne 0x40c090
cmp byte [esp + 7], 0
mov edi, dword [esp + 8]
jne 0x40c060
xor edx, edx
mov dword [esp + 0x14], ebp
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ebx, word [ebp + edx*4]
shr ebx, cl
mov ebp, edi
movzx edi, bl
mov ebx, dword [esp + edi*4 + 0xd2c]
lea eax, [ebx + 1]
mov dword [esp + edi*4 + 0xd2c], eax
mov edi, ebp
mov ebp, dword [esp + 0x14]
mov eax, dword [ebp + edx*4]
mov dword [edi + ebx*4], eax
mov ebx, dword [esp]
mov eax, edx
and eax, 1
xor edx, 1
lea edx, [edx + eax*2]
cmp edx, ebx
jb 0x40c0e0
jmp 0x40c060
test ebx, ebx
mov ebx, dword [esp + 0x15c4]
je 0x40c552
mov ecx, dword [esp]
cmp ecx, 1
jne 0x40c143
mov word [ebp], 1
jmp 0x40c42c
movzx eax, word [ebp + 4]
add word [ebp], ax
lea eax, [ecx - 1]
mov dword [esp + 0x14], eax
cmp eax, 2
mov ebx, ecx
jl 0x40c265
mov ecx, 2
mov edx, 2
sub edx, ebx
xor esi, esi
mov ebp, 1
jmp 0x40c19e
mov eax, dword [esp + 8]
movzx edi, word [eax + ecx*4]
inc ecx
add word [eax + ebp*4], di
lea edi, [edx + ebp]
inc edi
inc ebp
cmp edi, 1
mov ebx, dword [esp]
je 0x40c274
mov eax, dword [esp + 8]
movzx edi, word [eax + esi*4]
cmp ecx, ebx
jge 0x40c1b3
movzx ebx, word [eax + ecx*4]
cmp di, bx
jae 0x40c1e0
mov word [eax + ebp*4], di
mov word [eax + esi*4], bp
inc esi
cmp ecx, dword [esp]
jge 0x40c1ea
cmp esi, ebp
jge 0x40c180
mov eax, dword [esp + 8]
movzx ebx, word [eax + esi*4]
movzx edi, word [eax + ecx*4]
cmp bx, di
jae 0x40c188
jmp 0x40c1f2
inc ecx
mov word [eax + ebp*4], bx
cmp ecx, dword [esp]
jl 0x40c1c1
mov eax, dword [esp + 8]
movzx ebx, word [eax + esi*4]
add word [eax + ebp*4], bx
mov word [eax + esi*4], bp
inc esi
jmp 0x40c18d
mov ecx, esi
and ecx, 0x7ffffffe
mov eax, dword [esp + 0xc]
mov edx, dword [esp + 0x18]
add edx, eax
add edx, 0x8194
xor eax, eax
xor ebx, ebx
jmp 0x40c22b
add eax, 2
cmp ecx, eax
je 0x40bf2a
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x40c246
mov word [esp + ebx*4 + 0xac], si
mov word [esp + ebx*4 + 0xae], ax
inc ebx
movzx esi, word [edx + eax*2]
test si, si
je 0x40c220
mov word [esp + ebx*4 + 0xac], si
lea esi, [eax + 1]
mov word [esp + ebx*4 + 0xae], si
inc ebx
jmp 0x40c220
lea ecx, [ebx - 2]
mov word [ebp + ebx*4 - 8], 0
jmp 0x40c315
lea ecx, [ebx - 2]
mov ebp, dword [esp + 8]
mov word [ebp + ebx*4 - 8], 0
cmp ebx, 3
jl 0x40c315
lea esi, [ebx - 3]
mov eax, ebp
mov ebp, ebx
and ebp, 3
xor ebp, 2
mov edx, esi
je 0x40c2b1
mov edx, esi
nop
nop
movzx edi, word [eax + edx*4]
movzx edi, word [eax + edi*4]
inc edi
mov word [eax + edx*4], di
dec edx
dec ebp
jne 0x40c2a0
cmp esi, 3
jae 0x40c2bc
mov ebp, dword [esp + 8]
jmp 0x40c315
inc edx
mov ebp, dword [esp + 8]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ebp + edx*4 - 4]
movzx esi, word [ebp + esi*4]
inc esi
mov word [ebp + edx*4 - 4], si
movzx esi, word [ebp + edx*4 - 8]
movzx esi, word [ebp + esi*4]
inc esi
mov word [ebp + edx*4 - 8], si
movzx esi, word [ebp + edx*4 - 0xc]
movzx esi, word [ebp + esi*4]
inc esi
mov word [ebp + edx*4 - 0xc], si
movzx esi, word [ebp + edx*4 - 0x10]
movzx esi, word [ebp + esi*4]
inc esi
mov word [ebp + edx*4 - 0x10], si
add edx, 0xfffffffc
jne 0x40c2d0
mov dword [esp + 0x10], 1
xor edx, edx
jmp 0x40c366
mov eax, dword [esp + 8]
mov dword [esp + 0x14], ebx
mov edi, esi
and edi, 2
mov ebx, esi
or esi, 2
imul esi, edi
xor edi, 2
and ebx, 0xfffffffd
imul ebx, edi
add esi, ebx
inc edx
mov dword [esp + 0x10], esi
test esi, esi
mov ebx, dword [esp + 0x15c4]
mov ebp, eax
jle 0x40c422
xor esi, esi
test ecx, ecx
js 0x40c3b0
mov ebx, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edi, word [ebp + ecx*4]
cmp edx, edi
jne 0x40c3b8
mov edi, esi
and edi, 1
xor esi, 1
lea esi, [esi + edi*2]
lea edi, [ecx - 1]
test ecx, ecx
mov ecx, edi
jg 0x40c380
mov ecx, 0xffffffff
jmp 0x40c3b8
mov ebx, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
mov ebp, eax
sub ebp, esi
jle 0x40c330
and ebp, 3
je 0x40c3eb
mov eax, dword [esp + 8]
lea ebx, [eax + ebx*4]
xor edi, edi
mov word [ebx], dx
inc edi
add ebx, 0xfffffffc
cmp ebp, edi
jne 0x40c3d0
mov eax, dword [esp + 0x10]
mov ebp, eax
sub ebp, edi
mov ebx, dword [esp + 0x14]
sub ebx, edi
jmp 0x40c3ed
mov ebp, eax
mov edi, esi
sub edi, eax
cmp edi, 0xfffffffc
mov eax, dword [esp + 8]
ja 0x40c334
nop
nop
mov word [eax + ebx*4], dx
mov word [eax + ebx*4 - 4], dx
mov word [eax + ebx*4 - 8], dx
mov word [eax + ebx*4 - 0xc], dx
add ebx, 0xfffffffc
add ebp, 0xfffffffc
cmp ebp, esi
jg 0x40c400
jmp 0x40c334
cmp dword [esp], 0
jle 0x40c552
mov eax, dword [esp]
lea edx, [eax - 1]
and eax, 3
xor ecx, ecx
cmp edx, 3
jb 0x40c47b
mov edx, dword [esp]
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ebp + ecx*4]
inc dword [esp + esi*4 + 0x28]
movzx esi, word [ebp + ecx*4 + 4]
inc dword [esp + esi*4 + 0x28]
movzx esi, word [ebp + ecx*4 + 8]
inc dword [esp + esi*4 + 0x28]
movzx esi, word [ebp + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x28]
add ecx, 4
cmp edx, ecx
jne 0x40c450
test eax, eax
je 0x40c49d
lea ecx, [ecx*4]
add ecx, ebp
xor edx, edx
nop
nop
nop
nop
nop
nop
movzx esi, word [ecx + edx*4]
inc dword [esp + esi*4 + 0x28]
inc edx
cmp eax, edx
jne 0x40c490
cmp dword [esp], 2
jl 0x40c552
lea eax, [ebx + 1]
cmp eax, 0x21
jge 0x40c50c
mov ecx, dword [esp + ebx*4 + 0x28]
mov edx, ebx
neg edx
and edx, 3
je 0x40c4cc
nop
nop
nop
nop
add ecx, dword [esp + eax*4 + 0x28]
mov dword [esp + ebx*4 + 0x28], ecx
inc eax
dec edx
jne 0x40c4c0
lea edx, [ebx - 0x1d]
cmp edx, 3
jb 0x40c508
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add ecx, dword [esp + eax*4 + 0x28]
mov dword [esp + ebx*4 + 0x28], ecx
add ecx, dword [esp + eax*4 + 0x2c]
mov dword [esp + ebx*4 + 0x28], ecx
add ecx, dword [esp + eax*4 + 0x30]
mov dword [esp + ebx*4 + 0x28], ecx
add ecx, dword [esp + eax*4 + 0x34]
mov dword [esp + ebx*4 + 0x28], ecx
add eax, 4
cmp eax, 0x21
jne 0x40c4e0
test ebx, ebx
jle 0x40c542
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 + 0x24]
shl esi, cl
add eax, esi
dec edx
inc ecx
cmp edx, 1
ja 0x40c520
mov edx, 1
mov ecx, ebx
shl edx, cl
cmp eax, edx
jne 0x40c76d
jmp 0x40c552
mov edx, 1
mov ecx, ebx
shl edx, cl
xor eax, eax
jmp 0x40c76d
mov edi, dword [esp + 0x20]
shl edi, 5
mov esi, dword [esp + 0xc]
lea eax, [esi + edi]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.0040c930
add esp, 0xc
mov eax, dword [esp + 0x18]
add eax, esi
add eax, 0x8852
mov esi, edi
push 0x240
push 0
push eax
call fcn.0040c930
add esp, 0xc
test ebx, ebx
jle 0x40c624
mov eax, 1
add esi, dword [esp + 0xc]
jmp 0x40c5bf
mov edi, dword [esp]
mov dword [esp], edi
lea ecx, [eax + 1]
cmp eax, ebx
mov eax, ecx
je 0x40c624
mov edx, dword [esp + eax*4 + 0x28]
test edx, edx
jle 0x40c5b0
test dl, 1
jne 0x40c5d0
mov ecx, edx
jmp 0x40c5ea
mov edi, dword [esp]
movzx ecx, word [ebp + edi*4 - 2]
dec edi
mov dword [esp], edi
mov byte [ecx + esi + 0x8f12], al
mov ecx, edx
not ecx
lea ecx, [ecx + edx*2]
cmp edx, 1
mov edi, dword [esp]
je 0x40c5b3
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [ebp + edi*4 - 2]
mov byte [edx + esi + 0x8f12], al
movzx edx, word [ebp + edi*4 - 6]
add edi, 0xfffffffe
mov byte [edx + esi + 0x8f12], al
add ecx, 0xfffffffe
test ecx, ecx
jg 0x40c600
jmp 0x40c5b3
mov dword [esp + 0x530], 0
cmp ebx, 2
jl 0x40c693
inc ebx
xor eax, eax
cmp ebx, 4
jge 0x40c641
mov ebx, 3
mov ecx, 2
jl 0x40c681
mov edx, ebx
and edx, 0x7ffffffe
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x24]
add eax, eax
mov dword [esp + ecx*4 + 0x52c], eax
add eax, dword [esp + ecx*4 + 0x28]
add eax, eax
mov dword [esp + ecx*4 + 0x530], eax
add ecx, 2
cmp edx, ecx
jne 0x40c660
test bl, 1
je 0x40c693
add eax, dword [esp + ecx*4 + 0x24]
add eax, eax
mov dword [esp + ecx*4 + 0x52c], eax
mov ecx, dword [esp + 0x15c0]
test ecx, ecx
jle 0x40c762
xor eax, eax
mov edx, dword [esp + 0x1c]
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], edi
jmp 0x40c6db
mov ecx, dword [esp]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15c0]
inc eax
cmp eax, ecx
je 0x40c762
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x40c6d2
mov ecx, dword [esp + ebx*4 + 0x52c]
lea edi, [ecx + 1]
mov dword [esp + ebx*4 + 0x52c], edi
xor edi, edi
cmp bl, 4
jb 0x40c73f
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 0x40c710
and ebx, 3
je 0x40c6c0
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 0x40c750
jmp 0x40c6c0
add esp, 0x15ac
pop esi
pop edi
pop ebx
pop ebp
ret
dec dword [esp + ebx*4 + 0x28]
mov ecx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x40c798
mov esi, dword [esp + ecx*4 + 0x24]
dec ecx
test esi, esi
je 0x40c780
dec esi
mov dword [esp + ecx*4 + 0x28], esi
add dword [esp + ecx*4 + 0x2c], 2
dec eax
cmp eax, edx
jne 0x40c76d
jmp 0x40c552