Function at 0x40ba40
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15ac
call fcn.0040c410
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.0040c5e0
add esp, 0xc
cmp dword [esp + 0x15c8], 0
mov dword [esp + 0x18], edi
je 0x40bb0e
test esi, esi
mov ecx, esi
jle 0x40c206
xor eax, eax
cmp ecx, 1
je 0x40bad8
mov ecx, dword [esp + 0x15c0]
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
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 0x40bac0
mov ecx, dword [esp + 0x15c0]
test cl, 1
je 0x40c206
mov ecx, dword [esp + 0x18]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, dword [esp + 0xc]
movzx eax, byte [eax + ecx + 0x8f12]
mov ecx, dword [esp + 0x15c0]
inc dword [esp + eax*4 + 0x28]
jmp 0x40c206
lea eax, [edi + edi*8]
mov dword [esp + 0x14], eax
mov ebx, eax
shl ebx, 6
test esi, esi
mov dword [esp + 0x20], ebx
jle 0x40bbcc
cmp esi, 1
jne 0x40c082
xor eax, eax
xor edi, edi
mov ecx, dword [esp + 0x15c0]
test cl, 1
je 0x40bb65
mov ecx, dword [esp + 0xc]
add ecx, ebx
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x40bb65
mov word [esp + edi*4 + 0xac], cx
mov word [esp + edi*4 + 0xae], ax
inc edi
lea eax, [esp + 0x52c]
push 0x800
push 0
push eax
call fcn.0040c5e0
add esp, 0xc
test edi, edi
sete byte [esp + 7]
je 0x40bbe3
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [esp + eax*4 + 0xac]
movzx edx, cl
mov esi, dword [esp + edx*4 + 0x52c]
mov ebx, esi
and ebx, 1
xor esi, 1
lea esi, [esi + ebx*2]
mov dword [esp + edx*4 + 0x52c], esi
shr ecx, 8
inc dword [esp + ecx*4 + 0x92c]
inc eax
cmp edi, eax
jne 0x40bb90
mov eax, dword [esp + 0x92c]
jmp 0x40bbec
lea eax, [esp + 0x52c]
push 0x800
push 0
push eax
call fcn.0040c5e0
add esp, 0xc
xor edi, edi
mov byte [esp + 7], 1
xor eax, eax
xor ecx, ecx
cmp eax, edi
setne cl
inc ecx
mov dword [esp + 0x24], ecx
lea eax, [esp + 0xac]
mov dword [esp], eax
lea eax, [esp + 0x112c]
xor ecx, ecx
lea ebx, [esp + 0x52c]
xor edx, edx
mov dword [esp + 0x10], edi
jmp 0x40bc3a
mov edx, dword [esp + 0x1c]
inc edx
add ecx, 8
add ebx, 0x400
mov eax, ebp
cmp edx, dword [esp + 0x24]
je 0x40bcdd
mov dword [esp + 0x1c], edx
mov ebp, dword [esp]
mov dword [esp], eax
mov edx, 3
xor eax, eax
nop
nop
nop
nop
nop
mov dword [esp + edx*4 + 0xd20], eax
add eax, dword [ebx + edx*4 - 0xc]
mov dword [esp + edx*4 + 0xd24], eax
add eax, dword [ebx + edx*4 - 8]
mov dword [esp + edx*4 + 0xd28], eax
add eax, dword [ebx + edx*4 - 4]
mov dword [esp + edx*4 + 0xd2c], eax
add eax, dword [ebx + edx*4]
add edx, 4
cmp edx, 0x103
jne 0x40bc50
cmp byte [esp + 7], 0
mov esi, dword [esp]
jne 0x40bc20
xor edx, edx
mov dword [esp + 8], ebp
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx eax, word [ebp + edx*4]
shr eax, cl
mov ebp, eax
not ebp
or ebp, 0xff
add ebp, eax
mov eax, dword [esp + ebp*4 + 0xd30]
lea edi, [eax + 1]
mov dword [esp + ebp*4 + 0xd30], edi
mov ebp, dword [esp + 8]
mov edi, dword [ebp + edx*4]
mov dword [esi + eax*4], edi
mov edi, dword [esp + 0x10]
inc edx
cmp edi, edx
jne 0x40bca0
jmp 0x40bc20
test edi, edi
mov ebx, dword [esp + 0x15c4]
mov ebp, dword [esp + 0x14]
je 0x40c0f5
cmp edi, 1
jne 0x40bd02
mov eax, dword [esp]
mov word [eax], 1
jmp 0x40bf61
mov esi, dword [esp]
movzx eax, word [esi + 4]
add word [esi], ax
cmp edi, 3
jl 0x40bdaa
mov eax, 2
mov ecx, 2
sub ecx, edi
mov dword [esp + 8], ecx
xor edx, edx
mov ebx, 1
jmp 0x40bd50
mov ecx, esi
movzx esi, word [esi + eax*4]
inc eax
add word [ecx + ebx*4], si
mov ebp, dword [esp + 0x14]
mov ecx, dword [esp + 8]
lea esi, [ecx + ebx]
inc esi
inc ebx
cmp esi, 1
mov esi, dword [esp]
je 0x40bdaa
movzx ecx, word [esi + edx*4]
cmp eax, edi
jge 0x40bd61
movzx ebp, word [esi + eax*4]
cmp cx, bp
jae 0x40bd90
mov word [esi + ebx*4], cx
mov word [esi + edx*4], bx
inc edx
cmp eax, edi
jge 0x40bd99
cmp edx, ebx
jge 0x40bd30
movzx ebp, word [esi + edx*4]
mov ecx, esi
movzx esi, word [esi + eax*4]
cmp bp, si
jae 0x40bd36
jmp 0x40bd9f
inc eax
mov word [esi + ebx*4], bp
cmp eax, edi
jl 0x40bd6e
movzx ebp, word [esi + edx*4]
mov ecx, esi
add word [ecx + ebx*4], bp
mov word [ecx + edx*4], bx
inc edx
jmp 0x40bd3b
mov word [esi + edi*4 - 8], 0
mov ecx, edi
add ecx, 0xfffffffd
js 0x40be41
mov edx, edi
and edx, 3
xor edx, 2
mov eax, ecx
je 0x40bded
mov eax, ecx
nop
nop
nop
nop
nop
nop
mov esi, dword [esp]
movzx esi, word [esi + eax*4]
mov ebx, dword [esp]
movzx esi, word [ebx + esi*4]
inc esi
mov ebx, dword [esp]
mov word [ebx + eax*4], si
mov esi, dword [esp]
dec eax
dec edx
jne 0x40bdd0
cmp ecx, 3
jb 0x40be41
inc eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [esi + eax*4 - 4]
movzx ecx, word [esi + ecx*4]
inc ecx
mov word [esi + eax*4 - 4], cx
movzx ecx, word [esi + eax*4 - 8]
movzx ecx, word [esi + ecx*4]
inc ecx
mov word [esi + eax*4 - 8], cx
movzx ecx, word [esi + eax*4 - 0xc]
movzx ecx, word [esi + ecx*4]
inc ecx
mov word [esi + eax*4 - 0xc], cx
movzx ecx, word [esi + eax*4 - 0x10]
movzx ecx, word [esi + ecx*4]
inc ecx
mov word [esi + eax*4 - 0x10], cx
add eax, 0xfffffffc
jne 0x40be00
lea eax, [edi - 1]
lea ecx, [edi - 2]
mov dword [esp + 8], 1
xor edx, edx
jmp 0x40be8c
mov esi, ebx
and esi, 2
mov edi, ebx
or ebx, 2
imul ebx, esi
xor esi, 2
and edi, 0x7ffffffd
imul edi, esi
add ebx, edi
inc edx
mov dword [esp + 8], ebx
test ebx, ebx
mov edi, dword [esp + 0x10]
jle 0x40bf52
test ecx, ecx
js 0x40bec0
lea ebx, [ecx + 1]
xor esi, esi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov edi, dword [esp]
movzx edi, word [edi + ecx*4]
cmp edx, edi
jne 0x40bed0
inc esi
dec ecx
cmp ebx, esi
jne 0x40bea0
mov ecx, 0xffffffff
jmp 0x40bed2
xor ebx, ebx
jmp 0x40bed2
mov ebx, esi
mov edi, dword [esp + 8]
mov esi, edi
sub esi, ebx
jle 0x40be60
and esi, 3
je 0x40bf0e
mov dword [esp + 0x1c], ebx
mov edi, dword [esp]
lea ebp, [edi + eax*4]
xor ebx, ebx
nop
nop
nop
mov word [ebp], dx
inc ebx
add ebp, 0xfffffffc
cmp esi, ebx
jne 0x40bef0
mov esi, dword [esp + 8]
sub esi, ebx
sub eax, ebx
mov ebp, dword [esp + 0x14]
mov ebx, dword [esp + 0x1c]
jmp 0x40bf14
mov esi, edi
mov dword [esp + 8], edi
mov edi, ebx
sub edi, dword [esp + 8]
cmp edi, 0xfffffffc
mov edi, dword [esp]
ja 0x40be60
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
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 esi, 0xfffffffc
cmp esi, ebx
jg 0x40bf30
jmp 0x40be60
test edi, edi
mov ebx, dword [esp + 0x15c4]
jle 0x40c0f5
lea edx, [edi - 1]
mov eax, edi
and eax, 3
xor ecx, ecx
cmp edx, 3
mov ebx, dword [esp]
jb 0x40bfaa
mov edx, edi
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
nop
nop
nop
nop
movzx esi, word [ebx + ecx*4]
inc dword [esp + esi*4 + 0x28]
movzx esi, word [ebx + ecx*4 + 4]
inc dword [esp + esi*4 + 0x28]
movzx esi, word [ebx + ecx*4 + 8]
inc dword [esp + esi*4 + 0x28]
movzx esi, word [ebx + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x28]
add ecx, 4
cmp edx, ecx
jne 0x40bf80
test eax, eax
je 0x40bfcd
mov edx, dword [esp]
lea ecx, [edx + ecx*4]
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ecx + edx*4]
inc dword [esp + esi*4 + 0x28]
inc edx
cmp eax, edx
jne 0x40bfc0
cmp edi, 2
mov ebx, dword [esp + 0x15c4]
jl 0x40c0f5
cmp ebx, 0x20
jge 0x40c050
mov eax, dword [esp + ebx*4 + 0x28]
mov edx, ebx
neg edx
mov ecx, ebx
and edx, 3
je 0x40c00c
nop
nop
nop
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 0x40c000
lea edx, [ebx - 0x1d]
cmp edx, 3
jb 0x40c048
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 0x40c020
test ebx, ebx
jle 0x40c0e5
lea edx, [ebx + 1]
xor ecx, ecx
xor eax, eax
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 0x40c060
mov edx, 1
mov ecx, ebx
shl edx, cl
cmp eax, edx
jne 0x40c35d
jmp 0x40c0f5
mov ecx, esi
and ecx, 0x7ffffffe
mov eax, dword [esp + 0xc]
lea edx, [ebx + eax]
add edx, 0x8194
xor eax, eax
xor edi, edi
jmp 0x40c0ab
add eax, 2
cmp ecx, eax
je 0x40bb33
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x40c0c6
mov word [esp + edi*4 + 0xac], si
mov word [esp + edi*4 + 0xae], ax
inc edi
movzx esi, word [edx + eax*2]
test si, si
je 0x40c0a0
mov word [esp + edi*4 + 0xac], si
lea esi, [eax + 1]
mov word [esp + edi*4 + 0xae], si
inc edi
jmp 0x40c0a0
mov edx, 1
mov ecx, ebx
shl edx, cl
xor eax, eax
jmp 0x40c35d
shl ebp, 5
mov esi, dword [esp + 0xc]
lea eax, [esi + ebp]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.0040c5e0
add esp, 0xc
mov eax, dword [esp + 0x20]
add eax, esi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.0040c5e0
add esp, 0xc
test ebx, ebx
mov esi, dword [esp]
jle 0x40c1ff
add esi, 0xfffffffe
mov eax, 1
add ebp, dword [esp + 0xc]
mov dword [esp], esi
jmp 0x40c15d
lea ecx, [eax + 1]
cmp eax, ebx
mov eax, ecx
je 0x40c1ff
mov ecx, dword [esp + eax*4 + 0x28]
test ecx, ecx
jle 0x40c150
mov edx, ecx
and edx, 3
je 0x40c1b0
mov dword [esp + 0x10], edi
lea ebx, [esi + edi*4]
xor esi, esi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edi, word [ebx]
mov byte [edi + ebp + 0x8f12], al
inc esi
add ebx, 0xfffffffc
cmp edx, esi
jne 0x40c180
mov edi, dword [esp + 0x10]
sub edi, esi
mov edx, ecx
sub edx, esi
mov ebx, dword [esp + 0x15c4]
mov esi, dword [esp]
cmp ecx, 4
jb 0x40c150
jmp 0x40c1b7
mov edx, ecx
cmp ecx, 4
jb 0x40c150
dec edx
nop
nop
nop
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 0x40c1c0
jmp 0x40c150
mov ecx, dword [esp + 0x15c0]
mov dword [esp + 0x530], 0
cmp ebx, 2
jl 0x40c26d
lea ecx, [ebx - 1]
cmp ebx, 2
jne 0x40c227
xor eax, eax
mov edx, 2
jmp 0x40c254
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 + 0x534], eax
add eax, dword [esp + edx*4 + 0x30]
add eax, eax
mov dword [esp + edx*4 + 0x538], eax
add edx, 2
cmp ebx, edx
jne 0x40c230
add edx, 2
test cl, 1
mov ecx, dword [esp + 0x15c0]
je 0x40c26d
add eax, dword [esp + edx*4 + 0x24]
add eax, eax
mov dword [esp + edx*4 + 0x52c], eax
test ecx, ecx
jle 0x40c352
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 + 0x10], edi
jmp 0x40c2bc
mov ecx, dword [esp + 0x10]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15c0]
inc eax
cmp eax, ecx
je 0x40c352
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x40c2b3
mov ecx, dword [esp + ebx*4 + 0x52c]
mov edi, ecx
and edi, 1
mov ebp, ecx
xor ebp, 1
lea edi, [edi*2]
add edi, ebp
mov dword [esp + ebx*4 + 0x52c], edi
xor edi, edi
cmp bl, 4
jb 0x40c32f
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 0x40c300
and ebx, 3
je 0x40c2a0
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 0x40c340
jmp 0x40c2a0
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 0x40c39a
mov esi, dword [esp + ecx*4 + 0x24]
dec ecx
test esi, esi
je 0x40c370
dec esi
mov dword [esp + ecx*4 + 0x28], esi
mov esi, dword [esp + ecx*4 + 0x2c]
mov edi, esi
xor edi, 2
and esi, 2
lea esi, [edi + esi*2]
mov edi, dword [esp + 0x10]
mov dword [esp + ecx*4 + 0x2c], esi
dec eax
cmp eax, edx
jne 0x40c35d
jmp 0x40c0f5