Function at 0x40e2e6
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4c
mov eax, dword [0x450eac]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x1c]
xor ecx, ecx
push ebx
mov ebx, dword [ebp + 0x10]
push edi
mov edi, dword [ebp + 8]
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x38], ecx
mov dword [ebp - 0x34], ecx
mov dword [ebp - 0x30], ecx
test edi, edi
je 0x40e4ec
test ebx, ebx
je 0x40e4ec
test eax, eax
je 0x40e4ec
push esi
push dword [ebp + 0x20]
push ecx
push eax
call fcn.004288f0
lea eax, [ebp - 0x38]
push eax
call fcn.00410976
lea eax, [ebp - 0x34]
push eax
call fcn.00410976
lea eax, [ebp - 0x30]
push eax
call fcn.00410976
push 0x14
pop esi
push esi
push dword [ebp - 0x38]
call fcn.00410966
push esi
push dword [ebp - 0x34]
call fcn.00410966
push esi
push dword [ebp - 0x30]
call fcn.00410966
push dword [ebp + 0xc]
push edi
push dword [ebp - 0x38]
call fcn.0041075a
mov esi, eax
add esp, 0x3c
test esi, esi
jne 0x40e3a6
push dword [ebp + 0xc]
push edi
push dword [ebp - 0x34]
call fcn.0041075a
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x40e3a6
push dword [ebp + 0x14]
push ebx
push dword [ebp - 0x34]
call fcn.00410873
add esp, 0xc
mov esi, eax
mov eax, dword [ebp + 0x20]
xor ebx, ebx
movzx eax, ax
dec eax
mov dword [ebp - 0x3c], ebx
cdq
push 0x14
pop ecx
idiv ecx
inc eax
movzx eax, ax
mov dword [ebp - 0x4c], eax
test esi, esi
jne 0x40e4c9
cmp bx, ax
jae 0x40e4c9
push dword [ebp - 0x30]
xor eax, eax
lea edi, [ebp - 0x2c]
push dword [ebp - 0x34]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
call fcn.00410924
mov esi, eax
mov dword [ebp - 0x40], esi
pop ecx
pop ecx
test esi, esi
jne 0x40e4c9
movzx ecx, bx
xor edi, edi
inc ecx
mov eax, ecx
shr eax, 0x18
mov byte [ebp - 0x18], al
mov eax, ecx
shr eax, 0x10
mov byte [ebp - 0x17], al
lea eax, [ebx + 1]
shr ecx, 8
mov byte [ebp - 0x16], cl
mov byte [ebp - 0x15], al
cmp dword [ebp + 0x18], edi
jle 0x40e48a
push 4
pop ecx
push ecx
lea eax, [ebp - 0x18]
push eax
push dword [ebp - 0x30]
call fcn.00410873
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x40e4c9
push 0x14
pop eax
push eax
lea eax, [ebp - 0x18]
push eax
push dword [ebp - 0x30]
call fcn.004108b6
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x40e4c9
push 0x14
pop eax
xor ecx, ecx
mov edx, eax
mov al, byte [ebp + ecx - 0x18]
xor byte [ebp + ecx - 0x2c], al
inc ecx
sub edx, 1
jne 0x40e458
push dword [ebp - 0x30]
push dword [ebp - 0x38]
call fcn.00410924
mov esi, eax
mov dword [ebp - 0x40], eax
pop ecx
pop ecx
test esi, esi
jne 0x40e4c9
push 0x14
pop eax
inc edi
mov ecx, eax
movzx eax, di
cmp eax, dword [ebp + 0x18]
jl 0x40e41e
mov edi, dword [ebp - 0x44]
xor ecx, ecx
mov esi, dword [ebp + 0x20]
imul eax, ebx, 0x14
mov dword [ebp - 0x48], eax
mov ebx, eax
lea eax, [ebx + ecx]
movzx edx, ax
cmp edx, esi
jge 0x40e4b7
movzx eax, cx
inc ecx
push 0x14
mov al, byte [ebp + eax - 0x2c]
mov byte [edx + edi], al
pop eax
cmp cx, ax
jb 0x40e49a
mov ebx, dword [ebp - 0x3c]
mov esi, dword [ebp - 0x40]
inc ebx
mov eax, dword [ebp - 0x4c]
mov dword [ebp - 0x3c], ebx
jmp 0x40e3c7
lea eax, [ebp - 0x30]
push eax
call fcn.004109aa
lea eax, [ebp - 0x38]
push eax
call fcn.004109aa
lea eax, [ebp - 0x34]
push eax
call fcn.004109aa
add esp, 0xc
mov eax, esi
pop esi
jmp 0x40e4ef
push 0xffffffffffffff9a
pop eax
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop ebx
call fcn.0042702f
leave
ret