Function at 0x40164f
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x24
mov eax, dword [0x67a3bc]
xor edx, edx
push ebx
mov ebx, dword [esp + 0x2c]
push ebp
push esi
push edi
div dword [ebx + 0x6740]
mov edi, dword [esp + 0x3c]
mov ebp, eax
mov eax, dword [0x67a3cc]
mov ecx, eax
cdq
sub ecx, edi
dec edi
idiv edi
xor edx, edx
mov dword [esp + 0x14], ecx
mov dword [esp + 0x20], eax
mov ecx, 0x49e
mov eax, edi
mov esi, dword [ebx + edi*4 + 4]
div dword [0x67a384]
mov eax, dword [ebx + 0x7394]
mov dword [esp + 0x30], edx
xor edx, edx
div ecx
mov dword [esp + 0x3c], edi
mov dword [esp + 0x28], eax
mov eax, 0xcd0
cdq
idiv dword [0x67a39c]
mov dword [esp + 0x2c], edi
mov eax, edx
mov dword [esp + 0x10], esi
mov dword [esp + 0x1c], eax
cmp esi, dword [eax + 0x5c8]
jl 0x40179b
imul ecx, esi, 0xc
mov edx, 0x5c19
add ecx, ebp
mov dword [esp + 0x18], ecx
mov eax, dword [0x67a3b8]
mov dword [esp + 0x24], 0x1294
mov eax, dword [eax + esi*4]
xor eax, 0x161f
or eax, dword [edx]
add eax, dword [0x67a3ac]
mov dword [esi*4 + 0x1de1], eax
movzx ecx, byte [ecx]
mov edx, dword [ebp]
mov esi, dword [esp + 0x20]
movzx eax, byte [edx + esi + 5]
imul ecx, eax
mov eax, dword [esp + 0x10]
or eax, edi
sub eax, dword [esp + 0x10]
mov byte [edx + esi + 5], cl
cdq
idiv dword [esp + 0x24]
mov ecx, dword [0x67a3b4]
mov esi, dword [0x67a3a0]
sub edx, dword [esi + ecx*4 + 0x18]
mov dword [esi + ecx*4 + 0x18], edx
xor edx, edx
mov esi, dword [esp + 0x10]
mov word [0x67a390], si
imul eax, dword [ebp], 0xc
mov ecx, dword [ebx + edi*4 + 0xc]
sub ecx, esi
mov dword [eax + edi], ecx
mov ecx, dword [0x67a3b4]
mov eax, dword [0x67a3c0]
dec ecx
mov dword [0x67a3b4], ecx
lea ecx, [eax + ecx*4]
mov eax, dword [0x67a38c]
div dword [ecx + 0x64]
inc esi
mov edx, 0x5c19
mov dword [ecx + 0x64], eax
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x18]
add ecx, 0xc
mov dword [esp + 0x10], esi
mov dword [esp + 0x18], ecx
cmp esi, dword [eax + 0x5c8]
jge 0x4016df
mov esi, dword [ebp]
xor edx, edx
mov eax, dword [0x67a3c0]
mov ecx, esi
add ecx, ecx
mov ebx, dword [eax + ecx*8 + 0x28]
mov eax, dword [esp + 0x14]
xor ebx, 0x4ca
mov ecx, dword [esp + 0x38]
movzx edi, byte [eax + edi*4]
mov eax, dword [esp + 0x3c]
or edi, dword [0x67a3a8]
mov eax, dword [ecx + eax*4]
div dword [ecx + esi*4]
movzx ecx, word [0x67a390]
push ecx
push dword [esp + 0x40]
push eax
push 0x1485
push edi
push ebx
call fcn.004091d9
mov ebx, dword [esp + 0x54]
add esp, 0x18
mov edi, dword [esp + 0x38]
mov dword [ebx + ebx*4], eax
movzx eax, word [0x67a390]
cdq
idiv dword [0x67a3b0]
mov eax, dword [0x67a3c0]
mov dword [0x67a3b0], edx
mov ecx, dword [ebp]
mov eax, dword [eax + ebx*4 + 0x1c]
xor eax, ebx
sub eax, dword [0x67a388]
add dword [ebp + ecx*4], eax
inc dword [0x67a388]
inc ebx
mov ecx, dword [0x67a3b4]
inc ecx
mov dword [0x67a3b4], ecx
cmp dword [edi + ecx*4], ecx
ja 0x40189c
imul eax, dword [ebp], 0xc
mov edx, dword [esp + 0x28]
cmp ecx, dword [eax + edx]
jae 0x40189c
mov ecx, dword [ebp - 4]
xor edx, edx
movzx eax, word [0x67a390]
imul esi, ecx, 0xc
div dword [esi + ebp + 0x88]
mov edx, dword [esp + 0x1c]
imul eax, dword [ebp + ecx*4 - 4]
mov dword [esi + edi], eax
inc dword [ebp]
mov ecx, dword [ebp]
movzx eax, byte [0x67a392]
or eax, ebx
or dword [edx + ecx*4], eax
xor edx, edx
inc byte [0x67a392]
mov eax, dword [ebp]
mov ecx, dword [esp + 0x2c]
lea ecx, [ecx + eax*4]
mov eax, dword [esp + 0x30]
mov eax, dword [eax + 0x2520]
div dword [ecx]
mov dword [ecx], eax
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebp
movzx eax, byte [eax + ebx*4]
pop ebx
add esp, 0x24
ret