Function at 0x40bda0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b4
call fcn.0040c860
mov edi, edx
mov dword [esp + 8], ecx
mov esi, dword [esp + 0x15c8]
lea eax, [esp + 0x30]
push 0x84
push 0
push eax
call fcn.0040ca90
add esp, 0xc
cmp dword [esp + 0x15d0], 0
mov dword [esp + 0x1c], edi
je 0x40be6e
test esi, esi
mov ecx, esi
jle 0x40c647
xor eax, eax
cmp ecx, 1
je 0x40be38
mov ecx, dword [esp + 0x15c8]
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x1c]
lea eax, [eax + eax*8]
shl eax, 5
mov edx, dword [esp + 8]
add edx, eax
add edx, 0x8f13
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, byte [edx + eax - 1]
inc dword [esp + esi*4 + 0x30]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x30]
add eax, 2
cmp ecx, eax
jne 0x40be20
mov ecx, dword [esp + 0x15c8]
test cl, 1
je 0x40c647
mov ecx, dword [esp + 0x1c]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, dword [esp + 8]
movzx eax, byte [eax + ecx + 0x8f12]
mov ecx, dword [esp + 0x15c8]
inc dword [esp + eax*4 + 0x30]
jmp 0x40c647
lea eax, [edi + edi*8]
mov dword [esp + 0x24], eax
shl eax, 6
mov dword [esp + 0x18], eax
test esi, esi
jle 0x40bf69
cmp esi, 1
jne 0x40c1de
xor eax, eax
xor ebx, ebx
mov ecx, dword [esp + 0x15c8]
test cl, 1
je 0x40bec7
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 0x40bec7
mov word [esp + ebx*4 + 0x4b4], cx
mov word [esp + ebx*4 + 0x4b6], ax
inc ebx
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.0040ca90
add esp, 0xc
test ebx, ebx
sete byte [esp + 7]
je 0x40bf80
xor eax, eax
cmp ebx, 1
je 0x40bf3f
mov ecx, ebx
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [esp + eax*4 + 0x4b4]
movzx esi, dl
inc dword [esp + esi*4 + 0x934]
shr edx, 8
inc dword [esp + edx*4 + 0xd34]
movzx edx, word [esp + eax*4 + 0x4b8]
movzx esi, dl
inc dword [esp + esi*4 + 0x934]
shr edx, 8
inc dword [esp + edx*4 + 0xd34]
add eax, 2
cmp ecx, eax
jne 0x40bf00
test bl, 1
je 0x40bf60
movzx eax, word [esp + eax*4 + 0x4b4]
movzx ecx, al
inc dword [esp + ecx*4 + 0x934]
shr eax, 8
inc dword [esp + eax*4 + 0xd34]
mov eax, dword [esp + 0xd34]
jmp 0x40bf89
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.0040ca90
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 + 0x2c], ecx
lea eax, [ebx - 1]
mov dword [esp + 0x20], eax
mov dword [esp + 0xc], ebx
and ebx, 0xfffffffe
mov dword [esp + 0x28], ebx
lea ebp, [esp + 0x4b4]
lea eax, [esp + 0x1134]
xor ecx, ecx
lea edi, [esp + 0x934]
xor edx, edx
jmp 0x40bfe6
add ecx, 8
inc edx
add edi, 0x400
mov eax, esi
cmp edx, dword [esp + 0x2c]
je 0x40c118
mov esi, ebp
mov ebp, eax
mov eax, 3
xor ebx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov dword [esp + eax*4 + 0xa8], ebx
add ebx, dword [edi + eax*4 - 0xc]
mov dword [esp + eax*4 + 0xac], ebx
add ebx, dword [edi + eax*4 - 8]
mov dword [esp + eax*4 + 0xb0], ebx
add ebx, dword [edi + eax*4 - 4]
mov dword [esp + eax*4 + 0xb4], ebx
add ebx, dword [edi + eax*4]
add eax, 4
cmp eax, 0x103
jne 0x40c000
cmp byte [esp + 7], 0
jne 0x40bfd0
mov dword [esp + 0x14], edx
cmp dword [esp + 0x20], 0
mov dword [esp], esi
je 0x40c0c9
xor eax, eax
mov dword [esp + 0x10], ebp
movzx ebx, word [esi + eax*4]
shr ebx, cl
mov ebp, ebx
xor ebp, 0x3fffff00
or ebx, 0xff
and ebx, ebp
mov ebp, dword [esp + ebx*4 + 0xb4]
mov edx, dword [esp]
mov edx, dword [edx + eax*4]
mov esi, dword [esp + 0x10]
mov dword [esi + ebp*4], edx
lea edx, [ebp + 1]
mov esi, dword [esp]
movzx ebp, word [esi + eax*4 + 4]
shr ebp, cl
mov dword [esp + ebx*4 + 0xb4], edx
mov edx, ebp
xor edx, 0x3fffff00
or ebp, 0xff
and ebp, edx
mov edx, dword [esp + ebp*4 + 0xb4]
lea ebx, [edx + 1]
mov dword [esp + ebp*4 + 0xb4], ebx
mov ebp, dword [esp + 0x10]
mov esi, dword [esp]
mov ebx, dword [esi + eax*4 + 4]
mov dword [ebp + edx*4], ebx
add eax, 2
cmp dword [esp + 0x28], eax
jne 0x40c050
jmp 0x40c0cb
xor eax, eax
test byte [esp + 0xc], 1
mov edx, dword [esp + 0x14]
je 0x40bfd0
movzx edx, word [esi + eax*4]
shr edx, cl
mov ebx, edx
xor ebx, 0x3fffff00
or edx, 0xff
and edx, ebx
mov ebx, dword [esp + edx*4 + 0xb4]
mov esi, ebp
lea ebp, [ebx + 1]
mov dword [esp + edx*4 + 0xb4], ebp
mov edx, dword [esp + 0x14]
mov ebp, esi
mov esi, dword [esp]
mov eax, dword [esi + eax*4]
mov dword [ebp + ebx*4], eax
jmp 0x40bfd0
mov ebx, dword [esp + 0xc]
test ebx, ebx
mov edi, dword [esp + 0x24]
je 0x40c517
cmp ebx, 1
jne 0x40c138
mov word [ebp], 1
jmp 0x40c3df
movzx eax, word [ebp + 4]
add word [ebp], ax
cmp ebx, 3
jl 0x40c245
mov eax, 2
mov ecx, 2
sub ecx, ebx
xor edx, edx
mov esi, 1
jmp 0x40c17d
movzx edi, word [ebp + eax*4]
inc eax
add word [ebp + esi*4], di
lea edi, [ecx + esi]
inc edi
inc esi
cmp edi, 1
mov ebx, dword [esp + 0xc]
je 0x40c254
movzx edi, word [ebp + edx*4]
cmp eax, ebx
jge 0x40c190
movzx ebx, word [ebp + eax*4]
cmp di, bx
jae 0x40c1c0
mov word [ebp + esi*4], di
mov word [ebp + edx*4], si
inc edx
cmp eax, dword [esp + 0xc]
jge 0x40c1cc
cmp edx, esi
jge 0x40c160
movzx ebx, word [ebp + edx*4]
movzx edi, word [ebp + eax*4]
cmp bx, di
jae 0x40c165
jmp 0x40c1d1
inc eax
mov word [ebp + esi*4], bx
cmp eax, dword [esp + 0xc]
jl 0x40c1a1
movzx ebx, word [ebp + edx*4]
add word [ebp + esi*4], bx
mov word [ebp + edx*4], si
inc edx
jmp 0x40c16b
mov ecx, esi
and ecx, 0x7ffffffe
mov eax, dword [esp + 8]
mov edx, dword [esp + 0x18]
add edx, eax
add edx, 0x8194
xor eax, eax
xor ebx, ebx
jmp 0x40c20b
add eax, 2
cmp ecx, eax
je 0x40be91
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x40c226
mov word [esp + ebx*4 + 0x4b4], si
mov word [esp + ebx*4 + 0x4b6], ax
inc ebx
movzx esi, word [edx + eax*2]
test si, si
je 0x40c200
mov word [esp + ebx*4 + 0x4b4], si
lea esi, [eax + 1]
mov word [esp + ebx*4 + 0x4b6], si
inc ebx
jmp 0x40c200
lea ecx, [ebx - 2]
mov word [ebp + ebx*4 - 8], 0
jmp 0x40c2d5
mov word [ebp + ebx*4 - 8], 0
lea edx, [ebx - 3]
mov ecx, ebx
and ecx, 3
xor ecx, 2
mov eax, edx
je 0x40c284
mov eax, edx
nop
nop
nop
nop
movzx esi, word [ebp + eax*4]
movzx esi, word [ebp + esi*4]
inc esi
mov word [ebp + eax*4], si
dec eax
dec ecx
jne 0x40c270
lea ecx, [ebx - 2]
cmp edx, 3
jb 0x40c2d5
inc eax
nop
nop
nop
movzx edx, word [ebp + eax*4 - 4]
movzx edx, word [ebp + edx*4]
inc edx
mov word [ebp + eax*4 - 4], dx
movzx edx, word [ebp + eax*4 - 8]
movzx edx, word [ebp + edx*4]
inc edx
mov word [ebp + eax*4 - 8], dx
movzx edx, word [ebp + eax*4 - 0xc]
movzx edx, word [ebp + edx*4]
inc edx
mov word [ebp + eax*4 - 0xc], dx
movzx edx, word [ebp + eax*4 - 0x10]
movzx edx, word [ebp + edx*4]
inc edx
mov word [ebp + eax*4 - 0x10], dx
add eax, 0xfffffffc
jne 0x40c290
mov eax, 1
xor edx, edx
mov esi, dword [esp + 0x20]
mov dword [esp + 0x10], ebp
jmp 0x40c31f
inc edx
mov eax, edi
or eax, 2
mov dword [esp], eax
mov eax, edi
and eax, 2
mov ecx, dword [esp]
imul ecx, eax
mov dword [esp], ecx
and edi, 0xfffffffd
xor eax, 2
imul eax, edi
add eax, dword [esp]
test eax, eax
mov ecx, dword [esp + 0x14]
jle 0x40c3d3
test ecx, ecx
mov dword [esp], eax
js 0x40c360
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
nop
movzx eax, word [ebp + ecx*4]
cmp edx, eax
jne 0x40c352
mov eax, edi
and eax, 1
xor edi, 1
lea edi, [edi + eax*2]
lea eax, [ecx - 1]
test ecx, ecx
mov ecx, eax
jg 0x40c330
mov ecx, 0xffffffff
mov eax, dword [esp]
jmp 0x40c362
xor edi, edi
sub eax, edi
mov dword [esp + 0x14], ecx
jle 0x40c2f0
and eax, 3
je 0x40c399
lea ebp, [ebp + esi*4]
xor ebx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [ebp], dx
inc ebx
add ebp, 0xfffffffc
cmp eax, ebx
jne 0x40c380
mov eax, dword [esp]
sub eax, ebx
sub esi, ebx
mov ebp, dword [esp + 0x10]
jmp 0x40c39c
mov eax, dword [esp]
mov ebx, edi
sub ebx, dword [esp]
cmp ebx, 0xfffffffc
mov ebx, dword [esp + 0xc]
ja 0x40c2f0
nop
nop
mov word [ebp + esi*4], dx
mov word [ebp + esi*4 - 4], dx
mov word [ebp + esi*4 - 8], dx
mov word [ebp + esi*4 - 0xc], dx
add esi, 0xfffffffc
add eax, 0xfffffffc
cmp eax, edi
jg 0x40c3b0
jmp 0x40c2f0
test ebx, ebx
mov edi, dword [esp + 0x24]
jle 0x40c517
cmp dword [esp + 0x20], 0
je 0x40c4f7
xor eax, eax
nop
nop
nop
nop
movzx ecx, word [ebp + eax*4]
mov edx, dword [esp + ecx*4 + 0x30]
mov esi, edx
and esi, 1
xor edx, 1
lea edx, [edx + esi*2]
mov dword [esp + ecx*4 + 0x30], edx
movzx ecx, word [ebp + eax*4 + 4]
mov edx, dword [esp + ecx*4 + 0x30]
mov esi, edx
and esi, 1
xor edx, 1
lea edx, [edx + esi*2]
mov dword [esp + ecx*4 + 0x30], edx
add eax, 2
cmp dword [esp + 0x28], eax
jne 0x40c3f0
test bl, 1
je 0x40c446
movzx eax, word [ebp + eax*4]
mov ecx, dword [esp + eax*4 + 0x30]
mov edx, ecx
and edx, 1
xor ecx, 1
lea ecx, [ecx + edx*2]
mov dword [esp + eax*4 + 0x30], ecx
cmp ebx, 2
jl 0x40c517
mov edx, dword [esp + 0x15cc]
cmp edx, 0x20
jge 0x40c4bc
mov eax, dword [esp + edx*4 + 0x30]
mov esi, edx
neg edx
mov ecx, esi
and edx, 3
je 0x40c47c
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x34]
inc ecx
mov dword [esp + esi*4 + 0x30], eax
dec edx
jne 0x40c470
lea edx, [esi - 0x1d]
cmp edx, 3
mov edx, esi
jb 0x40c4b8
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x34]
mov dword [esp + edx*4 + 0x30], eax
add eax, dword [esp + ecx*4 + 0x38]
mov dword [esp + edx*4 + 0x30], eax
add eax, dword [esp + ecx*4 + 0x3c]
mov dword [esp + edx*4 + 0x30], eax
add eax, dword [esp + ecx*4 + 0x40]
add ecx, 4
mov dword [esp + edx*4 + 0x30], eax
cmp ecx, 0x20
jne 0x40c490
test edx, edx
jle 0x40c507
inc edx
xor ecx, ecx
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, dword [esp + edx*4 + 0x2c]
shl esi, cl
add eax, esi
dec edx
inc ecx
cmp edx, 1
ja 0x40c4d0
mov edx, 1
mov ecx, dword [esp + 0x15cc]
shl edx, cl
cmp eax, edx
jne 0x40c79d
jmp 0x40c517
xor eax, eax
test bl, 1
jne 0x40c42e
jmp 0x40c446
mov ecx, edx
mov edx, 1
shl edx, cl
xor eax, eax
jmp 0x40c79d
shl edi, 5
mov esi, dword [esp + 8]
lea eax, [esi + edi]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.0040ca90
add esp, 0xc
mov eax, dword [esp + 0x18]
add eax, esi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.0040ca90
add esp, 0xc
cmp dword [esp + 0x15cc], 0
jle 0x40c640
mov eax, dword [esp + 0x15cc]
inc eax
cmp eax, 3
jge 0x40c571
mov eax, 2
add ebp, 0xfffffffe
mov ecx, 1
add edi, dword [esp + 8]
mov dword [esp + 0x10], ebp
mov dword [esp], eax
jmp 0x40c599
inc ecx
cmp ecx, eax
je 0x40c640
mov edx, dword [esp + ecx*4 + 0x30]
test edx, edx
jle 0x40c590
mov esi, edx
and esi, 3
je 0x40c5f0
mov dword [esp + 0xc], ebx
lea ebx, [ebx*4]
add ebx, ebp
mov eax, edi
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
movzx ebp, word [ebx]
mov byte [ebp + eax + 0x8f12], cl
inc edi
add ebx, 0xfffffffc
cmp esi, edi
jne 0x40c5c0
mov ebx, dword [esp + 0xc]
sub ebx, edi
mov esi, edx
sub esi, edi
mov edi, eax
mov ebp, dword [esp + 0x10]
mov eax, dword [esp]
cmp edx, 4
jb 0x40c590
jmp 0x40c5f7
mov esi, edx
cmp edx, 4
jb 0x40c590
dec esi
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [ebp + ebx*4]
mov byte [edx + edi + 0x8f12], cl
movzx edx, word [ebp + ebx*4 - 4]
mov byte [edx + edi + 0x8f12], cl
movzx edx, word [ebp + ebx*4 - 8]
mov byte [edx + edi + 0x8f12], cl
movzx edx, word [ebp + ebx*4 - 0xc]
add ebx, 0xfffffffc
mov byte [edx + edi + 0x8f12], cl
add esi, 0xfffffffc
cmp esi, 0xfffffffe
jb 0x40c600
jmp 0x40c590
mov ecx, dword [esp + 0x15c8]
mov dword [esp + 0x938], 0
mov eax, dword [esp + 0x15cc]
cmp eax, 2
jl 0x40c6bd
lea ecx, [eax - 1]
cmp eax, 2
jne 0x40c66f
xor eax, eax
mov edx, 2
jmp 0x40c6a4
mov ebx, ecx
and ebx, 0xfffffffe
xor eax, eax
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + edx*4 + 0x34]
add eax, eax
mov dword [esp + edx*4 + 0x93c], eax
add eax, dword [esp + edx*4 + 0x38]
add eax, eax
mov dword [esp + edx*4 + 0x940], eax
add edx, 2
cmp ebx, edx
jne 0x40c680
add edx, 2
test cl, 1
mov ecx, dword [esp + 0x15c8]
je 0x40c6bd
add eax, dword [esp + edx*4 + 0x2c]
add eax, eax
mov dword [esp + edx*4 + 0x934], eax
test ecx, ecx
jle 0x40c792
xor eax, eax
mov edx, dword [esp + 0x1c]
lea edi, [edx + edx*8]
mov edx, edi
shl edx, 5
mov esi, dword [esp + 8]
add edx, esi
shl edi, 6
add edi, esi
mov dword [esp], edi
jmp 0x40c70b
mov ecx, dword [esp]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15c8]
inc eax
cmp eax, ecx
je 0x40c792
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x40c702
mov ecx, dword [esp + ebx*4 + 0x934]
lea edi, [ecx + 1]
mov dword [esp + ebx*4 + 0x934], edi
xor edi, edi
cmp bl, 4
jb 0x40c76f
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 0x40c740
and ebx, 3
je 0x40c6f0
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 0x40c780
jmp 0x40c6f0
add esp, 0x15b4
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, dword [esp + 0x15cc]
dec dword [esp + ecx*4 + 0x30]
nop
nop
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x40c7c8
mov esi, dword [esp + ecx*4 + 0x2c]
dec ecx
test esi, esi
je 0x40c7b0
dec esi
mov dword [esp + ecx*4 + 0x30], esi
add dword [esp + ecx*4 + 0x34], 2
dec eax
cmp eax, edx
jne 0x40c79d
jmp 0x40c517