Function at 0x640540
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x10
mov ecx, dword [esp + 0x3c]
mov edi, dword [esp + 0x38]
mov eax, dword [esp + 0x2c]
mov esi, dword [esp + 0x28]
mov ebp, dword [ecx]
test ebp, ebp
sete cl
test eax, eax
sete dl
or dl, cl
mov ebx, dword [esp + 0x24]
jne 0x64058c
nop dword [eax + eax]
movzx ecx, byte [edi + ebp]
xor cl, byte [ebx]
inc ebx
mov byte [esi], cl
inc esi
lea ecx, [eax - 1]
inc ebp
and ebp, 0xf
je 0x64058e
cmp eax, 1
mov eax, ecx
jne 0x640570
jmp 0x64058e
mov ecx, eax
mov dword [esp + 8], ebp
mov edx, esi
mov eax, dword [esp + 0x34]
mov eax, dword [eax + 0xc]
bswap eax
mov dword [esp + 4], eax
cmp ecx, 0x10
jae 0x6406a9
mov dword [esp], edx
test ecx, ecx
je 0x640779
mov dword [esp + 0xc], ecx
xorps xmm0, xmm0
mov edi, dword [esp + 0x38]
movups xmmword [edi], xmm0
push dword [esp + 0x34]
push dword [esp + 0x34]
push 1
push edi
push edi
call dword [esp + 0x54]
mov edx, dword [esp + 0x48]
add esp, 0x14
mov eax, dword [esp + 4]
inc eax
bswap eax
mov dword [edx + 0xc], eax
mov ebp, dword [esp + 8]
jne 0x640670
movzx eax, byte [edx + 0xb]
inc eax
mov byte [edx + 0xb], al
shr eax, 8
movzx ecx, byte [edx + 0xa]
add ecx, eax
mov byte [edx + 0xa], cl
shr ecx, 8
movzx eax, byte [edx + 9]
add eax, ecx
mov byte [edx + 9], al
shr eax, 8
movzx ecx, byte [edx + 8]
add ecx, eax
mov byte [edx + 8], cl
shr ecx, 8
movzx eax, byte [edx + 7]
add eax, ecx
mov byte [edx + 7], al
shr eax, 8
movzx ecx, byte [edx + 6]
add ecx, eax
mov byte [edx + 6], cl
shr ecx, 8
movzx eax, byte [edx + 5]
add eax, ecx
mov byte [edx + 5], al
shr eax, 8
movzx ecx, byte [edx + 4]
add ecx, eax
mov byte [edx + 4], cl
shr ecx, 8
movzx eax, byte [edx + 3]
add eax, ecx
mov byte [edx + 3], al
shr eax, 8
movzx ecx, byte [edx + 2]
add ecx, eax
mov byte [edx + 2], cl
shr ecx, 8
movzx eax, byte [edx + 1]
add eax, ecx
mov byte [edx + 1], al
add byte [edx], ah
mov edx, dword [esp + 0xc]
test dl, 1
mov esi, dword [esp]
jne 0x64077f
mov eax, edx
cmp edx, 1
jne 0x6407a0
jmp 0x6407c1
shl ebx, 4
sub esi, ebx
mov edx, dword [esp]
add edx, ebx
add ebp, ebx
cmp esi, 0xf
mov ecx, esi
mov ebx, ebp
jbe 0x6405aa
mov eax, ecx
shr eax, 4
mov edi, dword [esp + 4]
mov esi, ebx
mov ebx, edi
neg ebx
add edi, eax
mov ebp, 0
cmovb edi, ebp
mov ebp, esi
cmovae ebx, eax
push dword [esp + 0x34]
push dword [esp + 0x34]
push ebx
mov dword [esp + 0xc], edx
push edx
push esi
mov esi, ecx
call dword [esp + 0x54]
mov edx, dword [esp + 0x48]
add esp, 0x14
mov eax, edi
bswap eax
mov dword [edx + 0xc], eax
mov dword [esp + 4], edi
test edi, edi
jne 0x640690
movzx eax, byte [edx + 0xb]
inc eax
mov byte [edx + 0xb], al
shr eax, 8
movzx ecx, byte [edx + 0xa]
add ecx, eax
mov byte [edx + 0xa], cl
shr ecx, 8
movzx eax, byte [edx + 9]
add eax, ecx
mov byte [edx + 9], al
shr eax, 8
movzx ecx, byte [edx + 8]
add ecx, eax
mov byte [edx + 8], cl
shr ecx, 8
movzx eax, byte [edx + 7]
add eax, ecx
mov byte [edx + 7], al
shr eax, 8
movzx ecx, byte [edx + 6]
add ecx, eax
mov byte [edx + 6], cl
shr ecx, 8
movzx eax, byte [edx + 5]
add eax, ecx
mov byte [edx + 5], al
shr eax, 8
movzx ecx, byte [edx + 4]
add ecx, eax
mov byte [edx + 4], cl
shr ecx, 8
movzx eax, byte [edx + 3]
add eax, ecx
mov byte [edx + 3], al
shr eax, 8
movzx ecx, byte [edx + 2]
add ecx, eax
mov byte [edx + 2], cl
shr ecx, 8
movzx eax, byte [edx + 1]
add eax, ecx
mov byte [edx + 1], al
add byte [edx], ah
jmp 0x640690
mov ecx, dword [esp + 8]
jmp 0x6407c1
movzx ecx, byte [edi + ebp]
xor cl, byte [ebx + ebp]
lea eax, [edx - 1]
mov byte [esi + ebp], cl
inc ebp
mov ecx, ebp
cmp edx, 1
je 0x6407c1
nop word cs:[eax + eax]
movzx ecx, byte [edi + ebp]
xor cl, byte [ebx + ebp]
mov byte [esi + ebp], cl
movzx edx, byte [edi + ebp + 1]
xor dl, byte [ebx + ebp + 1]
lea ecx, [ebp + 2]
mov byte [esi + ebp + 1], dl
mov ebp, ecx
add eax, 0xfffffffe
jne 0x6407a0
mov eax, dword [esp + 0x3c]
mov dword [eax], ecx
add esp, 0x10
pop esi
pop edi
pop ebx
pop ebp
ret