Function at 0x402630
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0xc
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x20]
mov eax, dword [edi + 0x80c]
mov ebp, dword [edi + 0x804]
inc eax
lea ecx, [edi + 0x404]
mov dword [edi + 0x80c], eax
mov esi, eax
mov eax, dword [edi + 0x808]
lea ebx, [ecx + 0x200]
add eax, esi
cmp ecx, ebx
mov dword [esp + 0x14], eax
lea edx, [edi + 4]
mov eax, ecx
mov dword [esp + 0x18], ebx
jae 0x4027a1
mov esi, dword [eax]
mov edi, ebp
shl edi, 0xd
xor edi, ebp
mov ebp, dword [ebx]
mov dword [esp + 0x10], esi
and esi, 0x3fc
add edi, ebp
mov ebp, dword [esp + 0x14]
mov esi, dword [esi + ecx]
add eax, 4
add esi, ebp
mov ebp, dword [esp + 0x10]
add esi, edi
add ebx, 4
mov dword [eax - 4], esi
add edx, 4
shr esi, 8
and esi, 0x3fc
add eax, 4
add ebx, 4
add edx, 4
mov esi, dword [esi + ecx]
add eax, 4
add esi, ebp
add ebx, 4
mov dword [edx - 8], esi
mov ebp, dword [eax - 8]
mov dword [esp + 0x10], ebp
mov ebp, edi
shr ebp, 6
xor ebp, edi
mov edi, dword [ebx - 8]
add ebp, edi
mov edi, dword [esp + 0x10]
and edi, 0x3fc
add edx, 4
add ebx, 4
mov edi, dword [edi + ecx]
add edi, esi
mov esi, dword [esp + 0x10]
add edi, ebp
mov dword [eax - 8], edi
shr edi, 8
and edi, 0x3fc
mov edi, dword [edi + ecx]
add edi, esi
mov dword [esp + 0x14], edi
mov dword [edx - 8], edi
mov esi, dword [eax - 4]
lea edi, [ebp*4]
mov dword [esp + 0x10], esi
xor edi, ebp
mov ebp, dword [ebx - 8]
and esi, 0x3fc
add edi, ebp
mov ebp, dword [esp + 0x14]
mov esi, dword [esi + ecx]
add esi, ebp
mov ebp, dword [esp + 0x10]
add esi, edi
mov dword [eax - 4], esi
shr esi, 8
and esi, 0x3fc
mov esi, dword [esi + ecx]
add esi, ebp
mov dword [edx - 4], esi
mov ebp, dword [eax]
mov dword [esp + 0x10], ebp
mov ebp, edi
shr ebp, 0x10
xor ebp, edi
mov edi, dword [ebx - 4]
add ebp, edi
mov edi, dword [esp + 0x10]
and edi, 0x3fc
mov edi, dword [edi + ecx]
add edi, esi
add edi, ebp
mov dword [eax], edi
add eax, 4
shr edi, 8
and edi, 0x3fc
add edx, 4
mov esi, dword [edi + ecx]
mov edi, dword [esp + 0x10]
add esi, edi
mov dword [esp + 0x14], esi
mov dword [edx - 4], esi
cmp eax, dword [esp + 0x18]
jb 0x402679
mov edi, dword [esp + 0x20]
mov ebx, dword [esp + 0x18]
mov esi, ecx
cmp ecx, ebx
jae 0x4028ef
mov edi, dword [eax]
mov ebx, ebp
shl ebx, 0xd
xor ebx, ebp
mov ebp, dword [esi]
mov dword [esp + 0x10], edi
and edi, 0x3fc
add ebx, ebp
mov ebp, dword [esp + 0x14]
mov edi, dword [edi + ecx]
add eax, 4
add edi, ebp
mov ebp, dword [esp + 0x10]
add edi, ebx
add esi, 4
mov dword [eax - 4], edi
add edx, 4
shr edi, 8
and edi, 0x3fc
add eax, 4
add esi, 4
add edx, 4
mov edi, dword [edi + ecx]
add eax, 4
add edi, ebp
add esi, 4
mov dword [edx - 8], edi
mov ebp, dword [eax - 8]
mov dword [esp + 0x10], ebp
mov ebp, ebx
shr ebp, 6
xor ebp, ebx
mov ebx, dword [esi - 8]
add ebp, ebx
mov ebx, dword [esp + 0x10]
and ebx, 0x3fc
add edx, 4
add esi, 4
mov ebx, dword [ebx + ecx]
add ebx, edi
mov edi, dword [esp + 0x10]
add ebx, ebp
mov dword [eax - 8], ebx
shr ebx, 8
and ebx, 0x3fc
mov ebx, dword [ebx + ecx]
add ebx, edi
mov dword [esp + 0x14], ebx
mov dword [edx - 8], ebx
mov edi, dword [eax - 4]
lea ebx, [ebp*4]
mov dword [esp + 0x10], edi
xor ebx, ebp
mov ebp, dword [esi - 8]
and edi, 0x3fc
add ebx, ebp
mov ebp, dword [esp + 0x14]
mov edi, dword [edi + ecx]
add edi, ebp
mov ebp, dword [esp + 0x10]
add edi, ebx
mov dword [eax - 4], edi
shr edi, 8
and edi, 0x3fc
mov edi, dword [edi + ecx]
add edi, ebp
mov dword [edx - 4], edi
mov ebp, dword [eax]
mov dword [esp + 0x10], ebp
mov ebp, ebx
shr ebp, 0x10
xor ebp, ebx
mov ebx, dword [esi - 4]
add ebp, ebx
mov ebx, dword [esp + 0x10]
and ebx, 0x3fc
mov ebx, dword [ebx + ecx]
add ebx, edi
add ebx, ebp
mov dword [eax], ebx
add eax, 4
shr ebx, 8
and ebx, 0x3fc
add edx, 4
mov edi, dword [ebx + ecx]
mov ebx, dword [esp + 0x10]
add edi, ebx
mov dword [esp + 0x14], edi
mov dword [edx - 4], edi
cmp esi, dword [esp + 0x18]
jb 0x4027af
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x14]
pop edi
pop esi
mov dword [eax + 0x804], ebp
pop ebp
mov dword [eax + 0x808], ecx
pop ebx
add esp, 0xc
ret
mov edx, dword [esp + 0x14]
mov dword [edi + 0x804], ebp
mov dword [edi + 0x808], edx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret