Function at 0x10031740
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
push ebx
mov ebx, dword [ebp + 0xc]
mov eax, ebx
push esi
push edi
mov edi, dword [ebp + 8]
sub eax, edi
and eax, 0xfffffff8
cmp eax, 0x100
jle 0x100317cc
mov esi, dword [ebp + 0x10]
test esi, esi
jle 0x10031846
push dword [ebp + 0x14]
lea eax, [ebp - 0x20]
push ebx
push edi
push eax
call fcn.10029ba0
mov edx, dword [ebp - 0x1c]
mov eax, esi
sar eax, 2
add esp, 0x10
sar esi, 1
mov ecx, ebx
add esi, eax
sub ecx, edx
mov eax, dword [ebp - 0x20]
and ecx, 0xfffffff8
push dword [ebp + 0x14]
sub eax, edi
and eax, 0xfffffff8
push esi
cmp eax, ecx
jge 0x100317ae
mov eax, dword [ebp - 0x20]
push eax
push edi
call fcn.10031740
mov edi, dword [ebp - 0x1c]
mov dword [ebp + 8], edi
jmp 0x100317bb
push ebx
push edx
call fcn.10031740
mov ebx, dword [ebp - 0x20]
mov dword [ebp + 0xc], ebx
mov eax, ebx
add esp, 0x10
sub eax, edi
and eax, 0xfffffff8
cmp eax, 0x100
jg 0x10031760
mov esi, dword [ebp + 0x14]
cmp edi, ebx
je 0x10031a1e
lea ebx, [edi + 8]
mov dword [ebp - 0xc], ebx
cmp ebx, dword [ebp + 0xc]
je 0x10031a1e
mov eax, 8
sub eax, edi
mov dword [ebp - 0x1c], eax
mov ecx, dword [ebx + 4]
mov eax, dword [ebx]
mov dword [ebp - 0x10], ecx
mov ecx, dword [esi]
mov dword [ebp - 4], eax
mov dword [ebp - 8], ebx
mov edx, dword [ecx + eax*4]
mov eax, dword [edi]
mov dword [ebp - 0x18], edx
push dword [ecx + eax*4]
push edx
call fcn.10035bb0
add esp, 8
test al, al
je 0x100319ad
mov ecx, dword [ebp - 0x1c]
mov eax, ebx
add ecx, 0xfffffff8
add ecx, ebx
push ecx
sub eax, ecx
add eax, 8
push edi
push eax
call sub.VCRUNTIME140.dll_memmove
mov ecx, dword [ebp - 4]
add esp, 0xc
mov dword [edi], ecx
mov ecx, dword [ebp - 0x10]
mov dword [edi + 4], ecx
jmp 0x10031a0f
sub ebx, edi
mov ecx, ebx
mov dword [ebp + 0xc], ebx
sar ecx, 3
mov edx, ecx
mov dword [ebp - 8], ecx
sar edx, 1
test edx, edx
jle 0x1003195c
lea eax, [ecx - 1]
mov dword [ebp - 0x18], eax
sar eax, 1
mov dword [ebp + 8], eax
nop word [eax + eax]
mov eax, dword [edi + edx*8 - 8]
dec edx
mov ebx, edx
mov esi, dword [ebp + 0x14]
mov dword [ebp - 0x10], eax
mov dword [ebp - 4], edx
mov eax, dword [edi + edx*8 + 4]
mov dword [ebp - 0x1c], eax
mov eax, edx
mov dword [ebp - 0xc], edx
cmp edx, dword [ebp + 8]
jge 0x100318d9
mov ecx, dword [esi]
lea ebx, [eax + eax]
mov eax, dword [edi + ebx*8 + 8]
push dword [ecx + eax*4]
mov eax, dword [edi + ebx*8 + 0x10]
push dword [ecx + eax*4]
call fcn.10035bb0
mov edx, dword [ebp - 0xc]
add esp, 8
movzx eax, al
xor eax, 1
inc eax
add ebx, eax
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0xc], ebx
mov eax, dword [edi + ebx*8]
mov ecx, dword [edi + ebx*8 + 4]
mov dword [edi + edx*8], eax
mov eax, ebx
mov dword [edi + edx*8 + 4], ecx
cmp eax, dword [ebp + 8]
jl 0x10031891
mov edx, dword [ebp - 4]
mov ecx, dword [ebp - 8]
cmp ebx, dword [ebp + 8]
jne 0x100318f5
test cl, 1
jne 0x100318f5
mov eax, dword [edi + ecx*8 - 8]
mov ecx, dword [edi + ecx*8 - 4]
mov dword [edi + ebx*8], eax
mov dword [edi + ebx*8 + 4], ecx
mov ebx, dword [ebp - 0x18]
lea eax, [ebx - 1]
sar eax, 1
mov dword [ebp - 0xc], eax
cmp edx, ebx
jge 0x10031941
mov ecx, dword [esi]
lea eax, [edi + eax*8]
mov edx, dword [ebp - 0x10]
mov dword [ebp - 0x14], eax
mov eax, dword [eax]
push dword [ecx + edx*4]
push dword [ecx + eax*4]
call fcn.10035bb0
mov edx, dword [ebp - 4]
add esp, 8
test al, al
je 0x10031941
mov ecx, dword [ebp - 0x14]
mov eax, dword [ecx]
mov ecx, dword [ecx + 4]
mov dword [edi + ebx*8], eax
mov eax, dword [ebp - 0xc]
mov dword [edi + ebx*8 + 4], ecx
mov ebx, eax
dec eax
sar eax, 1
mov dword [ebp - 0xc], eax
cmp edx, ebx
jl 0x10031901
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 8]
mov dword [edi + ebx*8], eax
mov eax, dword [ebp - 0x1c]
mov dword [edi + ebx*8 + 4], eax
test edx, edx
jg 0x10031870
mov ebx, dword [ebp + 0xc]
cmp ecx, 2
jl 0x10031a1e
mov eax, dword [edi + ebx - 8]
mov ecx, dword [edi + ebx - 4]
mov dword [ebp - 0x20], eax
mov eax, dword [edi]
mov dword [ebp - 0x1c], ecx
mov ecx, dword [edi + 4]
mov dword [edi + ebx - 8], eax
lea eax, [ebp - 0x20]
mov dword [edi + ebx - 4], ecx
push dword [ebp + 0x14]
push eax
lea eax, [ebx - 8]
sar eax, 3
push eax
push 0
push edi
call fcn.1002f3c0
add ebx, 0xfffffff8
add esp, 0x14
mov eax, ebx
and eax, 0xfffffff8
cmp eax, 0x10
jge 0x10031965
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebx - 8]
add ebx, 0xfffffff8
mov ecx, dword [esi]
push dword [ecx + eax*4]
push dword [ebp - 0x18]
call fcn.10035bb0
add esp, 8
test al, al
je 0x100319fe
mov edi, dword [ebp - 8]
nop word [eax + eax]
mov eax, dword [ebx]
mov ecx, dword [ebx + 4]
mov dword [edi], eax
mov dword [edi + 4], ecx
mov edi, ebx
mov ecx, dword [esi]
sub ebx, 8
mov eax, dword [ebx]
push dword [ecx + eax*4]
mov eax, dword [ebp - 4]
push dword [ecx + eax*4]
call fcn.10035bb0
add esp, 8
test al, al
jne 0x100319d0
mov dword [ebp - 8], edi
mov edi, dword [ebp + 8]
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 4]
mov ebx, dword [ebp - 0xc]
mov dword [eax], ecx
mov ecx, dword [ebp - 0x10]
mov dword [eax + 4], ecx
add ebx, 8
mov dword [ebp - 0xc], ebx
cmp ebx, dword [ebp + 0xc]
jne 0x100317f0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret