Function at 0x4157a0
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x1c
mov eax, dword [0x4ae928]
xor edx, edx
movzx ecx, word [0x4ae908]
push ebx
push ebp
push esi
mov esi, dword [esp + 0x58]
push edi
lea edi, [eax + eax*2]
movzx ebp, word [0x4ae910]
mov eax, dword [esi + edi*4]
mov dword [esp + 0x20], eax
mov eax, 0xd84
div ecx
mov eax, 0x416
mov ecx, dword [esp + 0x4c]
mov ebx, edx
cdq
idiv dword [0x4ae8fc]
mov eax, dword [ecx + 0x4c40]
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x48]
mov dword [esp + 0x14], edx
mov edx, dword [0x4ae93c]
inc edx
mov dword [esp + 0x28], ebx
mov dword [0x4ae93c], edx
imul ebp, dword [eax + edx*4]
mov eax, dword [esi]
mov eax, dword [esi + eax*8]
mov dword [esp + 0x24], eax
mov ax, word [0x4ae900]
mov dword [esp + 0x48], ebp
mov ebp, dword [ecx + edx*4]
movzx ecx, ax
inc ax
mov word [0x4ae900], ax
movzx eax, ax
mov dword [esp + 0x18], ecx
mov ecx, dword [esp + 0x40]
mov dword [esp + 0x1c], ebp
lea eax, [eax + eax*2]
mov eax, dword [ecx + eax*4]
mov ecx, dword [ecx + edi*4 + 0x14]
mov dword [esp + 0x10], eax
cmp ecx, dword [0x4ae924]
jge 0x4158cb
mov esi, dword [esp + 0x50]
lea edi, [ecx*2 + 0x17]
add edi, ecx
lea edi, [esi + edi*4]
mov eax, dword [ebx + edx*4 + 0x64]
lea edi, [edi + 0xc]
sub eax, dword [esi + ecx*4]
mov edx, dword [esp + 0x5c]
mov dword [esi + ecx*4], eax
inc ecx
mov eax, dword [0x4ae93c]
lea eax, [eax + eax*2]
lea esi, [edx + eax*4]
mov eax, dword [edi - 0xc]
xor edx, edx
div dword [esi]
mov dword [esi], eax
mov esi, 0x1522
mov ax, word [0x4ae900]
inc ax
mov word [0x4ae900], ax
movzx eax, ax
lea edx, [eax*2]
movzx eax, byte [0x4ae8f2]
add ax, si
and word [edx + ebp], ax
inc byte [0x4ae8f2]
cmp ecx, dword [0x4ae924]
jge 0x4158cb
mov edx, dword [0x4ae93c]
mov esi, dword [esp + 0x50]
jmp 0x415860
mov eax, dword [esp + 0x54]
xor edx, edx
inc eax
mov ecx, dword [esp + 0x5c]
mov word [0x4ae900], ax
movzx eax, ax
mov ebp, dword [esp + 0x14]
mov edi, dword [esp + 0x38]
mov ebx, dword [esp + 0x34]
lea eax, [eax + eax*2]
lea esi, [ecx + eax*4]
mov ecx, dword [esp + 0x1c]
movzx eax, di
add edi, 0xffff
movzx ecx, word [ecx + eax*2]
mov eax, dword [ebx + ebp*4]
div dword [0x4ae934]
movzx edx, di
xor ecx, eax
mov edi, dword [esp + 0x24]
add dword [esi], ecx
mov esi, dword [esp + 0x3c]
mov ecx, dword [esp + 0x40]
mov dword [esp + 0x54], edx
movzx eax, word [esi]
lea ecx, [ecx + eax*4]
movzx eax, word [0x4ae900]
mov eax, dword [edi + eax*4]
mov edi, dword [esp + 0x5c]
imul eax, dword [edi + edx*4]
xor edx, edx
div dword [ecx]
mov dword [ecx], eax
mov eax, dword [esp + 0x54]
lea ecx, [ebx + eax*4]
movzx eax, word [0x4ae910]
cdq
idiv dword [ecx]
mov ebx, dword [esp + 0x4c]
mov dword [ecx], edx
xor edx, edx
mov ecx, dword [0x4ae91c]
mov eax, dword [ebp*4 + 0xd61]
div dword [ecx + ebp*4]
mov eax, dword [esp + 0x48]
mov ebp, dword [esp + 0x28]
movzx ecx, word [esi + eax*2]
mov eax, edx
xor edx, edx
div ecx
movzx ecx, word [0x4ae900]
mov edx, dword [esp + 0x18]
lea ecx, [ecx + ecx*2]
xor ax, word [edx + ecx*2]
xor edx, edx
mov word [0x4ae900], ax
dec dword [ebx]
mov eax, dword [ebx]
lea ecx, [edi + eax*4]
mov eax, dword [0x4ae914]
div dword [ecx]
mov edi, dword [esp + 0x14]
mov dword [ecx], eax
mov cx, word [0x4ae900]
movzx eax, cx
mov edx, dword [ebp + eax*4]
mov eax, 0xffff
xor edx, dword [esp + 0x48]
add cx, ax
mov eax, dword [0x4ae91c]
mov word [0x4ae900], cx
mov ecx, dword [esp + 0x10]
movzx eax, byte [eax + edi*8]
xor al, byte [0x4ae920]
inc edi
mov byte [esp + 0x5c], al
movzx eax, word [0x4ae904]
movzx ecx, word [ecx + eax*4]
movzx eax, byte [0x4ae93c]
mov byte [esp + 0x4c], al
push dword [esp + 0x4c]
push ecx
push dword [esp + 0x64]
push edx
call fcn.00404e40
movzx ecx, word [esi]
add esp, 0x10
mov word [esi + ecx*2 + 0x12], ax
mov ecx, dword [esp + 0x50]
mov eax, dword [esp + 0x20]
mov ecx, dword [ecx]
lea eax, [eax + ecx*2]
movzx esi, byte [ecx + eax]
cmp esi, 0x7bf
jl 0x415b01
mov eax, dword [esp + 0x54]
lea ecx, [eax + eax*2]
mov eax, dword [esp + 0x44]
lea eax, [eax + ecx*4]
add eax, 0x44
shl edi, 2
mov dword [esp + 0x50], eax
xor edx, edx
mov ecx, dword [esp + 0x18]
mov eax, esi
lea edi, [edi - 4]
xor eax, 0xfe5
div dword [0x4ae928]
mov edx, dword [esp + 0x10]
mov dword [0x4ae928], eax
mov eax, dword [0x4ae93c]
inc eax
mov dword [0x4ae93c], eax
movzx eax, word [ecx + eax*2 + 2]
mov ecx, dword [esp + 0x40]
xor dword [edi + ecx + 4], eax
mov cx, si
mov eax, dword [ebx]
sub cx, word [edx + eax*2]
mov eax, 0x82a
sub cx, ax
mov eax, dword [esp + 0x50]
and cx, word [eax]
mov eax, dword [esp + 0x1c]
mov word [eax + esi*2], cx
inc esi
mov eax, dword [ebx]
lea ecx, [eax*4]
mov eax, dword [esp + 0x48]
mov eax, dword [ebp + eax*4]
xor dword [ecx + ebp + 0x74], eax
mov eax, dword [0x4ae91c]
mov ecx, dword [edi + eax + 4]
mov eax, 0x39033aaf
or ecx, 0x120d
imul ecx
movzx eax, word [0x4ae92c]
sar edx, 9
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
mov edx, dword [esp + 0x20]
movzx ecx, cx
movzx eax, byte [eax + edx + 4]
mov edx, dword [esp + 0x10]
imul ecx, eax
mov eax, dword [ebx]
mov word [edx + eax*2 + 0x24], cx
cmp esi, 0x7bf
jge 0x415a47
mov eax, dword [0x4ae928]
inc eax
pop edi
mov dword [0x4ae928], eax
pop esi
mov eax, dword [ebp + eax*4 + 0x60]
xor eax, dword [0x4ae93c]
pop ebp
pop ebx
add esp, 0x1c
ret