Function at 0x402360
Capabilities:
Encode data using xor

Disassembly:
push ebx
push ebp
push esi
mov esi, dword [esp + 0x1c]
test esi, esi
push edi
jge 0x402370
xor esi, esi
jmp 0x40237d
cmp esi, 0x10000
jle 0x40237d
mov esi, 0x10000
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x14]
mov ebx, edx
mov edi, dword [esp + 0x18]
and ebx, 3
mov ecx, 0x10000
sub edx, ebx
sub ecx, esi
mov dword [esp + 0x20], ebx
lea edx, [eax + edx*4]
cmp eax, edx
mov dword [esp + 0x1c], edx
jae 0x4024d1
mov ebx, dword [edi]
mov ebp, dword [esp + 0x24]
xor ebx, ebp
add edi, 4
mov edx, ebx
add eax, 4
movsx ebx, bx
sar edx, 0x10
mov dword [esp + 0x18], ebx
mov ebp, ebx
mov ebx, edx
imul ebp, ecx
imul ebx, esi
imul edx, ecx
add ebp, ebx
mov ebx, dword [esp + 0x18]
imul ebx, esi
add edx, ebx
mov ebx, dword [esp + 0x28]
shr ebp, 0x10
and edx, 0xffff0000
add edi, 4
or ebp, edx
add eax, 4
xor ebp, ebx
add edi, 4
mov dword [eax - 8], ebp
mov ebx, dword [edi - 8]
mov ebp, dword [esp + 0x24]
add eax, 4
xor ebx, ebp
add edi, 4
mov edx, ebx
movsx ebx, bx
sar edx, 0x10
mov dword [esp + 0x18], ebx
mov ebp, ebx
mov ebx, edx
imul ebp, ecx
imul ebx, esi
imul edx, ecx
add ebp, ebx
mov ebx, dword [esp + 0x18]
imul ebx, esi
add edx, ebx
mov ebx, dword [esp + 0x28]
shr ebp, 0x10
and edx, 0xffff0000
or ebp, edx
xor ebp, ebx
mov dword [eax - 8], ebp
mov ebx, dword [edi - 8]
xor ebx, dword [esp + 0x24]
mov edx, ebx
movsx ebx, bx
sar edx, 0x10
mov dword [esp + 0x18], ebx
mov ebp, ebx
mov ebx, edx
imul ebp, ecx
imul ebx, esi
imul edx, ecx
add ebp, ebx
mov ebx, dword [esp + 0x18]
imul ebx, esi
add edx, ebx
mov ebx, dword [esp + 0x28]
shr ebp, 0x10
and edx, 0xffff0000
or ebp, edx
xor ebp, ebx
mov dword [eax - 4], ebp
mov ebx, dword [edi - 4]
xor ebx, dword [esp + 0x24]
mov edx, ebx
movsx ebx, bx
sar edx, 0x10
mov dword [esp + 0x18], ebx
mov ebp, ebx
mov ebx, edx
imul ebp, ecx
imul ebx, esi
imul edx, ecx
add ebp, ebx
mov ebx, dword [esp + 0x18]
imul ebx, esi
add edx, ebx
add eax, 4
shr ebp, 0x10
and edx, 0xffff0000
or ebp, edx
mov edx, dword [esp + 0x28]
xor ebp, edx
mov edx, dword [esp + 0x1c]
mov dword [eax - 4], ebp
cmp eax, edx
jb 0x4023aa
mov ebx, dword [esp + 0x20]
test bl, 1
je 0x40251f
mov ebx, dword [edi]
mov ebp, dword [esp + 0x24]
xor ebx, ebp
add edi, 4
mov edx, ebx
movsx ebx, bx
sar edx, 0x10
mov dword [esp + 0x18], ebx
mov ebp, ebx
mov ebx, edx
imul ebp, ecx
imul ebx, esi
imul edx, ecx
add ebp, ebx
mov ebx, dword [esp + 0x18]
imul ebx, esi
add edx, ebx
mov ebx, dword [esp + 0x28]
shr ebp, 0x10
and edx, 0xffff0000
or ebp, edx
xor ebp, ebx
mov ebx, dword [esp + 0x20]
mov dword [eax], ebp
add eax, 4
test bl, 2
je 0x40259a
mov ebx, dword [edi]
mov edx, dword [esp + 0x24]
xor ebx, edx
mov edx, ebx
movsx ebx, bx
sar edx, 0x10
mov dword [esp + 0x18], ebx
mov ebp, ebx
mov ebx, edx
imul ebp, ecx
imul ebx, esi
imul edx, ecx
add ebp, ebx
mov ebx, dword [esp + 0x18]
imul ebx, esi
add edx, ebx
shr ebp, 0x10
and edx, 0xffff0000
or ebp, edx
mov edx, dword [esp + 0x28]
xor ebp, edx
mov dword [eax], ebp
mov edi, dword [edi + 4]
xor edi, dword [esp + 0x24]
mov edx, edi
movsx edi, di
sar edx, 0x10
mov ebx, edi
mov ebp, edx
imul ebx, ecx
imul ebp, esi
imul edx, ecx
imul edi, esi
mov ecx, dword [esp + 0x28]
add ebx, ebp
add edx, edi
shr ebx, 0x10
and edx, 0xffff0000
or ebx, edx
xor ebx, ecx
mov dword [eax + 4], ebx
pop edi
pop esi
pop ebp
pop ebx
ret