Function at 0x404e40
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x3c
mov dx, word [0x4ae904]
mov ecx, dword [0x4ae93c]
push ebx
push ebp
mov ebp, dword [esp + 0x48]
inc ecx
mov dword [0x4ae93c], ecx
movzx eax, dx
push esi
movzx esi, byte [esp + 0x58]
push edi
mov eax, dword [ebp + eax*4]
movzx edi, byte [esp + 0x54]
add eax, ecx
mov dword [esp + 0x28], eax
movzx eax, word [0x4ae908]
mov dword [esp + 0x48], eax
movzx eax, byte [0x4ae8f0]
xor eax, edi
movzx ebx, word [0x4ae918]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x58]
inc eax
mov dword [esp + 0x10], esi
movzx ecx, ax
mov dword [esp + 0x58], eax
mov eax, dword [0x4ae8f4]
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x40], edi
mov eax, dword [eax + esi*4 + 0x9c]
xor eax, ecx
add ecx, 0x71b
mov dword [esp + 0x2c], eax
mov al, byte [0x4ae8f1]
movzx esi, al
inc al
mov byte [0x4ae8f1], al
or esi, edi
mov dword [esp + 0x18], ecx
movzx ecx, al
mov al, byte [esp + 0x58]
sub al, dl
mov dword [esp + 0x44], esi
mov esi, dword [0x4ae910]
mov byte [esp + 0x54], al
and esi, 0x1857
mov eax, dword [esp + 0x58]
movzx eax, al
mov dword [esp + 0x20], eax
mov dword [esp + 0x14], ecx
mov dword [esp + 0x24], esi
lea edx, [eax + eax*2]
mov eax, dword [0x4ae90c]
movzx eax, byte [edx + eax]
cmp ecx, eax
jne 0x404feb
mov eax, dword [esp + 0x1c]
lea edx, [esi + 7]
add eax, 0x6f3
mov dword [esp + 0x38], edx
and eax, edi
lea esi, [ecx*4]
mov edi, dword [esp + 0x10]
add esi, ebp
mov dword [esp + 0x1c], eax
lea eax, [edi + ebx*4]
mov bl, byte [esp + 0x54]
mov dword [esp + 0x34], eax
lea edi, [ecx + ecx*2]
mov eax, 0x182c
shl edi, 2
sub eax, ebp
mov ebp, dword [esp + 0x1c]
mov dword [esp + 0x30], eax
or dword [esi], ebp
lea esi, [esi + 4]
mov eax, dword [0x4ae8f4]
lea edi, [edi + 0xc]
mov ebp, dword [esp + 0x20]
dec bl
mov al, byte [edi + eax + 0x10]
or al, byte [esp + 0x58]
and al, cl
xor al, byte [0x4ae940]
and byte [edx + ecx], al
mov eax, 0x180c
mov eax, dword [eax]
mov edx, dword [eax*4]
mov eax, dword [esp + 0x10]
imul edx, ecx
inc ecx
or edx, dword [eax + eax*4]
mov eax, 0xb63bf93d
mul edx
mov eax, dword [esp + 0x30]
shr edx, 0xc
mov dword [eax + esi - 4], edx
mov eax, dword [esp + 0x34]
mov dword [eax], 1
lea eax, [ebp*2]
mov edx, dword [0x4ae90c]
add eax, ebp
mov ebp, dword [esp + 0x1c]
movzx edx, byte [eax + edx]
cmp ecx, edx
mov edx, dword [esp + 0x38]
je 0x404f61
mov ebp, dword [esp + 0x50]
mov edi, dword [esp + 0x40]
mov byte [esp + 0x54], bl
mov ebx, dword [esp + 0x3c]
movzx ecx, word [0x4ae900]
mov eax, edi
cdq
movzx esi, byte [esp + 0x54]
mov dword [esp + 0x1c], esi
lea ecx, [ecx*4]
idiv dword [ecx + ebp]
mov edx, dword [esp + 0x28]
mov dword [ecx + ebp], eax
mov eax, dword [esp + 0x20]
lea eax, [eax + eax*2]
lea ecx, [eax*4]
mov eax, 0x180c
mov eax, dword [eax]
add eax, eax
mov eax, dword [edx + eax*8]
xor edx, edx
div esi
mov al, byte [esp + 0x58]
xor dword [ecx + ebp], edx
inc al
imul ecx, dword [esp + 0x10], 0xd
xor edx, edx
mov byte [esp + 0x54], al
mov eax, 0x1808
mov esi, dword [eax]
mov eax, dword [0x4ae928]
mov eax, dword [ebp + eax*4]
xor eax, dword [0x4ae938]
imul eax, dword [ecx]
movzx ecx, byte [esi + 0x1ef6]
div ecx
movzx ecx, byte [esp + 0x54]
mov byte [esi + 0x1ef6], dl
mov dword [esp + 0x20], ecx
lea eax, [ecx + ecx*2]
mov esi, dword [ebp + eax*4]
movzx eax, byte [0x4ae8f1]
cmp esi, eax
jge 0x4050b6
mov ecx, dword [esp + 0x10]
mov edi, dword [ebp + ecx*4 + 0x24]
nop dword [eax]
mov eax, dword [esp + 0x24]
inc ebx
inc esi
movzx eax, byte [eax + ebx]
cdq
idiv edi
mov edi, eax
mov dword [ebp + ecx*4 + 0x24], edi
movzx ecx, byte [0x4ae8f1]
cmp esi, ecx
mov ecx, dword [esp + 0x10]
jl 0x405090
mov ecx, dword [esp + 0x20]
mov edx, 0x1808
mov eax, dword [edx]
mov edi, dword [ebp + eax*8 + 0x98]
movzx eax, byte [0x3c36]
cmp edi, eax
jl 0x4052c2
mov eax, dword [esp + 0x44]
mov ebp, dword [esp + 0x14]
mov dword [esp + 0x40], 0xcb0
lea eax, [eax + ecx*4]
add eax, 4
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x2c]
add eax, 3
add ebp, 0x64
mov dword [esp + 0x38], eax
lea ebp, [ebp + edi*4]
jmp 0x405106
mov edx, 0x1808
mov eax, dword [edx]
xor edx, edx
mov ecx, dword [esp + 0x18]
lea esi, [ecx + eax*8]
mov eax, dword [esp + 0x24]
movzx ecx, byte [edi + eax]
mov eax, 0x9cf
div ecx
mov ecx, 0x8e9
cdq
idiv ecx
sub edx, dword [esi]
mov dword [esi], edx
mov edx, 0x19bd
movzx ecx, word [0x4ae900]
mov eax, dword [0x4ae93c]
mov esi, dword [ecx + eax*4 + 0x20]
mov eax, dword [0x4ae928]
mov dword [esp + 0x44], eax
inc eax
mov dword [0x4ae928], eax
movzx eax, word [0x4ae908]
movzx ecx, word [ecx + 0x466c]
cmp word [eax + eax + 0x214cc8f], dx
mov dx, word [0x4ae904]
jae 0x405178
inc dx
mov word [0x4ae904], dx
mov eax, dword [esp + 0x44]
movzx eax, byte [ecx + eax + 0x17]
sub al, byte [0x4ae8f0]
add al, 0x57
add al, dl
and byte [ecx + ebx], al
inc byte [0x4ae8f0]
movzx eax, byte [ebx + 0x76f]
cdq
idiv esi
mov eax, edx
cdq
idiv dword [esp + 0x40]
xor word [ecx + ecx + 0x214cc8f], dx
mov ecx, 2
mov eax, dword [0x4ae93c]
sub ecx, esi
mov edx, dword [esp + 0x10]
movzx esi, byte [esp + 0x5c]
mov word [eax*2 + 0x214cc8f], cx
mov ecx, dword [esp + 0x3c]
mov eax, dword [0x4ae914]
mov dword [ecx], eax
mov eax, edi
imul eax, ebx
dec ebx
sub eax, dword [edx + edi*8]
mov dword [edx + edi*8], eax
mov eax, dword [esp + 0x38]
movzx ecx, byte [esi + eax]
mov eax, dword [edx + 0x984]
xor edx, edx
add eax, ebx
div ecx
mov ecx, dword [esp + 0x10]
xor edx, edx
xor eax, 0x1c30
and dword [ecx + esi*4], eax
mov eax, dword [0x4ae90c]
movzx ecx, byte [eax + edi + 8]
mov eax, 0xfa5
sub eax, ecx
mov ecx, dword [esp + 0x28]
div dword [ecx + esi*8]
mov esi, dword [esp + 0x48]
imul edx, dword [0x4ae924]
mov cl, byte [esp + 0x5c]
dec cl
mov byte [esp + 0x5c], cl
mov dword [0x4ae924], edx
mov edx, dword [esp + 0x14]
mov eax, dword [edx]
mov edx, 0x9c7
cmp word [esi + eax*2], dx
mov edx, dword [esp + 0x14]
jb 0x40525a
mov eax, dword [esp + 0x20]
mov eax, dword [edx + eax*4]
cmp eax, dword [0x4ae920]
jle 0x40526e
mov edx, dword [esp + 0x18]
mov eax, 0x1808
mov esi, dword [esp + 0x1c]
mov eax, dword [eax]
cmp dword [edx + eax*4], esi
jbe 0x4052aa
mov eax, dword [esp + 0x1c]
or dword [ebp], eax
movzx eax, cl
movzx eax, byte [eax + 0x1ef4]
cdq
idiv edi
mov ecx, eax
mov eax, 0x51eb851f
imul ecx
movzx eax, word [0x4ae92c]
sar edx, 3
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
imul ecx, eax
mov eax, dword [esp + 0x10]
or dword [eax + edi*8], ecx
dec byte [esp + 0x5c]
mov eax, 0x3c36
inc edi
add ebp, 4
movzx eax, byte [eax]
cmp edi, eax
jge 0x405101
mov ebp, dword [esp + 0x50]
mov eax, dword [0x4ae928]
mov ecx, dword [0x4ae914]
mov esi, dword [esp + 0x14]
pop edi
mov eax, dword [eax*4]
cdq
idiv dword [esi + ecx*4]
mov esi, dword [esp + 0x14]
mov ecx, 0x1808
xor edx, edx
mov ecx, dword [ecx]
mov dword [ebp + ecx*8 + 0x20], eax
mov eax, dword [esp + 0x54]
dec eax
movzx eax, ax
and eax, dword [esi + 0x39d4]
div ebx
mov dword [ebp + ebx*4 + 0x18], eax
mov eax, 0xffff
mov cx, word [0x4ae92c]
add cx, ax
mov al, byte [esp + 0x50]
mov word [0x4ae92c], cx
dec al
movzx ecx, cx
movzx eax, al
lea edx, [ecx*8]
mov ecx, dword [esp + 0x28]
movzx ecx, byte [ecx + eax*2]
sub ecx, dword [edx + ebp + 0x80]
mov dword [edx + ebp + 0x80], ecx
mov eax, dword [esi + eax*4 + 0x58]
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret