Function at 0x40e760
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
push esi
mov esi, dword [ebp + 8]
mov ebx, edx
push edi
xor edi, edi
mov dword [ebp - 0x3c], ebx
mov dword [ebp - 0x44], ecx
xor edx, edx
mov dword [ebp - 0x40], esi
movsx eax, dx
inc edx
or edi, dword [ecx + eax*4]
cmp dx, 4
jb 0x40e785
test edi, edi
jne 0x40e7fa
xor edx, edx
movsx ecx, dx
inc edx
mov eax, dword [ebx + ecx*4]
mov dword [esi + ecx*4], eax
cmp dx, 4
jb 0x40e798
mov edi, dword [esi + 0xc]
and edi, 1
shl edi, 0x10
xor ebx, ebx
movsx eax, bx
inc ebx
mov ecx, dword [esi + eax*4]
lea edx, [esi + eax*4]
shr ecx, 1
or ecx, edi
mov edi, dword [edx]
shl edi, 0x1f
mov dword [edx], ecx
cmp bx, 4
jb 0x40e7b3
and dword [esi], 0x1ffff
xor edx, edx
movsx ecx, dx
inc edx
mov eax, dword [esi + ecx*4]
mov dword [esi + ecx*4 + 0x10], eax
cmp dx, 4
jb 0x40e7d6
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00413dc9
mov esp, ebp
pop ebp
ret
lea edx, [ebp - 0x28]
call fcn.0040d570
mov edx, dword [ebp - 0x28]
lea edi, [ebp - 0x1c]
shr edx, 0x10
mov ebx, 3
and edx, 1
mov ecx, dword [edi]
lea edi, [edi - 4]
dec ebx
lea eax, [ecx + ecx]
or eax, edx
mov edx, ecx
shr edx, 0x1f
mov dword [edi + 4], eax
test bx, bx
jns 0x40e813
mov ecx, dword [ebp - 0x3c]
lea eax, [ebp - 0x18]
and dword [ebp - 0x28], 0x1ffff
lea edx, [ebp - 0x28]
push eax
call fcn.0040d360
mov edi, dword [ebp - 0xc]
add esp, 4
and edi, 1
shl edi, 0x10
xor ebx, ebx
nop
movsx eax, bx
lea edx, [ebp - 0x18]
mov ecx, dword [edx + eax*4]
lea edx, [edx + eax*4]
shr ecx, 1
inc ebx
or ecx, edi
mov edi, dword [edx]
shl edi, 0x1f
mov dword [edx], ecx
cmp bx, 4
jb 0x40e850
and dword [ebp - 0x18], 0x1ffff
xor ebx, ebx
xor ecx, ecx
nop dword [eax]
movsx eax, cx
inc ecx
xor ebx, dword [ebp + eax*4 - 0x18]
cmp cx, 4
jb 0x40e880
or esi, 0xffffffff
mov eax, 0x10
movzx edi, ax
mov edx, ebx
mov ecx, edi
shr esi, cl
shr edx, cl
and ebx, esi
xor ebx, edx
shr di, 1
movzx eax, di
jne 0x40e896
mov esi, dword [ebp - 0x40]
test ebx, ebx
je 0x40e8fb
xor ecx, ecx
nop word [eax + eax]
movsx eax, cx
inc ecx
mov dword [esi + eax*4], 0
cmp cx, 4
jb 0x40e8c0
xor ecx, ecx
movsx eax, cx
inc ecx
mov dword [esi + eax*4 + 0x10], 0
cmp cx, 4
jb 0x40e8d3
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00413dc9
mov esp, ebp
pop ebp
ret
xor ecx, ecx
nop dword [eax]
movsx eax, cx
inc ecx
mov dword [ebp + eax*4 - 0x38], 0
cmp cx, 4
jb 0x40e900
mov ebx, 1
xor edi, edi
lea esi, [ebx + 0x70]
nop dword [eax]
mov ecx, edi
mov eax, 3
shr ecx, 5
sub eax, ecx
lea ecx, [edi + 1]
movzx edx, ax
mov eax, 3
mov dword [ebp - 0x3c], ecx
shr ecx, 5
sub eax, ecx
movzx ecx, ax
movsx eax, dx
mov edi, dword [ebp + eax*4 - 0x38]
xor edi, dword [ebp + eax*4 - 0x18]
and edi, ebx
cmp cx, dx
jne 0x40e966
movsx eax, cx
lea ecx, [ebp - 0x38]
lea ecx, [ecx + eax*4]
lea eax, [edi + edi]
or dword [ecx], eax
add ebx, ebx
jmp 0x40e976
mov ebx, 1
test edi, edi
je 0x40e976
movsx eax, cx
mov dword [ebp + eax*4 - 0x38], ebx
mov edi, dword [ebp - 0x3c]
sub esi, 1
jne 0x40e920
mov eax, dword [ebp - 0x38]
xor eax, dword [ebp - 0x18]
mov esi, dword [ebp - 0x40]
test eax, 0x10000
je 0x40e9cb
xor ecx, ecx
movsx eax, cx
inc ecx
mov dword [esi + eax*4], 0
cmp cx, 4
jb 0x40e990
xor ecx, ecx
movsx eax, cx
inc ecx
mov dword [esi + eax*4 + 0x10], 0
cmp cx, 4
jb 0x40e9a3
mov eax, 2
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00413dc9
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp - 0x44]
lea edx, [ebp - 0x38]
push esi
mov ecx, edi
call fcn.0040d360
add esp, 4
xor ecx, ecx
nop
movsx eax, cx
inc ecx
mov dword [esi + eax*4 + 0x10], 0
cmp cx, 4
jb 0x40e9e0
xor edx, edx
movsx ecx, dx
inc edx
mov eax, dword [edi + ecx*4]
xor eax, dword [esi + ecx*4]
mov dword [esi + ecx*4 + 0x10], eax
cmp dx, 4
jb 0x40e9f4
mov ecx, dword [ebp - 8]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00413dc9
mov esp, ebp
pop ebp
ret