Function at 0x402240
Capabilities:
Encode data using xor

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff0
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
sub esp, 0xd8
push esi
mov esi, ecx
mov dword [ebp - 0x10], edx
xor ecx, ecx
mov dword [ebp - 0xd4], esi
push edi
mov edi, dword [ebx + 8]
mov eax, dword [esi + 0x84]
lea edx, [esi + 0x40]
mov dword [ebp - 0x54], eax
mov eax, dword [esi + 0x80]
mov dword [ebp - 8], edi
mov dword [ebp - 4], ecx
mov dword [ebp - 0xc], eax
test eax, eax
je 0x4022d3
cmp eax, edi
jae 0x4022ce
mov edx, dword [ebx + 0xc]
mov ecx, dword [ebp - 0x10]
sub ecx, edx
mov dword [ebp - 0x20], edx
mov dword [ebp - 0x24], ecx
mov ecx, dword [ebp - 4]
cmp eax, 0x40
jae 0x4022c8
mov eax, dword [ebp - 0x24]
inc ecx
mov al, byte [eax + edx]
mov edx, dword [ebp - 0xc]
xor al, byte [edx + esi]
mov edx, dword [ebp - 0x20]
mov byte [edx], al
inc edx
mov eax, dword [ebp - 0xc]
inc eax
mov dword [ebp - 0x20], edx
mov dword [ebp - 0xc], eax
cmp eax, edi
jb 0x4022a2
mov dword [ebp - 4], ecx
lea edx, [esi + 0x40]
sub edi, ecx
mov dword [ebp - 8], edi
xor ecx, ecx
test edi, edi
cmove ecx, eax
cmp dword [0x42234c], 0
mov dword [ebp - 0xc], ecx
je 0x402356
mov eax, edi
mov dword [ebp - 8], edi
and eax, 0x3f
sub dword [ebp - 8], eax
mov dword [ebp - 0x24], eax
je 0x402323
push dword [ebp - 0x54]
mov edi, dword [ebp - 4]
mov eax, dword [ebx + 0xc]
mov ecx, dword [ebp - 8]
add eax, edi
push esi
push eax
mov eax, dword [ebp - 0x10]
add eax, edi
push eax
call fcn.004013c0
mov ecx, dword [ebp - 0xc]
lea edx, [esi + 0x40]
add esp, 0x10
add edi, dword [ebp - 8]
mov dword [ebp - 4], edi
mov edi, dword [ebp - 0x24]
test edi, edi
je 0x402765
push dword [ebp - 0x54]
mov eax, dword [ebx + 0xc]
mov ecx, edi
add eax, dword [ebp - 4]
push esi
push eax
mov eax, dword [ebp - 0x10]
add eax, dword [ebp - 4]
push eax
call fcn.004013c0
add esp, 0x10
mov dword [esi + 0x80], edi
pop edi
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret
test edi, edi
je 0x402765
mov dword [ebp - 0xd8], 0x40
nop dword [eax + eax]
movups xmm2, xmmword [edx]
mov eax, dword [ebp - 0x54]
movups xmm3, xmmword [edx + 0x10]
movaps xmmword [ebp - 0xb0], xmm2
movaps xmmword [ebp - 0xa0], xmm3
movups xmm4, xmmword [edx + 0x20]
movups xmm1, xmmword [edx + 0x30]
movaps xmmword [ebp - 0x90], xmm4
movaps xmmword [ebp - 0x80], xmm1
test eax, eax
jle 0x402632
mov esi, dword [ebp - 0x74]
mov ecx, dword [ebp - 0x80]
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x78]
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x7c]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x94]
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x98]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x9c]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0xa0]
mov dword [ebp - 0x50], eax
nop dword [eax]
add eax, dword [ebp - 0xb0]
mov edx, eax
xor edx, ecx
mov ecx, dword [ebp - 0x90]
rol edx, 0x10
add ecx, edx
mov edi, ecx
xor edi, dword [ebp - 0x50]
rol edi, 0xc
add eax, edi
mov dword [ebp - 0x50], eax
xor eax, edx
rol eax, 8
mov dword [ebp - 0x70], eax
add eax, ecx
mov dword [ebp - 0xc4], eax
xor eax, edi
mov edi, dword [ebp - 0x2c]
rol eax, 7
mov ecx, dword [ebp - 0x8c]
mov dword [ebp - 0xcc], eax
mov eax, dword [ebp - 0x14]
add eax, dword [ebp - 0xac]
xor edi, eax
rol edi, 0x10
add ecx, edi
mov edx, ecx
xor edx, dword [ebp - 0x14]
rol edx, 0xc
add eax, edx
mov dword [ebp - 0xb4], eax
xor eax, edi
mov edi, dword [ebp - 0x38]
rol eax, 8
mov dword [ebp - 0xc0], eax
add eax, ecx
mov ecx, dword [ebp - 0x88]
mov dword [ebp - 0x28], eax
xor eax, edx
rol eax, 7
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x20]
add eax, dword [ebp - 0xa8]
xor edi, eax
rol edi, 0x10
add ecx, edi
mov edx, ecx
xor edx, dword [ebp - 0x20]
rol edx, 0xc
add eax, edx
mov dword [ebp - 0xbc], eax
xor eax, edi
rol eax, 8
mov dword [ebp - 0xd0], eax
add eax, ecx
mov ecx, dword [ebp - 0x84]
mov dword [ebp - 0x38], eax
xor eax, edx
rol eax, 7
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0xa4]
add eax, dword [ebp - 0x30]
xor esi, eax
rol esi, 0x10
add ecx, esi
mov edx, ecx
xor edx, dword [ebp - 0x30]
rol edx, 0xc
add eax, edx
mov edi, eax
mov dword [ebp - 0xc8], eax
xor edi, esi
rol edi, 8
lea eax, [edi + ecx]
mov dword [ebp - 0x30], eax
xor eax, edx
rol eax, 7
mov dword [ebp - 0xb8], eax
mov eax, dword [ebp - 0x14]
add eax, dword [ebp - 0x50]
mov ecx, eax
mov edx, dword [ebp - 0x38]
xor ecx, edi
rol ecx, 0x10
add edx, ecx
mov edi, edx
xor edi, dword [ebp - 0x14]
rol edi, 0xc
lea esi, [edi + eax]
mov dword [ebp - 0xb0], esi
xor esi, ecx
mov ecx, dword [ebp - 0x30]
rol esi, 8
lea eax, [edx + esi]
mov edx, dword [ebp - 0x2c]
xor edi, eax
mov dword [ebp - 0x88], eax
mov eax, dword [ebp - 0xb4]
add eax, edx
rol edi, 7
mov dword [ebp - 0x14], edi
mov dword [ebp - 0x9c], edi
mov edi, dword [ebp - 0x70]
xor edi, eax
rol edi, 0x10
add ecx, edi
xor edx, ecx
rol edx, 0xc
add eax, edx
mov dword [ebp - 0xac], eax
xor eax, edi
rol eax, 8
mov edi, dword [ebp - 0xc0]
mov dword [ebp - 0x70], eax
mov dword [ebp - 0x80], eax
add eax, ecx
mov ecx, dword [ebp - 0xc4]
mov dword [ebp - 0x84], eax
xor eax, edx
mov edx, dword [ebp - 0xb8]
rol eax, 7
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x98], eax
mov eax, dword [ebp - 0xbc]
add eax, edx
xor edi, eax
rol edi, 0x10
add ecx, edi
xor edx, ecx
rol edx, 0xc
add eax, edx
mov dword [ebp - 0xa8], eax
xor eax, edi
mov edi, dword [ebp - 0xcc]
rol eax, 8
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x7c], eax
add eax, ecx
mov ecx, dword [ebp - 0x28]
mov dword [ebp - 0x90], eax
xor eax, edx
mov edx, dword [ebp - 0xd0]
rol eax, 7
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x94], eax
mov eax, dword [ebp - 0xc8]
add eax, edi
xor edx, eax
rol edx, 0x10
add ecx, edx
xor edi, ecx
rol edi, 0xc
add eax, edi
mov dword [ebp - 0xa4], eax
xor eax, edx
rol eax, 8
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x78], eax
add eax, ecx
mov dword [ebp - 0x8c], eax
xor eax, edi
rol eax, 7
sub dword [ebp - 0x24], 1
mov ecx, dword [ebp - 0x70]
mov dword [ebp - 0x50], eax
mov dword [ebp - 0xa0], eax
jne 0x4023e0
movaps xmm4, xmmword [ebp - 0x90]
movaps xmm3, xmmword [ebp - 0xa0]
movaps xmm2, xmmword [ebp - 0xb0]
mov ecx, dword [ebp - 0xc]
mov dword [ebp - 0x74], esi
mov esi, dword [ebp - 0xd4]
movaps xmm1, xmmword [ebp - 0x80]
lea edx, [esi + 0x40]
lea eax, [ebp - 0x74]
xor edi, edi
cmp esi, eax
ja 0x40264c
lea eax, [ebp - 0xb0]
mov dword [ebp - 0x28], eax
lea eax, [esi + 0x3c]
cmp eax, dword [ebp - 0x28]
jae 0x402660
lea eax, [edx + 0x3c]
cmp esi, eax
ja 0x402675
lea eax, [esi + 0x3c]
cmp eax, edx
jb 0x402675
nop word [eax + eax]
mov eax, dword [edx + edi*4]
add eax, dword [ebp + edi*4 - 0xb0]
mov dword [esi + edi*4], eax
inc edi
cmp edi, 0x10
jl 0x402660
jmp 0x4026a3
movups xmm0, xmmword [edx]
paddd xmm0, xmm2
movups xmmword [esi], xmm0
movups xmm0, xmmword [edx + 0x10]
paddd xmm0, xmm3
movups xmmword [esi + 0x10], xmm0
movups xmm0, xmmword [edx + 0x20]
paddd xmm0, xmm4
movups xmmword [esi + 0x20], xmm0
movups xmm0, xmmword [edx + 0x30]
paddd xmm1, xmm0
movups xmmword [esi + 0x30], xmm1
add dword [edx + 0x30], 1
jne 0x4026ac
inc dword [edx + 0x34]
mov edi, dword [ebp - 8]
cmp edi, 0x40
jb 0x402710
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 0x10]
movups xmm0, xmmword [esi]
mov edx, dword [ebp - 0x10]
movups xmm2, xmmword [esi + 0x10]
movups xmm3, xmmword [eax + ecx + 0x10]
movups xmm1, xmmword [eax + ecx]
mov ecx, dword [ebx + 0xc]
pxor xmm2, xmm3
pxor xmm1, xmm0
movups xmmword [eax + ecx], xmm1
movups xmmword [eax + ecx + 0x10], xmm2
movups xmm1, xmmword [eax + edx + 0x20]
movups xmm3, xmmword [eax + edx + 0x30]
movups xmm0, xmmword [esi + 0x20]
movups xmm2, xmmword [esi + 0x30]
pxor xmm1, xmm0
movups xmmword [eax + ecx + 0x20], xmm1
pxor xmm2, xmm3
movups xmmword [eax + ecx + 0x30], xmm2
mov ecx, dword [ebp - 0xc]
add eax, 0x40
mov dword [ebp - 4], eax
jmp 0x40274b
cmp ecx, edi
jae 0x40274e
mov eax, dword [ebp - 0x10]
sub eax, dword [ebx + 0xc]
mov edx, dword [ebp - 8]
mov edi, dword [ebp - 4]
add edi, dword [ebx + 0xc]
mov dword [ebp - 0x28], eax
mov eax, edx
sub eax, ecx
add dword [ebp - 4], eax
nop dword [eax]
mov eax, dword [ebp - 0x28]
lea edi, [edi + 1]
mov al, byte [edi + eax - 1]
xor al, byte [ecx + esi]
inc ecx
mov byte [edi - 1], al
cmp ecx, edx
jb 0x402730
mov edi, dword [ebp - 8]
mov dword [ebp - 0xc], ecx
lea edx, [esi + 0x40]
cmp edi, 0x40
mov eax, edi
cmova eax, dword [ebp - 0xd8]
sub edi, eax
mov dword [ebp - 8], edi
jne 0x402370
pop edi
mov dword [esi + 0x80], ecx
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret