Function at 0x1031940
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 0x1031983
mov esi, dword [ebp + 0x14]
mov edi, dword [ebp + 8]
push esi
push eax
push ebx
push edi
call fcn.01031840
mov ecx, dword [ebp + 0x10]
cmp eax, 0xffffffff
jne 0x1031c93
push esi
push ecx
push ebx
push edi
call fcn.01031840
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 0x10319f6
inc eax
cmp eax, 0xc
jl 0x1031990
lea eax, [ebx + 1]
mov dword [ebp + 0x14], 8
jmp 0x10319b0
cmp cl, byte [eax - 1]
je 0x10319b8
inc dword [ebp - 4]
cmp cl, byte [eax]
je 0x10319bf
inc dword [ebp - 4]
cmp cl, byte [eax + 1]
je 0x10319c7
inc dword [ebp - 4]
cmp cl, byte [eax + 2]
je 0x10319cf
inc dword [ebp - 4]
cmp cl, byte [eax + 3]
je 0x10319d7
inc dword [ebp - 4]
cmp cl, byte [eax + 4]
je 0x10319df
inc dword [ebp - 4]
add eax, 6
sub dword [ebp + 0x14], 1
jne 0x10319b0
cmp dword [ebp - 4], 3
jge 0x10319f6
or eax, 0xffffffff
jmp 0x1031afe
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 0x1031a00
mov ebx, dword [ebp + 0xc]
xor eax, eax
mov ecx, dword [ebp + 0x10]
cmp ecx, 0x80
jl 0x1031968
cmp ecx, 0x100
jge 0x1031b23
push esi
add ecx, 0xffffffa0
push ecx
lea eax, [ebx + 0x60]
push eax
jmp 0x103195f
cmp ecx, 0x200
jge 0x1031b49
lea eax, [ecx - 0xc0]
cmp eax, 0x30
jle 0x1031b3b
mov eax, 0x30
push esi
push eax
lea ecx, [ebx + 0xc0]
push ecx
jmp 0x103195f
cmp ecx, 0x400
jge 0x1031b6f
lea eax, [ecx - 0x180]
cmp eax, 0x30
jle 0x1031b61
mov eax, 0x30
push esi
push eax
lea edx, [ebx + 0x180]
push edx
jmp 0x103195f
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 0x1031bc9
inc ecx
cmp ecx, 0x10
jl 0x1031b82
lea ecx, [eax + 1]
mov dword [ebp + 8], 0x10
cmp dl, byte [ecx - 1]
je 0x1031b9f
inc dword [ebp + 0x14]
cmp dl, byte [ecx]
je 0x1031ba6
inc dword [ebp + 0x14]
cmp dl, byte [ecx + 1]
je 0x1031bae
inc dword [ebp + 0x14]
cmp dl, byte [ecx + 2]
je 0x1031bb6
inc dword [ebp + 0x14]
add ecx, 4
sub dword [ebp + 8], 1
jne 0x1031b97
cmp dword [ebp + 0x14], 4
jl 0x1031c84
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 0x1031bd0
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.01031840
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10