Function at 0x410857
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x18
push ebx
push ebp
push esi
mov esi, dword [esp + 0x34]
push edi
mov edi, dword [esp + 0x3c]
mov ebp, dword [edi]
cmp dword [esi], ebp
cmova ebp, dword [esi]
xor eax, eax
inc eax
cmp ebp, eax
cmovb ebp, eax
push ebp
mov dword [esp + 0x3c], ebp
call fcn.00411af4
mov ebx, eax
push ebp
mov dword [esp + 0x20], ebx
call fcn.00411af4
push esi
push ebx
mov dword [esp + 0x4c], eax
call fcn.00410c92
push edi
mov edi, dword [esp + 0x50]
push edi
call fcn.00410c92
lea esi, [ebp + 1]
push esi
call fcn.00411af4
mov ebp, eax
push esi
mov dword [esp + 0x44], ebp
call fcn.00411af4
mov esi, dword [esp + 0x58]
mov ebx, eax
push esi
mov dword [esp + 0x34], ebx
call fcn.00411af4
shl esi, 6
mov dword [esp + 0x38], eax
mov dword [esp + 0x5c], esi
lea ecx, [esi*2 + 0x1f]
shr ecx, 5
push ecx
call fcn.00411af4
and dword [esp + 0x44], 0
add esp, 0x28
mov dword [esp + 0x20], eax
test esi, esi
je 0x410975
mov ebp, dword [esp + 0x18]
push ebp
push edi
call fcn.00410b74
mov ecx, dword [ebp + 4]
mov edx, dword [ecx]
mov esi, edx
mov ecx, dword [edi + 4]
and esi, 1
mov ebx, esi
xor ebx, eax
mov edi, dword [ecx]
and edi, edx
and edi, 1
and ebx, edi
xor ebx, esi
mov esi, dword [esp + 0x44]
push ebx
push esi
push ebp
call fcn.00410c0a
push edi
push esi
push ebp
push ebp
call fcn.00410bdf
push 1
push ebp
push ebp
call fcn.004122e8
mov esi, dword [esp + 0x4c]
push edi
mov edi, dword [esp + 0x54]
add esi, esi
push esi
push edi
call fcn.004124d1
push ebx
lea eax, [esi + 1]
push eax
push edi
call fcn.004124d1
mov eax, dword [esp + 0x64]
add esp, 0x48
mov edi, dword [esp + 0x3c]
inc eax
mov dword [esp + 0x1c], eax
cmp eax, dword [esp + 0x38]
jb 0x4108f9
mov ebp, dword [esp + 0x24]
mov ebx, dword [esp + 0x10]
cmp dword [esp + 0x34], 0
mov esi, dword [esp + 0x18]
je 0x41098e
push edi
push esi
push dword [esp + 0x3c]
call fcn.00410738
add esp, 0xc
cmp dword [esp + 0x2c], 0
jne 0x4109a0
cmp dword [esp + 0x30], 0
je 0x410adc
push 0
push esi
call fcn.004115c1
mov ecx, dword [ebp + 4]
push 0
push edi
mov dword [ecx], eax
call fcn.004115c1
mov ecx, dword [ebx + 4]
push ebp
push esi
mov dword [ecx], eax
call fcn.00410c92
push ebx
push edi
call fcn.00410c92
mov eax, dword [edi + 4]
add esp, 0x20
mov eax, dword [eax]
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x38]
test eax, eax
je 0x410a7f
mov ebx, dword [esp + 0x20]
dec eax
mov dword [esp + 0x38], eax
lea esi, [eax + eax]
push esi
push ebx
call fcn.004115c1
lea ecx, [esi + 1]
mov edi, eax
push ecx
push ebx
call fcn.004115c1
mov ecx, dword [ebp + 4]
mov ebx, eax
mov esi, dword [ecx]
and esi, 1
push esi
push dword [esp + 0x50]
push ebp
push ebp
call fcn.00410b97
mov eax, dword [esp + 0x30]
push esi
mov esi, dword [esp + 0x3c]
push esi
push eax
push eax
call fcn.00410b97
push 1
push ebp
push ebp
call fcn.004122e8
mov eax, dword [esp + 0x4c]
push edi
push ebp
push eax
push eax
call fcn.00410b97
add esp, 0x4c
push 1
push esi
push esi
call fcn.00411a74
push edi
mov edi, dword [esp + 0x4c]
push edi
push esi
push esi
call fcn.00410b97
push ebx
push edi
push esi
call fcn.00410c0a
push ebx
push dword [esp + 0x3c]
push ebp
call fcn.00410c0a
xor dword [esp + 0x68], ebx
add esp, 0x34
mov eax, dword [esp + 0x38]
test eax, eax
jne 0x4109e0
mov ebx, dword [esp + 0x10]
push ebp
push edi
push dword [esp + 0x1c]
call fcn.0041256f
push dword [esp + 0x40]
push dword [esp + 0x24]
push ebp
push ebp
call fcn.0041248d
push ebx
push esi
push dword [esp + 0x38]
call fcn.0041256f
push dword [esp + 0x5c]
push dword [esp + 0x40]
push ebx
push ebx
call fcn.0041248d
add esp, 0x38
cmp dword [esp + 0x2c], 0
je 0x410ac9
push ebp
push dword [esp + 0x30]
call fcn.00410c92
pop ecx
pop ecx
cmp dword [esp + 0x30], 0
je 0x410adc
push ebx
push dword [esp + 0x34]
call fcn.00410c92
pop ecx
pop ecx
push esi
call fcn.00411368
push edi
call fcn.00411368
push ebp
call fcn.00411368
push ebx
call fcn.00411368
push dword [esp + 0x24]
call fcn.00411368
push dword [esp + 0x34]
call fcn.00411368
add esp, 0x18
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret