Function at 0x407ce4
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x34
push ebx
push ebp
push esi
push edi
mov ecx, dword [esp + 0x50]
movzx edx, word [0x9769ac]
inc ecx
movzx eax, cx
mov dword [esp + 0x20], eax
mov eax, dword [0x9769b8]
mov dword [esp + 0x50], ecx
mov ecx, dword [0x9769c8]
mov bh, byte [esp + 0x60]
mov eax, dword [ecx + eax*4]
mov ecx, dword [esp + 0x54]
sub eax, edx
mov dword [esp + 0x1c], eax
mov eax, dword [0x976990]
xor eax, dword [0x9769c0]
mov dword [esp + 0x40], eax
mov eax, dword [0x9769a0]
mov ebp, dword [0x9769b0]
mov esi, dword [esp + 0x4c]
mov bl, byte [ecx + eax*2]
inc eax
mov dword [0x9769a0], eax
movzx ecx, bh
mov eax, ecx
mov byte [esp + 0x13], bl
cdq
idiv dword [0x976984]
dec bl
mov dword [esp + 0x34], ecx
mov dword [esp + 0x24], eax
mov eax, dword [0x9769b4]
mov dword [esp + 0x38], eax
mov eax, dword [0x9769c4]
movzx edi, bl
mov dword [esp + 0x14], 0x1197
mov eax, dword [esi + eax*4]
mov dword [esp + 0x3c], eax
movzx ecx, byte [edi + ecx]
dec byte [ebp]
movzx eax, byte [ebp]
mov byte [esp + 0x30], bl
mov dword [esp + 0x2c], edi
mov dword [esp + 0x18], ecx
cmp ecx, dword [eax*4 + 0xf11]
ja 0x407f27
mov ebx, ecx
lea eax, [ebx + 0x79f]
imul eax, dword [esp + 0x20]
mov dword [esp + 0x28], eax
mov eax, dword [0x97699c]
mov ecx, dword [esp + 0x5c]
mov edi, dword [0x9769c8]
mov esi, dword [0x9769b8]
movzx ecx, word [ecx + eax*4 + 4]
mov eax, dword [esp + 0x14]
cdq
idiv ecx
mov eax, dword [0x976998]
mov ecx, dword [esp + 0x1c]
add edx, dword [eax + ebx*4]
mov eax, dword [esp + 0x2c]
or edx, dword [ecx + eax*4]
mov eax, 0x12cd
add dword [edi + esi*4 + 0x80], edx
inc dword [0x97699c]
mov ecx, dword [0x976998]
cdq
mov edi, dword [esp + 0x48]
idiv dword [ecx + ebx*4]
mov esi, eax
mov eax, dword [esp + 0x24]
mov edx, dword [eax + ebx*4 + 0x18]
mov eax, dword [esp + 0x4c]
sub edx, dword [esp + 0x18]
mov ecx, dword [eax]
mov eax, dword [0x976994]
movzx ecx, word [eax + ecx*2]
mov eax, dword [0x9769a4]
mov eax, dword [edi + eax*4]
and eax, dword [esp + 0x18]
push eax
push ecx
push edx
push dword [esp + 0x3c]
push esi
mov esi, dword [esp + 0x28]
push dword [edi + esi*4]
call fcn.0040aebc
mov edx, dword [esp + 0x64]
mov ecx, dword [edx]
mov edx, dword [esp + 0x74]
mov word [edx + ecx*4], ax
mov eax, dword [0x9769a4]
mov ecx, dword [esp + 0x40]
mov dword [edi + esi*4], eax
mov eax, dword [0x9769cc]
and dword [eax + ebx*4], ecx
mov eax, dword [0x9769a4]
and eax, 0xec7
push eax
push 0x176d
call fcn.0040bb51
mov edx, dword [esp + 0x44]
add esp, 0x20
mov edi, dword [esp + 0x2c]
mov dword [edx + ebx*4], eax
xor edx, edx
mov eax, edi
mov ebx, 0xf13
xor eax, dword [0x97698c]
div ebx
mov ebx, dword [esp + 0x18]
xor edx, edx
xor esi, eax
mov eax, dword [0x97698c]
div ebx
xor edx, edx
mov dword [esp + 0x14], esi
div dword [0x976984]
mov esi, dword [0x9769c8]
mov ecx, eax
movzx eax, byte [ebp]
add ecx, dword [eax*8 + 0xf11]
and dword [esi + ebx*8], ecx
mov eax, dword [0x976984]
mov ecx, dword [esp + 0x5c]
inc dword [0x97698c]
movzx ecx, word [ecx + eax*2]
mov eax, dword [esp + 0x34]
movzx eax, byte [eax + edi*4]
xor eax, ecx
movzx ecx, byte [edi + ebp]
sub eax, 0xae3
cdq
idiv ebx
movzx eax, al
imul eax, ecx
inc ebx
mov dword [esp + 0x18], ebx
mov byte [edi + ebp], al
mov eax, dword [esp + 0x20]
add dword [esp + 0x28], eax
dec byte [ebp]
movzx eax, byte [ebp]
cmp ebx, dword [eax*4 + 0xf11]
jbe 0x407db4
mov bl, byte [esp + 0x30]
mov bh, byte [esp + 0x60]
movzx eax, word [0x9769a8]
mov edx, dword [esp + 0x48]
mov ecx, dword [esp + 0x1c]
mov esi, dword [esp + 0x14]
mov eax, dword [edx + eax*8 + 8]
cmp eax, dword [ecx + esi*8]
mov ecx, dword [0x97699c]
mov esi, dword [esp + 0x4c]
je 0x408093
mov bl, byte [esp + 0x13]
movzx edi, bl
cmp dword [edx + ecx*4], edi
jb 0x408093
mov eax, dword [esp + 0x20]
mov esi, dword [esp + 0x3c]
mov cl, byte [eax*4 + 0xf11]
mov eax, dword [0x976980]
xor cl, bh
mov byte [eax + esi], cl
mov eax, dword [0x97699c]
mov ecx, dword [esp + 0x54]
movzx edx, word [ecx + eax*2]
movzx ecx, byte [esi]
mov eax, dword [0x9769cc]
mov dword [eax + ecx*4], edx
mov eax, dword [esp + 0x50]
mov edx, dword [0x976988]
inc eax
mov ebx, dword [0x9769d0]
mov ecx, dword [0x976980]
movzx esi, ax
add ecx, ebx
mov dword [esp + 0x50], eax
movzx eax, byte [ebp]
mov edi, dword [edx + esi*4]
imul edi, dword [esp + 0x14]
mov al, byte [eax + ebp]
mov byte [esp + 0x48], al
mov eax, dword [0x976990]
imul eax, dword [edx + eax*4], 0xe06
push eax
push ecx
lea eax, [esi + esi]
push eax
push dword [esp + 0x54]
push edi
push ebx
call fcn.0040aebc
mov ecx, dword [0x976988]
mov edx, 0xf11
add esp, 0x18
mov ebx, dword [esp + 0x38]
mov edx, dword [edx]
mov dword [ecx + edx*4 + 0x20], eax
mov eax, 0x84
cdq
idiv dword [esp + 0x14]
mov cx, word [0x9769a8]
mov eax, 0xffff
or dword [0x9769c0], edx
add cx, ax
mov al, byte [esp + 0x60]
inc al
mov word [0x9769a8], cx
movzx esi, cx
movzx ecx, al
mov eax, dword [esp + 0x14]
cdq
idiv ecx
mov ecx, dword [esp + 0x50]
xor edx, edx
dec cl
and al, cl
mov ecx, dword [0x976984]
add al, byte [ecx*4 + 0xf11]
or byte [esi + ebp], al
mov eax, dword [esp + 0x4c]
mov esi, dword [eax]
mov eax, dword [esp + 0x54]
movzx ecx, word [eax + 0x2c28]
mov eax, dword [0x9769a0]
or eax, dword [0x976990]
div ecx
movzx ecx, byte [ebx + esi*4]
xor edx, edx
div ecx
mov ecx, dword [esp + 0x1c]
mov byte [ebx + esi*4], dl
mov eax, dword [0x97699c]
inc dword [0x9769a0]
dec eax
mov dword [0x97699c], eax
mov eax, dword [ecx + eax*4]
jmp 0x408162
mov eax, dword [0x9769b8]
xor edx, edx
dec eax
mov dword [0x9769b8], eax
movzx eax, byte [eax + ebp]
xor eax, ecx
mov ecx, 0x1964
sub eax, 0x132b
div ecx
mov eax, dword [esi]
mov dword [eax*8 + 0xf11], edx
mov esi, dword [esi]
mov eax, dword [esp + 0x54]
mov ecx, dword [0x9769cc]
movzx eax, word [eax + esi*4]
sub eax, dword [esp + 0x34]
cdq
idiv dword [ecx + esi*4]
movzx eax, word [0x9769a8]
mov ecx, dword [esp + 0x38]
mov esi, dword [esp + 0x3c]
movzx ecx, byte [ecx + eax*4]
mov eax, edx
cdq
idiv ecx
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x4c]
mov dword [ecx + edi*8], eax
lea ecx, [edi]
mov edi, dword [esp + 0x1c]
movzx esi, byte [esi]
mov eax, dword [edi + ecx*4]
add eax, dword [edx + 0x26c0]
xor edx, edx
mov edi, dword [esp + 0x40]
div dword [edi + ecx*4]
mov ecx, dword [esp + 0x48]
or dword [ecx + esi*4], eax
mov eax, dword [esp + 0x20]
dec eax
push eax
push 0x670
call fcn.0040bb51
mov edx, dword [esp + 0x2c]
pop ecx
pop ecx
mov ecx, dword [0x976984]
add ecx, 2
mov edi, dword [esp + 0x1c]
add ecx, ecx
dec bl
movzx esi, bl
mov dword [edx + ecx*8], eax
mov eax, dword [0x976984]
movzx ecx, byte [esi + ebp]
cdq
idiv ecx
mov byte [esi + ebp], al
mov eax, dword [0x97699c]
dec eax
mov dword [0x97699c], eax
mov eax, dword [edi + eax*4]
xor eax, dword [0x9769c4]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x34
ret