Function at 0x407cbc
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 [0x972edc]
inc ecx
movzx eax, cx
mov dword [esp + 0x20], eax
mov eax, dword [0x972ee8]
mov dword [esp + 0x50], ecx
mov ecx, dword [0x972ef8]
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 [0x972ec0]
xor eax, dword [0x972ef0]
mov dword [esp + 0x40], eax
mov eax, dword [0x972ed0]
mov ebp, dword [0x972ee0]
mov esi, dword [esp + 0x4c]
mov bl, byte [ecx + eax*2]
inc eax
mov dword [0x972ed0], eax
movzx ecx, bh
mov eax, ecx
mov byte [esp + 0x13], bl
cdq
idiv dword [0x972eb4]
dec bl
mov dword [esp + 0x34], ecx
mov dword [esp + 0x24], eax
mov eax, dword [0x972ee4]
mov dword [esp + 0x38], eax
mov eax, dword [0x972ef4]
movzx edi, bl
mov dword [esp + 0x14], 0xdfe
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 0x407eff
mov ebx, ecx
lea eax, [ebx + 0x79f]
imul eax, dword [esp + 0x20]
mov dword [esp + 0x28], eax
mov eax, dword [0x972ecc]
mov ecx, dword [esp + 0x5c]
mov edi, dword [0x972ef8]
mov esi, dword [0x972ee8]
movzx ecx, word [ecx + eax*4 + 4]
mov eax, dword [esp + 0x14]
cdq
idiv ecx
mov eax, dword [0x972ec8]
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 [0x972ecc]
mov ecx, dword [0x972ec8]
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 [0x972ec4]
movzx ecx, word [eax + ecx*2]
mov eax, dword [0x972ed4]
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.0040aebb
mov edx, dword [esp + 0x64]
mov ecx, dword [edx]
mov edx, dword [esp + 0x74]
mov word [edx + ecx*4], ax
mov eax, dword [0x972ed4]
mov ecx, dword [esp + 0x40]
mov dword [edi + esi*4], eax
mov eax, dword [0x972efc]
and dword [eax + ebx*4], ecx
mov eax, dword [0x972ed4]
and eax, 0xec7
push eax
push 0x176d
call fcn.0040bb88
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 [0x972ebc]
div ebx
mov ebx, dword [esp + 0x18]
xor edx, edx
xor esi, eax
mov eax, dword [0x972ebc]
div ebx
xor edx, edx
mov dword [esp + 0x14], esi
div dword [0x972eb4]
mov esi, dword [0x972ef8]
mov ecx, eax
movzx eax, byte [ebp]
add ecx, dword [eax*8 + 0xf11]
and dword [esi + ebx*8], ecx
mov eax, dword [0x972eb4]
mov ecx, dword [esp + 0x5c]
inc dword [0x972ebc]
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, 0x10a3
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 0x407d8c
mov bl, byte [esp + 0x30]
mov bh, byte [esp + 0x60]
movzx eax, word [0x972ed8]
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 [0x972ecc]
mov esi, dword [esp + 0x4c]
je 0x40806b
mov bl, byte [esp + 0x13]
movzx edi, bl
cmp dword [edx + ecx*4], edi
jb 0x40806b
mov eax, dword [esp + 0x20]
mov esi, dword [esp + 0x3c]
mov cl, byte [eax*4 + 0xf11]
mov eax, dword [0x972eb0]
xor cl, bh
mov byte [eax + esi], cl
mov eax, dword [0x972ecc]
mov ecx, dword [esp + 0x54]
movzx edx, word [ecx + eax*2]
movzx ecx, byte [esi]
mov eax, dword [0x972efc]
mov dword [eax + ecx*4], edx
mov eax, dword [esp + 0x50]
mov edx, dword [0x972eb8]
inc eax
mov ebx, dword [0x972f00]
mov ecx, dword [0x972eb0]
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 [0x972ec0]
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.0040aebb
mov ecx, dword [0x972eb8]
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 [0x972ed8]
mov eax, 0xffff
or dword [0x972ef0], edx
add cx, ax
mov al, byte [esp + 0x60]
inc al
mov word [0x972ed8], 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 [0x972eb4]
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 [0x972ed0]
or eax, dword [0x972ec0]
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 [0x972ecc]
inc dword [0x972ed0]
dec eax
mov dword [0x972ecc], eax
mov eax, dword [ecx + eax*4]
jmp 0x408138
mov eax, dword [0x972ee8]
xor edx, edx
dec eax
mov dword [0x972ee8], eax
movzx eax, byte [eax + ebp]
xor eax, ecx
mov ecx, 0xa73
sub eax, 0x5c4
div ecx
mov eax, dword [esi]
mov dword [eax*8 + 0xf11], edx
mov esi, dword [esi]
mov eax, dword [esp + 0x54]
mov ecx, dword [0x972efc]
movzx eax, word [eax + esi*4]
sub eax, dword [esp + 0x34]
cdq
idiv dword [ecx + esi*4]
movzx eax, word [0x972ed8]
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.0040bb88
mov edx, dword [esp + 0x2c]
pop ecx
pop ecx
mov ecx, dword [0x972eb4]
inc ecx
mov edi, dword [esp + 0x1c]
add ecx, ecx
dec bl
movzx esi, bl
mov dword [edx + ecx*8], eax
mov eax, dword [0x972eb4]
movzx ecx, byte [esi + ebp]
cdq
idiv ecx
mov byte [esi + ebp], al
mov eax, dword [0x972ecc]
dec eax
mov dword [0x972ecc], eax
mov eax, dword [edi + eax*4]
xor eax, dword [0x972ef4]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x34
ret