Function at 0x401251
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x10
mov ax, word [0x67a390]
mov ecx, 0xffff
push ebx
movzx ebx, ax
add ax, cx
mov word [0x67a390], ax
mov eax, dword [esp + 0x44]
push ebp
push esi
push edi
inc byte [eax]
mov ebp, 0x634
mov eax, dword [esp + 0x3c]
mov ecx, dword [0x67a3a8]
mov dword [esp + 0x10], ecx
mov esi, dword [eax + 0x26c8]
mov eax, dword [0x67a3a0]
sub esi, dword [eax + 0x5cbc]
mov eax, dword [0x67a3c4]
dec eax
mov dword [esp + 0x14], esi
mov dword [0x67a3c4], eax
movzx edi, word [eax + eax + 0x1a]
movzx eax, word [ecx + ebx*2]
cmp edi, eax
jb 0x4013ad
mov ecx, dword [esp + 0x44]
mov eax, dword [esp + 0x28]
add ecx, 0x14
mov esi, dword [esp + 0x50]
movzx eax, ax
mov dword [esp + 0x1c], eax
lea ecx, [ecx + edi*4]
mov dword [esp + 0x18], ecx
mov ecx, dword [ecx]
dec ebx
mov eax, dword [0x67a3b4]
mov edx, dword [esp + 0x30]
sub ecx, dword [edx + eax*4 + 0x18]
mov edx, dword [esp + 0x40]
mov eax, dword [esp + 0x2c]
add ecx, dword [edx + 0xc64]
mov dword [eax + ebx*4], ecx
mov eax, edi
sub eax, dword [0x67a39c]
xor eax, dword [esp + 0x1c]
movzx ecx, byte [esi]
add ecx, 8
add ecx, ecx
or eax, dword [edx + ecx*8]
mov ecx, dword [esp + 0x3c]
imul ebp, eax
inc esi
mov byte [0x67a392], 0
mov eax, edi
cdq
idiv dword [ecx + edi*4]
mov ecx, dword [0x67a3b4]
mov eax, dword [esp + 0x3c]
imul edx, dword [eax + ecx*4]
mov eax, edx
cdq
idiv dword [0x67a3cc]
mov edx, dword [esp + 0x4c]
inc ecx
mov dword [0x67a3cc], eax
mov eax, dword [0x67a3c4]
mov dword [0x67a3b4], ecx
add eax, eax
imul ecx, dword [0x67a384], 0xc
mov eax, dword [edx + eax*8]
mov edx, dword [esp + 0x24]
sub eax, dword [ecx + edx + 0x2c]
mov dword [ecx + edx + 0x2c], eax
xor edx, edx
mov ecx, dword [0x67a384]
mov eax, dword [esp + 0x10]
shl ecx, 4
add ecx, dword [0x67a394]
movzx eax, word [eax + 0x3524]
div dword [ecx + 0x14]
inc edi
mov dword [ecx + 0x14], eax
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x18]
add ecx, 4
mov dword [esp + 0x18], ecx
movzx eax, word [eax + ebx*2]
cmp edi, eax
jge 0x4012d6
mov dword [esp + 0x50], esi
mov esi, dword [esp + 0x14]
mov ecx, dword [0x67a384]
dec ebx
mov eax, dword [0x67a3b8]
inc ecx
mov dword [0x67a384], ecx
mov ecx, dword [eax + ecx*4]
cmp ecx, ebx
jg 0x4013f5
mov edi, dword [0x67a3b4]
xor edx, edx
mov eax, ecx
div edi
mov edi, eax
mov eax, ecx
cdq
idiv esi
mov eax, edx
xor edx, edx
div ebp
xor edx, edx
div esi
inc ecx
mov esi, edx
cmp ecx, ebx
jle 0x4013cd
mov dword [0x67a3b4], edi
mov dword [esp + 0x14], edx
mov edi, dword [esp + 0x50]
mov esi, dword [esp + 0x3c]
movzx ecx, bl
movzx edx, byte [edi]
movzx eax, byte [edx + edi]
imul ecx, eax
inc ebx
mov eax, dword [esp + 0x34]
mov dword [esp + 0x50], ebx
mov ebx, dword [esp + 0x38]
mov byte [edx + edi], cl
mov ecx, dword [0x67a3b4]
inc ecx
mov dword [0x67a3b4], ecx
movzx eax, word [eax + ecx*2]
or eax, 0x620
cdq
idiv dword [esi + 0x5da4]
mov eax, dword [esp + 0x40]
add dword [eax + ecx*8], edx
xor edx, edx
mov eax, dword [esp + 0x28]
mov ecx, dword [0x67a3b4]
add eax, 0xffff
movzx esi, ax
mov dword [esp + 0x28], eax
mov eax, dword [0x67a3a0]
movzx edi, byte [edi]
mov eax, dword [eax + ecx*8 + 4]
add eax, esi
div dword [0x67a3ac]
xor edx, esi
or dword [ebx + edi*4 + 0x7c], edx
inc dword [0x67a3ac]
inc ebp
mov eax, dword [0x67a3bc]
mov ecx, dword [0x67a384]
xor eax, ebp
mov edx, dword [esp + 0x10]
or ax, word [ebx + ebp*8 + 8]
mov edi, dword [esp + 0x14]
add word [edx + ecx*8], ax
mov eax, dword [0x67a384]
lea ecx, [ebx + eax*4]
mov eax, dword [esp + 0x28]
dec eax
mov ebx, edi
and eax, 0x1a99
imul eax, eax, 0x171a
cdq
idiv dword [ecx]
mov dword [ecx], edx
cmp edi, 0x11f0
je 0x40151a
mov esi, dword [esp + 0x50]
mov ecx, dword [esp + 0x24]
xor edx, edx
mov eax, ebx
div dword [ecx + 0x22e4]
lea eax, [esi + 0x15d6]
movzx ecx, word [0x67a390]
or dword [0x67a38c], edx
cdq
idiv edi
sub edx, dword [0x67a3b4]
mov eax, edx
xor edx, edx
div ecx
dec ebp
xor edx, edx
mov word [0x67a390], ax
mov eax, dword [esp + 0x48]
mov dword [eax + ebx*4], ebp
mov eax, dword [esp + 0x10]
movzx eax, word [eax + 0x946]
or eax, ebp
div esi
inc ebx
mov esi, eax
cmp ebx, 0x11f0
jne 0x4014c0
pop edi
pop esi
lea eax, [ebp + 1]
pop ebp
pop ebx
add esp, 0x10
ret