Function at 0x1031180
Capabilities:
Encode data using xor

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
mov eax, dword [ebp + 0x10]
sub esp, 8
cmp eax, 0x40
push ebx
mov ebx, dword [ebp + 0xc]
push esi
push edi
jge 0x10311c3
mov esi, dword [ebp + 0x14]
mov edi, dword [ebp + 8]
push esi
push eax
push ebx
push edi
call fcn.01031080
mov ecx, dword [ebp + 0x10]
cmp eax, 0xffffffff
jne 0x10314d3
push esi
push ecx
push ebx
push edi
call fcn.01031080
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov cl, byte [ebx]
xor eax, eax
mov dword [ebp - 4], eax
lea ebx, [ebx]
mov esi, dword [ebp + 0x14]
mov edi, dword [ebp + 8]
cmp cl, byte [eax + ebx]
jne 0x1031236
inc eax
cmp eax, 0xc
jl 0x10311d0
lea eax, [ebx + 1]
mov dword [ebp + 0x14], 8
jmp 0x10311f0
cmp cl, byte [eax - 1]
je 0x10311f8
inc dword [ebp - 4]
cmp cl, byte [eax]
je 0x10311ff
inc dword [ebp - 4]
cmp cl, byte [eax + 1]
je 0x1031207
inc dword [ebp - 4]
cmp cl, byte [eax + 2]
je 0x103120f
inc dword [ebp - 4]
cmp cl, byte [eax + 3]
je 0x1031217
inc dword [ebp - 4]
cmp cl, byte [eax + 4]
je 0x103121f
inc dword [ebp - 4]
add eax, 6
sub dword [ebp + 0x14], 1
jne 0x10311f0
cmp dword [ebp - 4], 3
jge 0x1031236
or eax, 0xffffffff
jmp 0x103133e
lea eax, [ebx + 2]
mov dword [ebp + 0x14], 8
movzx ebx, byte [eax - 2]
mov edx, dword [esi + 4]
mov ecx, dword [esi]
mov dword [ebp - 4], edx
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 4]
shld ebx, ecx, 8
xor ebx, dword [edi + edx*8 + 4]
shl ecx, 8
xor ecx, dword [edi + edx*8]
mov dword [esi + 4], ebx
mov edx, ebx
mov dword [esi], ecx
movzx ebx, byte [eax - 1]
mov dword [ebp - 4], edx
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 4]
shld ebx, ecx, 8
xor ebx, dword [edi + edx*8 + 4]
shl ecx, 8
xor ecx, dword [edi + edx*8]
mov dword [esi + 4], ebx
mov edx, ebx
mov dword [esi], ecx
movzx ebx, byte [eax]
mov dword [ebp - 4], edx
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 4]
shld ebx, ecx, 8
xor ebx, dword [edi + edx*8 + 4]
shl ecx, 8
xor ecx, dword [edi + edx*8]
mov dword [esi + 4], ebx
mov edx, ebx
mov dword [esi], ecx
movzx ebx, byte [eax + 1]
mov dword [ebp - 4], edx
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 4]
shld ebx, ecx, 8
xor ebx, dword [edi + edx*8 + 4]
shl ecx, 8
xor ecx, dword [edi + edx*8]
mov edx, ebx
mov dword [esi + 4], ebx
mov dword [ebp - 4], edx
mov dword [esi], ecx
movzx ebx, byte [eax + 2]
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 4]
shld ebx, ecx, 8
xor ebx, dword [edi + edx*8 + 4]
shl ecx, 8
xor ecx, dword [edi + edx*8]
mov edx, ebx
mov dword [esi + 4], ebx
mov dword [ebp - 4], edx
mov dword [esi], ecx
movzx ebx, byte [eax + 3]
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 4]
shld ebx, ecx, 8
xor ebx, dword [edi + edx*8 + 4]
shl ecx, 8
xor ecx, dword [edi + edx*8]
add eax, 6
sub dword [ebp + 0x14], 1
mov dword [esi], ecx
mov dword [esi + 4], ebx
jne 0x1031240
mov ebx, dword [ebp + 0xc]
xor eax, eax
mov ecx, dword [ebp + 0x10]
cmp ecx, 0x80
jl 0x10311a8
cmp ecx, 0x100
jge 0x1031363
push esi
add ecx, 0xffffffa0
push ecx
lea eax, [ebx + 0x60]
push eax
jmp 0x103119f
cmp ecx, 0x200
jge 0x1031389
lea eax, [ecx - 0xc0]
cmp eax, 0x30
jle 0x103137b
mov eax, 0x30
push esi
push eax
lea ecx, [ebx + 0xc0]
push ecx
jmp 0x103119f
cmp ecx, 0x400
jge 0x10313af
lea eax, [ecx - 0x180]
cmp eax, 0x30
jle 0x10313a1
mov eax, 0x30
push esi
push eax
lea edx, [ebx + 0x180]
push edx
jmp 0x103119f
mov dl, byte [ebx + ecx - 0x100]
lea eax, [ebx + ecx - 0x100]
xor ecx, ecx
mov dword [ebp + 0x14], ecx
cmp dl, byte [ecx + eax]
jne 0x1031409
inc ecx
cmp ecx, 0x10
jl 0x10313c2
lea ecx, [eax + 1]
mov dword [ebp + 8], 0x10
cmp dl, byte [ecx - 1]
je 0x10313df
inc dword [ebp + 0x14]
cmp dl, byte [ecx]
je 0x10313e6
inc dword [ebp + 0x14]
cmp dl, byte [ecx + 1]
je 0x10313ee
inc dword [ebp + 0x14]
cmp dl, byte [ecx + 2]
je 0x10313f6
inc dword [ebp + 0x14]
add ecx, 4
sub dword [ebp + 8], 1
jne 0x10313d7
cmp dword [ebp + 0x14], 4
jl 0x10314c4
mov dword [ebp + 0x10], 0x10
mov edx, dword [esi + 4]
movzx ebx, byte [eax]
mov ecx, dword [esi]
mov dword [ebp - 4], edx
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 4]
shld ebx, ecx, 8
xor ebx, dword [edi + edx*8 + 4]
shl ecx, 8
xor ecx, dword [edi + edx*8]
mov dword [esi + 4], ebx
mov edx, ebx
mov dword [esi], ecx
movzx ebx, byte [eax + 1]
mov dword [ebp - 4], edx
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 4]
shld ebx, ecx, 8
xor ebx, dword [edi + edx*8 + 4]
shl ecx, 8
xor ecx, dword [edi + edx*8]
mov edx, ebx
mov dword [esi + 4], ebx
mov dword [ebp - 4], edx
mov dword [esi], ecx
movzx ebx, byte [eax + 2]
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 4]
shld ebx, ecx, 8
xor ebx, dword [edi + edx*8 + 4]
shl ecx, 8
xor ecx, dword [edi + edx*8]
mov edx, ebx
mov dword [esi + 4], ebx
mov dword [ebp - 4], edx
mov dword [esi], ecx
movzx ebx, byte [eax + 3]
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 4]
shld ebx, ecx, 8
xor ebx, dword [edi + edx*8 + 4]
shl ecx, 8
xor ecx, dword [edi + edx*8]
add eax, 4
sub dword [ebp + 0x10], 1
mov dword [esi], ecx
mov dword [esi + 4], ebx
jne 0x1031410
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov ecx, dword [ebp + 0x10]
mov ebx, dword [ebp + 0xc]
push esi
push ecx
push ebx
push edi
call fcn.01031080
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10