Function at 0x401b86
Capabilities:
Encode data using xor

Disassembly:
mov eax, dword [esi + 0x68]
cmp eax, 0x106
jae 0x401b6b
push esi
call fcn.00401980
mov eax, dword [esi + 0x68]
add esp, 4
cmp eax, 0x106
jae 0x401b63
mov ecx, dword [esp + 0x18]
test ecx, ecx
je 0x401d75
test eax, eax
je 0x401d0a
cmp eax, 3
jb 0x401bb1
mov eax, dword [esi + 0x3c]
mov ecx, dword [esi + 0x4c]
mov edx, dword [esi + 0x60]
mov edi, dword [esi + 0x48]
shl eax, cl
mov ecx, dword [esi + 0x2c]
xor ebx, ebx
mov bl, byte [ecx + edx + 2]
add cl, byte [ebx - 0x3cccc7b2]
xor ebx, ebx
and eax, edi
mov dword [esi + 0x3c], eax
mov bx, word [ecx + eax*2]
mov eax, dword [esi + 0x28]
mov ecx, dword [esi + 0x34]
and eax, edx
mov word [ecx + eax*2], bx
mov edx, dword [esi + 0x3c]
mov eax, dword [esi + 0x38]
mov cx, word [esi + 0x60]
mov word [eax + edx*2], cx
push eax
push eax
test ebx, ebx
je 0x401bd9
mov edx, dword [esi + 0x60]
mov eax, dword [esi + 0x20]
sub edx, ebx
sub eax, 0x106
cmp edx, eax
ja 0x401bd9
cmp dword [esi + 0x7c], 2
je 0x401bd9
push ebx
push esi
call fcn.00401d80
add esp, 8
mov dword [esi + 0x54], eax
mov eax, dword [esi + 0x54]
cmp eax, 3
jb 0x401c9c
mov ecx, dword [esi + 0x60]
mov edx, dword [esi + 0x64]
add eax, 0xfffffffd
sub ecx, edx
push eax
push ecx
push esi
call fcn.00405cd0
mov ecx, dword [esi + 0x54]
mov edx, dword [esi + 0x68]
mov ebp, eax
mov eax, dword [esi + 0x74]
add esp, 0xc
sub edx, ecx
cmp ecx, eax
mov dword [esi + 0x68], edx
ja 0x401c6a
cmp edx, 3
jb 0x401c6a
dec ecx
mov dword [esi + 0x54], ecx
mov eax, dword [esi + 0x60]
mov edx, dword [esi + 0x3c]
mov ecx, dword [esi + 0x4c]
inc eax
mov ebx, dword [esi + 0x48]
mov dword [esi + 0x60], eax
mov edi, eax
mov eax, dword [esi + 0x2c]
shl edx, cl
xor ecx, ecx
mov cl, byte [edi + eax + 2]
mov eax, dword [esi + 0x38]
xor edx, ecx
mov ecx, dword [esi + 0x28]
and edx, ebx
xor ebx, ebx
and edi, ecx
mov ecx, dword [esi + 0x34]
mov dword [esi + 0x3c], edx
mov bx, word [eax + edx*2]
mov word [ecx + edi*2], bx
mov edx, dword [esi + 0x3c]
mov eax, dword [esi + 0x38]
mov cx, word [esi + 0x60]
mov word [eax + edx*2], cx
mov eax, dword [esi + 0x54]
dec eax
mov dword [esi + 0x54], eax
jne 0x401c18
jmp 0x401cbc
mov edx, dword [esi + 0x60]
mov eax, dword [esi + 0x2c]
add edx, ecx
mov ecx, dword [esi + 0x4c]
mov dword [esi + 0x60], edx
mov dword [esi + 0x54], 0
lea edi, [edx + eax]
xor edx, edx
mov eax, dword [esi + 0x48]
mov dl, byte [edi]
mov dword [esi + 0x3c], edx
shl edx, cl
xor ecx, ecx
mov cl, byte [edi + 1]
xor edx, ecx
and edx, eax
mov dword [esi + 0x3c], edx
jmp 0x401cbf
mov edx, dword [esi + 0x60]
mov eax, dword [esi + 0x2c]
xor ecx, ecx
mov cl, byte [edx + eax]
push ecx
push 0
push esi
call fcn.00405cd0
mov ecx, dword [esi + 0x68]
add esp, 0xc
dec ecx
mov ebp, eax
mov dword [esi + 0x68], ecx
inc dword [esi + 0x60]
test ebp, ebp
je 0x401b3a
mov ecx, dword [esi + 0x50]
test ecx, ecx
jl 0x401cd7
mov edx, dword [esi + 0x2c]
mov eax, ecx
add eax, edx
jmp 0x401cd9
xor eax, eax
mov edx, dword [esi + 0x60]
push 0
sub edx, ecx
push edx
push eax
push esi
call fcn.00404c10
mov ecx, dword [esi]
mov eax, dword [esi + 0x60]
add esp, 0x10
mov dword [esi + 0x50], eax
push ecx
call fcn.004017f0
mov edx, dword [esi]
add esp, 4
mov eax, dword [edx + 0x10]
test eax, eax
je 0x401d75
jmp 0x401b3a
mov ecx, dword [esi + 0x50]
test ecx, ecx
jl 0x401d18
pop es
xor eax, eax
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
ret