Function at 0x10031800
Capabilities:
Encode data using xor

Disassembly:
mov eax, 0x20
call fcn.10016d60
mov eax, dword [esp + 0x38]
mov edx, dword [esp + 0x34]
push ebx
push ebp
test eax, eax
mov eax, dword [esp + 0x38]
push esi
push edi
lea ecx, [esp + 0x10]
push eax
push ecx
push edx
je 0x10031916
call fcn.10032200
mov ebp, dword [esp + 0x48]
add esp, 0xc
xor edi, edi
lea eax, [ebp + 7]
cdq
and edx, 7
add eax, edx
sar eax, 3
test eax, eax
jle 0x1003186c
mov esi, dword [esp + 0x34]
lea ecx, [esp + 0x10]
sub esi, ecx
mov ecx, dword [esp + 0x38]
lea edx, [esp + 0x10]
sub ecx, edx
lea edx, [esp + edi + 0x10]
mov bl, byte [esi + edx]
xor bl, byte [edx]
inc edi
cmp edi, eax
mov byte [ecx + edx], bl
jl 0x1003185b
mov ecx, dword [esp + 0x44]
mov esi, dword [esp + 0x38]
lea edi, [esp + 0x20]
mov ebx, ebp
mov edx, dword [ecx]
mov dword [esp + 0x10], edx
mov edx, dword [ecx + 4]
mov dword [esp + 0x14], edx
mov edx, dword [ecx + 8]
mov dword [esp + 0x18], edx
mov ecx, dword [ecx + 0xc]
mov dword [esp + 0x1c], ecx
mov ecx, eax
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
and ebx, 0x80000007
rep movsb byte es:[edi], byte [esi]
jns 0x100318b2
dec ebx
or ebx, 0xfffffff8
inc ebx
mov eax, 0
setne al
add eax, 0x10
push eax
mov eax, ebp
cdq
and edx, 7
add eax, edx
lea edx, [esp + 0x14]
sar eax, 3
lea ecx, [esp + eax + 0x14]
push ecx
push edx
call dword [sym.imp.MSVCR71.dll_memmove]
add esp, 0xc
test ebx, ebx
je 0x100319fa
mov ecx, 8
xor esi, esi
sub ecx, ebx
mov dword [esp + 0x38], ecx
jmp 0x100318f7
mov ecx, dword [esp + 0x38]
mov al, byte [esp + esi + 0x11]
mov dl, byte [esp + esi + 0x10]
shr al, cl
mov cl, bl
shl dl, cl
or al, dl
mov byte [esp + esi + 0x10], al
inc esi
cmp esi, 0x10
jl 0x100318f3
jmp 0x100319fa
call fcn.10032200
mov ebp, dword [esp + 0x48]
add esp, 0xc
xor edi, edi
lea eax, [ebp + 7]
cdq
and edx, 7
add eax, edx
sar eax, 3
test eax, eax
jle 0x10031959
mov esi, dword [esp + 0x34]
lea ecx, [esp + 0x10]
sub esi, ecx
mov ecx, dword [esp + 0x38]
lea edx, [esp + 0x10]
sub ecx, edx
lea edx, [esp + edi + 0x10]
mov bl, byte [esi + edx]
xor bl, byte [edx]
inc edi
cmp edi, eax
mov byte [ecx + edx], bl
jl 0x10031948
mov ecx, dword [esp + 0x44]
mov esi, dword [esp + 0x34]
lea edi, [esp + 0x20]
mov ebx, ebp
mov edx, dword [ecx]
mov dword [esp + 0x10], edx
mov edx, dword [ecx + 4]
mov dword [esp + 0x14], edx
mov edx, dword [ecx + 8]
mov dword [esp + 0x18], edx
mov ecx, dword [ecx + 0xc]
mov dword [esp + 0x1c], ecx
mov ecx, eax
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
and ebx, 0x80000007
rep movsb byte es:[edi], byte [esi]
jns 0x1003199f
dec ebx
or ebx, 0xfffffff8
inc ebx
mov eax, 0
setne al
add eax, 0x10
push eax
mov eax, ebp
cdq
and edx, 7
add eax, edx
lea edx, [esp + 0x14]
sar eax, 3
lea ecx, [esp + eax + 0x14]
push ecx
push edx
call dword [sym.imp.MSVCR71.dll_memmove]
add esp, 0xc
test ebx, ebx
je 0x100319fa
mov ecx, 8
xor esi, esi
sub ecx, ebx
mov dword [esp + 0x38], ecx
jmp 0x100319e0
mov ecx, dword [esp + 0x38]
mov al, byte [esp + esi + 0x11]
mov dl, byte [esp + esi + 0x10]
shr al, cl
mov cl, bl
shl dl, cl
or al, dl
mov byte [esp + esi + 0x10], al
inc esi
cmp esi, 0x10
jl 0x100319dc
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
pop edi
mov dword [eax], ecx
mov ecx, dword [esp + 0x14]
mov dword [eax + 4], edx
mov edx, dword [esp + 0x18]
pop esi
mov dword [eax + 8], ecx
pop ebp
mov dword [eax + 0xc], edx
pop ebx
add esp, 0x20
ret