Function at 0x4129f7
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x2c
mov edx, dword [0x4bd5d0]
mov ecx, dword [esp + 0x30]
push ebx
mov ebx, dword [esp + 0x3c]
push ebp
movzx eax, word [ecx + edx*2]
mov dword [esp + 0x1c], eax
imul eax, dword [ebx], 0xc
mov ecx, dword [0x4bd5bc]
push esi
mov esi, dword [esp + 0x48]
push edi
mov edi, dword [0x4bd5c4]
mov al, byte [eax + ebx + 0x10]
and al, 0x5e
mov byte [esp + 0x12], al
mov ax, word [0x4bd5ac]
inc ax
mov word [0x4bd5ac], ax
mov cl, byte [esi + ecx*8]
and cl, al
movzx eax, ax
mov byte [esp + 0x13], cl
imul ecx, dword [ebx + eax*4 + 0x10], 0x1b1b
inc dword [0x4bd5dc]
movzx eax, word [esi + eax*2]
sub eax, 0xae1
mov esi, dword [esp + 0x50]
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x64]
mov dword [esp + 0x18], ecx
mov ecx, dword [0x4bd56c]
movzx eax, byte [eax + 0x908]
mov dword [esp + 0x20], eax
movzx eax, word [0x4bd5c8]
mov eax, dword [ebx + eax*4]
mov dword [esp + 0x64], eax
mov eax, dword [0x4bd5b0]
movzx ebp, word [edi + eax*2 + 6]
xor ebp, dword [0x4bd5f0]
inc ecx
movzx eax, word [0x4bd568]
mov dword [0x4bd56c], ecx
sub eax, dword [esi + ecx*4]
mov esi, dword [0x4bd5ec]
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x4c]
movzx ecx, word [eax + esi*2]
mov eax, dword [esp + 0x58]
mov eax, dword [eax + edx*4 + 0x20]
cdq
idiv ecx
inc esi
mov dword [0x4bd5ec], esi
mov ecx, dword [ebx + 0x7b14]
mov dword [esp + 0x14], eax
mov eax, dword [ebx]
movzx esi, word [0x4bd560]
mov dword [esp + 0x28], esi
movzx edx, word [edi + eax*2]
mov eax, dword [esp + 0x58]
mov edi, dword [0x4bd598]
sub edx, dword [eax + 0x5054]
mov eax, dword [ebx + edi*4]
mov dword [esp + 0x34], eax
mov eax, dword [0x4bd578]
mov dword [esp + 0x1c], edx
xor ecx, dword [eax + 0x684c]
mov eax, dword [esp + 0x4c]
mov dword [esp + 0x38], ecx
movzx eax, word [eax + ebp*8]
cmp eax, dword [0x4bd5d4]
jb 0x412b4b
mov eax, dword [esp + 0x24]
mov ecx, dword [ebx]
movzx ecx, byte [ecx + eax]
mov ax, si
add esi, 0xffff
mov dword [esp + 0x28], esi
cmp cx, ax
je 0x412c01
mov al, byte [esp + 0x12]
mov ecx, dword [0x4bd5bc]
dec al
movzx edi, al
mov byte [esp + 0x12], al
mov eax, dword [esp + 0x60]
movzx ecx, word [eax + ecx*8]
mov eax, dword [esp + 0x14]
movzx eax, byte [eax + 0xd3c]
add ecx, eax
mov eax, dword [esp + 0x30]
mov dword [eax + edi*4], ecx
mov ecx, dword [0x4bd5dc]
mov eax, dword [esp + 0x18]
add ecx, ecx
sub eax, dword [0x4bd5d8]
imul eax, eax, 0x17965f2
and dword [edx + ecx*8], eax
mov esi, dword [0x4bd584]
mov ecx, dword [esp + 0x64]
imul eax, ebp, 0xc
shl esi, 4
add esi, dword [esp + 0x20]
movzx ecx, byte [ecx + 0x1c33]
mov eax, dword [eax + edx]
xor edx, edx
sub eax, ecx
div dword [esi]
mov dword [esi], eax
mov eax, dword [esp + 0x64]
inc dword [0x4bd584]
mov esi, dword [esp + 0x24]
movzx edx, word [0x4bd5ac]
movzx ecx, byte [edi + eax]
mov eax, dword [0x4bd56c]
movzx eax, byte [eax + esi]
mov esi, dword [esp + 0x2c]
sub cx, ax
imul eax, dword [0x4bd598], 6
add cx, word [eax + esi]
mov eax, 0x1033
sub cx, ax
xor word [esi + edx*2], cx
mov edi, dword [0x4bd598]
mov edx, dword [0x4bd5bc]
add edi, edi
mov eax, dword [0x4bd58c]
dec edx
mov ecx, dword [esp + 0x28]
mov dword [0x4bd5bc], edx
movzx ecx, cx
mov eax, dword [eax + edx*4]
cdq
idiv ecx
movzx esi, word [0x4bd5c8]
xor edx, edx
mov ecx, dword [esp + 0x50]
add eax, dword [ecx + edi*8]
mov edi, dword [esp + 0x40]
movzx ecx, word [edi + esi*2]
div ecx
mov al, byte [esp + 0x12]
mov word [edi + esi*2], dx
inc al
movzx ecx, word [0x4bd57c]
movzx edi, al
mov eax, dword [0x4bd560]
cdq
idiv ecx
mov ecx, dword [0x4bd58c]
xor eax, dword [0x4bd560]
cdq
idiv dword [ecx + 0x5d04]
mov eax, dword [esp + 0x40]
mov word [eax + edi*2 + 0x3a], dx
mov eax, 0xffff
mov cx, word [0x4bd5c8]
add cx, ax
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x2c]
mov word [0x4bd5c8], cx
mov esi, dword [ebx]
mov ebx, dword [esp + 0x1c]
movzx eax, word [eax]
imul eax, eax, 3
movzx ecx, cx
add ecx, ecx
movzx eax, byte [eax + edx]
cdq
idiv dword [ebx + ecx*8]
movzx eax, word [0x4bd5ac]
mov ecx, dword [esp + 0x64]
mov ebx, dword [esp + 0x48]
imul eax, eax, 3
movzx eax, byte [eax + ecx + 2]
mov ecx, dword [esp + 0x14]
xor edx, eax
mov eax, dword [esp + 0x34]
add dword [eax + esi*4 + 0x14], edx
inc word [0x4bd5ac]
mov eax, dword [ebx]
add ebx, 4
movzx ecx, byte [ecx + eax]
mov eax, ebp
cdq
idiv ecx
mov eax, dword [0x4bd564]
mov ecx, dword [esp + 0x1c]
add eax, eax
inc ebp
mov dword [ecx + eax*8], edx
inc dword [ebx]
mov ecx, dword [esp + 0x40]
mov eax, dword [ebx]
movzx esi, word [ecx + eax*2 + 0xa]
mov eax, dword [esp + 0x20]
imul ecx, edi, 0xc
mov dword [esp + 0x40], ecx
cmp esi, dword [ecx + eax]
jbe 0x412da3
mov edi, dword [esp + 0x38]
mov ecx, dword [esp + 0x18]
movzx eax, byte [esp + 0x13]
dec ecx
mov edx, dword [esp + 0x1c]
mov dword [esp + 0x18], ecx
sub ecx, eax
mov eax, dword [ebx]
lea ebx, [ebx + 4]
mov dword [edx + eax*4 + 0xc], ecx
mov ecx, dword [0x4bd5d0]
mov al, cl
sub al, byte [esp + 0x13]
mov edx, dword [esp + 0x58]
add al, 0x2b
mov byte [esp + 0x13], al
dec ecx
mov dword [0x4bd5d0], ecx
mov eax, dword [ebx]
imul ecx, ecx, 0xc
movzx eax, word [edi + eax*2]
sub eax, dword [ecx + edx]
add eax, ebp
inc ebp
mov dword [ecx + edx], eax
mov eax, esi
movzx ecx, word [edi + esi*2]
or eax, ebp
cdq
idiv ecx
mov eax, dword [esp + 0x4c]
mov word [edi + esi*2], dx
movzx ecx, word [eax + esi*8]
mov eax, dword [0x4bd5a4]
xor eax, esi
or eax, 0x137
cdq
idiv ecx
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x40]
add dword [0x4bd5ec], edx
inc esi
cmp esi, dword [ecx + eax]
ja 0x412d19
movzx eax, word [0x4bd5b4]
xor edx, edx
pop edi
pop esi
mov ecx, 0x11c4
pop ebp
div ecx
pop ebx
add esp, 0x2c
ret